From a878c98ecc312ff7192698cde6afd38060c124b8 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Wed, 22 Jan 2025 11:23:13 +0300 Subject: [PATCH] fix: [Security:Rules:SharedExceptionList] The toggle button for linking a rule on add rule exception panel is missing discernible text (#205600) Closes: #204667 ## Summary The toggle button for linking to a rule on Add rule exception panel is missing discernible text **Preconditions** Security -> Rules->Shared exceptions ->Add rule exception panel is open ## Changes made: 1. Added 'label' attribute for **EuiSwitch** ### Screen ![image](https://github.com/user-attachments/assets/9714112b-b402-43c6-9b62-388f94079b33) --- .../link_rule_switch/index.tsx | 8 +++++++- .../link_rule_switch/translations.ts | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/translations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx index 25fcf6f942c67..df4e9c296a598 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx @@ -8,6 +8,7 @@ import React, { memo, useCallback, useMemo } from 'react'; import type { EuiSwitchProps } from '@elastic/eui'; import { EuiFlexItem, EuiSwitch } from '@elastic/eui'; import type { RuleResponse } from '../../../../../../../common/api/detection_engine'; +import * as i18n from './translations'; export const LinkRuleSwitch = memo( ({ @@ -35,7 +36,12 @@ export const LinkRuleSwitch = memo( return ( - + ); } diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/translations.ts new file mode 100644 index 0000000000000..1914672f525cb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/translations.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const LINK_SWITCH_ARIA_LABEL = (name: string) => + i18n.translate( + 'xpack.securitySolution.rule_exceptions.flyoutComponents.addToRulesTableSelection.linkSwitch.ariaLabel', + { + values: { name }, + defaultMessage: 'Link "{name}"', + } + );