Skip to content

Add filtering based off of "active" query param in Web UI#1879

Merged
stuartnelson3 merged 2 commits into
prometheus:masterfrom
wbh1:active-filter
May 12, 2019
Merged

Add filtering based off of "active" query param in Web UI#1879
stuartnelson3 merged 2 commits into
prometheus:masterfrom
wbh1:active-filter

Conversation

@wbh1
Copy link
Copy Markdown
Contributor

@wbh1 wbh1 commented May 8, 2019

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!

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
Copy link
Copy Markdown
Contributor

@stuartnelson3 stuartnelson3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread ui/app/README.md

In order to to show _only_ silenced alerts, update the query string to hide active alerts.
```
http://alertmanager/#/alerts?silenced=true&active=false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

[ type_ "checkbox"
, class "custom-control-input"
, checked (Maybe.withDefault False maybeShowSilenced)
, checked (Maybe.withDefault False maybeChecked)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just looking at this and thinking about that param name, thanks for fixing this!

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
@wbh1
Copy link
Copy Markdown
Contributor Author

wbh1 commented May 10, 2019

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?

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
Copy link
Copy Markdown
Contributor

Thanks!

@stuartnelson3 stuartnelson3 merged commit 3321962 into prometheus:master May 12, 2019
@wbh1 wbh1 deleted the active-filter branch May 13, 2019 18:15
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.

Adding active=true in alert list not passed to backend

3 participants