mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Fixes the accessibility issue of the run button (#215277)](https://github.com/elastic/kibana/pull/215277) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-03-21T06:46:02Z","message":"[ES|QL] Fixes the accessibility issue of the run button (#215277)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/214540\n\nSeparates the tooltip label with the aria label for accessibility\nreasons\n\n<img width=\"428\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7aef7e8f-dc1d-4fce-ae05-cf6e215480af\"\n/>","sha":"6cd920c8e07b20d3d5060aa51694ec0ae9d7c197","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Fixes the accessibility issue of the run button","number":215277,"url":"https://github.com/elastic/kibana/pull/215277","mergeCommit":{"message":"[ES|QL] Fixes the accessibility issue of the run button (#215277)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/214540\n\nSeparates the tooltip label with the aria label for accessibility\nreasons\n\n<img width=\"428\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7aef7e8f-dc1d-4fce-ae05-cf6e215480af\"\n/>","sha":"6cd920c8e07b20d3d5060aa51694ec0ae9d7c197"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215277","number":215277,"mergeCommit":{"message":"[ES|QL] Fixes the accessibility issue of the run button (#215277)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/214540\n\nSeparates the tooltip label with the aria label for accessibility\nreasons\n\n<img width=\"428\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7aef7e8f-dc1d-4fce-ae05-cf6e215480af\"\n/>","sha":"6cd920c8e07b20d3d5060aa51694ec0ae9d7c197"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
This commit is contained in:
parent
c828ff8696
commit
d7d4bfd78f
1 changed files with 11 additions and 3 deletions
|
@ -62,6 +62,7 @@ import './query_bar.scss';
|
|||
|
||||
const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0;
|
||||
const COMMAND_KEY = isMac ? '⌘' : 'CTRL';
|
||||
const textBasedRunShortcut = `${COMMAND_KEY} + Enter`;
|
||||
|
||||
export const strings = {
|
||||
getNeedsUpdatingLabel: () =>
|
||||
|
@ -88,6 +89,11 @@ export const strings = {
|
|||
i18n.translate('unifiedSearch.queryBarTopRow.submitButton.run', {
|
||||
defaultMessage: 'Run query',
|
||||
}),
|
||||
getRunQueryShortcutLabel: () =>
|
||||
i18n.translate('unifiedSearch.queryBarTopRow.submitButton.shortcutLabel', {
|
||||
defaultMessage: `(shortcut {textBasedRunShortcut})`,
|
||||
values: { textBasedRunShortcut },
|
||||
}),
|
||||
getRunButtonLabel: () =>
|
||||
i18n.translate('unifiedSearch.queryBarTopRow.submitButton.runButton', {
|
||||
defaultMessage: 'Run',
|
||||
|
@ -565,9 +571,11 @@ export const QueryBarTopRow = React.memo(
|
|||
if (!shouldRenderUpdatebutton() && !shouldRenderDatePicker()) {
|
||||
return null;
|
||||
}
|
||||
const textBasedRunShortcut = `${COMMAND_KEY} + Enter`;
|
||||
const buttonLabelUpdate = strings.getNeedsUpdatingLabel();
|
||||
const buttonLabelRefresh = Boolean(isQueryLangSelected)
|
||||
? `${strings.getRunQueryLabel()} ${strings.getRunQueryShortcutLabel()}`
|
||||
: strings.getRefreshQueryLabel();
|
||||
const buttonLabelUpdate = strings.getNeedsUpdatingLabel();
|
||||
const tooltipText = Boolean(isQueryLangSelected)
|
||||
? textBasedRunShortcut
|
||||
: strings.getRefreshQueryLabel();
|
||||
const buttonLabelRun = textBasedRunShortcut;
|
||||
|
@ -598,7 +606,7 @@ export const QueryBarTopRow = React.memo(
|
|||
needsUpdate={props.isDirty}
|
||||
data-test-subj="querySubmitButton"
|
||||
toolTipProps={{
|
||||
content: props.isDirty ? tooltipDirty : buttonLabelRefresh,
|
||||
content: props.isDirty ? tooltipDirty : tooltipText,
|
||||
delay: 'long',
|
||||
position: 'bottom',
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue