mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
# Backport This will backport the following commits from `main` to `8.17`: - [[Search] Fix button without a11y aria-label (#201236)](https://github.com/elastic/kibana/pull/201236) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sander Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-25T16:22:16Z","message":"[Search] Fix button without a11y aria-label (#201236)\n\nAlso adds a tooltip to the document count to explain why the count might differ.","sha":"77f08541e146ac071d18d1df52b2ab6284608df7","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:version","v8.17.0"],"title":"[Search] Fix button without a11y aria-label","number":201236,"url":"https://github.com/elastic/kibana/pull/201236","mergeCommit":{"message":"[Search] Fix button without a11y aria-label (#201236)\n\nAlso adds a tooltip to the document count to explain why the count might differ.","sha":"77f08541e146ac071d18d1df52b2ab6284608df7"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201236","number":201236,"mergeCommit":{"message":"[Search] Fix button without a11y aria-label (#201236)\n\nAlso adds a tooltip to the document count to explain why the count might differ.","sha":"77f08541e146ac071d18d1df52b2ab6284608df7"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
This commit is contained in:
parent
86288e107d
commit
86bc83d5ee
3 changed files with 19 additions and 0 deletions
|
@ -85,6 +85,12 @@ export const ResultField: React.FC<ResultFieldProps> = ({
|
|||
<EuiPopover
|
||||
button={
|
||||
<EuiButtonIcon
|
||||
aria-label={i18n.translate(
|
||||
'searchIndexDocuments.result.fieldTypeButtonAriaLabel',
|
||||
{
|
||||
defaultMessage: "Show this field's type",
|
||||
}
|
||||
)}
|
||||
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
|
||||
iconType={iconType || (fieldType ? iconMap[fieldType] : defaultToken)}
|
||||
/>
|
||||
|
|
|
@ -18,6 +18,7 @@ import {
|
|||
EuiText,
|
||||
useEuiTheme,
|
||||
useGeneratedHtmlId,
|
||||
EuiIconTip,
|
||||
} from '@elastic/eui';
|
||||
|
||||
interface BaseQuickStatProps {
|
||||
|
@ -33,6 +34,7 @@ interface BaseQuickStatProps {
|
|||
}>;
|
||||
setOpen: (open: boolean) => void;
|
||||
first?: boolean;
|
||||
tooltipContent?: string;
|
||||
}
|
||||
|
||||
export const QuickStat: React.FC<BaseQuickStatProps> = ({
|
||||
|
@ -45,6 +47,7 @@ export const QuickStat: React.FC<BaseQuickStatProps> = ({
|
|||
secondaryTitle,
|
||||
iconColor,
|
||||
content,
|
||||
tooltipContent,
|
||||
...rest
|
||||
}) => {
|
||||
const { euiTheme } = useEuiTheme();
|
||||
|
@ -93,6 +96,11 @@ export const QuickStat: React.FC<BaseQuickStatProps> = ({
|
|||
{secondaryTitle}
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
{tooltipContent && (
|
||||
<EuiFlexItem>
|
||||
<EuiIconTip content={tooltipContent} />
|
||||
</EuiFlexItem>
|
||||
)}
|
||||
</EuiFlexGroup>
|
||||
</EuiPanel>
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ export interface QuickStatsProps {
|
|||
index: Index;
|
||||
mappings: Mappings;
|
||||
indexDocuments: IndexDocuments;
|
||||
tooltipContent?: string;
|
||||
}
|
||||
|
||||
export const SetupAISearchButton: React.FC = () => {
|
||||
|
@ -107,6 +108,10 @@ export const QuickStats: React.FC<QuickStatsProps> = ({ index, mappings, indexDo
|
|||
description: index.size ?? '0b',
|
||||
},
|
||||
]}
|
||||
tooltipContent={i18n.translate('xpack.searchIndices.quickStats.documentCountTooltip', {
|
||||
defaultMessage:
|
||||
'This excludes nested documents, which Elasticsearch uses internally to store chunks of vectors.',
|
||||
})}
|
||||
first
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue