diff --git a/app/kubernetes/views/applications/create/createApplication.html b/app/kubernetes/views/applications/create/createApplication.html index 57a787ffa..0efd94e0f 100644 --- a/app/kubernetes/views/applications/create/createApplication.html +++ b/app/kubernetes/views/applications/create/createApplication.html @@ -135,11 +135,11 @@ class="btn btn-sm btn-primary" ng-click="ctrl.updateApplicationViaWebEditor()" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.CONTENT || ctrl.state.updateWebEditorInProgress" - ng-disabled="!kubernetesApplicationCreationForm.$valid || !ctrl.state.isEditorDirty || ctrl.state.updateWebEditorInProgress" + ng-disabled="ctrl.isUpdateApplicationViaWebEditorButtonDisabled() || !kubernetesApplicationCreationForm.$valid" style="margin-top: 7px; margin-left: 0" button-spinner="ctrl.state.updateWebEditorInProgress" > - Update the application + Update application Update in progress... @@ -403,7 +403,7 @@ class="btn btn-sm btn-primary" ng-click="ctrl.updateApplicationViaWebEditor()" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.CONTENT || ctrl.state.updateWebEditorInProgress" - ng-disabled="!kubernetesApplicationCreationForm.$valid || !ctrl.state.isEditorDirty || ctrl.state.updateWebEditorInProgress" + ng-disabled="ctrl.isUpdateApplicationViaWebEditorButtonDisabled() || !kubernetesApplicationCreationForm.$valid" style="margin-top: 7px; margin-left: 0" button-spinner="ctrl.state.updateWebEditorInProgress" > diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index c9e34a36b..408c7e446 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -38,6 +38,7 @@ class KubernetesCreateApplicationController { $async, $state, $timeout, + $window, Notifications, Authentication, KubernetesResourcePoolService, @@ -58,6 +59,7 @@ class KubernetesCreateApplicationController { this.$async = $async; this.$state = $state; this.$timeout = $timeout; + this.$window = $window; this.Notifications = Notifications; this.Authentication = Authentication; this.KubernetesResourcePoolService = KubernetesResourcePoolService; @@ -157,6 +159,7 @@ class KubernetesCreateApplicationController { this.refreshReactComponent = this.refreshReactComponent.bind(this); this.onChangeNamespaceName = this.onChangeNamespaceName.bind(this); this.canSupportSharedAccess = this.canSupportSharedAccess.bind(this); + this.isUpdateApplicationViaWebEditorButtonDisabled = this.isUpdateApplicationViaWebEditorButtonDisabled.bind(this); this.$scope.$watch( () => this.formValues, @@ -255,7 +258,7 @@ class KubernetesCreateApplicationController { { stackFile: this.stackFileContent, stackName: this.formValues.StackName } ); this.state.isEditorDirty = false; - await this.$state.reload(this.$state.current); + this.$window.location.reload(); } catch (err) { this.Notifications.error('Failure', err, 'Failed redeploying application'); } finally { @@ -643,6 +646,10 @@ class KubernetesCreateApplicationController { return overflow || autoScalerOverflow || inProgress || invalid || hasNoChanges || nonScalable; } + isUpdateApplicationViaWebEditorButtonDisabled() { + return (this.savedFormValues.StackName === this.formValues.StackName && !this.state.isEditorDirty) || this.state.updateWebEditorInProgress; + } + isExternalApplication() { if (this.application) { return KubernetesApplicationHelper.isExternalApplication(this.application);