Skip to content

Commit

Permalink
Chore: add detection results
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Jan 19, 2024
1 parent c31ca2a commit 4545bc4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand All @@ -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' && (
Expand Down

0 comments on commit 4545bc4

Please sign in to comment.