Skip to content
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 @@ -19,6 +19,7 @@ import {
EuiFormRow,
EuiComboBox,
EuiText,
useGeneratedHtmlId,
} from '@elastic/eui';
import type { EuiComboBoxOptionOption } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -68,6 +69,7 @@ const AddTagsFlyoutComponent: React.FC<AddTagsFlyoutProps> = ({
onClose,
onSave,
}) => {
const flyoutTitleId = useGeneratedHtmlId();
const [localTags, setLocalTags] = useState<string[]>(currentTags);
const { tags: availableTags } = useHistoryTags();
const { mutate: updateTags, isLoading: isSaving } = useUpdateActionTags();
Expand Down Expand Up @@ -125,10 +127,10 @@ const AddTagsFlyoutComponent: React.FC<AddTagsFlyoutProps> = ({
}, [actionId, localTags, updateTags, onSave, onClose]);

return (
<EuiFlyout onClose={onClose} size="s" ownFocus>
<EuiFlyout onClose={onClose} size="s" ownFocus aria-labelledby={flyoutTitleId}>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<h2>{FLYOUT_TITLE}</h2>
<h2 id={flyoutTitleId}>{FLYOUT_TITLE}</h2>
</EuiTitle>
</EuiFlyoutHeader>
<EuiFlyoutBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const RunByFilterPopoverComponent: React.FC<RunByFilterPopoverProps> = ({
panelPaddingSize="none"
repositionOnScroll
panelProps={PANEL_PROPS}
aria-label={RUN_BY_LABEL}
>
<EuiSelectable
searchable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const SourceFilterPopoverComponent: React.FC<SourceFilterPopoverProps> = ({
panelPaddingSize="none"
repositionOnScroll
panelProps={PANEL_PROPS}
aria-label={SOURCE_LABEL}
>
<EuiSelectable aria-label={SOURCE_LABEL} options={selectableOptions} onChange={handleChange}>
{(list) => <div style={POPOVER_CONTENT_STYLE}>{list}</div>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const TagsColumnComponent: React.FC<TagsColumnProps> = ({ tags }) => {
closePopover={closePopover}
repositionOnScroll
data-test-subj="tagsColumnPopover"
aria-label={POPOVER_TITLE}
>
<EuiPopoverTitle>{POPOVER_TITLE}</EuiPopoverTitle>
<EuiBadgeGroup css={popoverWrapperCss}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const TagsFilterPopoverComponent: React.FC<TagsFilterPopoverProps> = ({
panelPaddingSize="none"
repositionOnScroll
panelProps={PANEL_PROPS}
aria-label={TAGS_LABEL}
>
<EuiSelectable
searchable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiConfirmModal } from '@elastic/eui';
import { EuiConfirmModal, useGeneratedHtmlId } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useCallback, useMemo, useState } from 'react';

Expand All @@ -15,6 +15,7 @@ interface UseDuplicateGuardParams {
}

export const useDuplicateGuard = ({ copyMutation, resourceType }: UseDuplicateGuardParams) => {
const confirmModalTitleId = useGeneratedHtmlId();
const bodyText = useMemo(
() =>
i18n.translate('xpack.osquery.duplicateConfirmation.body', {
Expand Down Expand Up @@ -48,8 +49,12 @@ export const useDuplicateGuard = ({ copyMutation, resourceType }: UseDuplicateGu
setIsFormDirty(isDirty);
}, []);

const titleProps = useMemo(() => ({ id: confirmModalTitleId }), [confirmModalTitleId]);

const duplicateModal = isDuplicateModalVisible ? (
<EuiConfirmModal
aria-labelledby={confirmModalTitleId}
titleProps={titleProps}
title={i18n.translate('xpack.osquery.duplicateConfirmation.title', {
defaultMessage: 'You have unsaved changes',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const RowActionsMenuComponent: React.FC<RowActionsMenuProps> = ({
closePopover={closePopover}
panelPaddingSize="none"
anchorPosition="leftCenter"
aria-label={actionsAriaLabel}
>
<EuiContextMenuPanel size="s" items={menuItems} />
</EuiPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const ColumnPickerPopoverComponent: React.FC<ColumnPickerPopoverProps> = ({
panelPaddingSize="none"
repositionOnScroll
panelProps={panelProps}
aria-label={COLUMNS_LABEL}
>
<EuiSelectable aria-label={COLUMNS_LABEL} options={selectableOptions} onChange={handleChange}>
{(list) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const CreatedByFilterPopoverComponent: React.FC<CreatedByFilterPopoverProps> = (
panelPaddingSize="none"
repositionOnScroll
panelProps={panelProps}
aria-label={CREATED_BY_LABEL}
>
<EuiSelectable
searchable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const SelectableFilterPopoverComponent: React.FC<SelectableFilterPopoverProps> =
panelPaddingSize="none"
repositionOnScroll
panelProps={panelProps}
aria-label={label}
>
<EuiSelectable aria-label={label} options={selectableOptions} onChange={handleChange}>
{(list) => <div style={POPOVER_CONTENT_STYLE}>{list}</div>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const SortFieldsPopoverComponent: React.FC<SortFieldsPopoverProps> = ({
panelPaddingSize="none"
repositionOnScroll
panelProps={panelProps}
aria-label={SORT_FIELDS_LABEL}
>
<div style={POPOVER_CONTENT_STYLE}>
<EuiPopoverTitle paddingSize="s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const RowKebabMenuContent: React.FC<RowKebabMenuProps> = React.memo(
closePopover={close}
panelPaddingSize="none"
anchorPosition="downLeft"
aria-label={kebabLabel}
>
<EuiContextMenuPanel size="s" items={menuItems} />
</EuiPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ export const AgentPoliciesPopover = ({ agentPolicyIds = [] }: { agentPolicyIds?:
}

return (
<EuiPopover button={button} isOpen={isPopoverOpen} closePopover={closePopover}>
<EuiPopover
button={button}
isOpen={isPopoverOpen}
closePopover={closePopover}
aria-label={i18n.translate('xpack.osquery.packs.table.agentPoliciesPopoverAriaLabel', {
defaultMessage: 'Agent policies',
})}
>
<EuiText size="s">
{agentPolicyIds?.map((policyId) => (
<div key={policyId}>
Expand Down
Loading