mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-27 13:49:10 +02:00
chore: mark CRs where we'd overwrite strategies
This commit is contained in:
parent
f274904ce6
commit
b999df8a25
@ -1,8 +1,10 @@
|
||||
import { Box, styled } from '@mui/material';
|
||||
import { IChangeRequestUpdateStrategy } from 'component/changeRequest/changeRequest.types';
|
||||
import { useChangeRequestPlausibleContext } from 'component/changeRequest/ChangeRequestContext';
|
||||
import { useUiFlag } from 'hooks/useUiFlag';
|
||||
import { IFeatureStrategy } from 'interfaces/strategy';
|
||||
import { getChangesThatWouldBeOverwritten } from './strategy-change-diff-calculation';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const ChangesToOverwriteWarning = styled(Box)(({ theme }) => ({
|
||||
color: theme.palette.warning.dark,
|
||||
@ -76,6 +78,13 @@ export const ChangesToOverwrite: React.FC<{
|
||||
const changesThatWouldBeOverwritten = checkForChanges
|
||||
? getChangesThatWouldBeOverwritten(currentStrategy, change)
|
||||
: null;
|
||||
const { registerWillOverwriteStrategyChanges } =
|
||||
useChangeRequestPlausibleContext();
|
||||
useEffect(() => {
|
||||
if (changesThatWouldBeOverwritten) {
|
||||
registerWillOverwriteStrategyChanges();
|
||||
}
|
||||
}, [changesThatWouldBeOverwritten]);
|
||||
|
||||
if (!changesThatWouldBeOverwritten) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user