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 user to pass multiple filters to custom slash commands / Show all filters in help menu #208

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikbapat
Copy link

@nikbapat nikbapat commented Jul 2, 2021

Before:
When calling a dashboard using custom slash commands, lookerbot only allowed for the dashboard to have a single filter. Attempting to call a dashboard with multiple filters and using only one parameter would cause the parameter to be applied to both filters, even if it was only relevant to one. (see below call and resulting applied filters).

Slack: Single parameter, multiple filters

Before: Single parameter, multiple filters

Passing multiple parameters to a multi-filter dashboard would pass the literal entered string as a parameter to all filters, even if separated by a space or semicolon.

Before: Semicolon

Using a comma to separate them would lead to a logical "or" between the passed values, which was still applied to all filters. This would create an issue when filters have overlapping input spaces.

Before: Comma

After:
This PR enables users to pass multiple parameters to the slack command, which will be applied to the filters one by one in the order the filters are listed. The parameters should be separated by semicolons to distinguish between filters. The comma still works as a logical "or" within a given parameter.

Slack: Semicolon and Comma, multiple filters

After: Semicolon and Comma, multiple filters

If there are fewer parameters passed than available filters, all subsequent filters will have no parameter passed (i.e. no restriction). To leave an earlier parameter blank but pass a value to a later parameter, use a semicolon to separate but do not enter a value.

Slack: Blank parameter

After: Blank parameter

The PR also makes changes to looker.ts to allow all filters to appear in the help menu in the order that parameters should be entered, with semicolons where appropriate.

After: Help Menu

@nikbapat
Copy link
Author

nikbapat commented Jul 2, 2021

Hi @annguy3n , would it be possible for you to review this PR when you get the chance? Thanks!

@zeitgeistf
Copy link

IMO, this is a great feature to have, even at my current company, we have been struggling to manually input all the filter conditions every time when someone tries to look up custom metrics from a shared dashboard that has many filters.
Based on my understanding of the changes, now all of that can be simplified by using Slack command.

@wilg @annguy3n @namabile @reedloden @ronnieplooker @morganatlooker @arkarkark can you please take a look at this (or help to notify the maintainer that manages this project), really look forward to introduce this feature to my team, thanks!!

@zeitgeistf
Copy link

@wilg @annguy3n @namabile @reedloden @ronnieplooker @morganatlooker @arkarkark Hi team, any update on this? this is a really nice feature to have, can you please consider, thanks

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.

2 participants