Skip to content

Commit 4aac2aa

Browse files
chore: enable the exact same change components as normal update strategies (#11486)
Removes any special treatment of milestone strategies in the change request change item. Milestone strategies can also be disabled, so might as well allow showing the same kind of content for that.
1 parent 6890c2b commit 4aac2aa

1 file changed

Lines changed: 18 additions & 30 deletions

File tree

frontend/src/component/changeRequest/ChangeRequest/Changes/Change/StrategyChange.tsx

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type {
1313
} from 'component/changeRequest/changeRequest.types';
1414
import { useCurrentStrategy } from './hooks/useCurrentStrategy.ts';
1515
import { Badge } from 'component/common/Badge/Badge';
16-
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
1716
import { flexRow } from 'themes/themeStyles';
1817
import { EnvironmentVariantsTable } from 'component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsCard/EnvironmentVariantsTable/EnvironmentVariantsTable';
1918
import { ChangeOverwriteWarning } from './ChangeOverwriteWarning/ChangeOverwriteWarning.tsx';
@@ -173,42 +172,31 @@ const UpdateStrategy: FC<{
173172
/>
174173
<ChangeItemWrapper>
175174
<ChangeItemInfo>
176-
{change.action === 'updateMilestoneStrategy' ? (
177-
<Action>Editing strategy</Action>
178-
) : (
179-
<EditHeader
180-
wasDisabled={currentStrategy?.disabled}
181-
willBeDisabled={change.payload?.disabled}
182-
/>
183-
)}
175+
<EditHeader
176+
wasDisabled={currentStrategy?.disabled}
177+
willBeDisabled={change.payload?.disabled}
178+
/>
184179
<NameWithChangeInfo
185180
newName={change.payload.title}
186181
previousName={previousTitle}
187182
/>
188183
</ChangeItemInfo>
189184
{actions}
190185
</ChangeItemWrapper>
191-
{change.action === 'updateStrategy' && (
192-
<ConditionallyRender
193-
condition={
194-
change.payload?.disabled !== currentStrategy?.disabled
195-
}
196-
show={
197-
<Typography
198-
sx={{
199-
marginTop: (theme) => theme.spacing(2),
200-
marginBottom: (theme) => theme.spacing(2),
201-
...flexRow,
202-
gap: (theme) => theme.spacing(1),
203-
}}
204-
>
205-
This strategy will be{' '}
206-
<DisabledEnabledState
207-
disabled={change.payload?.disabled || false}
208-
/>
209-
</Typography>
210-
}
211-
/>
186+
{change.payload?.disabled !== currentStrategy?.disabled && (
187+
<Typography
188+
sx={{
189+
marginTop: (theme) => theme.spacing(2),
190+
marginBottom: (theme) => theme.spacing(2),
191+
...flexRow,
192+
gap: (theme) => theme.spacing(1),
193+
}}
194+
>
195+
This strategy will be{' '}
196+
<DisabledEnabledState
197+
disabled={change.payload?.disabled || false}
198+
/>
199+
</Typography>
212200
)}
213201

214202
<TabPanel>

0 commit comments

Comments
 (0)