mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-03 01:18:43 +02:00
Feat/tag type colors frontend (#9566)
Add frontend support for tag type colors
This commit is contained in:
parent
df351808c1
commit
aad5a6a1a9
@ -17,12 +17,15 @@ const CreateTagType = () => {
|
|||||||
const {
|
const {
|
||||||
tagName,
|
tagName,
|
||||||
tagDesc,
|
tagDesc,
|
||||||
|
color,
|
||||||
setTagName,
|
setTagName,
|
||||||
setTagDesc,
|
setTagDesc,
|
||||||
|
setColor,
|
||||||
getTagPayload,
|
getTagPayload,
|
||||||
validateNameUniqueness,
|
validateNameUniqueness,
|
||||||
errors,
|
errors,
|
||||||
clearErrors,
|
clearErrors,
|
||||||
|
isTagTypeColorEnabled,
|
||||||
} = useTagTypeForm();
|
} = useTagTypeForm();
|
||||||
const { createTag, loading } = useTagTypesApi();
|
const { createTag, loading } = useTagTypesApi();
|
||||||
|
|
||||||
@ -70,12 +73,15 @@ const CreateTagType = () => {
|
|||||||
handleSubmit={handleSubmit}
|
handleSubmit={handleSubmit}
|
||||||
handleCancel={handleCancel}
|
handleCancel={handleCancel}
|
||||||
tagName={tagName}
|
tagName={tagName}
|
||||||
setTagName={setTagName}
|
|
||||||
tagDesc={tagDesc}
|
tagDesc={tagDesc}
|
||||||
|
color={color}
|
||||||
|
setTagName={setTagName}
|
||||||
setTagDesc={setTagDesc}
|
setTagDesc={setTagDesc}
|
||||||
|
setColor={setColor}
|
||||||
mode='Create'
|
mode='Create'
|
||||||
clearErrors={clearErrors}
|
clearErrors={clearErrors}
|
||||||
validateNameUniqueness={validateNameUniqueness}
|
validateNameUniqueness={validateNameUniqueness}
|
||||||
|
isTagTypeColorEnabled={isTagTypeColorEnabled}
|
||||||
>
|
>
|
||||||
<CreateButton name='type' permission={CREATE_TAG_TYPE} />
|
<CreateButton name='type' permission={CREATE_TAG_TYPE} />
|
||||||
</TagTypeForm>
|
</TagTypeForm>
|
||||||
|
@ -21,12 +21,15 @@ const EditTagType = () => {
|
|||||||
const {
|
const {
|
||||||
tagName,
|
tagName,
|
||||||
tagDesc,
|
tagDesc,
|
||||||
|
color,
|
||||||
setTagName,
|
setTagName,
|
||||||
setTagDesc,
|
setTagDesc,
|
||||||
|
setColor,
|
||||||
getTagPayload,
|
getTagPayload,
|
||||||
errors,
|
errors,
|
||||||
clearErrors,
|
clearErrors,
|
||||||
} = useTagTypeForm(tagType?.name, tagType?.description);
|
isTagTypeColorEnabled,
|
||||||
|
} = useTagTypeForm(tagType?.name, tagType?.description, tagType?.color);
|
||||||
const { updateTagType, loading } = useTagTypesApi();
|
const { updateTagType, loading } = useTagTypesApi();
|
||||||
|
|
||||||
const handleSubmit = async (e: Event) => {
|
const handleSubmit = async (e: Event) => {
|
||||||
@ -72,11 +75,14 @@ const EditTagType = () => {
|
|||||||
handleSubmit={handleSubmit}
|
handleSubmit={handleSubmit}
|
||||||
handleCancel={handleCancel}
|
handleCancel={handleCancel}
|
||||||
tagName={tagName}
|
tagName={tagName}
|
||||||
setTagName={setTagName}
|
|
||||||
tagDesc={tagDesc}
|
tagDesc={tagDesc}
|
||||||
|
color={color}
|
||||||
|
setTagName={setTagName}
|
||||||
setTagDesc={setTagDesc}
|
setTagDesc={setTagDesc}
|
||||||
|
setColor={setColor}
|
||||||
mode='Edit'
|
mode='Edit'
|
||||||
clearErrors={clearErrors}
|
clearErrors={clearErrors}
|
||||||
|
isTagTypeColorEnabled={isTagTypeColorEnabled}
|
||||||
>
|
>
|
||||||
<UpdateButton permission={UPDATE_TAG_TYPE} />
|
<UpdateButton permission={UPDATE_TAG_TYPE} />
|
||||||
</TagForm>
|
</TagForm>
|
||||||
|
103
frontend/src/component/tags/TagTypeForm/TagTypeColorPicker.tsx
Normal file
103
frontend/src/component/tags/TagTypeForm/TagTypeColorPicker.tsx
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import type { FC } from 'react';
|
||||||
|
import { styled, Box, useTheme } from '@mui/material';
|
||||||
|
|
||||||
|
interface ITagTypeColorPickerProps {
|
||||||
|
selectedColor: string;
|
||||||
|
onChange: (color: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IColorOption {
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const StyledColorContainer = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
marginBottom: theme.spacing(2),
|
||||||
|
marginTop: theme.spacing(1),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const StyledColorsWrapper = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
marginTop: theme.spacing(1),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const StyledColorCircle = styled('button')<{
|
||||||
|
$color: string;
|
||||||
|
$selected: boolean;
|
||||||
|
}>(({ theme, $color, $selected }) => ({
|
||||||
|
width: '24px',
|
||||||
|
height: '24px',
|
||||||
|
borderRadius: '50%',
|
||||||
|
border: $selected
|
||||||
|
? `2px solid ${theme.palette.primary.main}`
|
||||||
|
: $color === '#FFFFFF'
|
||||||
|
? `1px solid ${theme.palette.divider}`
|
||||||
|
: `1px solid ${$color}`,
|
||||||
|
backgroundColor: $color,
|
||||||
|
cursor: 'pointer',
|
||||||
|
padding: 0,
|
||||||
|
'&:hover': {
|
||||||
|
boxShadow: theme.boxShadows.elevated,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const TagTypeColorPicker: FC<ITagTypeColorPickerProps> = ({
|
||||||
|
selectedColor,
|
||||||
|
onChange,
|
||||||
|
}) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const getColorWithFallback = (color: string | undefined): string =>
|
||||||
|
color || '#FFFFFF';
|
||||||
|
|
||||||
|
const colorOptions: IColorOption[] = [
|
||||||
|
{ name: 'White', value: theme.palette.common.white },
|
||||||
|
{
|
||||||
|
name: 'Green',
|
||||||
|
value: getColorWithFallback(theme.palette.success.border),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Yellow',
|
||||||
|
value: getColorWithFallback(theme.palette.warning.border),
|
||||||
|
},
|
||||||
|
{ name: 'Red', value: theme.palette.error.main },
|
||||||
|
{
|
||||||
|
name: 'Blue',
|
||||||
|
value: getColorWithFallback(theme.palette.info.border),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Purple',
|
||||||
|
value: getColorWithFallback(theme.palette.secondary.border),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Gray',
|
||||||
|
value: getColorWithFallback(theme.palette.neutral.border),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StyledColorContainer>
|
||||||
|
<StyledColorsWrapper>
|
||||||
|
{colorOptions.map((color) => (
|
||||||
|
<Box
|
||||||
|
key={color.value}
|
||||||
|
title={color.name}
|
||||||
|
sx={{ display: 'flex', alignItems: 'center' }}
|
||||||
|
>
|
||||||
|
<StyledColorCircle
|
||||||
|
$color={color.value}
|
||||||
|
$selected={selectedColor === color.value}
|
||||||
|
onClick={() => onChange(color.value)}
|
||||||
|
type='button'
|
||||||
|
aria-label={`Select ${color.name} color`}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
))}
|
||||||
|
</StyledColorsWrapper>
|
||||||
|
</StyledColorContainer>
|
||||||
|
);
|
||||||
|
};
|
@ -1,21 +1,25 @@
|
|||||||
import Input from 'component/common/Input/Input';
|
import Input from 'component/common/Input/Input';
|
||||||
import { TextField, Button, styled } from '@mui/material';
|
import { TextField, Button, styled, Typography } from '@mui/material';
|
||||||
|
import { TagTypeColorPicker } from './TagTypeColorPicker';
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
import { trim } from 'component/common/util';
|
import { trim } from 'component/common/util';
|
||||||
import { EDIT } from 'constants/misc';
|
import { EDIT } from 'constants/misc';
|
||||||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
|
||||||
interface ITagTypeForm {
|
interface ITagTypeForm {
|
||||||
tagName: string;
|
tagName: string;
|
||||||
tagDesc: string;
|
tagDesc: string;
|
||||||
|
color: string;
|
||||||
setTagName: React.Dispatch<React.SetStateAction<string>>;
|
setTagName: React.Dispatch<React.SetStateAction<string>>;
|
||||||
setTagDesc: React.Dispatch<React.SetStateAction<string>>;
|
setTagDesc: React.Dispatch<React.SetStateAction<string>>;
|
||||||
|
setColor: React.Dispatch<React.SetStateAction<string>>;
|
||||||
handleSubmit: (e: any) => void;
|
handleSubmit: (e: any) => void;
|
||||||
handleCancel: () => void;
|
handleCancel: () => void;
|
||||||
errors: { [key: string]: string };
|
errors: { [key: string]: string };
|
||||||
mode: 'Create' | 'Edit';
|
mode: 'Create' | 'Edit';
|
||||||
clearErrors: () => void;
|
clearErrors: () => void;
|
||||||
validateNameUniqueness?: () => void;
|
validateNameUniqueness?: () => void;
|
||||||
|
isTagTypeColorEnabled: boolean;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,12 +63,15 @@ const TagTypeForm: React.FC<ITagTypeForm> = ({
|
|||||||
handleCancel,
|
handleCancel,
|
||||||
tagName,
|
tagName,
|
||||||
tagDesc,
|
tagDesc,
|
||||||
|
color,
|
||||||
setTagName,
|
setTagName,
|
||||||
setTagDesc,
|
setTagDesc,
|
||||||
|
setColor,
|
||||||
errors,
|
errors,
|
||||||
mode,
|
mode,
|
||||||
validateNameUniqueness,
|
validateNameUniqueness,
|
||||||
clearErrors,
|
clearErrors,
|
||||||
|
isTagTypeColorEnabled,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<StyledForm onSubmit={handleSubmit}>
|
<StyledForm onSubmit={handleSubmit}>
|
||||||
@ -95,6 +102,20 @@ const TagTypeForm: React.FC<ITagTypeForm> = ({
|
|||||||
value={tagDesc}
|
value={tagDesc}
|
||||||
onChange={(e) => setTagDesc(e.target.value)}
|
onChange={(e) => setTagDesc(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={isTagTypeColorEnabled}
|
||||||
|
show={
|
||||||
|
<>
|
||||||
|
<Typography variant='body2'>
|
||||||
|
Tag color
|
||||||
|
<TagTypeColorPicker
|
||||||
|
selectedColor={color}
|
||||||
|
onChange={setColor}
|
||||||
|
/>
|
||||||
|
</Typography>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</StyledContainer>
|
</StyledContainer>
|
||||||
<StyledButtonContainer>
|
<StyledButtonContainer>
|
||||||
{children}
|
{children}
|
||||||
|
@ -1,12 +1,25 @@
|
|||||||
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';
|
||||||
|
|
||||||
const useTagTypeForm = (initialTagName = '', initialTagDesc = '') => {
|
interface TagTypePayload {
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
color?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useTagTypeForm = (
|
||||||
|
initialTagName = '',
|
||||||
|
initialTagDesc = '',
|
||||||
|
initialColor = '#FFFFFF',
|
||||||
|
) => {
|
||||||
const [tagName, setTagName] = useState(initialTagName);
|
const [tagName, setTagName] = useState(initialTagName);
|
||||||
const [tagDesc, setTagDesc] = useState(initialTagDesc);
|
const [tagDesc, setTagDesc] = useState(initialTagDesc);
|
||||||
|
const [color, setColor] = useState(initialColor);
|
||||||
const [errors, setErrors] = useState({});
|
const [errors, setErrors] = useState({});
|
||||||
const { validateTagName } = useTagTypesApi();
|
const { validateTagName } = useTagTypesApi();
|
||||||
|
const isTagTypeColorEnabled = Boolean(useUiFlag('tagTypeColor'));
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTagName(initialTagName);
|
setTagName(initialTagName);
|
||||||
@ -16,11 +29,21 @@ const useTagTypeForm = (initialTagName = '', initialTagDesc = '') => {
|
|||||||
setTagDesc(initialTagDesc);
|
setTagDesc(initialTagDesc);
|
||||||
}, [initialTagDesc]);
|
}, [initialTagDesc]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setColor(initialColor);
|
||||||
|
}, [initialColor]);
|
||||||
|
|
||||||
const getTagPayload = () => {
|
const getTagPayload = () => {
|
||||||
return {
|
const payload: TagTypePayload = {
|
||||||
name: tagName,
|
name: tagName,
|
||||||
description: tagDesc,
|
description: tagDesc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (isTagTypeColorEnabled && color) {
|
||||||
|
payload.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
return payload;
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateNameUniqueness = async () => {
|
const validateNameUniqueness = async () => {
|
||||||
@ -54,12 +77,15 @@ const useTagTypeForm = (initialTagName = '', initialTagDesc = '') => {
|
|||||||
return {
|
return {
|
||||||
tagName,
|
tagName,
|
||||||
tagDesc,
|
tagDesc,
|
||||||
|
color,
|
||||||
setTagName,
|
setTagName,
|
||||||
setTagDesc,
|
setTagDesc,
|
||||||
|
setColor,
|
||||||
getTagPayload,
|
getTagPayload,
|
||||||
clearErrors,
|
clearErrors,
|
||||||
validateNameUniqueness,
|
validateNameUniqueness,
|
||||||
errors,
|
errors,
|
||||||
|
isTagTypeColorEnabled,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState, useMemo } from 'react';
|
import { useState, useMemo } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Box } from '@mui/material';
|
import { Box, styled } from '@mui/material';
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
SortableTableHeader,
|
SortableTableHeader,
|
||||||
@ -31,6 +31,22 @@ 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 }>(
|
||||||
|
({ theme, $color }) => ({
|
||||||
|
width: '12px',
|
||||||
|
height: '12px',
|
||||||
|
borderRadius: '50%',
|
||||||
|
backgroundColor: $color,
|
||||||
|
marginRight: theme.spacing(0.2),
|
||||||
|
marginLeft: theme.spacing(1.5),
|
||||||
|
border:
|
||||||
|
$color === '#FFFFFF'
|
||||||
|
? `1px solid ${theme.palette.divider}`
|
||||||
|
: `1px solid ${$color}`,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
export const TagTypeList = () => {
|
export const TagTypeList = () => {
|
||||||
const [deletion, setDeletion] = useState<{
|
const [deletion, setDeletion] = useState<{
|
||||||
@ -41,6 +57,7 @@ export const TagTypeList = () => {
|
|||||||
const { deleteTagType } = useTagTypesApi();
|
const { deleteTagType } = useTagTypesApi();
|
||||||
const { tagTypes, refetch, loading } = useTagTypes();
|
const { tagTypes, refetch, loading } = useTagTypes();
|
||||||
const { setToastData, setToastApiError } = useToast();
|
const { setToastData, setToastApiError } = useToast();
|
||||||
|
const isTagTypeColorEnabled = Boolean(useUiFlag('tagTypeColor'));
|
||||||
|
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
@ -50,9 +67,10 @@ export const TagTypeList = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return tagTypes.map(({ name, description }) => ({
|
return tagTypes.map(({ name, description, color }) => ({
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
|
color,
|
||||||
}));
|
}));
|
||||||
}, [tagTypes, loading]);
|
}, [tagTypes, loading]);
|
||||||
|
|
||||||
@ -81,15 +99,23 @@ export const TagTypeList = () => {
|
|||||||
width: '90%',
|
width: '90%',
|
||||||
Cell: ({
|
Cell: ({
|
||||||
row: {
|
row: {
|
||||||
original: { name, description },
|
original: { name, description, color },
|
||||||
},
|
},
|
||||||
}: any) => {
|
}: any) => {
|
||||||
return (
|
return (
|
||||||
|
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={
|
||||||
|
isTagTypeColorEnabled && Boolean(color)
|
||||||
|
}
|
||||||
|
show={<StyledColorDot $color={color} />}
|
||||||
|
/>
|
||||||
<LinkCell
|
<LinkCell
|
||||||
data-loading
|
data-loading
|
||||||
title={name}
|
title={name}
|
||||||
subtitle={description}
|
subtitle={description}
|
||||||
/>
|
/>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
sortType: 'alphanumeric',
|
sortType: 'alphanumeric',
|
||||||
@ -136,7 +162,7 @@ export const TagTypeList = () => {
|
|||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[navigate],
|
[navigate, isTagTypeColorEnabled],
|
||||||
);
|
);
|
||||||
|
|
||||||
const initialState = useMemo(
|
const initialState = useMemo(
|
||||||
|
@ -264,6 +264,9 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
||||||
role="cell"
|
role="cell"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="MuiBox-root css-70qvj9"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="css-1prhjm6"
|
className="css-1prhjm6"
|
||||||
@ -291,6 +294,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
@ -434,6 +438,9 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
||||||
role="cell"
|
role="cell"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="MuiBox-root css-70qvj9"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="css-1prhjm6"
|
className="css-1prhjm6"
|
||||||
@ -461,6 +468,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
@ -604,6 +612,9 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
||||||
role="cell"
|
role="cell"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="MuiBox-root css-70qvj9"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="css-1prhjm6"
|
className="css-1prhjm6"
|
||||||
@ -631,6 +642,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
@ -774,6 +786,9 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
||||||
role="cell"
|
role="cell"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="MuiBox-root css-70qvj9"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="css-1prhjm6"
|
className="css-1prhjm6"
|
||||||
@ -801,6 +816,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
@ -944,6 +960,9 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
className="MuiTableCell-root MuiTableCell-body MuiTableCell-sizeMedium css-jvmadm-MuiTableCell-root"
|
||||||
role="cell"
|
role="cell"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="MuiBox-root css-70qvj9"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="css-1prhjm6"
|
className="css-1prhjm6"
|
||||||
@ -971,6 +990,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
aria-sort={null}
|
aria-sort={null}
|
||||||
|
@ -7,9 +7,11 @@ export interface ITagType {
|
|||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
|
color?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITagPayload {
|
export interface ITagPayload {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
color?: string;
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ export type UiFlags = {
|
|||||||
consumptionModel?: boolean;
|
consumptionModel?: boolean;
|
||||||
edgeObservability?: boolean;
|
edgeObservability?: boolean;
|
||||||
adminNavUI?: boolean;
|
adminNavUI?: boolean;
|
||||||
|
tagTypeColor?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -65,7 +65,8 @@ export type IFlagKey =
|
|||||||
| 'teamsIntegrationChangeRequests'
|
| 'teamsIntegrationChangeRequests'
|
||||||
| 'edgeObservability'
|
| 'edgeObservability'
|
||||||
| 'simplifyDisableFeature'
|
| 'simplifyDisableFeature'
|
||||||
| 'adminNavUI';
|
| 'adminNavUI'
|
||||||
|
| 'tagTypeColor';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||||
|
|
||||||
@ -314,6 +315,10 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_ADMIN_NAV_UI,
|
process.env.UNLEASH_EXPERIMENTAL_ADMIN_NAV_UI,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
tagTypeColor: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_TAG_TYPE_COLOR,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
@ -59,6 +59,7 @@ process.nextTick(async () => {
|
|||||||
teamsIntegrationChangeRequests: true,
|
teamsIntegrationChangeRequests: true,
|
||||||
simplifyDisableFeature: true,
|
simplifyDisableFeature: true,
|
||||||
adminNavUI: false,
|
adminNavUI: false,
|
||||||
|
tagTypeColor: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user