From e1c7079c81706bd068c616c67a70aa9bfda58278 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Tue, 2 Aug 2022 14:10:39 +1200 Subject: [PATCH] feat(ui): ui improvements create template EE-3628 (#7352) --- ...-create-custom-template-view.controller.js | 11 +++- .../kube-create-custom-template-view.html | 38 ++++++------ .../porAccessControlForm.html | 6 +- .../customTemplateCommonFields.html | 62 +++++++++---------- .../createCustomTemplateView.html | 2 +- app/react/components/buttons/AddButton.tsx | 1 + .../FileUpload/FileUploadField.tsx | 11 ++-- .../form-components/InputList/InputList.tsx | 12 ++-- ...ustomTemplatesVariablesDefinitionField.tsx | 2 +- 9 files changed, 75 insertions(+), 70 deletions(-) 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 4e48a2152..a966ff8cc 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 @@ -9,8 +9,8 @@ class KubeCreateCustomTemplateViewController { Object.assign(this, { $async, $state, Authentication, CustomTemplateService, FormValidator, ModalService, Notifications, ResourceControlService }); this.methodOptions = [ - buildOption('method_editor', 'fa fa-edit', 'Web editor', 'Use our Web editor', 'editor'), - buildOption('method_upload', 'fa fa-upload', 'Upload', 'Upload from your computer', 'upload'), + buildOption('method_editor', 'svg-custom', 'Web editor', 'Use our Web editor', 'editor'), + buildOption('method_upload', 'svg-upload', 'Upload', 'Upload from your computer', 'upload'), ]; this.templates = null; @@ -97,7 +97,12 @@ class KubeCreateCustomTemplateViewController { this.state.actionInProgress = true; try { - const customTemplate = await this.createCustomTemplateByMethod(method, this.formValues); + const formValues = { ...this.formValues, Variables: null }; + if (this.formValues.Variables.length > 0) { + formValues.Variables = JSON.stringify(this.formValues.Variables); + } + + const customTemplate = await this.createCustomTemplateByMethod(method, formValues); const accessControlData = this.formValues.AccessControlData; const userDetails = this.Authentication.getUserDetails(); 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 b4a0188dc..7db559ce0 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 @@ -11,23 +11,25 @@
Build method
- - -
Templates allow deploying any kind of Kubernetes resource (Deployment, Secret, ConfigMap...)
-
- You can get more information about Kubernetes file format in the - official documentation. -
-
-
+
+ + +

Templates allow deploying any kind of Kubernetes resource (Deployment, Secret, ConfigMap...)

+

+ You can get more information about Kubernetes file format in the + official documentation. +

+
+
+
You can upload a Manifest file from your computer. @@ -48,7 +50,7 @@