-
Notifications
You must be signed in to change notification settings - Fork 29
Add tooltips for state pictograms #1262
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
Open
jrauh01
wants to merge
2
commits into
main
Choose a base branch
from
feature/state-pictogram-tooltips
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,19 +220,56 @@ public function assembleFooter($item, HtmlDocument $footer, string $layout): voi | |
| ); | ||
| } | ||
|
|
||
| if ($item->state->is_acknowledged) { | ||
| $title = $isService | ||
| ? sprintf( | ||
| $this->translate('Service "%s" on "%s" is acknowledged'), | ||
| $item->display_name, | ||
| $item->host->display_name | ||
| ) | ||
| : sprintf($this->translate('Host "%s" is acknowledged'), $item->display_name); | ||
|
|
||
| $statusIcons->addHtml(new Icon(Icons::IS_ACKNOWLEDGED, ['title' => $title])); | ||
| } | ||
|
|
||
| if ($item->state->in_downtime) { | ||
| if ($isService) { | ||
| $message = $item->state->is_handled | ||
| ? 'Service "%s" on "%s" is handled by Downtime' | ||
| : 'Service "%s" on "%s" is in Downtime'; | ||
|
|
||
| $title = sprintf($this->translate($message), $item->display_name, $item->host->display_name); | ||
| } else { | ||
| $message = $item->state->is_handled ? 'Host "%s" is handled by Downtime' : 'Host "%s" is in Downtime'; | ||
|
|
||
| $title = sprintf($this->translate($message), $item->display_name); | ||
| } | ||
|
|
||
| $statusIcons->addHtml(new Icon(Icons::IN_DOWNTIME, ['title' => $title])); | ||
| } | ||
|
|
||
| if ($item->state->is_flapping) { | ||
| $title = $isService | ||
| ? sprintf( | ||
| $this->translate('Service "%s" on "%s" is in flapping state'), | ||
| $item->display_name, | ||
| $item->host->display_name | ||
| ) | ||
| : sprintf( | ||
| $this->translate('Host "%s" is in flapping state'), | ||
| $item->display_name | ||
| ); | ||
| : sprintf($this->translate('Host "%s" is in flapping state'), $item->display_name); | ||
|
|
||
| $statusIcons->addHtml(new Icon(Icons::IS_FLAPPING, ['title' => $title])); | ||
| } | ||
|
|
||
| if (! $item->state->is_reachable) { | ||
| $title = $isService | ||
| ? sprintf( | ||
| $this->translate('Service "%s" on "%s" is unreachable'), | ||
| $item->display_name, | ||
| $item->host->display_name | ||
| ) | ||
| : sprintf($this->translate('Host "%s" is unreachable'), $item->display_name); | ||
|
|
||
| $statusIcons->addHtml(new Icon('random', ['title' => $title])); | ||
| $statusIcons->add(new Icon(Icons::HOST_DOWN, ['title' => $title])); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
| } | ||
|
|
||
| if (! $item->notifications_enabled) { | ||
|
|
||
Oops, something went wrong.
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.
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.
Why did you change the icon? If this was not discussed, please remove this change.
Uh oh!
There was an error while loading. Please reload this page.
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.
If the reason is that the footer used it, then it was wrong to use
randombefore. Thestate-ballvisuals have always usedbolt.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 was discussed with @lippserd. I think the reason was to have the
state-ballandfootervisual the same.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 will be a breaking change. There must be a reason why we used
boltbefore. @flourish86, can you please clarify which icon should be used here?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.
Interesting and great that this is pointed out.
It doesn't make sense to have two different icons for flapping. We added the flapping "bolt" to the state ball after the footer icon and probably haven't though of to adjust the latter.
Looking at it after taking a step back, the footer icon doesn't deliver any value anymore, so my suggestion would be to drop it completely and continue to use the bolt icon for the state ball.
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 footer should also have the icon (it is part of
.state-iconsindetailedview mode, which can show more icons at the same time as the state-ball), but the same asstate-ball, so we’ll use thebolticon.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 still delivers value, as the host can be
in downtimeand inflappingstate at the same time, but the state-ball will only showdowntimeicon.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, I know the icons in the footer. But removing only the flapping icon would not harm the others, would it?
Ok, I’d consider this quite an edge case and I’d argue, that if it actually is in downtime most people will not care about the object flapping.
I'm fine with keeping it, though.
Besides that, the icons have to be the same. So one of those has to be changed. I’d opt for the one in the footer, since the bolt works better with larger sizes in the state ball. And the event visuals for flapping also use the bolt icon.
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.
Okay 😄. @jrauh01, please use
boltin both cases.