From 4545bc4cef59253315372b363988cfcf5662ac75 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 19 Jan 2024 10:53:58 +0400 Subject: [PATCH] Chore: add detection results --- .../ChangeRequest/Changes/Change/StrategyChange.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx index da411b101d55..673f5f66ce7e 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx @@ -17,6 +17,8 @@ import { Badge } from 'component/common/Badge/Badge'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { flexRow } from 'themes/themeStyles'; import { EnvironmentVariantsTable } from 'component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable'; +import { useUiFlag } from 'hooks/useUiFlag'; +import { getChangesThatWouldBeOverwritten } from './strategy-change-diff-calculation'; export const ChangeItemWrapper = styled(Box)({ display: 'flex', @@ -120,6 +122,7 @@ export const StrategyChange: VFC<{ featureName: string; projectId: string; }> = ({ actions, change, featureName, environmentName, projectId }) => { + const checkForChanges = useUiFlag('changeRequestConflictHandling'); const currentStrategy = useCurrentStrategy( change, projectId, @@ -137,6 +140,14 @@ export const StrategyChange: VFC<{ isStrategyAction && hasDiff(currentStrategy?.variants || [], change.payload.variants || []); + const changesThatWouldBeOverwritten = + checkForChanges && change.action === 'updateStrategy' + ? getChangesThatWouldBeOverwritten({ + currentStrategyConfig: currentStrategy, + change, + }) + : null; + return ( <> {change.action === 'addStrategy' && (