From cf508065ecb8bc0aeff572fa5367dd51d89d0744 Mon Sep 17 00:00:00 2001 From: cong meng Date: Fri, 8 Jan 2021 12:51:27 +1300 Subject: [PATCH] fix(frontend): application edit page initializes the overridenKeyType of new added configuration key to NONE so that the user can select how to load it (#4548) (#4593) Co-authored-by: Simon Meng --- app/kubernetes/helpers/application/index.js | 5 ++++- app/kubernetes/models/application/formValues.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/kubernetes/helpers/application/index.js b/app/kubernetes/helpers/application/index.js index 3124f4247..daf993719 100644 --- a/app/kubernetes/helpers/application/index.js +++ b/app/kubernetes/helpers/application/index.js @@ -175,7 +175,10 @@ class KubernetesApplicationHelper { item.OverridenKeys = _.map(keys, (k) => { const fvKey = new KubernetesApplicationConfigurationFormValueOverridenKey(); fvKey.Key = k.Key; - if (index < k.EnvCount) { + if (!k.Count) { + // !k.Count indicates k.Key is new added to the configuration and has not been loaded to the application yet + fvKey.Type = KubernetesApplicationConfigurationFormValueOverridenKeyTypes.NONE; + } else if (index < k.EnvCount) { fvKey.Type = KubernetesApplicationConfigurationFormValueOverridenKeyTypes.ENVIRONMENT; } else { fvKey.Type = KubernetesApplicationConfigurationFormValueOverridenKeyTypes.FILESYSTEM; diff --git a/app/kubernetes/models/application/formValues.js b/app/kubernetes/models/application/formValues.js index 1f1df1197..12d6151c3 100644 --- a/app/kubernetes/models/application/formValues.js +++ b/app/kubernetes/models/application/formValues.js @@ -35,6 +35,7 @@ export class KubernetesApplicationFormValues { } export const KubernetesApplicationConfigurationFormValueOverridenKeyTypes = Object.freeze({ + NONE: 0, ENVIRONMENT: 1, FILESYSTEM: 2, });