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
Add a tooltip to health state of the cards in the physical infra dashboard #4453
Conversation
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
if critical_count.positive? | ||
icon_class = 'pficon pficon-error-circle-o' | ||
count = critical_count | ||
description = "#{count} #{component_type.downcase} are in critical state." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing gettext.
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing gettext.
There was a problem hiding this comment.
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!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing gettext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if critical_count.positive? | ||
icon_class = 'pficon pficon-error-circle-o' | ||
count = critical_count | ||
description = _("#{count} #{component_type.downcase} are in critical state.") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 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." |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_( )
?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
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! 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep hammering that home.
There was a problem hiding this comment.
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 ?
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 **
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
This pr is able to:
Remove the redundant number if all components are healthy.
Before
After
Add a tooltip in the health state icon in the provider dasborad