diff --git a/ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx b/ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx index 293e34d2a6873..6bf9190122b4e 100644 --- a/ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx +++ b/ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx @@ -7,14 +7,7 @@ import {Consumer} from '../../../shared/context'; import * as models from '../../../shared/models'; import {services} from '../../../shared/services'; import {ApplicationRetryOptions} from '../application-retry-options/application-retry-options'; -import { - ApplicationManualSyncFlags, - ApplicationSyncOptions, - FORCE_WARNING, - SyncFlags, - REPLACE_WARNING, - PRUNE_WARNING -} from '../application-sync-options/application-sync-options'; +import {ApplicationManualSyncFlags, ApplicationSyncOptions, FORCE_WARNING, SyncFlags, REPLACE_WARNING, PRUNE_WARNING} from '../application-sync-options/application-sync-options'; import {ComparisonStatusIcon, getAppDefaultSource, nodeKey} from '../utils'; import './application-sync-panel.scss'; @@ -65,6 +58,24 @@ export const ApplicationSyncPanel = ({application, selectedResource, hide}: {app onSubmit={async (params: any) => { setPending(true); let resources = appResources.filter((_, i) => params.resources[i]); + + const syncFlags = {...params.syncFlags} as SyncFlags; + const prune = syncFlags.Prune || false; + const requiresPrune = resources.filter(resource => resource?.requiresPruning === true); + + if (prune && appResources.length === requiresPrune.length) { + const confirmed = await ctx.popup.confirm('Synchronize with prune?', () => ( +