Allow user to pass multiple filters to custom slash commands / Show all filters in help menu #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
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.
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.
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.
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.
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.