From 18afc34f859f795501128d6915b6bce8e74acf8a Mon Sep 17 00:00:00 2001 From: andreas-unleash <104830839+andreas-unleash@users.noreply.github.com> Date: Mon, 8 Aug 2022 16:21:23 +0300 Subject: [PATCH] fix build --- .../admin/groups/GroupsList/GroupsList.tsx | 4 ++-- .../FeatureDetails/FeatureDetails.tsx | 21 ++++++++++++------- .../FeatureDetails/helpers.ts | 2 +- .../ConstraintAccordion.styles.ts | 2 +- .../PlaygroundParameterItem.tsx | 2 +- frontend/src/hooks/useHiddenColumns.ts | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx b/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx index 8c4b063bff..64c555d9f6 100644 --- a/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx +++ b/frontend/src/component/admin/groups/GroupsList/GroupsList.tsx @@ -1,12 +1,12 @@ import { useEffect, useMemo, useState, VFC } from 'react'; import { useGroups } from 'hooks/api/getters/useGroups/useGroups'; -import { Link, useNavigate, useSearchParams } from 'react-router-dom'; +import { useNavigate, useSearchParams } from 'react-router-dom'; import { IGroup } from 'interfaces/group'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { Search } from 'component/common/Search/Search'; -import { Button, Grid, useMediaQuery } from '@mui/material'; +import { Grid, useMediaQuery } from '@mui/material'; import theme from 'themes/theme'; import { SearchHighlightProvider } from 'component/common/Table/SearchHighlightContext/SearchHighlightContext'; import { TablePlaceholder } from 'component/common/Table'; diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/FeatureDetails.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/FeatureDetails.tsx index 8ad0e66a4e..29afaaedfd 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/FeatureDetails.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/FeatureDetails.tsx @@ -7,7 +7,7 @@ import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResul import { useStyles } from './FeatureDetails.styles'; import { CloseOutlined } from '@mui/icons-material'; import React from 'react'; -import { ConditionallyRender } from '../../../../../common/ConditionallyRender/ConditionallyRender'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { checkForEmptyValues, hasCustomStrategies, @@ -31,13 +31,18 @@ export const FeatureDetails = ({ ? `This feature toggle is True in ${input?.environment} because ` : `This feature toggle is False in ${input?.environment} because `; - const reason = feature.isEnabled - ? 'at least one strategy is True' - : !feature.isEnabledInCurrentEnvironment - ? 'the environment is disabled' - : hasOnlyCustomStrategies(feature) - ? 'no strategies could be fully evaluated' - : 'all strategies are either False or could not be fully evaluated'; + const reason = (() => { + if (feature.isEnabled) + return 'at least one strategy is True'; + + if (!feature.isEnabledInCurrentEnvironment) + return 'the environment is disabled'; + + if (hasOnlyCustomStrategies(feature)) + return 'no strategies could be fully evaluated' + + return 'all strategies are either False or could not be fully evaluated'; + })() const color = feature.isEnabled ? theme.palette.success.main diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/helpers.ts b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/helpers.ts index 04d60d53bd..9c249d0c04 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/helpers.ts +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureDetails/helpers.ts @@ -1,4 +1,4 @@ -import { PlaygroundFeatureSchema } from '../../../../../../hooks/api/actions/usePlayground/playground.model'; +import { PlaygroundFeatureSchema } from 'hooks/api/actions/usePlayground/playground.model'; export const DEFAULT_STRATEGIES = [ 'default', diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/ConstraintExecution/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordion.styles.ts b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/ConstraintExecution/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordion.styles.ts index f6092fcc94..64e00cc2f9 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/ConstraintExecution/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordion.styles.ts +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/ConstraintExecution/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordion.styles.ts @@ -17,7 +17,7 @@ export const useStyles = makeStyles()(theme => ({ fill: '#fff', }, accordion: { - border: `1px solid ${theme.palette.grey[400]}`, + border: `1px solid ${theme.palette.dividerAlternative}`, borderRadius: theme.spacing(1), backgroundColor: '#fff', boxShadow: 'none', diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/PlaygroundParameterItem/PlaygroundParameterItem.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/PlaygroundParameterItem/PlaygroundParameterItem.tsx index eddd9b67c9..0653054755 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/PlaygroundParameterItem/PlaygroundParameterItem.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/StrategyList/StrategyItem/StrategyExecution/PlaygroundParameterItem/PlaygroundParameterItem.tsx @@ -32,7 +32,7 @@ export const PlaygroundParameterItem = ({ )} > - {input} + {`${input}`}
{ const hidden = condition ? hiddenColumns : []; setHiddenColumns(hidden); - }, [setHiddenColumns, condition]); + }, [setHiddenColumns, hiddenColumns, condition]); }; export default useHiddenColumns;