From 69498b44f0ea372ad08313c82a23cf848efbded6 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 17 Jun 2022 14:04:28 +0200 Subject: [PATCH] Uniform refresh for old and new history panel Fixes https://github.com/galaxyproject/galaxy/issues/13731 --- .../History/adapters/HistoryPanelProxy.js | 3 ++- client/src/components/RuleCollectionBuilder.vue | 10 +++------- client/src/components/Tool/ToolForm.vue | 6 ++---- client/src/components/Upload/Collection.vue | 4 ++-- client/src/components/Upload/Composite.vue | 5 ++--- client/src/components/Upload/UploadBoxMixin.js | 6 ++---- client/src/utils/data.js | 15 ++++++++++----- 7 files changed, 23 insertions(+), 26 deletions(-) diff --git a/client/src/components/History/adapters/HistoryPanelProxy.js b/client/src/components/History/adapters/HistoryPanelProxy.js index 15ae565a61b..936b8bdb761 100644 --- a/client/src/components/History/adapters/HistoryPanelProxy.js +++ b/client/src/components/History/adapters/HistoryPanelProxy.js @@ -56,7 +56,8 @@ export class HistoryPanelProxy { watchHistory(); } refreshContents() { - // to be removed after disabling legacy history + // to be removed after disabling legacy history, present to provide uniform interface + // with History Panel Backbone View. } loadCurrentHistory() { store.dispatch("history/loadCurrentHistory"); diff --git a/client/src/components/RuleCollectionBuilder.vue b/client/src/components/RuleCollectionBuilder.vue index 64c0a1124c4..2ccd47ff1ce 100644 --- a/client/src/components/RuleCollectionBuilder.vue +++ b/client/src/components/RuleCollectionBuilder.vue @@ -572,6 +572,7 @@ import { getAppRoot } from "onload/loadConfig"; import { getGalaxyInstance } from "app"; import axios from "axios"; import _l from "utils/localization"; +import { refreshContentsWrapper } from "utils/data"; import HotTable from "@handsontable/vue"; import UploadUtils from "mvc/upload/upload-utils"; import JobStatesModel from "mvc/history/job-states-model"; @@ -1313,10 +1314,7 @@ export default { this.mapping.splice(index, 1); }, refreshAndWait(response) { - const Galaxy = getGalaxyInstance(); - if (Galaxy && Galaxy.currHistoryPanel) { - Galaxy.currHistoryPanel.refreshContents(); - } + refreshContentsWrapper(); this.waitOnJob(response); }, waitOnJob(response) { @@ -1332,9 +1330,7 @@ export default { "Unknown error encountered while running your upload job, this could be a server issue or a problem with the upload definition."; this.doFullJobCheck(jobId); } else { - const Galaxy = getGalaxyInstance(); - const history = Galaxy && Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model; - history.refresh && history.refresh(); + refreshContentsWrapper(); this.oncreate(); } }; diff --git a/client/src/components/Tool/ToolForm.vue b/client/src/components/Tool/ToolForm.vue index b236bf8329f..b62a8b10571 100644 --- a/client/src/components/Tool/ToolForm.vue +++ b/client/src/components/Tool/ToolForm.vue @@ -91,6 +91,7 @@ import { getGalaxyInstance } from "app"; import { getToolFormData, updateToolFormData, submitJob } from "./services"; import { allowCachedJobs } from "./utilities"; +import { refreshContentsWrapper } from "utils/data"; import ToolCard from "./ToolCard"; import ButtonSpinner from "components/Common/ButtonSpinner"; import CurrentUser from "components/providers/CurrentUser"; @@ -274,7 +275,6 @@ export default { return; } this.showExecuting = true; - const Galaxy = getGalaxyInstance(); const jobDef = { history_id: historyId, tool_id: this.formConfig.id, @@ -296,9 +296,7 @@ export default { submitJob(jobDef).then( (jobResponse) => { this.showExecuting = false; - if (Galaxy.currHistoryPanel) { - Galaxy.currHistoryPanel.refreshContents(); - } + refreshContentsWrapper(); if (jobResponse.produces_entry_points) { this.showEntryPoints = true; this.entryPoints = jobResponse.jobs; diff --git a/client/src/components/Upload/Collection.vue b/client/src/components/Upload/Collection.vue index 2bf7f590193..748000471b7 100644 --- a/client/src/components/Upload/Collection.vue +++ b/client/src/components/Upload/Collection.vue @@ -120,6 +120,7 @@ import _l from "utils/localization"; import _ from "underscore"; import { getGalaxyInstance } from "app"; +import { refreshContentsWrapper } from "utils/data"; import UploadRow from "mvc/upload/collection/collection-row"; import UploadBoxMixin from "./UploadBoxMixin"; import { uploadModelsToPayload } from "./helpers"; @@ -250,8 +251,7 @@ export default { const outputs = incoming.outputs || incoming.data.outputs || {}; it.set({ percentage: 100, status: "success", outputs }); this._updateStateForSuccess(it); - const Galaxy = getGalaxyInstance(); - Galaxy.currHistoryPanel.refreshContents(); + refreshContentsWrapper(); }, _eventBuild: function () { diff --git a/client/src/components/Upload/Composite.vue b/client/src/components/Upload/Composite.vue index eeb1b58ef9c..fc8329ad95c 100644 --- a/client/src/components/Upload/Composite.vue +++ b/client/src/components/Upload/Composite.vue @@ -61,7 +61,7 @@