From 9dd9ffdb3b9823d50ce010c4c3d6df467c2bd6d9 Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Tue, 14 May 2024 13:34:28 +1200 Subject: [PATCH] fix(app): redirect to app after edit [EE-6385] (#11772) Co-authored-by: testa113 --- .../applications/create/createApplicationController.js | 7 ++++++- .../kubernetes-redeploy-app-git-form.controller.js | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index c998d5e0a..eaeecf921 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -263,7 +263,12 @@ class KubernetesCreateApplicationController { { stackFile: this.stackFileContent, stackName: this.formValues.StackName } ); this.state.isEditorDirty = false; - this.$window.location.reload(); + this.Notifications.success('Success', 'Request to update application successfully submitted'); + this.$state.go( + 'kubernetes.applications.application', + { name: this.application.Name, namespace: this.application.ResourcePool, endpointId: this.endpoint.Id }, + { inherit: false } + ); } catch (err) { this.Notifications.error('Failure', err, 'Failed redeploying application'); } finally { diff --git a/app/portainer/components/forms/kubernetes-redeploy-app-git-form/kubernetes-redeploy-app-git-form.controller.js b/app/portainer/components/forms/kubernetes-redeploy-app-git-form/kubernetes-redeploy-app-git-form.controller.js index 9123401a5..5d30474ca 100644 --- a/app/portainer/components/forms/kubernetes-redeploy-app-git-form/kubernetes-redeploy-app-git-form.controller.js +++ b/app/portainer/components/forms/kubernetes-redeploy-app-git-form/kubernetes-redeploy-app-git-form.controller.js @@ -132,8 +132,8 @@ class KubernetesRedeployAppGitFormController { this.state.redeployInProgress = true; await this.StackService.updateKubeGit(this.stack.Id, this.stack.EndpointId, this.namespace, this.formValues); - this.Notifications.success('Success', 'Pulled and redeployed stack successfully'); - await this.$state.reload(); + this.Notifications.success('Success', 'Pulled and redeployed application successfully'); + this.$state.go('kubernetes.applications.application', { name: this.appName, namespace: this.namespace, endpointId: this.endpointId }, { inherit: false }); } catch (err) { this.Notifications.error('Failure', err, 'Failed redeploying application'); } finally { @@ -170,6 +170,8 @@ class KubernetesRedeployAppGitFormController { } $onInit() { + this.endpointId = this.$state.params.endpointId; + this.appName = this.$state.params.name; this.formValues.RefName = this.stack.GitConfig.ReferenceName; this.formValues.TLSSkipVerify = this.stack.GitConfig.TLSSkipVerify;