From 76b33cdd11ee11195ec6df11ab931c8a4bc902df Mon Sep 17 00:00:00 2001 From: andreas-unleash <104830839+andreas-unleash@users.noreply.github.com> Date: Wed, 3 Aug 2022 14:54:13 +0300 Subject: [PATCH] bug fixes and linting --- .../ConstraintAccordionViewHeader.tsx | 6 +-- ...raintAccordionViewHeaderMultipleValues.tsx | 4 +- ...nstraintAccordionViewHeaderSingleValue.tsx | 8 ++-- .../PlaygroundConstraintItem.tsx | 2 +- .../PlaygroundResultStrategyExecution.tsx | 9 ++-- .../actions/usePlayground/playground.model.ts | 42 +++++-------------- 6 files changed, 25 insertions(+), 46 deletions(-) diff --git a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx index f3833c3e1f..0b1cd2b6bd 100644 --- a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx +++ b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx @@ -4,12 +4,12 @@ import { ConstraintAccordionViewHeaderInfo } from './ConstraintAccordionViewHead import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions'; import { useStyles } from 'component/common/ConstraintAccordion/ConstraintAccordion.styles'; import { - PlaygroundFeatureStrategyConstraintResult, + PlaygroundConstraintSchema, PlaygroundRequestSchema, -} from '../../../../../hooks/api/actions/usePlayground/playground.model'; +} from 'hooks/api/actions/usePlayground/playground.model'; interface IConstraintAccordionViewHeaderProps { - constraint: IConstraint | PlaygroundFeatureStrategyConstraintResult; + constraint: IConstraint | PlaygroundConstraintSchema; onDelete?: () => void; onEdit?: () => void; singleValue: boolean; diff --git a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderMultipleValues/ConstraintAccordionViewHeaderMultipleValues.tsx b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderMultipleValues/ConstraintAccordionViewHeaderMultipleValues.tsx index da0cc1fcfc..14e3d06b79 100644 --- a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderMultipleValues/ConstraintAccordionViewHeaderMultipleValues.tsx +++ b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderMultipleValues/ConstraintAccordionViewHeaderMultipleValues.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useMemo, useState } from 'react'; import classnames from 'classnames'; import { IConstraint } from '../../../../../../interfaces/strategy'; import { useStyles } from '../../../ConstraintAccordion.styles'; -import { PlaygroundFeatureStrategyConstraintResult } from '../../../../../../hooks/api/actions/usePlayground/playground.model'; +import { PlaygroundConstraintSchema } from 'hooks/api/actions/usePlayground/playground.model'; const StyledValuesSpan = styled('span')(({ theme }) => ({ display: '-webkit-box', @@ -21,7 +21,7 @@ const StyledValuesSpan = styled('span')(({ theme }) => ({ })); interface ConstraintSingleValueProps { - constraint: IConstraint | PlaygroundFeatureStrategyConstraintResult; + constraint: IConstraint | PlaygroundConstraintSchema; expanded: boolean; maxLength: number; allowExpand: (shouldExpand: boolean) => void; diff --git a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderSingleValue/ConstraintAccordionViewHeaderSingleValue.tsx b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderSingleValue/ConstraintAccordionViewHeaderSingleValue.tsx index da51969721..c25172e704 100644 --- a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderSingleValue/ConstraintAccordionViewHeaderSingleValue.tsx +++ b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ContraintAccordionViewHeaderSingleValue/ConstraintAccordionViewHeaderSingleValue.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; import { Chip, styled, Typography } from '@mui/material'; -import { formatConstraintValue } from '../../../../../../utils/formatConstraintValue'; +import { formatConstraintValue } from 'utils/formatConstraintValue'; import { useStyles } from '../../../ConstraintAccordion.styles'; import { IConstraint } from '../../../../../../interfaces/strategy'; -import { useLocationSettings } from '../../../../../../hooks/useLocationSettings'; -import { PlaygroundFeatureStrategyConstraintResult } from '../../../../../../hooks/api/actions/usePlayground/playground.model'; +import { useLocationSettings } from 'hooks/useLocationSettings'; +import { PlaygroundConstraintSchema } from 'hooks/api/actions/usePlayground/playground.model'; import { ConditionallyRender } from '../../../../ConditionallyRender/ConditionallyRender'; const StyledSingleValueChip = styled(Chip)(({ theme }) => ({ @@ -15,7 +15,7 @@ const StyledSingleValueChip = styled(Chip)(({ theme }) => ({ })); interface ConstraintSingleValueProps { - constraint: IConstraint | PlaygroundFeatureStrategyConstraintResult; + constraint: IConstraint | PlaygroundConstraintSchema; allowExpand: (shouldExpand: boolean) => void; } diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundConstraintItem/PlaygroundConstraintItem.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundConstraintItem/PlaygroundConstraintItem.tsx index 872b1e4d05..a94a22e1df 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundConstraintItem/PlaygroundConstraintItem.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundConstraintItem/PlaygroundConstraintItem.tsx @@ -2,7 +2,7 @@ import { Chip, Typography, useTheme } from '@mui/material'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { useStyles } from './PlaygroundConstraintItem.styles'; import StringTruncator from 'component/common/StringTruncator/StringTruncator'; -import { CancelOutlined } from "@mui/icons-material"; +import { CancelOutlined } from '@mui/icons-material'; interface IConstraintItemProps { value: string[]; diff --git a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundResultStrategyExecution/PlaygroundResultStrategyExecution.tsx b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundResultStrategyExecution/PlaygroundResultStrategyExecution.tsx index 890fee8487..41315c33b6 100644 --- a/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundResultStrategyExecution/PlaygroundResultStrategyExecution.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/PlaygroundResultFeatureStrategyList/PlaygroundResultStrategyList/PlaygroundResultFeatureStrategyItem/PlaygroundResultStrategyExecution/PlaygroundResultStrategyExecution.tsx @@ -19,9 +19,7 @@ import PercentageCircle from '../../../../../../../../common/PercentageCircle/Pe import StringTruncator from '../../../../../../../../common/StringTruncator/StringTruncator'; import { useStrategies } from '../../../../../../../../../hooks/api/getters/useStrategies/useStrategies'; import { PlaygroundConstraintItem } from '../PlaygroundConstraintItem/PlaygroundConstraintItem'; -import { - ConstraintItem -} from "../../../../../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/ConstraintItem/ConstraintItem"; +import { ConstraintItem } from '../../../../../../../../feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/ConstraintItem/ConstraintItem'; interface PlaygroundResultStrategyExecutionProps { strategyResult: PlaygroundStrategySchema; @@ -217,8 +215,9 @@ export const PlaygroundResultStrategyExecution = ({