mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-12 01:17:04 +02:00
demo data
This commit is contained in:
parent
61c8c4d66b
commit
562ad10c06
@ -66,12 +66,12 @@ export const FeatureResultInfoPopoverCell = ({
|
|||||||
],
|
],
|
||||||
segments: [
|
segments: [
|
||||||
{
|
{
|
||||||
result: false,
|
result: feature?.isEnabled as any,
|
||||||
id: 5,
|
id: 5,
|
||||||
name: 'my-segment',
|
name: 'my-segment',
|
||||||
constraints: [
|
constraints: [
|
||||||
{
|
{
|
||||||
result: false,
|
result: feature?.isEnabled as any,
|
||||||
contextName: 'environment',
|
contextName: 'environment',
|
||||||
operator: 'IN',
|
operator: 'IN',
|
||||||
caseInsensitive: false,
|
caseInsensitive: false,
|
||||||
@ -107,7 +107,10 @@ export const FeatureResultInfoPopoverCell = ({
|
|||||||
}}
|
}}
|
||||||
classes={{ paper: styles.popoverPaper }}
|
classes={{ paper: styles.popoverPaper }}
|
||||||
>
|
>
|
||||||
<PlaygroundResultFeatureDetails feature={feature.isEnabled ? dummyPlaygroundFeatureTrue : dummyPlaygroundFeatureFalse} />
|
<PlaygroundResultFeatureDetails
|
||||||
|
feature={feature.isEnabled ? dummyPlaygroundFeatureTrue : dummyPlaygroundFeatureFalse}
|
||||||
|
onClose={() => setOpen(false)}
|
||||||
|
/>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={strategies.length > 0}
|
condition={strategies.length > 0}
|
||||||
show={
|
show={
|
||||||
|
@ -25,11 +25,16 @@ export const PlaygroundResultConstraintExecution = ({
|
|||||||
constraints,
|
constraints,
|
||||||
}: PlaygroundResultConstraintExecutionProps) => {
|
}: PlaygroundResultConstraintExecutionProps) => {
|
||||||
// const context = usePlaygroundContext();
|
// const context = usePlaygroundContext();
|
||||||
const context: SdkContextSchema = {
|
const contextFalse: SdkContextSchema = {
|
||||||
appName: 'MyApp',
|
appName: 'MyApp',
|
||||||
environment: '',
|
environment: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const contextTrue: SdkContextSchema = {
|
||||||
|
appName: 'MyApp',
|
||||||
|
environment: 'development',
|
||||||
|
};
|
||||||
|
|
||||||
if (!constraints) return null;
|
if (!constraints) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -42,7 +47,7 @@ export const PlaygroundResultConstraintExecution = ({
|
|||||||
/>
|
/>
|
||||||
<ConstraintAccordionView
|
<ConstraintAccordionView
|
||||||
constraint={constraint}
|
constraint={constraint}
|
||||||
playgroundContext={context}
|
playgroundContext={Boolean(constraint.result) ? contextTrue : contextFalse}
|
||||||
maxLength={80}
|
maxLength={80}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: 'transparent!important',
|
backgroundColor: 'transparent!important',
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import { makeStyles } from 'tss-react/mui';
|
import { makeStyles } from 'tss-react/mui';
|
||||||
|
|
||||||
export const useStyles = makeStyles()(theme => ({
|
export const useStyles = makeStyles()(theme => ({
|
||||||
|
titleRowWrapper: {
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
titleRow: {
|
titleRow: {
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
@ -18,4 +23,8 @@ export const useStyles = makeStyles()(theme => ({
|
|||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
padding: '4px',
|
padding: '4px',
|
||||||
},
|
},
|
||||||
|
icon: {
|
||||||
|
textAlign: 'right'
|
||||||
|
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { PlaygroundFeatureSchema } from '../../../../../../hooks/api/actions/usePlayground/playground.model';
|
import { PlaygroundFeatureSchema } from '../../../../../../hooks/api/actions/usePlayground/playground.model';
|
||||||
import {Typography, useTheme} from '@mui/material';
|
import {IconButton, Typography, useTheme} from '@mui/material';
|
||||||
import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
|
import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
|
||||||
import { useStyles } from './PlaygroundResultFeatureDetails.styles';
|
import { useStyles } from './PlaygroundResultFeatureDetails.styles';
|
||||||
|
import {CloseOutlined} from "@mui/icons-material";
|
||||||
|
import React from "react";
|
||||||
interface PlaygroundFeatureResultDetailsProps {
|
interface PlaygroundFeatureResultDetailsProps {
|
||||||
feature: PlaygroundFeatureSchema;
|
feature: PlaygroundFeatureSchema;
|
||||||
|
onClose: () => void
|
||||||
}
|
}
|
||||||
export const PlaygroundResultFeatureDetails = ({
|
export const PlaygroundResultFeatureDetails = ({
|
||||||
feature,
|
feature,
|
||||||
|
onClose,
|
||||||
}: PlaygroundFeatureResultDetailsProps) => {
|
}: PlaygroundFeatureResultDetailsProps) => {
|
||||||
const { classes: styles } = useStyles();
|
const { classes: styles } = useStyles();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@ -19,8 +23,15 @@ export const PlaygroundResultFeatureDetails = ({
|
|||||||
: 'all strategies are False';
|
: '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 &&
|
||||||
|
((event: React.SyntheticEvent) => {
|
||||||
|
event.stopPropagation();
|
||||||
|
onClose();
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<div className={styles.titleRowWrapper}>
|
||||||
<div className={styles.titleRow}>
|
<div className={styles.titleRow}>
|
||||||
<Typography variant={'subtitle1'} className={styles.name}>
|
<Typography variant={'subtitle1'} className={styles.name}>
|
||||||
{feature.name}
|
{feature.name}
|
||||||
@ -29,6 +40,10 @@ export const PlaygroundResultFeatureDetails = ({
|
|||||||
<PlaygroundResultChip enabled={feature.isEnabled} />
|
<PlaygroundResultChip enabled={feature.isEnabled} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<IconButton onClick={() => onClose()} className={styles.icon}>
|
||||||
|
<CloseOutlined />
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
<div className={styles.descriptionRow}>
|
<div className={styles.descriptionRow}>
|
||||||
<Typography variant={'body1'}>{description}</Typography>
|
<Typography variant={'body1'}>{description}</Typography>
|
||||||
<Typography variant={'subtitle1'} color={color}>
|
<Typography variant={'subtitle1'} color={color}>
|
||||||
|
Loading…
Reference in New Issue
Block a user