Skip to content
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

[8.17] [Search] Fix button without a11y aria-label (#201236) #201643

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
EuiText,
useEuiTheme,
useGeneratedHtmlId,
EuiIconTip,
} from '@elastic/eui';

interface BaseQuickStatProps {
Expand All @@ -33,6 +34,7 @@ interface BaseQuickStatProps {
}>;
setOpen: (open: boolean) => void;
first?: boolean;
tooltipContent?: string;
}

export const QuickStat: React.FC<BaseQuickStatProps> = ({
Expand All @@ -45,6 +47,7 @@ export const QuickStat: React.FC<BaseQuickStatProps> = ({
secondaryTitle,
iconColor,
content,
tooltipContent,
...rest
}) => {
const { euiTheme } = useEuiTheme();
Expand Down Expand Up @@ -93,6 +96,11 @@ export const QuickStat: React.FC<BaseQuickStatProps> = ({
{secondaryTitle}
</EuiText>
</EuiFlexItem>
{tooltipContent && (
<EuiFlexItem>
<EuiIconTip content={tooltipContent} />
</EuiFlexItem>
)}
</EuiFlexGroup>
</EuiPanel>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface QuickStatsProps {
index: Index;
mappings: Mappings;
indexDocuments: IndexDocuments;
tooltipContent?: string;
}

export const SetupAISearchButton: React.FC = () => {
Expand Down Expand Up @@ -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>
Expand Down