diff --git a/ui/src/app/applications/components/application-parameters/application-parameters.tsx b/ui/src/app/applications/components/application-parameters/application-parameters.tsx index 3028c3a13725c..28698c8eda79f 100644 --- a/ui/src/app/applications/components/application-parameters/application-parameters.tsx +++ b/ui/src/app/applications/components/application-parameters/application-parameters.tsx @@ -189,10 +189,10 @@ export const ApplicationParameters = (props: { } else { const v: models.ApplicationSource[] = new Array(); v.push(app.spec.source); - return getEditablePanel(attributes, props.details, 0, v); + return getEditablePanel(attributes, props.details, 0, v, true); } - function getEditablePanel(panel: EditablePanelItem[], repoAppDetails: models.RepoAppDetails, ind: number, sources: models.ApplicationSource[]): any { + function getEditablePanel(panel: EditablePanelItem[], repoAppDetails: models.RepoAppDetails, ind: number, sources: models.ApplicationSource[], isSingleSource?: boolean): any { const src: models.ApplicationSource = sources[ind]; let descriptionCollapsed: string; let floatingTitle: string; @@ -230,6 +230,8 @@ export const ApplicationParameters = (props: { save={ props.save && (async (input: models.Application) => { + const updatedSrc = isSingleSource ? input.spec.source : input.spec.sources[ind]; + function isDefined(item: any) { return item !== null && item !== undefined; } @@ -237,11 +239,11 @@ export const ApplicationParameters = (props: { return item !== null && item !== undefined && item.match(/:/); } - if (src.helm && src.helm.parameters) { - src.helm.parameters = src.helm.parameters.filter(isDefined); + if (updatedSrc.helm && updatedSrc.helm.parameters) { + updatedSrc.helm.parameters = updatedSrc.helm.parameters.filter(isDefined); } - if (src.kustomize && src.kustomize.images) { - src.kustomize.images = src.kustomize.images.filter(isDefinedWithVersion); + if (updatedSrc.kustomize && updatedSrc.kustomize.images) { + updatedSrc.kustomize.images = updatedSrc.kustomize.images.filter(isDefinedWithVersion); } let params = input.spec?.source?.plugin?.parameters;