mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01: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,23 +145,25 @@ export const RestrictiveLegalValues = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{filteredValues.map((match) => (
|
<StyledValuesContainer>
|
||||||
<LegalValueLabel
|
{filteredValues.map((match) => (
|
||||||
key={match.value}
|
<LegalValueLabel
|
||||||
legal={match}
|
key={match.value}
|
||||||
control={
|
legal={match}
|
||||||
<Checkbox
|
control={
|
||||||
checked={Boolean(valuesMap[match.value])}
|
<Checkbox
|
||||||
onChange={() => onChange(match.value)}
|
checked={Boolean(valuesMap[match.value])}
|
||||||
name={match.value}
|
onChange={() => onChange(match.value)}
|
||||||
color='primary'
|
name={match.value}
|
||||||
disabled={deletedLegalValues
|
color='primary'
|
||||||
.map(({ value }) => value)
|
disabled={deletedLegalValues
|
||||||
.includes(match.value)}
|
.map(({ value }) => value)
|
||||||
/>
|
.includes(match.value)}
|
||||||
}
|
/>
|
||||||
/>
|
}
|
||||||
))}
|
/>
|
||||||
|
))}
|
||||||
|
</StyledValuesContainer>
|
||||||
|
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={Boolean(error)}
|
condition={Boolean(error)}
|
||||||
|
Loading…
Reference in New Issue
Block a user