This is an automated email from the ASF dual-hosted git repository.

davidjumani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit f957457c05ef775bcaead5218d31413d876a2bf6
Merge: 8e0e5ac b3dca8c
Author: davidjumani <[email protected]>
AuthorDate: Fri Aug 27 15:39:16 2021 +0530

    Merge remote-tracking branch 'apache/4.15' into main

 ui/src/utils/plugins.js      | 8 ++++++--
 ui/src/views/AutogenView.vue | 9 +++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --cc ui/src/utils/plugins.js
index 3101f55,1f621be..947052c
--- a/ui/src/utils/plugins.js
+++ b/ui/src/utils/plugins.js
@@@ -123,11 -117,15 +123,15 @@@ export const pollJobPlugin = 
            store.dispatch('AddHeaderNotice', {
              key: jobId,
              title: title,
 -            description: desc,
 +            description: description,
              status: 'failed',
 -            duration: 0
 +            duration: 2
            })
-           if (!action || !('isFetchData' in action) || (action.isFetchData)) {
+ 
+           // Ensure we refresh on the same / parent page
+           const currentPage = this.$router.currentRoute.path
+           const samePage = options.originalPage === currentPage || 
options.originalPage.startsWith(currentPage + '/')
+           if (samePage && (!action || !('isFetchData' in action) || 
(action.isFetchData))) {
              eventBus.$emit('async-job-complete', action)
            }
            errorMethod(result)
diff --cc ui/src/views/AutogenView.vue
index 6540873,0ad9568..3ef981a
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@@ -1020,8 -861,10 +1020,10 @@@ export default 
        }).then(function () {
        })
      },
 -    pollActionCompletion (jobId, action, resourceName, showLoading = true) {
 +    pollActionCompletion (jobId, action, resourceName, resource, showLoading 
= true) {
-       eventBus.$emit('update-job-details', jobId, resource)
+       if (this.shouldNavigateBack(action)) {
+         action.isFetchData = false
+       }
        return new Promise((resolve) => {
          this.$pollJob({
            jobId,
@@@ -1269,15 -1063,9 +1271,15 @@@
            args = [action.api, params]
          }
          api(...args).then(json => {
 -          this.handleResponse(json, resourceName, action).then(jobId => {
 +          var response = this.handleResponse(json, resourceName, 
this.getDataIdentifier(params), action)
 +          if (!response) {
 +            this.fetchData()
 +            this.closeAction()
 +            return
 +          }
 +          response.then(jobId => {
              hasJobId = jobId
-             if ((action.icon === 'delete' || ['archiveEvents', 
'archiveAlerts', 'unmanageVirtualMachine'].includes(action.api)) && 
this.dataView) {
+             if (this.shouldNavigateBack(action)) {
                this.$router.go(-1)
              } else {
                if (!hasJobId) {

Reply via email to