1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00
This commit is contained in:
andreas-unleash 2022-07-29 12:05:40 +03:00
parent 562ad10c06
commit 2895516dda
6 changed files with 23 additions and 21 deletions

View File

@ -78,8 +78,7 @@ export const ConstraintAccordionViewHeaderInfo = ({
constraint.contextName
]
)
? theme.palette.neutral
.dark
? theme.palette.neutral.dark
: theme.palette.error.main
}
>

View File

@ -34,14 +34,12 @@ export const FeatureResultInfoPopoverCell = ({
name: feature?.name as any,
projectId: 'default',
isEnabled: true,
} as any;
const dummyPlaygroundFeatureFalse: PlaygroundFeatureSchema = {
name: feature?.name as any,
projectId: 'default',
isEnabled: false,
} as any;
const strategies: PlaygroundFeatureStrategyResult[] = [
@ -57,11 +55,7 @@ export const FeatureResultInfoPopoverCell = ({
operator: 'IN',
caseInsensitive: false,
inverted: false,
values: [
'MyApp',
'MyOtherApp',
'Unleash',
],
values: ['MyApp', 'MyOtherApp', 'Unleash'],
},
],
segments: [
@ -108,7 +102,11 @@ export const FeatureResultInfoPopoverCell = ({
classes={{ paper: styles.popoverPaper }}
>
<PlaygroundResultFeatureDetails
feature={feature.isEnabled ? dummyPlaygroundFeatureTrue : dummyPlaygroundFeatureFalse}
feature={
feature.isEnabled
? dummyPlaygroundFeatureTrue
: dummyPlaygroundFeatureFalse
}
onClose={() => setOpen(false)}
/>
<ConditionallyRender

View File

@ -47,7 +47,11 @@ export const PlaygroundResultConstraintExecution = ({
/>
<ConstraintAccordionView
constraint={constraint}
playgroundContext={Boolean(constraint.result) ? contextTrue : contextFalse}
playgroundContext={
Boolean(constraint.result)
? contextTrue
: contextFalse
}
maxLength={80}
sx={{
backgroundColor: 'transparent!important',

View File

@ -24,7 +24,6 @@ export const useStyles = makeStyles()(theme => ({
padding: '4px',
},
icon: {
textAlign: 'right'
}
textAlign: 'right',
},
}));

View File

@ -1,12 +1,12 @@
import { PlaygroundFeatureSchema } from '../../../../../../hooks/api/actions/usePlayground/playground.model';
import {IconButton, Typography, useTheme} from '@mui/material';
import { IconButton, Typography, useTheme } from '@mui/material';
import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
import { useStyles } from './PlaygroundResultFeatureDetails.styles';
import {CloseOutlined} from "@mui/icons-material";
import React from "react";
import { CloseOutlined } from '@mui/icons-material';
import React from 'react';
interface PlaygroundFeatureResultDetailsProps {
feature: PlaygroundFeatureSchema;
onClose: () => void
onClose: () => void;
}
export const PlaygroundResultFeatureDetails = ({
feature,
@ -21,7 +21,9 @@ export const PlaygroundResultFeatureDetails = ({
const reason = feature.isEnabled
? 'at least one strategy is True'
: 'all strategies are False';
const color = feature.isEnabled ? theme.palette.success.main : theme.palette.error.main;
const color = feature.isEnabled
? theme.palette.success.main
: theme.palette.error.main;
const onCloseClick =
onClose &&
@ -29,6 +31,7 @@ export const PlaygroundResultFeatureDetails = ({
event.stopPropagation();
onClose();
});
return (
<>
<div className={styles.titleRowWrapper}>
@ -40,7 +43,7 @@ export const PlaygroundResultFeatureDetails = ({
<PlaygroundResultChip enabled={feature.isEnabled} />
</span>
</div>
<IconButton onClick={() => onClose()} className={styles.icon}>
<IconButton onClick={onCloseClick} className={styles.icon}>
<CloseOutlined />
</IconButton>
</div>

View File

@ -264,7 +264,6 @@ export interface PlaygroundFeatureStrategySegmentResult {
result: boolean;
constraints?: PlaygroundFeatureStrategyConstraintResult[];
}
6;
export interface PlaygroundFeatureStrategyResult {
id: string;