mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fmt and lint
This commit is contained in:
parent
f9d8c4a36a
commit
2299eb9305
@ -1,5 +1,5 @@
|
|||||||
import { Fragment, useMemo, VFC } from 'react';
|
import { Fragment, useMemo, VFC } from 'react';
|
||||||
import { Box, Chip, Tooltip } from '@mui/material';
|
import { Box, Chip } from '@mui/material';
|
||||||
import { IFeatureStrategy } from 'interfaces/strategy';
|
import { IFeatureStrategy } from 'interfaces/strategy';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import PercentageCircle from 'component/common/PercentageCircle/PercentageCircle';
|
import PercentageCircle from 'component/common/PercentageCircle/PercentageCircle';
|
||||||
|
@ -71,8 +71,8 @@ export const PlaygroundResultFeatureDetails = ({
|
|||||||
feature.isEnabled === 'unevaluated'
|
feature.isEnabled === 'unevaluated'
|
||||||
? '?'
|
? '?'
|
||||||
: Boolean(feature.isEnabled)
|
: Boolean(feature.isEnabled)
|
||||||
? 'True'
|
? 'True'
|
||||||
: 'False'
|
: 'False'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -20,9 +20,7 @@ export const PlaygroundResultFeatureStrategyList = ({
|
|||||||
}: PlaygroundResultFeatureStrategyListProps) => {
|
}: PlaygroundResultFeatureStrategyListProps) => {
|
||||||
return (
|
return (
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={
|
condition={!feature.isEnabledInCurrentEnvironment}
|
||||||
!feature.isEnabledInCurrentEnvironment
|
|
||||||
}
|
|
||||||
show={
|
show={
|
||||||
<WrappedPlaygroundResultStrategyList
|
<WrappedPlaygroundResultStrategyList
|
||||||
strategies={feature?.strategies}
|
strategies={feature?.strategies}
|
||||||
|
@ -56,7 +56,7 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
paddingRight: compact ? '12px' : 0,
|
paddingRight: compact ? '12px' : 0,
|
||||||
ml: '-12px'
|
ml: '-12px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
@ -64,7 +64,9 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
|||||||
show={<StrategySeparator text="OR" />}
|
show={<StrategySeparator text="OR" />}
|
||||||
/>
|
/>
|
||||||
<StyledItemWrapper>
|
<StyledItemWrapper>
|
||||||
<Typography variant={'subtitle1'} color={'text.secondary'}>{index + 1}</Typography>
|
<Typography variant={'subtitle1'} color={'text.secondary'}>
|
||||||
|
{index + 1}
|
||||||
|
</Typography>
|
||||||
<Box className={styles.innerContainer} sx={{ border }}>
|
<Box className={styles.innerContainer} sx={{ border }}>
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles.headerName}>
|
<div className={styles.headerName}>
|
||||||
|
@ -31,10 +31,9 @@ const StyledStrategyExecutionWrapper = styled('div')(({ theme }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledParamWrapper = styled('div')(({ theme }) => ({
|
const StyledParamWrapper = styled('div')(({ theme }) => ({
|
||||||
padding: theme.spacing(2,1),
|
padding: theme.spacing(2, 1),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
export const PlaygroundResultStrategyExecution = ({
|
export const PlaygroundResultStrategyExecution = ({
|
||||||
strategyResult,
|
strategyResult,
|
||||||
input,
|
input,
|
||||||
@ -170,7 +169,10 @@ export const PlaygroundResultStrategyExecution = ({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Fragment key={param?.name}>
|
<Fragment key={param?.name}>
|
||||||
<PlaygroundConstraintItem value={values} text={param.name} />
|
<PlaygroundConstraintItem
|
||||||
|
value={values}
|
||||||
|
text={param.name}
|
||||||
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={notLastItem}
|
condition={notLastItem}
|
||||||
show={<StrategySeparator text="AND" />}
|
show={<StrategySeparator text="AND" />}
|
||||||
|
@ -22,7 +22,13 @@ export const FeatureStatusCell = ({ enabled }: IFeatureStatusCellProps) => {
|
|||||||
<StyledChipWrapper data-loading>
|
<StyledChipWrapper data-loading>
|
||||||
<PlaygroundResultChip
|
<PlaygroundResultChip
|
||||||
enabled={enabled}
|
enabled={enabled}
|
||||||
label={enabled === 'unevaluated' ? '?' : Boolean(enabled) ? 'True': 'False' }
|
label={
|
||||||
|
enabled === 'unevaluated'
|
||||||
|
? '?'
|
||||||
|
: Boolean(enabled)
|
||||||
|
? 'True'
|
||||||
|
: 'False'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</StyledChipWrapper>
|
</StyledChipWrapper>
|
||||||
</StyledCellBox>
|
</StyledCellBox>
|
||||||
|
@ -4,10 +4,10 @@ import { ConditionallyRender } from '../../../../common/ConditionallyRender/Cond
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ReactComponent as FeatureEnabledIcon } from '../../../../../assets/icons/isenabled-true.svg';
|
import { ReactComponent as FeatureEnabledIcon } from '../../../../../assets/icons/isenabled-true.svg';
|
||||||
import { ReactComponent as FeatureDisabledIcon } from '../../../../../assets/icons/isenabled-false.svg';
|
import { ReactComponent as FeatureDisabledIcon } from '../../../../../assets/icons/isenabled-false.svg';
|
||||||
import { WarningOutlined } from "@mui/icons-material";
|
import { WarningOutlined } from '@mui/icons-material';
|
||||||
|
|
||||||
interface IResultChipProps {
|
interface IResultChipProps {
|
||||||
enabled: boolean | 'unevaluated' | 'unknown'
|
enabled: boolean | 'unevaluated' | 'unknown';
|
||||||
label: string;
|
label: string;
|
||||||
// Result icon - defaults to true
|
// Result icon - defaults to true
|
||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
@ -69,8 +69,8 @@ export const PlaygroundResultChip = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const icon = (
|
const icon = (
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={enabled === 'unknown' || enabled === 'unevaluated' }
|
condition={enabled === 'unknown' || enabled === 'unevaluated'}
|
||||||
show={<WarningOutlined color={'warning'} fontSize='inherit' /> }
|
show={<WarningOutlined color={'warning'} fontSize="inherit" />}
|
||||||
elseShow={
|
elseShow={
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={typeof enabled === 'boolean' && Boolean(enabled)}
|
condition={typeof enabled === 'boolean' && Boolean(enabled)}
|
||||||
@ -91,13 +91,13 @@ export const PlaygroundResultChip = ({
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
let chipWidth = 60;
|
let chipWidth = 60;
|
||||||
if (size === 'medium') chipWidth = 72;
|
if (size === 'medium') chipWidth = 72;
|
||||||
if (size === 'large') chipWidth = 100;
|
if (size === 'large') chipWidth = 100;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={enabled === 'unknown' || enabled === 'unevaluated' }
|
condition={enabled === 'unknown' || enabled === 'unevaluated'}
|
||||||
show={
|
show={
|
||||||
<StyledUnknownChip
|
<StyledUnknownChip
|
||||||
icon={showIcon ? icon : undefined}
|
icon={showIcon ? icon : undefined}
|
||||||
@ -125,5 +125,5 @@ export const PlaygroundResultChip = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user