kabir-rab / master-items-viewer

Displays master dimensions and master measures with expressions and descriptions. This allows users to search the master items description or expression.
https://kabonline.net
MIT License
12 stars 1 forks source link

Extension shows empty despite master items in the app #1

Closed armandfrigo closed 4 years ago

armandfrigo commented 4 years ago

Hello, Extension shows empty despite master items in the app. Also, whenever I click on the buttons for Measures/Dimensions, I get the below error message. That's with September 2019 patch 2.

angular.31978c1cc8d68d2ba534.js:8 TypeError: getMasterLibrary is not a function at h.$scope.viewChange (master-items-viewer.js:50) at fn (eval at compile (angular.31978c1cc8d68d2ba534.js:8), :4:158) at i (angular.31978c1cc8d68d2ba534.js:8) at h.$eval (angular.31978c1cc8d68d2ba534.js:8) at h.$apply (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement. (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement.dispatch (jquery.b98c142190f10af0d55e.js:8) at HTMLButtonElement.v.handle (jquery.b98c142190f10af0d55e.js:8)

2020-03-02_11-03-17

kabir-rab commented 4 years ago

Can you give e bit more information please so I can try replicating this - I have only tested this with November 2019 and February 2020 release so far and it works on desktop and QSE for windows server, I was not able to recreate this error.

Thanks for trying it out.

Kab

armandfrigo commented 4 years ago

Chrome Version 80.0.3987.122 (Official Build) (32-bit) "version": "1.0.0.2"

kabir-rab commented 4 years ago

The error is a JavaScript error with the primary function which is the one being called by the angular controller to view the data fetched by the service. I am running chrome version 80.0.3987 too - but the 64 bit version (that shouldn't really matter). I think there something must be going wrong with the babel and web pack during package creations. I have going to repack without minifing the js file. Can you try the attached please and let me know if this resolves the issue? (you might have to clear your browser cache as you have loaded the other version already)

master-items-viewer-v-1.0.0.2.zip

armandfrigo commented 4 years ago

Hi Kab, unfortunately same behavior. I don't see any errors in the network tab or WS stream, apart from the console one I shared earlier with regards to buttons.

kabir-rab commented 4 years ago

hmm this is acting rather strange. I can rewrite this function slightly different way and see if this makes any difference.

kabir-rab commented 4 years ago

can you try this build please? I have changed the way I am calling the method to see if that resolves it. I still can't recreate this issue - I have tried IE 10, chrome and Edge - all worked fine with all versions of the codes I have shared with you. Working on QSE servers - I have tried it on 3 different version now (June 2019 - February 2020). So this got me bit puzzled.

I am sure you are clearing the browser cache, but just going to throw it out there, clear it out please. Also please make sure older version is deleted from the server before adding this one in (which you have to do anyways).

master-items-viewer-v-1.0.0.3.zip

armandfrigo commented 4 years ago

Hi, Sorry I had missed the notification on your message.

I imported that version. The extension shows empty, still.

Do I need to set something for Measures/Dimensions to display? I was under the impression they should display when we add the extension on the sheet.

When hitting the Dimensions button: angular.31978c1cc8d68d2ba534.js:8 TypeError: Cannot read property 'dimensions' of undefined at getMasterLibrary (master-items-viewer.js:26) at h.$scope.viewChange (master-items-viewer.js:51) at fn (eval at compile (angular.31978c1cc8d68d2ba534.js:8), :4:158) at i (angular.31978c1cc8d68d2ba534.js:8) at h.$eval (angular.31978c1cc8d68d2ba534.js:8) at h.$apply (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement. (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement.dispatch (jquery.b98c142190f10af0d55e.js:8) at HTMLButtonElement.v.handle (jquery.b98c142190f10af0d55e.js:8)

angular.31978c1cc8d68d2ba534.js:8 TypeError: Cannot read property 'measures' of undefined at getMasterLibrary (master-items-viewer.js:25) at h.$scope.viewChange (master-items-viewer.js:51) at fn (eval at compile (angular.31978c1cc8d68d2ba534.js:8), :4:158) at i (angular.31978c1cc8d68d2ba534.js:8) at h.$eval (angular.31978c1cc8d68d2ba534.js:8) at h.$apply (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement. (angular.31978c1cc8d68d2ba534.js:8) at HTMLButtonElement.dispatch (jquery.b98c142190f10af0d55e.js:8) at HTMLButtonElement.v.handle (jquery.b98c142190f10af0d55e.js:8)

All resources were downloaded without an issue from the network tab in dev tools.

FYI, I tried that one as a sanity check and it works fine: https://github.com/GINQO/Master-Item-Manager

We cannot see the measures/dimensions in a table, but only as CSV. Maybe you can check how they did it.

Kind regards, Armand

viperior commented 4 years ago

I'm having the same problem as @armandfrigo . I see a "No results found" error message despite there being many master measures defined in the app.

Error message from console upon clicking 'Measures': app.6.105.4.js:7 TypeError: Cannot read property 'measures' of undefined at getMasterLibrary (master-items-viewer.js:25) at d.$scope.viewChange (master-items-viewer.js:51) at fn (eval at compile (app.6.105.4.js:7), :4:158) at i (app.6.105.4.js:7) at d.$eval (app.6.105.4.js:7) at d.$apply (app.6.105.4.js:7) at HTMLButtonElement. (app.6.105.4.js:7) at HTMLButtonElement.dispatch (app.6.105.4.js:7) at HTMLButtonElement.m.handle (app.6.105.4.js:7) (anonymous) @ app.6.105.4.js:7 (anonymous) @ app.6.105.4.js:7 $apply @ app.6.105.4.js:7 (anonymous) @ app.6.105.4.js:7 dispatch @ app.6.105.4.js:7 m.handle @ app.6.105.4.js:7

Error message from console upon clicking 'Dimensions': app.6.105.4.js:7 TypeError: Cannot read property 'dimensions' of undefined at getMasterLibrary (master-items-viewer.js:26) at d.$scope.viewChange (master-items-viewer.js:51) at fn (eval at compile (app.6.105.4.js:7), :4:158) at i (app.6.105.4.js:7) at d.$eval (app.6.105.4.js:7) at d.$apply (app.6.105.4.js:7) at HTMLButtonElement. (app.6.105.4.js:7) at HTMLButtonElement.dispatch (app.6.105.4.js:7) at HTMLButtonElement.m.handle (app.6.105.4.js:7)

Chrome version: 80.0.3987.132 (Official Build) (64-bit)

Qlik Sense Enterprise Version: Qlik Sense June 2019 - 13.32.2

Master-Items-Viewer Extension versions tested: 0.0.2 0.0.3

I followed the instructions during installation (standard extension installation process via QMC) and made sure to clear my browser cache and remove the previous version before testing 0.0.3.

Thank you!

kabir-rab commented 4 years ago

ok I will take a look at the weekend, I think I have an idea on how to fix this but still bit puzzled as to why its only happening in certain cases. I suspect its the the angular service class is causing this issue. I will rewrite this to see if i can resolve it.

viperior commented 4 years ago

@kabir-rab Thank you! I am happy to perform further testing when you are ready.

kabir-rab commented 4 years ago

@viperior @armandfrigo - I have finally managed to get some time to test it on June 2019. Seems like the issue is with the following -

generateSheetList = function(){
                    var deferred = $.Deferred(),
                        sheetObjectList = [];
                    app.getList( "Sheet", function(sheets){
                        sheetObjectList = sheets.qAppObjectList.qItems; // This is not included in the older version and causing the error
                    })
                    .then(function(sheets){
                        app.destroySessionObject(sheets.id)
                        .then(function(a){
                            deferred.resolve(sheetObjectList);
                        });
                    });
                    return deferred;
                }

qAppObjectList.qItems is missing in version prior to November 2019. Fix for the older versions would be to use a different logic to retrieve all objects, can use the full property tree call which was one of the options I was using at a earlier stage of the development. I will see if I can rewrite this so it works in older versions.

Reason for getting all objects is to check where the master dimensions/measure is being used. Prior to adding that feature, the version I had that works with older version. If you are interested, I can re-pack that earlier version for you to use till I work on the re-write.

-Kab

viperior commented 4 years ago

@kabir-rab Nice work! I am interested in a re-pack of the earlier version.

kabir-rab commented 4 years ago

@viperior @armandfrigo - There is a lite version that works on earlier versions of Qlik Sense. I have tested this on June 2019. You miss some additional features but its 90% of the full version.

https://github.com/kabir-rab/master-items-viewer-lite

I will close the ticket as this is no longer relevant.

Thank you. Kab

viperior commented 4 years ago

@kabir-rab You rock! Thank you!