Remove filters and drill downs on sign out

Comments

3 comments

  • Avatar
    Sanjoy Ghosh

    I tried this code but it is not working for me. All my drill downs are still there after I am sign out also.

     

    0
    Comment actions Permalink
  • Avatar
    Eli

    What OS and browser are you using?

    Do you get any error in the console? (press F12 to bring up the console in the browser).

     

    0
    Comment actions Permalink
  • Avatar
    Jonathan Sabah (Edited )

    Hi Eli,

    I have not tried the script but do you think it could be adapted so that drilling down any one widget would automatically drill down all the other widgets of the dashboard sharing the same dimension (assuming same aggregation)?

    Also, I am testing the script to see how removing filters and drillup work but changing the selector to the user icon and adding a few console logs here and there:

    dashboard.on('refreshend', function(se, ev){
    $('.app-icon--header-user').on('click', function(){
    console.clear();
    console.log(se);
    console.log(ev);

    //Remove all filters
    prism.$ngscope.dashboard.filters.clear();
    prism.$ngscope.dashboard.filters.update([], {refresh:true, save:true});

    // remove all drill downs
    _.each(se.widgets.$$widgets, function(widget, index){
    let id = widget.oid;
    let scope = angular.element($('widget[widgetid="'+id+'"]')).scope()
    let activity = prism.$injector.get('base.services.$activity');

    console.log(id + ", scope: " + scope + ", activity: " );
    console.log(JSON.stringify(activity));

    if(_.find(widget.rawQueryResult.metadata, function(md){return md.through != undefined})){

    prism.$command.create('dashboard.commands.drillUp', { $scope: scope, $activity: activity }).execute();
    }
    })
    })
    })

    I get the following results

    c {_id: "5dbafdbc9939eae3386878e2", title: "DashboardTest", oid: "5dbafdbc9939eae3386878e1", desc: "", source: null, …}
    {dashboard: c, completedQueries: 0}
    5dbb03e475c70be3644aad28, scope: undefined, activity:
    {}
    5ddfbc9c9aeff53db4de54b3, scope: undefined, activity:
    {}
    5ddfbcd39aeff53db4de54bc, scope: undefined, activity:
    {}
    5ddfc1a59aeff53db4de54d5, scope: undefined, activity:
    {}
    5ddfc2a09aeff53db4de54d9, scope: undefined, activity:
    {}
    5ddfc3b281966d063870d5b5, scope: undefined, activity:
    {}
    5ddfc81a81966d063870d5be, scope: undefined, activity:
    {}

    Testing in Chrome 78.0.3904.108 and Windows 10 64bit and Sisense 8.0.1.10112.

    Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.