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

Add alerts to dashboard #1234

Merged
merged 10 commits into from
Aug 31, 2017
Merged

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented May 3, 2017

Depends on ManageIQ/manageiq#14976

Description

We are discussing adding alerts to the dashboard:

...
The current containers dashboard does not provide a summary of Alerts NOR ability to drill down to the Alerts area.
...
Mockup and comments make sense to me. Unless there are objections or other comments I think we could start working on this.

This PR is a POC for adding alerts to the dashboard.

Screenshots

System
screenshot-localhost 3000-2017-05-03-11-14-20

One Provider
screenshot-localhost 3000-2017-05-03-11-14-00

Current
currentdashboard

Mockup
dashboard4x2-addalerts

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@miq-bot add_label compute/containers

@simon3z @zeari @moolitayer @cben @dkorn @himdel please review

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@serenamarie125 @Loicavenel PTAL

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@miq-bot add_label enhancement

errors = @ems.miq_alert_statuses.where(:severity => "error").count
else
warnings = MiqAlertStatus.where(:severity => "warning").count
errors = MiqAlertStatus.where(:severity => "error").count
Copy link

Choose a reason for hiding this comment

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

Are alert statuses exclusive to containers providers? Seems like there should be a filter here

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 💯 Thanks ! working on that now ...

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@zeari Thanks fixed using @moolitayer's suggestion ems_id != null

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@himdel @cben codeclimate thinks that

  if (data) {
     statusObject.href = data.href;
     statusObject.count = data.count;
     statusObject.notifications = data.notifications;
   }

is similar to:

    if(type == "Add") {
      $scope.altText =  $scope.addBtnText;
      $scope.btnText = $scope.addBtnText;
      $scope.btnClick = $scope.addClicked;
    } else if(type == "Submit") {

with gravity 48 ! what is going on here ?

@himdel
Copy link
Contributor

himdel commented May 3, 2017

@yaacov Yeah, just ignore codeclimate here, aparently any 3 assignments in a condition are too similar :)

@serenamarie125
Copy link

LGTM @yaacov!
What happens when there are no alerts, just a green check?

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

What happens when there are no alerts, just a green check?

@serenamarie125

screenshot-localhost 3000-2017-05-03-15-46-31

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@serenamarie125 looking at the way it looks with zero alerts, I changed it to:

screenshot-localhost 3000-2017-05-03-15-54-53

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

This is how it looks when only the number of errors is zero:

screenshot-localhost 3000-2017-05-03-16-12-54

@serenamarie125
Copy link

@yaacov I'd suggest that we never show 0.
So if there are only 15 errors, just show error icon with 15.

If there errors of any severity, just show a green check with no number.

See the standard card example here: http://www.patternfly.org/pattern-library/cards/aggregate-status-card/

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@serenamarie125 👍

Only warnings:
screenshot-localhost 3000-2017-05-03-16-36-33

Only errors:
screenshot-localhost 3000-2017-05-03-16-39-46

Warnings and errors:
screenshot-localhost 3000-2017-05-03-16-40-44

Every thing is fine:
[EDIT: this has changed to not showing the zero]

@yaacov yaacov force-pushed the add-alerts-to-dashboard branch 2 times, most recently from a2d1ef1 to e816661 Compare May 3, 2017 14:10
@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@serenamarie125 changed the no alerts to:

screenshot-localhost 3000-2017-05-03-17-08-53

@yaacov
Copy link
Member Author

yaacov commented May 3, 2017

@simon3z can we remove the POC from this ?

@moolitayer
Copy link

@simon3z can we remove the POC from this ?

Note the alerts feature isn't fully functional upstream (not in the cm-ops flow). So the counts might always be 0 for all our customers. We should how and when this can be available upstream
See also ManageIQ/manageiq#14976

else
warnings = MiqAlertStatus.where.not(:ems_id => nil).where(:severity => "warning").count
errors = MiqAlertStatus.where.not(:ems_id => nil).where(:severity => "error").count
end
Copy link
Member

@martinpovolny martinpovolny May 4, 2017

Choose a reason for hiding this comment

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

relation = @ems || MiqAlertStatus.where.not(:ems_id => nil)
warnings, errors = relation.group(:severity).count.values_at(*%w(warning error))

something like this to cut the number of SQL queries (and also source lines) by 2 (3)?

Copy link
Member Author

Choose a reason for hiding this comment

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

@martinpovolny Nice, thanks 👍 fixed

@yaacov yaacov changed the title [POC] Add alerts to dashboard [WIP] [POC] Add alerts to dashboard May 11, 2017
@miq-bot miq-bot added the wip label May 11, 2017
@serenamarie125
Copy link

@miq-bot add_label ux/review

@@ -96,6 +97,28 @@ def providers
result.values
end

def alerts
relation = @ems ? @ems.miq_alert_statuses : MiqAlertStatus.where.not(:ems_id => nil)
Copy link

@zeari zeari Aug 21, 2017

Choose a reason for hiding this comment

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

switch MiqAlertStatus.where.not(:ems_id => nil)
with something like MiqAlertStatus.where(:ems_id => ContainerManager.all.pluck(:id))

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 right, thanks

@yaacov yaacov changed the title [WIP][POC] Add alerts to dashboard Add alerts to dashboard Aug 21, 2017
@yaacov
Copy link
Member Author

yaacov commented Aug 21, 2017

removing POC and WIP but this is still pending core.

@miq-bot miq-bot removed the wip label Aug 21, 2017
@miq-bot
Copy link
Member

miq-bot commented Aug 22, 2017

Checked commits yaacov/manageiq-ui-classic@0cabfdb~...b25a37e with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

Copy link

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

LGTM @yaacov

@serenamarie125
Copy link

@miq-bot add_label ux/approved
@miq-bot remove_label ux/review

@martinpovolny
Copy link
Member

This might need to be converted to an (angular) component. Ping @h-kataria, please, take a look.

@h-kataria
Copy link
Contributor

@yaacov changes look good in this PR. Container dashboards will need to be converted to use angular components once #1901 is completed and merged, I am close to getting Infrastructure providers dashboard converted.

@martinpovolny martinpovolny merged commit 0e2ef08 into ManageIQ:master Aug 31, 2017
@martinpovolny martinpovolny added this to the Sprint 68 Ending Sep 4, 2017 milestone Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants