mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-27 01:19:00 +02:00
feat: add tooltips to constraint operator buttons (#9941)

This commit is contained in:
parent
fd4042db00
commit
7a012ce910
@ -10,7 +10,6 @@ import Delete from '@mui/icons-material/Delete';
|
|||||||
import { ValueList } from './ValueList';
|
import { ValueList } from './ValueList';
|
||||||
import { ReactComponent as CaseSensitiveIcon } from 'assets/icons/case-sensitive.svg';
|
import { ReactComponent as CaseSensitiveIcon } from 'assets/icons/case-sensitive.svg';
|
||||||
import { ReactComponent as CaseInsensitiveIcon } from 'assets/icons/case-insensitive.svg';
|
import { ReactComponent as CaseInsensitiveIcon } from 'assets/icons/case-insensitive.svg';
|
||||||
import { ScreenReaderOnly } from 'component/common/ScreenReaderOnly/ScreenReaderOnly';
|
|
||||||
import { AddValuesWidget } from './AddValuesWidget';
|
import { AddValuesWidget } from './AddValuesWidget';
|
||||||
|
|
||||||
import { ReactComponent as EqualsIcon } from 'assets/icons/constraint-equals.svg';
|
import { ReactComponent as EqualsIcon } from 'assets/icons/constraint-equals.svg';
|
||||||
@ -268,6 +267,11 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<OperatorOptions>
|
<OperatorOptions>
|
||||||
|
<HtmlTooltip
|
||||||
|
title={`Make the selected operator${localConstraint.inverted ? ' inclusive' : ' exclusive'}`}
|
||||||
|
arrow
|
||||||
|
describeChild
|
||||||
|
>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type='button'
|
type='button'
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@ -281,13 +285,8 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
) : (
|
) : (
|
||||||
<StyledEqualsIcon aria-label='The constraint operator is inclusive.' />
|
<StyledEqualsIcon aria-label='The constraint operator is inclusive.' />
|
||||||
)}
|
)}
|
||||||
<ScreenReaderOnly>
|
|
||||||
Make the selected operator
|
|
||||||
{localConstraint.inverted
|
|
||||||
? ' inclusive'
|
|
||||||
: ' exclusive'}
|
|
||||||
</ScreenReaderOnly>
|
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</HtmlTooltip>
|
||||||
|
|
||||||
<ConstraintOperatorSelect
|
<ConstraintOperatorSelect
|
||||||
options={operatorsForContext(contextName)}
|
options={operatorsForContext(contextName)}
|
||||||
@ -297,6 +296,11 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{showCaseSensitiveButton ? (
|
{showCaseSensitiveButton ? (
|
||||||
|
<HtmlTooltip
|
||||||
|
title={`Make match${localConstraint.caseInsensitive ? ' ' : ' not '}case sensitive`}
|
||||||
|
arrow
|
||||||
|
describeChild
|
||||||
|
>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
type='button'
|
type='button'
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@ -310,14 +314,8 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
) : (
|
) : (
|
||||||
<StyledCaseSensitiveIcon aria-label='The match is case sensitive.' />
|
<StyledCaseSensitiveIcon aria-label='The match is case sensitive.' />
|
||||||
)}
|
)}
|
||||||
<ScreenReaderOnly>
|
|
||||||
Make match
|
|
||||||
{localConstraint.caseInsensitive
|
|
||||||
? ' '
|
|
||||||
: ' not '}
|
|
||||||
case sensitive
|
|
||||||
</ScreenReaderOnly>
|
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
</HtmlTooltip>
|
||||||
) : null}
|
) : null}
|
||||||
</OperatorOptions>
|
</OperatorOptions>
|
||||||
</ConstraintOptions>
|
</ConstraintOptions>
|
||||||
|
Loading…
Reference in New Issue
Block a user