mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
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 
This commit is contained in:
parent
e2c138bca1
commit
a878c98ecc
2 changed files with 24 additions and 1 deletions
|
@ -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 (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiSwitch onChange={onLinkOrUnlinkRule} label="" checked={isRuleLinked} />
|
||||
<EuiSwitch
|
||||
onChange={onLinkOrUnlinkRule}
|
||||
checked={isRuleLinked}
|
||||
label={i18n.LINK_SWITCH_ARIA_LABEL(rule.name)}
|
||||
showLabel={false}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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}"',
|
||||
}
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue