mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-14 01:16:17 +02:00
fix: legal values styling in segments (#9044)
This commit is contained in:
parent
71eb6b1511
commit
18cd0e2cdb
@ -4,6 +4,13 @@ export const useStyles = makeStyles()((theme) => ({
|
|||||||
container: {
|
container: {
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
wordBreak: 'break-word',
|
wordBreak: 'break-word',
|
||||||
|
padding: theme.spacing(0.5, 1),
|
||||||
|
background: theme.palette.background.paper,
|
||||||
|
border: `1px solid ${theme.palette.divider}`,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
'&:hover': {
|
||||||
|
border: `1px solid ${theme.palette.primary.main}`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
lineHeight: 1.33,
|
lineHeight: 1.33,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { Alert, Checkbox } from '@mui/material';
|
import { Alert, Checkbox, styled } from '@mui/material';
|
||||||
import { useThemeStyles } from 'themes/themeStyles';
|
import { useThemeStyles } from 'themes/themeStyles';
|
||||||
import { ConstraintValueSearch } from 'component/common/ConstraintAccordion/ConstraintValueSearch/ConstraintValueSearch';
|
import { ConstraintValueSearch } from 'component/common/ConstraintAccordion/ConstraintValueSearch/ConstraintValueSearch';
|
||||||
import { ConstraintFormHeader } from '../ConstraintFormHeader/ConstraintFormHeader';
|
import { ConstraintFormHeader } from '../ConstraintFormHeader/ConstraintFormHeader';
|
||||||
@ -49,6 +49,17 @@ export const getIllegalValues = (
|
|||||||
return constraintValues.filter((value) => deletedValuesSet.has(value));
|
return constraintValues.filter((value) => deletedValuesSet.has(value));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const StyledValuesContainer = styled('div')(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
padding: theme.spacing(2),
|
||||||
|
border: `1px solid ${theme.palette.divider}`,
|
||||||
|
borderRadius: theme.shape.borderRadiusMedium,
|
||||||
|
maxHeight: '378px',
|
||||||
|
overflow: 'auto',
|
||||||
|
}));
|
||||||
|
|
||||||
export const RestrictiveLegalValues = ({
|
export const RestrictiveLegalValues = ({
|
||||||
data,
|
data,
|
||||||
values,
|
values,
|
||||||
@ -134,6 +145,7 @@ export const RestrictiveLegalValues = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<StyledValuesContainer>
|
||||||
{filteredValues.map((match) => (
|
{filteredValues.map((match) => (
|
||||||
<LegalValueLabel
|
<LegalValueLabel
|
||||||
key={match.value}
|
key={match.value}
|
||||||
@ -151,6 +163,7 @@ export const RestrictiveLegalValues = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
</StyledValuesContainer>
|
||||||
|
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={Boolean(error)}
|
condition={Boolean(error)}
|
||||||
|
Loading…
Reference in New Issue
Block a user