From d31982ed62df538e8d8ff16383eb86ecb499df86 Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Tue, 6 Feb 2024 13:26:54 -0500 Subject: [PATCH 1/2] Improve redirectModal message flexibility In the redirect-modal.js file, the headerMessage and message have been refactored to accept dynamic inputs from the calling method. Similarly, the footer.js has been modified to pass a custom message to the redirectModal. This enhancement increases flexibility and allows customized messages for different external links. --- .../main/webapp/picsureui/common/redirect-modal.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/common/redirect-modal.js b/biodatacatalyst-ui/src/main/webapp/picsureui/common/redirect-modal.js index 83382bbc..7e197599 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/common/redirect-modal.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/common/redirect-modal.js @@ -29,6 +29,8 @@ define([ return BB.View.extend({ initialize: function (opts) { this.data = opts || {}; + this.headerMessage = this.data.headerMessage ? this.data.headerMessage : "Leaving BDC-PIC-SURE"; + this.message = this.data.message && Array.isArray(this.data.message) ? this.data.message : ["This external website will be opened as a new tab in your browser.", "Are you sure you want to leave BDC-PIC-SURE?"]; }, render: function (sourceEvent, url = undefined) { let closeModal = function (e) { @@ -59,17 +61,11 @@ define([ } ]; - const modalMessage = [ - "This external website will be opened as a new tab in your browser.", - "Are you sure you want to leave BDC-PIC-SURE?" - ]; - - const modalContainerId = "modal-redirect"; const dialogView = new dialog({ options: dialogOption, - messages: modalMessage, + messages: this.message, modalContainerId: modalContainerId, }); @@ -78,7 +74,7 @@ define([ modal.displayModal( dialogView - , "Leaving BDC-PIC-SURE" + , this.headerMessage , () => { sourceEvent.target.focus(); } From a8e2b32351fa3c93e3524893f3ee27f83aa1b232 Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Tue, 6 Feb 2024 14:17:53 -0500 Subject: [PATCH 2/2] [ALS-5883] Allow optional override of download modal message --- .../src/main/webapp/picsureui/search-interface/package-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/package-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/package-view.js index 056f6818..6d77e599 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/package-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/package-view.js @@ -301,7 +301,7 @@ define([ $('.close')?.get(0).click(); }, classes: "btn btn-primary"} ]; - const message = 'You are transferring data through the BioData Catalyst security boundary which may or may not be supported by your Data Use Agreement(s), Limitation(s), or your Institutional Review Board policies and guidelines. As a BioData Catalyst user, you are solely responsible for adhering to the terms of these policies.'; + let message = settings?.downloadConfirmationMessage ?? 'You are transferring data through the BioData Catalyst security boundary which may or may not be supported by your Data Use Agreement(s), Limitation(s), or your Institutional Review Board policies and guidelines. As a BioData Catalyst user, you are solely responsible for adhering to the terms of these policies.'; const dialogView = new dialog({options: dialogOptions, messages: [message], previousView: {view: this, title: 'Review and Package Data', model: this.model}}); modal.displayModal(dialogView, 'Are you sure you want to download data?', function(){ $('#package-download-button').focus();