mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
PR
This commit is contained in:
parent
f97213f188
commit
c142975565
@ -1,10 +1,9 @@
|
||||
import { ConditionallyRender } from '../../../../ConditionallyRender/ConditionallyRender';
|
||||
import { styled, Typography } from '@mui/material';
|
||||
import { styled } from '@mui/material';
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { IConstraint } from '../../../../../../interfaces/strategy';
|
||||
import { useStyles } from '../../../ConstraintAccordion.styles';
|
||||
import { PlaygroundConstraintSchema } from 'hooks/api/actions/usePlayground/playground.model';
|
||||
|
||||
const StyledValuesSpan = styled('span')(({ theme }) => ({
|
||||
display: '-webkit-box',
|
||||
@ -21,7 +20,7 @@ const StyledValuesSpan = styled('span')(({ theme }) => ({
|
||||
}));
|
||||
|
||||
interface ConstraintSingleValueProps {
|
||||
constraint: IConstraint | PlaygroundConstraintSchema;
|
||||
constraint: IConstraint;
|
||||
expanded: boolean;
|
||||
maxLength: number;
|
||||
allowExpand: (shouldExpand: boolean) => void;
|
||||
@ -51,21 +50,6 @@ export const ConstraintAccordionViewHeaderMultipleValues = ({
|
||||
return (
|
||||
<div className={styles.headerValuesContainerWrapper}>
|
||||
<div className={styles.headerValuesContainer}>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
'result' in constraint && !Boolean(constraint.result)
|
||||
}
|
||||
show={
|
||||
<Typography
|
||||
variant={'body2'}
|
||||
color={'error'}
|
||||
noWrap={true}
|
||||
sx={{ mr: 1 }}
|
||||
>
|
||||
does not match any values{' '}
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
<StyledValuesSpan>{text}</StyledValuesSpan>
|
||||
<ConditionallyRender
|
||||
condition={expandable}
|
||||
|
@ -1,11 +1,9 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Chip, styled, Typography } from '@mui/material';
|
||||
import { Chip, styled } from '@mui/material';
|
||||
import { formatConstraintValue } from 'utils/formatConstraintValue';
|
||||
import { useStyles } from '../../../ConstraintAccordion.styles';
|
||||
import { IConstraint } from '../../../../../../interfaces/strategy';
|
||||
import { useLocationSettings } from 'hooks/useLocationSettings';
|
||||
import { PlaygroundConstraintSchema } from 'hooks/api/actions/usePlayground/playground.model';
|
||||
import { ConditionallyRender } from '../../../../ConditionallyRender/ConditionallyRender';
|
||||
|
||||
const StyledSingleValueChip = styled(Chip)(({ theme }) => ({
|
||||
margin: 'auto 0',
|
||||
@ -15,7 +13,7 @@ const StyledSingleValueChip = styled(Chip)(({ theme }) => ({
|
||||
}));
|
||||
|
||||
interface ConstraintSingleValueProps {
|
||||
constraint: IConstraint | PlaygroundConstraintSchema;
|
||||
constraint: IConstraint;
|
||||
allowExpand: (shouldExpand: boolean) => void;
|
||||
}
|
||||
|
||||
@ -32,16 +30,6 @@ export const ConstraintAccordionViewHeaderSingleValue = ({
|
||||
|
||||
return (
|
||||
<div className={styles.headerValuesContainerWrapper}>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
'result' in constraint && !Boolean(constraint.result)
|
||||
}
|
||||
show={
|
||||
<Typography variant={'body1'} color={'error'}>
|
||||
does not match any values{' '}
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
<StyledSingleValueChip
|
||||
label={formatConstraintValue(constraint, locationSettings)}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user