1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-18 01:18:23 +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 type React from 'react';
import { FormControlLabel } from '@mui/material'; import { FormControlLabel } from '@mui/material';
import { Highlighter } from 'component/common/Highlighter/Highlighter'; import { Highlighter } from 'component/common/Highlighter/Highlighter';
import { Truncator } from 'component/common/Truncator/Truncator';
interface ILegalValueTextProps { interface ILegalValueTextProps {
legal: ILegalValue; legal: ILegalValue;
@ -35,9 +36,15 @@ export const LegalValueLabel = ({
</Highlighter> </Highlighter>
</StyledValue> </StyledValue>
<StyledDescription> <StyledDescription>
<Truncator
title={legal.description}
arrow
lines={1}
>
<Highlighter search={filter}> <Highlighter search={filter}>
{legal.description} {legal.description}
</Highlighter> </Highlighter>
</Truncator>
</StyledDescription> </StyledDescription>
</> </>
} }

View File

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