From dab53cd90a789a89290d07b1ec406abf545c84a4 Mon Sep 17 00:00:00 2001 From: hujambo-dunia Date: Wed, 26 Apr 2023 13:43:58 -0400 Subject: [PATCH 1/3] Fix for missing Href to Composables pass-through component --- client/src/components/Toast.js | 3 ++- client/src/composables/toast.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/src/components/Toast.js b/client/src/components/Toast.js index 07a672a5fb38..20a3e2d589b7 100644 --- a/client/src/components/Toast.js +++ b/client/src/components/Toast.js @@ -1,9 +1,10 @@ export default { methods: { - showToast(message, title, variant) { + showToast(message, title, variant, href) { this.$bvToast.toast(message, { variant, title, + href, toaster: "b-toaster-bottom-right", append: true, solid: true, diff --git a/client/src/composables/toast.ts b/client/src/composables/toast.ts index 218563a704ea..a3ec0a2f997f 100644 --- a/client/src/composables/toast.ts +++ b/client/src/composables/toast.ts @@ -17,20 +17,20 @@ export const setToastComponentRef = (newRef: typeof toastRef) => { * Use 'useToast' for the Composition Api instead. */ export const Toast = { - success(message: string, title = "Success") { - toastRef.value?.showToast(message, title, "success"); + success(message: string, title = "Success", href = "") { + toastRef.value?.showToast(message, title, "success", href); }, - info(message: string, title = "Info") { - toastRef.value?.showToast(message, title, "info"); + info(message: string, title = "Info", href = "") { + toastRef.value?.showToast(message, title, "info", href); }, - warning(message: string, title = "Warning") { - toastRef.value?.showToast(message, title, "warning"); + warning(message: string, title = "Warning", href = "") { + toastRef.value?.showToast(message, title, "warning", href); }, - error(message: string, title = "Error") { - toastRef.value?.showToast(message, title, "danger"); + error(message: string, title = "Error", href = "") { + toastRef.value?.showToast(message, title, "danger", href); }, }; From 9260c8252a45597abc0f6b25731f50795b38119b Mon Sep 17 00:00:00 2001 From: hujambo-dunia Date: Wed, 26 Apr 2023 14:42:38 -0400 Subject: [PATCH 2/3] Fix for link pop-up window/toaster after Data Library to History import --- .../import-to-history/import-dataset.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js index 127d9243e64d..488a773428d6 100644 --- a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js +++ b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js @@ -126,7 +126,7 @@ var ImportDatasetModal = Backbone.View.extend({ // set the used history as current so user will see the last one // that he imported into in the history panel on the 'analysis' page $.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`); - this.chainCallImportingIntoHistory(items_to_import, history_name); + this.chainCallImportingIntoHistory(items_to_import, history_name, history_id); }, initChainCallControlToHistory: function (options) { @@ -147,27 +147,23 @@ var ImportDatasetModal = Backbone.View.extend({ * @param {array} history_item_set array of empty history items * @param {str} history_name name of the history to import to */ - chainCallImportingIntoHistory: function (history_item_set, history_name) { + chainCallImportingIntoHistory: function (history_item_set, history_name, history_id) { const Galaxy = getGalaxyInstance(); var popped_item = history_item_set.pop(); if (typeof popped_item == "undefined") { if (this.options.chain_call_control.failed_number === 0) { - Toast.success("Selected datasets imported into history. Click this to start analyzing it.", "", { - onclick: () => { - window.location = getAppRoot(); - }, - }); + Toast.success( + "Selected datasets imported into history. Click this to start analyzing it.", + "", + `${getAppRoot()}histories/view?id=${history_id}` + ); } else if (this.options.chain_call_control.failed_number === this.options.chain_call_control.total_number) { Toast.error("There was an error and no datasets were imported into history."); } else if (this.options.chain_call_control.failed_number < this.options.chain_call_control.total_number) { Toast.warning( "Some of the datasets could not be imported into history. Click this to see what was imported.", "", - { - onclick: () => { - window.location = getAppRoot(); - }, - } + `${getAppRoot()}histories/view?id=${history_id}` ); } Galaxy.modal.hide(); From c3e5f0cca70b59f3111679fecc4a1c7870e47339 Mon Sep 17 00:00:00 2001 From: Dannon Date: Thu, 27 Apr 2023 08:36:07 -0400 Subject: [PATCH 3/3] Update client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js Co-authored-by: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> --- .../TopToolbar/import-to-history/import-dataset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js index 488a773428d6..f9f885763378 100644 --- a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js +++ b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset.js @@ -153,8 +153,8 @@ var ImportDatasetModal = Backbone.View.extend({ if (typeof popped_item == "undefined") { if (this.options.chain_call_control.failed_number === 0) { Toast.success( - "Selected datasets imported into history. Click this to start analyzing it.", - "", + "Click here to start analyzing it.", + "Selected datasets imported into history", `${getAppRoot()}histories/view?id=${history_id}` ); } else if (this.options.chain_call_control.failed_number === this.options.chain_call_control.total_number) {