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,26 +267,26 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<OperatorOptions>
|
<OperatorOptions>
|
||||||
<StyledButton
|
<HtmlTooltip
|
||||||
type='button'
|
title={`Make the selected operator${localConstraint.inverted ? ' inclusive' : ' exclusive'}`}
|
||||||
onClick={() =>
|
arrow
|
||||||
updateConstraint({
|
describeChild
|
||||||
type: 'toggle inverted operator',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{localConstraint.inverted ? (
|
<StyledButton
|
||||||
<StyledNotEqualsIcon aria-label='The constraint operator is exclusive.' />
|
type='button'
|
||||||
) : (
|
onClick={() =>
|
||||||
<StyledEqualsIcon aria-label='The constraint operator is inclusive.' />
|
updateConstraint({
|
||||||
)}
|
type: 'toggle inverted operator',
|
||||||
<ScreenReaderOnly>
|
})
|
||||||
Make the selected operator
|
}
|
||||||
{localConstraint.inverted
|
>
|
||||||
? ' inclusive'
|
{localConstraint.inverted ? (
|
||||||
: ' exclusive'}
|
<StyledNotEqualsIcon aria-label='The constraint operator is exclusive.' />
|
||||||
</ScreenReaderOnly>
|
) : (
|
||||||
</StyledButton>
|
<StyledEqualsIcon aria-label='The constraint operator is inclusive.' />
|
||||||
|
)}
|
||||||
|
</StyledButton>
|
||||||
|
</HtmlTooltip>
|
||||||
|
|
||||||
<ConstraintOperatorSelect
|
<ConstraintOperatorSelect
|
||||||
options={operatorsForContext(contextName)}
|
options={operatorsForContext(contextName)}
|
||||||
@ -297,27 +296,26 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{showCaseSensitiveButton ? (
|
{showCaseSensitiveButton ? (
|
||||||
<StyledButton
|
<HtmlTooltip
|
||||||
type='button'
|
title={`Make match${localConstraint.caseInsensitive ? ' ' : ' not '}case sensitive`}
|
||||||
onClick={() =>
|
arrow
|
||||||
updateConstraint({
|
describeChild
|
||||||
type: 'toggle case sensitivity',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{localConstraint.caseInsensitive ? (
|
<StyledButton
|
||||||
<StyledCaseInsensitiveIcon aria-label='The match is not case sensitive.' />
|
type='button'
|
||||||
) : (
|
onClick={() =>
|
||||||
<StyledCaseSensitiveIcon aria-label='The match is case sensitive.' />
|
updateConstraint({
|
||||||
)}
|
type: 'toggle case sensitivity',
|
||||||
<ScreenReaderOnly>
|
})
|
||||||
Make match
|
}
|
||||||
{localConstraint.caseInsensitive
|
>
|
||||||
? ' '
|
{localConstraint.caseInsensitive ? (
|
||||||
: ' not '}
|
<StyledCaseInsensitiveIcon aria-label='The match is not case sensitive.' />
|
||||||
case sensitive
|
) : (
|
||||||
</ScreenReaderOnly>
|
<StyledCaseSensitiveIcon aria-label='The match is case sensitive.' />
|
||||||
</StyledButton>
|
)}
|
||||||
|
</StyledButton>
|
||||||
|
</HtmlTooltip>
|
||||||
) : null}
|
) : null}
|
||||||
</OperatorOptions>
|
</OperatorOptions>
|
||||||
</ConstraintOptions>
|
</ConstraintOptions>
|
||||||
|
Loading…
Reference in New Issue
Block a user