From 97a880e6c1cb1ec3245497abeb655b7738f84338 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 16 Jun 2022 08:32:41 +0300 Subject: [PATCH] feat(custom-templates): hide variables [EE-2602] (#7068) --- .../kube-create-custom-template-view.controller.js | 6 ++++++ .../kube-create-custom-template-view.html | 1 + .../kube-edit-custom-template-view.controller.js | 7 +++++++ .../kube-edit-custom-template-view.html | 1 + app/kubernetes/views/deploy/deploy.html | 2 +- app/kubernetes/views/deploy/deployController.js | 7 +++++++ app/portainer/feature-flags/feature-flags.service.ts | 1 + .../createCustomTemplateView.html | 1 + .../createCustomTemplateViewController.js | 7 +++++++ .../custom-templates-view/customTemplatesView.html | 1 + .../custom-templates-view/customTemplatesViewController.js | 7 +++++++ .../edit-custom-template-view/editCustomTemplateView.html | 1 + .../editCustomTemplateViewController.js | 7 +++++++ 13 files changed, 48 insertions(+), 1 deletion(-) diff --git a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js index a12cc34c5..4e48a2152 100644 --- a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js +++ b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.controller.js @@ -1,6 +1,7 @@ import { buildOption } from '@/portainer/components/BoxSelector'; import { AccessControlFormData } from '@/portainer/components/accessControlForm/porAccessControlFormModel'; import { getTemplateVariables, intersectVariables } from '@/react/portainer/custom-templates/components/utils'; +import { isBE } from '@/portainer/feature-flags/feature-flags.service'; class KubeCreateCustomTemplateViewController { /* @ngInject */ @@ -13,6 +14,7 @@ class KubeCreateCustomTemplateViewController { ]; this.templates = null; + this.isTemplateVariablesEnabled = isBE; this.state = { method: 'editor', @@ -53,6 +55,10 @@ class KubeCreateCustomTemplateViewController { } parseTemplate(templateStr) { + if (!this.isTemplateVariablesEnabled) { + return; + } + const variables = getTemplateVariables(templateStr); const isValid = !!variables; diff --git a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.html b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.html index da8e5d9dc..1707480c6 100644 --- a/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.html +++ b/app/kubernetes/custom-templates/kube-create-custom-template-view/kube-create-custom-template-view.html @@ -37,6 +37,7 @@ ; diff --git a/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateView.html b/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateView.html index bea6cdbcb..02ba30466 100644 --- a/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateView.html +++ b/app/portainer/views/custom-templates/create-custom-template-view/createCustomTemplateView.html @@ -108,6 +108,7 @@