fix stack name update issue (#11064)

pull/11088/head
Prabhat Khera 10 months ago committed by GitHub
parent f4db09a534
commit 4c00b72ae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"
>
<span ng-show="!ctrl.state.updateWebEditorInProgress">Update the application</span>
<span ng-show="!ctrl.state.updateWebEditorInProgress">Update application</span>
<span ng-show="ctrl.state.updateWebEditorInProgress">Update in progress...</span>
</button>
</div>
@ -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"
>

@ -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);

Loading…
Cancel
Save