mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Constraint View header adjustments
This commit is contained in:
		
							parent
							
								
									9316b633a2
								
							
						
					
					
						commit
						c16272ec26
					
				@ -49,7 +49,7 @@ export const useStyles = makeStyles()(theme => ({
 | 
			
		||||
    headerValuesContainerWrapper: {
 | 
			
		||||
        display: 'flex',
 | 
			
		||||
        flexDirection: 'row',
 | 
			
		||||
        justifyContent: 'center'
 | 
			
		||||
        justifyContent: 'center',
 | 
			
		||||
    },
 | 
			
		||||
    headerValuesContainer: {
 | 
			
		||||
        display: 'flex',
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,7 @@
 | 
			
		||||
import { Button, FormControlLabel, Switch } from '@mui/material';
 | 
			
		||||
import { Button } from '@mui/material';
 | 
			
		||||
import { IConstraint } from 'interfaces/strategy';
 | 
			
		||||
import { CANCEL } from '../ConstraintAccordionEdit';
 | 
			
		||||
 | 
			
		||||
import { ConstraintFormHeader } from './ConstraintFormHeader/ConstraintFormHeader';
 | 
			
		||||
import { useStyles } from './ConstraintAccordionEditBody.styles';
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { newOperators } from 'constants/operators';
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,5 @@
 | 
			
		||||
import { IUnleashContextDefinition } from 'interfaces/context';
 | 
			
		||||
import { IConstraint } from 'interfaces/strategy';
 | 
			
		||||
import { CaseInsensitive } from '../CaseInsensitive/CaseInsensitive';
 | 
			
		||||
import { DateSingleValue } from '../DateSingleValue/DateSingleValue';
 | 
			
		||||
import { FreeTextInput } from '../FreeTextInput/FreeTextInput';
 | 
			
		||||
import { RestrictiveLegalValues } from '../RestrictiveLegalValues/RestrictiveLegalValues';
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@ import { useStyles } from 'component/common/ConstraintAccordion/ConstraintAccord
 | 
			
		||||
import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext';
 | 
			
		||||
import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect';
 | 
			
		||||
import { ConstraintIcon } from 'component/common/ConstraintAccordion/ConstraintIcon';
 | 
			
		||||
import { Delete, Edit, Help } from '@mui/icons-material';
 | 
			
		||||
import { Delete, Edit } from '@mui/icons-material';
 | 
			
		||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
 | 
			
		||||
import {
 | 
			
		||||
    dateOperators,
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
import { Button, IconButton, Tooltip } from '@mui/material';
 | 
			
		||||
import { Tooltip } from '@mui/material';
 | 
			
		||||
import { ReactComponent as NegatedIcon } from '../../../../../../assets/icons/24_Negator.svg';
 | 
			
		||||
import { ReactComponent as NegatedIconOff } from '../../../../../../assets/icons/24_Negator off.svg';
 | 
			
		||||
import React, { useMemo } from 'react';
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { IConstraint } from '../../../../../../interfaces/strategy';
 | 
			
		||||
import {
 | 
			
		||||
    StyledToggleButtonOff,
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,4 @@
 | 
			
		||||
import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
 | 
			
		||||
import { ExpandMore } from '@mui/icons-material';
 | 
			
		||||
import { IConstraint } from 'interfaces/strategy';
 | 
			
		||||
 | 
			
		||||
import { ConstraintAccordionViewBody } from './ConstraintAccordionViewBody/ConstraintAccordionViewBody';
 | 
			
		||||
 | 
			
		||||
@ -53,19 +53,20 @@ const StyledSingleValueChip = styled(Chip)(({ theme }) => ({
 | 
			
		||||
    },
 | 
			
		||||
}));
 | 
			
		||||
 | 
			
		||||
const StyledIconWrapper = styled('div')<{ marginRight?: string, marginTop?: string  }>(
 | 
			
		||||
    ({ theme, marginRight, marginTop }) => ({
 | 
			
		||||
        backgroundColor: theme.palette.grey[200],
 | 
			
		||||
        width: 28,
 | 
			
		||||
        height: 47,
 | 
			
		||||
        display: 'inline-flex',
 | 
			
		||||
        justifyContent: 'center',
 | 
			
		||||
        padding: '10px 0',
 | 
			
		||||
        color: theme.palette.primary.main,
 | 
			
		||||
        marginRight: marginRight ? marginRight : '0.75rem',
 | 
			
		||||
        marginTop: marginTop ? marginTop: 0
 | 
			
		||||
    })
 | 
			
		||||
);
 | 
			
		||||
const StyledIconWrapper = styled('div')<{
 | 
			
		||||
    marginRight?: string;
 | 
			
		||||
    marginTop?: string;
 | 
			
		||||
}>(({ theme, marginRight, marginTop }) => ({
 | 
			
		||||
    backgroundColor: theme.palette.grey[200],
 | 
			
		||||
    width: 28,
 | 
			
		||||
    height: 47,
 | 
			
		||||
    display: 'inline-flex',
 | 
			
		||||
    justifyContent: 'center',
 | 
			
		||||
    padding: '10px 0',
 | 
			
		||||
    color: theme.palette.primary.main,
 | 
			
		||||
    marginRight: marginRight ? marginRight : '0.75rem',
 | 
			
		||||
    marginTop: marginTop ? marginTop : 0,
 | 
			
		||||
}));
 | 
			
		||||
 | 
			
		||||
interface IConstraintAccordionViewHeaderProps {
 | 
			
		||||
    compact: boolean;
 | 
			
		||||
@ -208,8 +209,10 @@ export const ConstraintAccordionViewHeader = ({
 | 
			
		||||
                                                'valuesExpandLabel'
 | 
			
		||||
                                            )}
 | 
			
		||||
                                        >
 | 
			
		||||
                                            {!expanded ? `Expand to view all (
 | 
			
		||||
                                            ${constraint?.values?.length})` : 'Collapse to view less' }
 | 
			
		||||
                                            {!expanded
 | 
			
		||||
                                                ? `Expand to view all (
 | 
			
		||||
                                            ${constraint?.values?.length})`
 | 
			
		||||
                                                : 'Collapse to view less'}
 | 
			
		||||
                                        </p>
 | 
			
		||||
                                    }
 | 
			
		||||
                                />
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,6 @@
 | 
			
		||||
import { IConstraint } from 'interfaces/strategy';
 | 
			
		||||
import { formatOperatorDescription } from 'component/common/ConstraintAccordion/ConstraintOperator/formatOperatorDescription';
 | 
			
		||||
import { useStyles } from 'component/common/ConstraintAccordion/ConstraintOperator/ConstraintOperator.styles';
 | 
			
		||||
import { ConditionallyRender } from '../../ConditionallyRender/ConditionallyRender';
 | 
			
		||||
import { ReactComponent as NegatedIcon } from '../../../../assets/icons/24_Negator.svg';
 | 
			
		||||
import { colors } from '../../../../themes/colors';
 | 
			
		||||
import React from 'react';
 | 
			
		||||
 | 
			
		||||
interface IConstraintOperatorProps {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user