1
0
mirror of https://github.com/Unleash/unleash.git synced 2026-01-05 20:06:22 +01:00

feat: skip safeguard cr confirmation dialogue (#11040)

This follows the same pattern we use for release plans in cr.


<img width="1519" height="618" alt="image"
src="https://github.com/user-attachments/assets/01ecbbd1-5991-4961-88ed-f3702f86dacf"
/>
This commit is contained in:
Jaanus Sellin 2025-11-28 09:24:11 +02:00 committed by GitHub
parent 9d7521672a
commit d1180f111f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -191,6 +191,7 @@ const ChangeSafeguard: FC<{
onCancel={() => {}}
safeguard={safeguard}
environment={environmentName}
skipConfirmation={true}
/>
)}
</TabPanel>
@ -271,6 +272,7 @@ const DeleteSafeguard: FC<{
onCancel={() => {}}
safeguard={safeguard}
environment={environmentName}
skipConfirmation={true}
/>
)}
</TabPanel>

View File

@ -51,6 +51,7 @@ interface ISafeguardFormProps {
onDelete?: () => void;
safeguard?: ISafeguard;
environment: string;
skipConfirmation?: boolean;
}
const getInitialValues = (safeguard?: ISafeguard) => ({
@ -87,6 +88,7 @@ export const SafeguardForm = ({
onDelete,
safeguard,
environment,
skipConfirmation = false,
}: ISafeguardFormProps) => {
const { metricOptions, loading } = useImpactMetricsOptions();
const projectId = useRequiredPathParam('projectId');
@ -211,7 +213,7 @@ export const SafeguardForm = ({
return;
}
if (isChangeRequestConfigured(environment)) {
if (isChangeRequestConfigured(environment) && !skipConfirmation) {
setDialogOpen(true);
return;
}