Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to de-activate a pinned query #564

Closed
wants to merge 1 commit into from
Closed

Allow to de-activate a pinned query #564

wants to merge 1 commit into from

Conversation

wiibaa
Copy link

@wiibaa wiibaa commented Oct 11, 2013

A simple use case:
I prepared a dashboard with a set of pinned queries, but final users may not be interested in all of them.
Currently one user would need to unpin and delete the query.

This PR makes the pinned queries clickable in order to de-activate / re-active them

@stubbetje
Copy link

Was looking for this exact feature and applied it locally and works like expected.

I would suggest, however, to leave the styling of the active pinned queries just like they were orginally and style the desactivated pinned query more faded out, just like is done with the disabled filter blocks.

@wiibaa
Copy link
Author

wiibaa commented Oct 16, 2013

Frankly speaking, I simply re-used the same styling as the query selection that is used within panel configuration to have this feature running quickly.
I have no strong styling conviction on this and prefer to leave the final decision to @rashidkpc that is doing so good already

@stubbetje
Copy link

Discovered an issue with this change. When you de-activate a pinned query, then that query will show up in histograms that use unpinned queries.

Simple fix is

diff --git a/src/app/services/querySrv.js b/src/app/services/querySrv.js
index a2b5b63..04cd31c 100755
--- a/src/app/services/querySrv.js
+++ b/src/app/services/querySrv.js
@@ -131,7 +131,7 @@ function (angular, _, config) {
      case 'pinned':
        return _.pluck(_.where(self.list,{pin:true, active:true}),'id');
      case 'unpinned':
-        return _.difference(self.ids,_.pluck(_.where(self.list,{pin:true, active:true}),'id'));
+        return _.pluck(_.where(self.list,{pin:false, active:true}),'id');
      case 'selected':
        return _.intersection(self.ids,config.ids);
      default:

Should panels that work on selected queries also be affected by deactivating a query? I am not sure.

@rashidkpc
Copy link
Contributor

Implemented this 34a2f0b for both pinned and unpinned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants