Add filtering based off of "active" query param in Web UI#1879
Merged
Conversation
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
Contributor
stuartnelson3
left a comment
There was a problem hiding this comment.
Looks awesome!
Do you want to add a test for generateQueryString to show that setting showActive to Just False results in active=false in the query string?
|
|
||
| In order to to show _only_ silenced alerts, update the query string to hide active alerts. | ||
| ``` | ||
| http://alertmanager/#/alerts?silenced=true&active=false |
| [ type_ "checkbox" | ||
| , class "custom-control-input" | ||
| , checked (Maybe.withDefault False maybeShowSilenced) | ||
| , checked (Maybe.withDefault False maybeChecked) |
Contributor
There was a problem hiding this comment.
I was just looking at this and thinking about that param name, thanks for fixing this!
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
Contributor
Author
I've added the test for this :) I also went ahead and removed one of the tests that was basically a duplicate. test "should default silenced & inhibited parameters to false and active to true if showSilenced is Nothing" <|
\() ->
Expect.equal "?silenced=false&inhibited=false&active=true"
(Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Nothing, showInhibited = Nothing, showActive = Nothing })tested the same thing as test "should not render keys with Nothing value except the silenced, inhibited, and active parameters, which default to false, false, true, respectively." <|
\() ->
Expect.equal "?silenced=false&inhibited=false&active=true"
(Utils.Filter.generateQueryString { receiver = Nothing, group = Nothing, customGrouping = False, text = Nothing, showSilenced = Nothing, showInhibited = Nothing, showActive = Nothing }) |
stuartnelson3
approved these changes
May 12, 2019
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes: #1867
This is my first foray into Elm, so please let me know if I missed anything :)
@stuartnelson3 -- I'm not sure who to add as a reviewer, so just tagging you.
Thanks!