From 352a4cca13b3785271921b60215159eccceb8fe7 Mon Sep 17 00:00:00 2001
From: andreas-unleash <104830839+andreas-unleash@users.noreply.github.com>
Date: Thu, 28 Jul 2022 19:23:38 +0300
Subject: [PATCH] Playground result info structure and initial styles
---
.../StrategyExecution/StrategyExecution.tsx | 3 +-
.../StrategyItem/StrategyItem.tsx | 61 +++++---------
.../FeatureResultInfoPopoverCell.styles.ts | 14 ++++
.../FeatureResultInfoPopoverCell.tsx | 43 ++++++++--
.../PlaygroundResultFeatureDetails.styles.ts | 21 +++++
.../PlaygroundResultFeatureDetails.tsx | 39 +++++++++
...ygroundResultFeatureStrategyItem.styles.ts | 32 +++++++
.../PlaygroundResultFeatureStrategyItem.tsx | 71 ++++++++++++----
.../FeatureStatusCell/FeatureStatusCell.tsx | 25 +-----
.../PlaygroundResultChip.tsx | 84 +++++++++++++++++++
.../ResultChip/ResultChip.tsx | 46 ----------
.../actions/usePlayground/playground.model.ts | 28 ++++++-
frontend/src/interfaces/strategy.ts | 18 ----
13 files changed, 331 insertions(+), 154 deletions(-)
create mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureResultInfoPopoverCell.styles.ts
create mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.styles.ts
create mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.tsx
create mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.styles.ts
create mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/PlaygroundResultChip/PlaygroundResultChip.tsx
delete mode 100644 frontend/src/component/playground/Playground/PlaygroundResultsTable/ResultChip/ResultChip.tsx
diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx
index 380ba8c3c4..18db353802 100644
--- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx
+++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx
@@ -16,9 +16,10 @@ import {
parseParameterNumber,
parseParameterStrings,
} from 'utils/parseParameter';
+import { PlaygroundFeatureStrategyResult } from 'hooks/api/actions/usePlayground/playground.model';
interface IStrategyExecutionProps {
- strategy: IFeatureStrategy;
+ strategy: IFeatureStrategy | PlaygroundFeatureStrategyResult;
percentageFill?: string;
}
diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx
index 30bc4d251a..f44f82ce6a 100644
--- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx
+++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem.tsx
@@ -1,7 +1,7 @@
import { DragIndicator, Edit } from '@mui/icons-material';
-import { styled, useTheme, IconButton, Chip } from '@mui/material';
+import { styled, useTheme, IconButton } from '@mui/material';
import { Link } from 'react-router-dom';
-import {IFeatureStrategy, IPlaygroundFeatureStrategyResult} from 'interfaces/strategy';
+import { IFeatureStrategy } from 'interfaces/strategy';
import {
getFeatureStrategyIcon,
formatStrategyName,
@@ -18,10 +18,8 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
interface IStrategyItemProps {
environmentId: string;
- strategy: IFeatureStrategy | IPlaygroundFeatureStrategyResult;
+ strategy: IFeatureStrategy;
isDraggable?: boolean;
- showActions?: boolean;
- result?: boolean;
}
const DragIcon = styled(IconButton)(({ theme }) => ({
@@ -34,8 +32,6 @@ export const StrategyItem = ({
environmentId,
strategy,
isDraggable,
- showActions = true,
- result,
}: IStrategyItemProps) => {
const projectId = useRequiredPathParam('projectId');
const featureId = useRequiredPathParam('featureId');
@@ -50,8 +46,6 @@ export const StrategyItem = ({
strategy.id
);
- const showShouldShowResultChip = result !== undefined;
-
return (
@@ -72,36 +66,25 @@ export const StrategyItem = ({
maxLength={15}
text={formatStrategyName(strategy.name)}
/>
-
-
-
-
-
-
- }
- />
-
- }
- />
+
({
+ popoverPaper: {
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'flex-start',
+ padding: '48px',
+ gap: '24px',
+ width: '728px',
+ height: 'auto',
+ // overflowY: 'scroll',
+ },
+}));
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureResultInfoPopoverCell.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureResultInfoPopoverCell.tsx
index eb10bf808d..43c91711bc 100644
--- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureResultInfoPopoverCell.tsx
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureResultInfoPopoverCell.tsx
@@ -1,8 +1,17 @@
-import { PlaygroundFeatureSchema } from '../../../../../hooks/api/actions/usePlayground/playground.model';
-import { Box, IconButton, Popover } from '@mui/material';
+import {
+ PlaygroundFeatureSchema,
+ PlaygroundFeatureStrategyResult,
+} from '../../../../../hooks/api/actions/usePlayground/playground.model';
+import { Box, IconButton, Popover, Typography } from '@mui/material';
import { InfoOutlined } from '@mui/icons-material';
import { IconCell } from '../../../../common/Table/cells/IconCell/IconCell';
import React, { useRef, useState } from 'react';
+import { ConditionallyRender } from '../../../../common/ConditionallyRender/ConditionallyRender';
+import { StrategyDraggableItem } from '../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyDraggableItem';
+import { FeatureStrategyEmpty } from '../../../../feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty';
+import { PlaygroundResultFeatureStrategyItem } from './PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem';
+import { useStyles } from './FeatureResultInfoPopoverCell.styles';
+import { PlaygroundResultFeatureDetails } from './PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails';
interface FeatureResultInfoPopoverCellProps {
feature?: PlaygroundFeatureSchema;
@@ -15,16 +24,18 @@ export const FeatureResultInfoPopoverCell = ({
return null;
}
const [open, setOpen] = useState(false);
+ const { classes: styles } = useStyles();
const ref = useRef(null);
const togglePopover = (event: React.SyntheticEvent) => {
setOpen(!open);
};
- const strategies = [
+ const strategies: PlaygroundFeatureStrategyResult[] = [
{
- type: 'standard',
+ name: 'default',
id: 'strategy-id',
+ parameters: {},
result: false,
constraints: [
{
@@ -54,10 +65,6 @@ export const FeatureResultInfoPopoverCell = ({
},
],
},
- {
- type: 'default',
- result: true,
- },
];
return (
@@ -77,8 +84,26 @@ export const FeatureResultInfoPopoverCell = ({
vertical: 'center',
horizontal: 'left',
}}
+ classes={{ paper: styles.popoverPaper }}
>
- {feature.name}
+
+ 0}
+ show={
+ <>
+ {`Strategies (${strategies.length})`}
+ {strategies.map((strategy, index) => (
+
+ ))}
+ >
+ }
+ />
>
);
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.styles.ts b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.styles.ts
new file mode 100644
index 0000000000..7b02b24f97
--- /dev/null
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.styles.ts
@@ -0,0 +1,21 @@
+import { makeStyles } from 'tss-react/mui';
+
+export const useStyles = makeStyles()(theme => ({
+ titleRow: {
+ display: 'inline-flex',
+ alignItems: 'flex-start',
+ justifyItems: 'center',
+ gap: '12px',
+ },
+ descriptionRow: {
+ flexDirection: 'row',
+ display: 'inline-flex',
+ alignItems: 'flex-start',
+ justifyItems: 'center',
+ gap: '6px',
+ },
+ name: {
+ fontWeight: 600,
+ padding: '4px',
+ },
+}));
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.tsx
new file mode 100644
index 0000000000..b0f77014b9
--- /dev/null
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureDetails/PlaygroundResultFeatureDetails.tsx
@@ -0,0 +1,39 @@
+import { PlaygroundFeatureSchema } from '../../../../../../hooks/api/actions/usePlayground/playground.model';
+import { Typography } from '@mui/material';
+import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
+import { useStyles } from './PlaygroundResultFeatureDetails.styles';
+interface PlaygroundFeatureResultDetailsProps {
+ feature: PlaygroundFeatureSchema;
+}
+export const PlaygroundResultFeatureDetails = ({
+ feature,
+}: PlaygroundFeatureResultDetailsProps) => {
+ const { classes: styles } = useStyles();
+
+ const description = feature.isEnabled
+ ? 'This feature toggle is True in production because '
+ : 'This feature toggle is False in production because ';
+ const reason = feature.isEnabled
+ ? 'at least one strategy is True'
+ : 'all strategies are False';
+ const color = feature.isEnabled ? 'success' : 'error';
+
+ return (
+ <>
+
+
+ {feature.name}
+
+
+
+
+
+
+ {description}
+
+ {reason}
+
+
+ >
+ );
+};
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.styles.ts b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.styles.ts
new file mode 100644
index 0000000000..327e01f383
--- /dev/null
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.styles.ts
@@ -0,0 +1,32 @@
+import { makeStyles } from 'tss-react/mui';
+
+export const useStyles = makeStyles()(theme => ({
+ header: {
+ display: 'flex',
+ padding: theme.spacing(2, 2),
+ justifyContent: 'space-between',
+ },
+ headerName: {
+ padding: theme.spacing(0.5, 2),
+ display: 'flex',
+ gap: theme.spacing(1),
+ alignItems: 'center',
+ borderBottom: `1px solid ${theme.palette.divider}`,
+ fontWeight: theme.typography.fontWeightMedium,
+ },
+ icon: {
+ fill: theme.palette.inactiveIcon,
+ },
+ resultChip: {
+ marginLeft: 'auto',
+ },
+ body: {
+ padding: theme.spacing(2),
+ justifyItems: 'center',
+ },
+ innerContainer: {
+ [theme.breakpoints.down(400)]: {
+ padding: '0.5rem',
+ },
+ },
+}));
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.tsx
index f890d4da16..0ef0890ca9 100644
--- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.tsx
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyItem/PlaygroundResultFeatureStrategyItem.tsx
@@ -1,38 +1,75 @@
import { ConditionallyRender } from '../../../../../common/ConditionallyRender/ConditionallyRender';
import { StrategySeparator } from '../../../../../common/StrategySeparator/StrategySeparator';
-import { StrategyItem } from '../../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyItem';
+import { styled, useTheme } from '@mui/material';
+import { useStyles } from './PlaygroundResultFeatureStrategyItem.styles';
import {
- IConstraint,
- IFeatureStrategy, IPlaygroundFeatureStrategyResult,
-} from '../../../../../../interfaces/strategy';
-import { ISegment } from '../../../../../../interfaces/segment';
-
+ formatStrategyName,
+ getFeatureStrategyIcon,
+} from '../../../../../../utils/strategyNames';
+import StringTruncator from '../../../../../common/StringTruncator/StringTruncator';
+import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
+import { StrategyExecution } from '../../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution';
+import { PlaygroundFeatureStrategyResult } from 'hooks/api/actions/usePlayground/playground.model';
interface IPlaygroundResultFeatureStrategyItemProps {
- strategy: IPlaygroundFeatureStrategyResult;
- environmentName: string;
+ strategy: PlaygroundFeatureStrategyResult;
index: number;
}
+const StyledStrategyResultBox = styled('div')(({ theme }) => ({
+ width: '100%',
+ position: 'relative',
+ paddingBottom: '1rem',
+ borderRadius: theme.shape.borderRadiusMedium,
+ '& + &': {
+ marginTop: theme.spacing(2),
+ },
+ background: theme.palette.background.default,
+}));
+
export const PlaygroundResultFeatureStrategyItem = ({
strategy,
- environmentName,
index,
}: IPlaygroundResultFeatureStrategyItemProps) => {
const { result } = strategy;
+ const { classes: styles } = useStyles();
+ const theme = useTheme();
+ const Icon = getFeatureStrategyIcon(strategy.name);
+ const label =
+ result === undefined ? 'Not found' : result ? 'True' : 'False';
+ const border = Boolean(result)
+ ? `2px solid ${theme.palette.success.main}`
+ : `1px solid ${theme.palette.divider}`;
return (
-
+
0}
show={}
/>
-
-
+
+
);
};
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureStatusCell/FeatureStatusCell.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureStatusCell/FeatureStatusCell.tsx
index 7ead5073d1..4ff8a5a598 100644
--- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureStatusCell/FeatureStatusCell.tsx
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureStatusCell/FeatureStatusCell.tsx
@@ -4,7 +4,7 @@ import { ReactComponent as FeatureEnabledIcon } from 'assets/icons/isenabled-tru
import { ReactComponent as FeatureDisabledIcon } from 'assets/icons/isenabled-false.svg';
import { Box, Chip, styled, useTheme } from '@mui/material';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
-import {ResultChip} from "../ResultChip/ResultChip";
+import { PlaygroundResultChip } from '../PlaygroundResultChip/PlaygroundResultChip';
interface IFeatureStatusCellProps {
enabled: boolean;
@@ -21,31 +21,10 @@ const StyledChipWrapper = styled(Box)(() => ({
}));
export const FeatureStatusCell = ({ enabled }: IFeatureStatusCellProps) => {
- const theme = useTheme();
- const icon = (
-
- }
- elseShow={
-
- }
- />
- );
-
- const label = enabled ? 'True' : 'False';
-
return (
-
+
);
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/PlaygroundResultChip/PlaygroundResultChip.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/PlaygroundResultChip/PlaygroundResultChip.tsx
new file mode 100644
index 0000000000..7b4691e0fe
--- /dev/null
+++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/PlaygroundResultChip/PlaygroundResultChip.tsx
@@ -0,0 +1,84 @@
+import { Chip, styled, useTheme } from '@mui/material';
+import { colors } from '../../../../../themes/colors';
+import { ConditionallyRender } from '../../../../common/ConditionallyRender/ConditionallyRender';
+import React from 'react';
+import { ReactComponent as FeatureEnabledIcon } from '../../../../../assets/icons/isenabled-true.svg';
+import { ReactComponent as FeatureDisabledIcon } from '../../../../../assets/icons/isenabled-false.svg';
+
+interface IResultChipProps {
+ enabled: boolean;
+ // Result icon - defaults to true
+ showIcon?: boolean;
+ label?: string;
+}
+
+export const StyledFalseChip = styled(Chip)(({ theme }) => ({
+ width: 80,
+ borderRadius: '5px',
+ border: `1px solid ${theme.palette.error.main}`,
+ backgroundColor: colors.red['200'],
+ ['& .MuiChip-label']: {
+ color: theme.palette.error.main,
+ },
+ ['& .MuiChip-icon']: {
+ color: theme.palette.error.main,
+ },
+}));
+
+export const StyledTrueChip = styled(Chip)(({ theme }) => ({
+ width: 80,
+ borderRadius: '5px',
+ border: `1px solid ${theme.palette.success.main}`,
+ backgroundColor: colors.green['100'],
+ ['& .MuiChip-label']: {
+ color: theme.palette.success.main,
+ },
+ ['& .MuiChip-icon']: {
+ color: theme.palette.success.main,
+ },
+}));
+
+export const PlaygroundResultChip = ({
+ enabled,
+ showIcon = true,
+ label,
+}: IResultChipProps) => {
+ const theme = useTheme();
+ const icon = (
+
+ }
+ elseShow={
+
+ }
+ />
+ );
+
+ const defaultLabel = enabled ? 'True' : 'False';
+
+ return (
+
+ }
+ elseShow={
+
+ }
+ />
+ );
+};
diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/ResultChip/ResultChip.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/ResultChip/ResultChip.tsx
deleted file mode 100644
index 6ad427a2af..0000000000
--- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/ResultChip/ResultChip.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import {Box, Chip, styled} from "@mui/material";
-import {colors} from "../../../../../themes/colors";
-import {ConditionallyRender} from "../../../../common/ConditionallyRender/ConditionallyRender";
-import React, {ReactElement} from "react";
-
-interface IResultChipProps {
- enabled: boolean;
- icon?: ReactElement;
- label?: string;
-}
-
-export const StyledFalseChip = styled(Chip)(({ theme }) => ({
- width: 80,
- borderRadius: '5px',
- border: `1px solid ${theme.palette.error.main}`,
- backgroundColor: colors.red['200'],
- ['& .MuiChip-label']: {
- color: theme.palette.error.main,
- },
- ['& .MuiChip-icon']: {
- color: theme.palette.error.main,
- },
-}));
-
-export const StyledTrueChip = styled(Chip)(({ theme }) => ({
- width: 80,
- borderRadius: '5px',
- border: `1px solid ${theme.palette.success.main}`,
- backgroundColor: colors.green['100'],
- ['& .MuiChip-label']: {
- color: theme.palette.success.main,
- },
- ['& .MuiChip-icon']: {
- color: theme.palette.success.main,
- },
-}));
-
-export const ResultChip = ({ enabled, icon, label}: IResultChipProps) => {
- return (
- }
- elseShow={}
- />
- );
-}
diff --git a/frontend/src/hooks/api/actions/usePlayground/playground.model.ts b/frontend/src/hooks/api/actions/usePlayground/playground.model.ts
index 3b954902de..eff504cda2 100644
--- a/frontend/src/hooks/api/actions/usePlayground/playground.model.ts
+++ b/frontend/src/hooks/api/actions/usePlayground/playground.model.ts
@@ -1,5 +1,10 @@
// TODO: replace with auto-generated openapi code
+import {
+ IConstraint,
+ IFeatureStrategyParameters,
+} from '../../../../interfaces/strategy';
+
export enum PlaygroundFeatureSchemaVariantPayloadTypeEnum {
Json = 'json',
Csv = 'csv',
@@ -158,7 +163,7 @@ export interface PlaygroundFeatureSchema {
* @type {boolean}
* @memberof PlaygroundFeatureSchema
*/
- isEnabled: boolean;
+ enabled: boolean | 'unevaluated';
/**
*
* @type {PlaygroundFeatureSchemaVariant}
@@ -248,3 +253,24 @@ export interface SdkContextSchema {
*/
userId?: string;
}
+
+export interface PlaygroundFeatureStrategyConstraintResult extends IConstraint {
+ result: boolean;
+}
+
+export interface PlaygroundFeatureStrategySegmentResult {
+ id: number;
+ name: string;
+ result: boolean;
+ constraints?: PlaygroundFeatureStrategyConstraintResult[];
+}
+
+export interface PlaygroundFeatureStrategyResult {
+ id: string;
+ name: string;
+ result: boolean | 'not found';
+ type?: string;
+ constraints?: PlaygroundFeatureStrategyConstraintResult[];
+ segments?: PlaygroundFeatureStrategySegmentResult[];
+ parameters: IFeatureStrategyParameters;
+}
diff --git a/frontend/src/interfaces/strategy.ts b/frontend/src/interfaces/strategy.ts
index 89e170272b..a9564f1aca 100644
--- a/frontend/src/interfaces/strategy.ts
+++ b/frontend/src/interfaces/strategy.ts
@@ -1,5 +1,4 @@
import { Operator } from 'constants/operators';
-import {ISegment} from "./segment";
export interface IFeatureStrategy {
id: string;
@@ -57,20 +56,3 @@ export interface IFeatureStrategySortOrder {
id: string;
sortOrder: number;
}
-
-
-export interface IPlaygroundFeatureStrategyConstraintResult extends IConstraint {
- result: boolean;
-}
-
-export interface IPlaygroundFeatureStrategySegmentResult extends ISegment {
- result: boolean;
-}
-
-export interface IPlaygroundFeatureStrategyResult {
- type: string;
- result: boolean;
- id?: string;
- constraints?: IPlaygroundFeatureStrategyConstraintResult[];
- segments?: IPlaygroundFeatureStrategySegmentResult[];
-}