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" class="btn btn-sm btn-primary"
ng-click="ctrl.updateApplicationViaWebEditor()" ng-click="ctrl.updateApplicationViaWebEditor()"
ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.CONTENT || ctrl.state.updateWebEditorInProgress" 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" style="margin-top: 7px; margin-left: 0"
button-spinner="ctrl.state.updateWebEditorInProgress" 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> <span ng-show="ctrl.state.updateWebEditorInProgress">Update in progress...</span>
</button> </button>
</div> </div>
@ -403,7 +403,7 @@
class="btn btn-sm btn-primary" class="btn btn-sm btn-primary"
ng-click="ctrl.updateApplicationViaWebEditor()" ng-click="ctrl.updateApplicationViaWebEditor()"
ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.CONTENT || ctrl.state.updateWebEditorInProgress" 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" style="margin-top: 7px; margin-left: 0"
button-spinner="ctrl.state.updateWebEditorInProgress" button-spinner="ctrl.state.updateWebEditorInProgress"
> >

@ -38,6 +38,7 @@ class KubernetesCreateApplicationController {
$async, $async,
$state, $state,
$timeout, $timeout,
$window,
Notifications, Notifications,
Authentication, Authentication,
KubernetesResourcePoolService, KubernetesResourcePoolService,
@ -58,6 +59,7 @@ class KubernetesCreateApplicationController {
this.$async = $async; this.$async = $async;
this.$state = $state; this.$state = $state;
this.$timeout = $timeout; this.$timeout = $timeout;
this.$window = $window;
this.Notifications = Notifications; this.Notifications = Notifications;
this.Authentication = Authentication; this.Authentication = Authentication;
this.KubernetesResourcePoolService = KubernetesResourcePoolService; this.KubernetesResourcePoolService = KubernetesResourcePoolService;
@ -157,6 +159,7 @@ class KubernetesCreateApplicationController {
this.refreshReactComponent = this.refreshReactComponent.bind(this); this.refreshReactComponent = this.refreshReactComponent.bind(this);
this.onChangeNamespaceName = this.onChangeNamespaceName.bind(this); this.onChangeNamespaceName = this.onChangeNamespaceName.bind(this);
this.canSupportSharedAccess = this.canSupportSharedAccess.bind(this); this.canSupportSharedAccess = this.canSupportSharedAccess.bind(this);
this.isUpdateApplicationViaWebEditorButtonDisabled = this.isUpdateApplicationViaWebEditorButtonDisabled.bind(this);
this.$scope.$watch( this.$scope.$watch(
() => this.formValues, () => this.formValues,
@ -255,7 +258,7 @@ class KubernetesCreateApplicationController {
{ stackFile: this.stackFileContent, stackName: this.formValues.StackName } { stackFile: this.stackFileContent, stackName: this.formValues.StackName }
); );
this.state.isEditorDirty = false; this.state.isEditorDirty = false;
await this.$state.reload(this.$state.current); this.$window.location.reload();
} catch (err) { } catch (err) {
this.Notifications.error('Failure', err, 'Failed redeploying application'); this.Notifications.error('Failure', err, 'Failed redeploying application');
} finally { } finally {
@ -643,6 +646,10 @@ class KubernetesCreateApplicationController {
return overflow || autoScalerOverflow || inProgress || invalid || hasNoChanges || nonScalable; return overflow || autoScalerOverflow || inProgress || invalid || hasNoChanges || nonScalable;
} }
isUpdateApplicationViaWebEditorButtonDisabled() {
return (this.savedFormValues.StackName === this.formValues.StackName && !this.state.isEditorDirty) || this.state.updateWebEditorInProgress;
}
isExternalApplication() { isExternalApplication() {
if (this.application) { if (this.application) {
return KubernetesApplicationHelper.isExternalApplication(this.application); return KubernetesApplicationHelper.isExternalApplication(this.application);

Loading…
Cancel
Save