From 93593e13797635eeb5762f8d7011230ce9a5f6af Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:56:10 +1300 Subject: [PATCH] fix(ui): update button disabled when manisfest reverted to the orignial content [EE-6544] (#10968) --- .../applications/create/createApplicationController.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index 9db29fb5d..24dad0f70 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -218,10 +218,12 @@ class KubernetesCreateApplicationController { onChangeFileContent(value) { this.$scope.$evalAsync(() => { - if (this.stackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== value.replace(/(\r\n|\n|\r)/gm, '')) { + if (this.oldStackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== value.replace(/(\r\n|\n|\r)/gm, '')) { this.state.isEditorDirty = true; - this.stackFileContent = value; + } else { + this.state.isEditorDirty = false; } + this.stackFileContent = value; }); } @@ -1060,6 +1062,7 @@ class KubernetesCreateApplicationController { this.stack = await this.StackService.stack(this.application.StackId); if (this.state.appType === KubernetesDeploymentTypes.CONTENT) { this.stackFileContent = await this.StackService.getStackFile(this.application.StackId); + this.oldStackFileContent = this.stackFileContent; } } }