File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export const pollJobPlugin = {
9191 const currentPage = this . $router . currentRoute . path
9292 const samePage = options . originalPage === currentPage || options . originalPage . startsWith ( currentPage + '/' )
9393 if ( samePage && ( ! action || ! ( 'isFetchData' in action ) || ( action . isFetchData ) ) ) {
94- eventBus . $emit ( 'async-job-complete' )
94+ eventBus . $emit ( 'async-job-complete' , action )
9595 }
9696 successMethod ( result )
9797 } else if ( result . jobstatus === 2 ) {
@@ -121,8 +121,12 @@ export const pollJobPlugin = {
121121 status : 'failed' ,
122122 duration : 0
123123 } )
124- if ( ! action || ! ( 'isFetchData' in action ) || ( action . isFetchData ) ) {
125- eventBus . $emit ( 'async-job-complete' )
124+
125+ // Ensure we refresh on the same / parent page
126+ const currentPage = this . $router . currentRoute . path
127+ const samePage = options . originalPage === currentPage || options . originalPage . startsWith ( currentPage + '/' )
128+ if ( samePage && ( ! action || ! ( 'isFetchData' in action ) || ( action . isFetchData ) ) ) {
129+ eventBus . $emit ( 'async-job-complete' , action )
126130 }
127131 errorMethod ( result )
128132 } else if ( result . jobstatus === 0 ) {
Original file line number Diff line number Diff line change @@ -862,6 +862,9 @@ export default {
862862 })
863863 },
864864 pollActionCompletion (jobId , action , resourceName , showLoading = true ) {
865+ if (this .shouldNavigateBack (action)) {
866+ action .isFetchData = false
867+ }
865868 return new Promise ((resolve ) => {
866869 this .$pollJob ({
867870 jobId,
@@ -1062,7 +1065,7 @@ export default {
10621065 api (... args).then (json => {
10631066 this .handleResponse (json, resourceName, action).then (jobId => {
10641067 hasJobId = jobId
1065- if (( action . icon === ' delete ' || [ ' archiveEvents ' , ' archiveAlerts ' , ' unmanageVirtualMachine ' ]. includes (action . api )) && this . dataView ) {
1068+ if (this . shouldNavigateBack (action) ) {
10661069 this .$router .go (- 1 )
10671070 } else {
10681071 if (! hasJobId) {
@@ -1083,6 +1086,9 @@ export default {
10831086 })
10841087 })
10851088 },
1089+ shouldNavigateBack (action ) {
1090+ return ((action .icon === ' delete' || [' archiveEvents' , ' archiveAlerts' , ' unmanageVirtualMachine' ].includes (action .api )) && this .dataView )
1091+ },
10861092 changeFilter (filter ) {
10871093 const query = Object .assign ({}, this .$route .query )
10881094 delete query .templatefilter
You can’t perform that action at this time.
0 commit comments