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 { Box, Chip, Tooltip } from '@mui/material';
|
||||
import { Box, Chip } from '@mui/material';
|
||||
import { IFeatureStrategy } from 'interfaces/strategy';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
import PercentageCircle from 'component/common/PercentageCircle/PercentageCircle';
|
||||
|
@ -71,8 +71,8 @@ export const PlaygroundResultFeatureDetails = ({
|
||||
feature.isEnabled === 'unevaluated'
|
||||
? '?'
|
||||
: Boolean(feature.isEnabled)
|
||||
? 'True'
|
||||
: 'False'
|
||||
? 'True'
|
||||
: 'False'
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
|
@ -20,9 +20,7 @@ export const PlaygroundResultFeatureStrategyList = ({
|
||||
}: PlaygroundResultFeatureStrategyListProps) => {
|
||||
return (
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
!feature.isEnabledInCurrentEnvironment
|
||||
}
|
||||
condition={!feature.isEnabledInCurrentEnvironment}
|
||||
show={
|
||||
<WrappedPlaygroundResultStrategyList
|
||||
strategies={feature?.strategies}
|
||||
|
@ -56,7 +56,7 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
||||
width: '100%',
|
||||
position: 'relative',
|
||||
paddingRight: compact ? '12px' : 0,
|
||||
ml: '-12px'
|
||||
ml: '-12px',
|
||||
}}
|
||||
>
|
||||
<ConditionallyRender
|
||||
@ -64,7 +64,9 @@ export const PlaygroundResultFeatureStrategyItem = ({
|
||||
show={<StrategySeparator text="OR" />}
|
||||
/>
|
||||
<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 }}>
|
||||
<div className={styles.header}>
|
||||
<div className={styles.headerName}>
|
||||
|
@ -31,10 +31,9 @@ const StyledStrategyExecutionWrapper = styled('div')(({ theme }) => ({
|
||||
}));
|
||||
|
||||
const StyledParamWrapper = styled('div')(({ theme }) => ({
|
||||
padding: theme.spacing(2,1),
|
||||
padding: theme.spacing(2, 1),
|
||||
}));
|
||||
|
||||
|
||||
export const PlaygroundResultStrategyExecution = ({
|
||||
strategyResult,
|
||||
input,
|
||||
@ -170,7 +169,10 @@ export const PlaygroundResultStrategyExecution = ({
|
||||
);
|
||||
return (
|
||||
<Fragment key={param?.name}>
|
||||
<PlaygroundConstraintItem value={values} text={param.name} />
|
||||
<PlaygroundConstraintItem
|
||||
value={values}
|
||||
text={param.name}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={notLastItem}
|
||||
show={<StrategySeparator text="AND" />}
|
||||
|
@ -22,7 +22,13 @@ export const FeatureStatusCell = ({ enabled }: IFeatureStatusCellProps) => {
|
||||
<StyledChipWrapper data-loading>
|
||||
<PlaygroundResultChip
|
||||
enabled={enabled}
|
||||
label={enabled === 'unevaluated' ? '?' : Boolean(enabled) ? 'True': 'False' }
|
||||
label={
|
||||
enabled === 'unevaluated'
|
||||
? '?'
|
||||
: Boolean(enabled)
|
||||
? 'True'
|
||||
: 'False'
|
||||
}
|
||||
/>
|
||||
</StyledChipWrapper>
|
||||
</StyledCellBox>
|
||||
|
@ -4,10 +4,10 @@ import { ConditionallyRender } from '../../../../common/ConditionallyRender/Cond
|
||||
import React from 'react';
|
||||
import { ReactComponent as FeatureEnabledIcon } from '../../../../../assets/icons/isenabled-true.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 {
|
||||
enabled: boolean | 'unevaluated' | 'unknown'
|
||||
enabled: boolean | 'unevaluated' | 'unknown';
|
||||
label: string;
|
||||
// Result icon - defaults to true
|
||||
showIcon?: boolean;
|
||||
@ -69,8 +69,8 @@ export const PlaygroundResultChip = ({
|
||||
const theme = useTheme();
|
||||
const icon = (
|
||||
<ConditionallyRender
|
||||
condition={enabled === 'unknown' || enabled === 'unevaluated' }
|
||||
show={<WarningOutlined color={'warning'} fontSize='inherit' /> }
|
||||
condition={enabled === 'unknown' || enabled === 'unevaluated'}
|
||||
show={<WarningOutlined color={'warning'} fontSize="inherit" />}
|
||||
elseShow={
|
||||
<ConditionallyRender
|
||||
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 === 'large') chipWidth = 100;
|
||||
|
||||
return (
|
||||
<ConditionallyRender
|
||||
condition={enabled === 'unknown' || enabled === 'unevaluated' }
|
||||
condition={enabled === 'unknown' || enabled === 'unevaluated'}
|
||||
show={
|
||||
<StyledUnknownChip
|
||||
icon={showIcon ? icon : undefined}
|
||||
@ -125,5 +125,5 @@ export const PlaygroundResultChip = ({
|
||||
/>
|
||||
}
|
||||
/>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user