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 a tooltip to health state of the cards in the physical infra dashboard #4453

Merged
merged 1 commit into from Aug 31, 2018
Merged

Add a tooltip to health state of the cards in the physical infra dashboard #4453

merged 1 commit into from Aug 31, 2018

Conversation

CharlleDaniel
Copy link
Member

@CharlleDaniel CharlleDaniel commented Aug 10, 2018

This pr is able to:

  • Remove the redundant number if all components are healthy.
    Before
    tooltip-img-3
    After
    screenshot-localhost-3000-2018 08 10-14-34-28

  • Add a tooltip in the health state icon in the provider dasborad
    tooltip-img2

@CharlleDaniel
Copy link
Member Author

@terezanovotna

@miq-bot

This comment has been minimized.

2 similar comments
@miq-bot

This comment has been minimized.

@miq-bot

This comment has been minimized.

@CharlleDaniel CharlleDaniel changed the title Add a tooltip message to health state of the cards Add a tooltip to health state of the cards inside the physical infra dashboard Aug 10, 2018
@CharlleDaniel CharlleDaniel changed the title Add a tooltip to health state of the cards inside the physical infra dashboard Add a tooltip to health state of the cards in the physical infra dashboard Aug 10, 2018
@CharlleDaniel
Copy link
Member Author

@miq-bot add_label enhancement
@miq-bot add_label gaprindashvili/no
@miq-bot add_label ux/review

if critical_count.positive?
icon_class = 'pficon pficon-error-circle-o'
count = critical_count
description = "#{count} #{component_type.downcase} are in critical state."
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing gettext.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec done.

elsif warning_count.positive?
icon_class = 'pficon pficon-warning-triangle-o'
count = warning_count
description = "#{count} #{component_type.downcase} may present unexpected behavior."
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing gettext.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

description = "#{count} #{component_type.downcase} may present unexpected behavior."
elsif valid_count.positive?
icon_class = 'pficon pficon-ok'
description = "All #{component_type.downcase} are healthy!"
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing gettext.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@terezanovotna
Copy link

LGTM!

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

if critical_count.positive?
icon_class = 'pficon pficon-error-circle-o'
count = critical_count
description = _("#{count} #{component_type.downcase} are in critical state.")
Copy link
Contributor

Choose a reason for hiding this comment

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

The above won't work. You need the following:

_("%{count} %{component_type} are in critical state.") % {:count => count, :component_type => component_type.downcase}```

Same below.

Copy link
Member

Choose a reason for hiding this comment

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

Does this thing have a singular/plural form? I see 1 servers are in critical state as a tooltip.

Copy link
Member Author

Choose a reason for hiding this comment

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

hey @mzazrivec I will change this, but could you explain what won't work ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@skateman This doesn't have singular/plural, If you want I could add as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I got the tooltip, but the number is still there:

@skateman About that, the idea is only to remove it if all components are healthy. If we have any state as warning or critical we should show their count.

Copy link
Member Author

Choose a reason for hiding this comment

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

@skateman Now was added a singular and plural message. Could you review again?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec Done, the gettext was fixed. Also thank you for your explanation, was very very nice.

Copy link
Member Author

Choose a reason for hiding this comment

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

@CharlleDaniel for the singular/plural, you can use n_(singular_text, plural_text, number)

@skateman This not worked for me, but thank you for your suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

I think you should use n_(), if it wasn't working you probably called it wrong. Can you send me over the line and the stacktrace?

Copy link
Member Author

Choose a reason for hiding this comment

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

@skateman I'm sorry, I did try to use _(singular_text, plural_text, number) but now I'm using n_() and it's works very well. Could you review again?

@skateman
Copy link
Member

I got the tooltip, but the number is still there:
screenshot from 2018-08-14 12-41-32

@CharlleDaniel
Copy link
Member Author

@skateman and @mzazrivec could you see the comments ?

:count => count,
def format_tooltip(health_state, component_type, count)
singular_structure = "%{count} %{component_type} is in %{health_state} state."
plural_structure = "%{count} %{component_type} are in %{health_state} state."
Copy link
Member

Choose a reason for hiding this comment

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

@mzazrivec do we have something for this is/are thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine. Though the strings need to be inside n_(). n_(var1, var2, count) won't work with the string extraction process.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec just a question, why n_(var1, var2, count) won't work? There must be only one string per n_( ) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The extraction logic cannot parse the string out if it's in a variable (or any expression).

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec thanks. Is it fine now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.

Copy link
Member

Choose a reason for hiding this comment

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

It's better than fine, it's gaprindashvili! 😆

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep hammering that home.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mzazrivec @skateman Could someone merge or approve this PR ?

@miq-bot
Copy link
Member

miq-bot commented Aug 27, 2018

Checked commit https://github.com/CharlleDaniel/manageiq-ui-classic/commit/f4071cab84200d9f0b8ef12b26504e72a758fc4b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

The Seal of Approval

@mzazrivec mzazrivec self-assigned this Aug 31, 2018
@mzazrivec mzazrivec added this to the Sprint 94 Ending Sept 10, 2018 milestone Aug 31, 2018
@mzazrivec mzazrivec merged commit d119f9b into ManageIQ:master Aug 31, 2018
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628384
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628384
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628384
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list. Adjusted existing spec test to expect iconImage to be nil.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 13, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list. Adjusted existing spec test to expect iconImage to be nil.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 14, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list. Adjusted existing spec test to expect iconImage to be nil.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 14, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list. Adjusted existing spec test to expect iconImage to be nil.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 14, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
h-kataria added a commit to h-kataria/manageiq-ui-classic that referenced this pull request Sep 17, 2018
- Red crosses were added as part of ManageIQ#4453 that caused them to show up on all aggregate status cards on all provider dashboards, fixed the condition and removed setting of redundant notification hash for providers when it is not needed.
- Show status icon under Alerts in aggregate card if Alerts are configured for a container provider, otherwise show "No data available" empty pf card.
- On Containers Overview dashboard, Fixed to not show provider icon in Provider status aggregate card, it should only show count of providers with a link to list view to Container Providers show list.
- Added a title on Container Overview dashboard screen, since that's the only screen on that subtab there are no breadcrumbs on the screen.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626199
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1626427
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.

None yet

6 participants