1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

chore: clarify deleted legal values warning (#9969)

This commit is contained in:
Jaanus Sellin 2025-05-13 10:19:11 +03:00 committed by GitHub
parent 8bf3b1f135
commit 31a23db05e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 9 additions and 13 deletions

View File

@ -28,7 +28,7 @@ test('should show alert when you have illegal legal values', async () => {
); );
await screen.findByText( await screen.findByText(
'This constraint is using legal values that have been deleted as valid options. If you save changes on this constraint and then save the strategy the following values will be removed:', 'This constraint is currently using values that were valid in the past but have since been deleted. If you save changes on this constraint and then save the strategy the following values will be removed:',
); );
}); });

View File

@ -173,10 +173,10 @@ export const RestrictiveLegalValues = ({
condition={Boolean(illegalValues && illegalValues.length > 0)} condition={Boolean(illegalValues && illegalValues.length > 0)}
show={ show={
<Alert severity='warning'> <Alert severity='warning'>
This constraint is using legal values that have been This constraint is currently using values that were
deleted as valid options. If you save changes on this valid in the past but have since been deleted. If you
constraint and then save the strategy the following save changes on this constraint and then save the
values will be removed: strategy the following values will be removed:
<ul> <ul>
{illegalValues?.map((value) => ( {illegalValues?.map((value) => (
<li key={value}>{value}</li> <li key={value}>{value}</li>

View File

@ -17,7 +17,6 @@ import { useFeature } from 'hooks/api/getters/useFeature/useFeature';
import { useLocationSettings } from 'hooks/useLocationSettings'; import { useLocationSettings } from 'hooks/useLocationSettings';
import { getLocalizedDateString } from '../../../util'; import { getLocalizedDateString } from '../../../util';
import { Tag } from 'component/common/Tag/Tag'; import { Tag } from 'component/common/Tag/Tag';
import { useUiFlag } from 'hooks/useUiFlag';
import { formatTag } from 'utils/format-tag'; import { formatTag } from 'utils/format-tag';
interface IFeatureNameCellProps { interface IFeatureNameCellProps {

View File

@ -77,9 +77,10 @@ const BaseLegalValueSelector: FC<BaseProps> = ({
<LegalValuesSelectorWidget> <LegalValuesSelectorWidget>
{deletedLegalValues?.size ? ( {deletedLegalValues?.size ? (
<Alert id={alertId} severity='warning'> <Alert id={alertId} severity='warning'>
This constraint is using legal values that have been deleted This constraint is currently using values that were valid in
as valid options. If you save changes on this constraint and the past but have since been deleted. If you save changes on
then save the strategy the following values will be removed: this constraint and then save the strategy the following
values will be removed:
<ul> <ul>
{[...deletedLegalValues].map((value) => ( {[...deletedLegalValues].map((value) => (
<li key={value}>{value}</li> <li key={value}>{value}</li>

View File

@ -2,7 +2,6 @@ import type { IFeatureToggle } from 'interfaces/featureToggle';
import { useContext, useState } from 'react'; import { useContext, useState } from 'react';
import { styled, Tooltip, Chip } from '@mui/material'; import { styled, Tooltip, Chip } from '@mui/material';
import useFeatureTags from 'hooks/api/getters/useFeatureTags/useFeatureTags'; import useFeatureTags from 'hooks/api/getters/useFeatureTags/useFeatureTags';
import DeleteTagIcon from '@mui/icons-material/Cancel';
import ClearIcon from '@mui/icons-material/Clear'; import ClearIcon from '@mui/icons-material/Clear';
import { ManageTagsDialog } from 'component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog'; import { ManageTagsDialog } from 'component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog';
import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import { UPDATE_FEATURE } from 'component/providers/AccessProvider/permissions';
@ -15,7 +14,6 @@ import { formatUnknownError } from 'utils/formatUnknownError';
import { StyledMetaDataItem } from './FeatureOverviewMetaData'; import { StyledMetaDataItem } from './FeatureOverviewMetaData';
import { AddTagButton } from './AddTagButton'; import { AddTagButton } from './AddTagButton';
import { Tag } from 'component/common/Tag/Tag'; import { Tag } from 'component/common/Tag/Tag';
import { useUiFlag } from 'hooks/useUiFlag';
import { formatTag } from 'utils/format-tag'; import { formatTag } from 'utils/format-tag';
const StyledLabel = styled('span')(({ theme }) => ({ const StyledLabel = styled('span')(({ theme }) => ({

View File

@ -1,7 +1,6 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import useTagTypesApi from 'hooks/api/actions/useTagTypesApi/useTagTypesApi'; import useTagTypesApi from 'hooks/api/actions/useTagTypesApi/useTagTypesApi';
import { formatUnknownError } from 'utils/formatUnknownError'; import { formatUnknownError } from 'utils/formatUnknownError';
import { useUiFlag } from 'hooks/useUiFlag';
interface TagTypePayload { interface TagTypePayload {
name: string; name: string;

View File

@ -31,7 +31,6 @@ import { LinkCell } from 'component/common/Table/cells/LinkCell/LinkCell';
import { sortTypes } from 'utils/sortTypes'; import { sortTypes } from 'utils/sortTypes';
import { AddTagTypeButton } from './AddTagTypeButton/AddTagTypeButton'; import { AddTagTypeButton } from './AddTagTypeButton/AddTagTypeButton';
import { Search } from 'component/common/Search/Search'; import { Search } from 'component/common/Search/Search';
import { useUiFlag } from 'hooks/useUiFlag';
const StyledColorDot = styled('div')<{ $color: string }>( const StyledColorDot = styled('div')<{ $color: string }>(
({ theme, $color }) => ({ ({ theme, $color }) => ({