-
Notifications
You must be signed in to change notification settings - Fork 186
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
Substitute warning icon in events view #7057
Merged
asteriscos
merged 8 commits into
4.10.0
from
enhacement/7049-substitute-warning-icon-in-events-view
Oct 21, 2024
+49
−28
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f6eb61d
Sustitude warning icon
JuanGarriuz f4dc7d2
Update Changelog
JuanGarriuz bf6e01a
Change to iInCircle
JuanGarriuz ee76bae
Solve aria-label comments and fixed icon centered with text
JuanGarriuz 241ead7
Merge branch '4.10.0' into enhacement/7049-substitute-warning-icon-in…
JuanGarriuz 660dbd6
Solve aria-label nitpick
JuanGarriuz 093b301
fix: aria-label in some buttons
Desvelao 1b4eec2
fix: aria-label
Desvelao 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 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 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 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
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. nitpick: change the |
This file contains 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 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 |
---|---|---|
|
@@ -17,7 +17,14 @@ | |
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip, EuiIcon } from '@elastic/eui'; | ||
import { | ||
EuiButtonEmpty, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiText, | ||
EuiToolTip, | ||
EuiIcon, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; | ||
import { i18n } from '@osd/i18n'; | ||
import { formatNumWithCommas } from '../../helpers'; | ||
|
@@ -43,45 +50,61 @@ export interface HitsCounterProps { | |
}; | ||
} | ||
|
||
export function HitsCounter({ hits, showResetButton, onResetQuery, tooltip }: HitsCounterProps) { | ||
export function HitsCounter({ | ||
hits, | ||
showResetButton, | ||
onResetQuery, | ||
tooltip, | ||
}: HitsCounterProps) { | ||
return ( | ||
<I18nProvider> | ||
<EuiFlexGroup | ||
gutterSize="s" | ||
className="dscResultCount" | ||
gutterSize='s' | ||
className='dscResultCount' | ||
responsive={false} | ||
justifyContent="center" | ||
alignItems="center" | ||
justifyContent='center' | ||
alignItems='center' | ||
> | ||
<EuiFlexItem grow={false}> | ||
<EuiText> | ||
<strong data-test-subj="discoverQueryHits">{formatNumWithCommas(hits)}</strong>{' '} | ||
<strong data-test-subj='discoverQueryHits'> | ||
{formatNumWithCommas(hits)} | ||
</strong>{' '} | ||
<FormattedMessage | ||
id="discover.hitsPluralTitle" | ||
defaultMessage="{hits, plural, one {hit} other {hits}}" | ||
id='discover.hitsPluralTitle' | ||
defaultMessage='{hits, plural, one {hit} other {hits}}' | ||
values={{ | ||
hits, | ||
}} | ||
/>{' '} | ||
{tooltip && tooltip.content && (<EuiToolTip position={tooltip.position || 'top'} content={tooltip.content}> | ||
<EuiIcon tabIndex={0} type={tooltip.iconType || 'info'} aria-label={tooltip.ariaLabel || 'Info'} /> | ||
</EuiToolTip>)} | ||
{tooltip && tooltip.content && ( | ||
<EuiToolTip | ||
position={tooltip.position || 'top'} | ||
content={tooltip.content} | ||
> | ||
<EuiIcon | ||
tabIndex={0} | ||
type={tooltip.iconType || 'iInCircle'} | ||
aria-label={tooltip.ariaLabel || 'iInCircle'} | ||
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. nitpick: restore the default value for the |
||
/> | ||
</EuiToolTip> | ||
)} | ||
</EuiText> | ||
</EuiFlexItem> | ||
{showResetButton && ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty | ||
iconType="refresh" | ||
data-test-subj="resetSavedSearch" | ||
iconType='refresh' | ||
data-test-subj='resetSavedSearch' | ||
onClick={onResetQuery} | ||
size="s" | ||
size='s' | ||
aria-label={i18n.translate('discover.reloadSavedSearchButton', { | ||
defaultMessage: 'Reset search', | ||
})} | ||
> | ||
<FormattedMessage | ||
id="discover.reloadSavedSearchButton" | ||
defaultMessage="Reset search" | ||
id='discover.reloadSavedSearchButton' | ||
defaultMessage='Reset search' | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
|
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.
nitpick: change the
aria-label
to something such asInfo
.