1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-31 01:16:01 +02:00

feat: predefined values more organized (#9752)

This commit is contained in:
Jaanus Sellin 2025-04-14 14:22:32 +03:00 committed by GitHub
parent ff3c17ffa7
commit 5b52a6e8d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 10 deletions

View File

@ -7,6 +7,7 @@ import {
import type React from 'react';
import { FormControlLabel } from '@mui/material';
import { Highlighter } from 'component/common/Highlighter/Highlighter';
import { Truncator } from 'component/common/Truncator/Truncator';
interface ILegalValueTextProps {
legal: ILegalValue;
@ -35,9 +36,15 @@ export const LegalValueLabel = ({
</Highlighter>
</StyledValue>
<StyledDescription>
<Highlighter search={filter}>
{legal.description}
</Highlighter>
<Truncator
title={legal.description}
arrow
lines={1}
>
<Highlighter search={filter}>
{legal.description}
</Highlighter>
</Truncator>
</StyledDescription>
</>
}

View File

@ -51,8 +51,8 @@ export const getIllegalValues = (
};
const StyledValuesContainer = styled('div')(({ theme }) => ({
display: 'flex',
flexWrap: 'wrap',
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, 120px)',
gap: theme.spacing(1),
padding: theme.spacing(2),
border: `1px solid ${theme.palette.divider}`,
@ -178,7 +178,9 @@ export const RestrictiveLegalValues = ({
Boolean(values)
}
show={
<StyledValuesContainer sx={{ border: 0 }}>
<StyledValuesContainer
sx={{ border: 0, paddingTop: 0 }}
>
{values.map((value) => {
return (
<Chip
@ -191,13 +193,10 @@ export const RestrictiveLegalValues = ({
</StyledValuesContainer>
}
/>
<ConstraintValueSearch
filter={filter}
setFilter={setFilter}
/>
</>
}
/>
<ConstraintValueSearch filter={filter} setFilter={setFilter} />
<StyledValuesContainer>
{filteredValues.map((match) => (
<LegalValueLabel