From 68ac095dd6121f122b3b14c88d75b5798dfebb92 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 20 Jun 2024 10:38:46 -0400 Subject: [PATCH] [ALS-6434] Use RECOVER for Open Access tour Dynamic tour tag Add open access search box text Add searchBoxTourId Add isOpenAccess to search view hbs Fix open access tour not respecting order Add new recover message to tour modal Update default tour search term --- .../webapp/picsureui/search-interface/guide-me.json | 4 ++++ .../search-interface/search-results-view.js | 3 ++- .../picsureui/search-interface/search-view.hbs | 2 +- .../webapp/picsureui/search-interface/search-view.js | 12 ++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/guide-me.json b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/guide-me.json index 944845e6..1b423d27 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/guide-me.json +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/guide-me.json @@ -3,6 +3,10 @@ "text": "Search clinical variables of interest. Here, a study you are authorized to access was searched. Click anywhere to continue the tour.", "position": "bottom" }, + "#search-box-open": { + "text": "Search clinical variables of interest. Here, the term “RECOVER” was used to get all RECOVER-related results. Click anywhere to continue the tour.", + "position": "bottom" + }, "#genomic-filter-btn": { "text": "Use the genomic filtering button to apply a filter using genomic information." }, diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js index 8699a8e0..267bc40d 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-results-view.js @@ -477,7 +477,8 @@ define(["backbone", "handlebars", "underscore", "text!search-interface/search-re let exportTitleText = "Click to add this variable to your data retrieval."; let tourAttr; if (row.result_index == 0) { - tourAttr = isOpenAccess ? ' data-intro="#open-actions-row"' : ' data-intro="#authorized-actions-row"' + ' data-sequence="6" id="first-actions-row"'; + tourAttr = isOpenAccess ? ' data-intro="#open-actions-row"' : ' data-intro="#authorized-actions-row"'; + tourAttr += ' data-sequence="6" id="first-actions-row"'; } let iconHtml = tourAttr ? '' : ''; diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.hbs b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.hbs index 65be3b02..2c0d17fc 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.hbs +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.hbs @@ -88,7 +88,7 @@ title="Type search terms here, use enter or the search button to submit search" placeholder="Search studies or variables" onsubmit="return false" - data-intro="#search-box" + data-intro="{{searchBoxTourId}}" data-sequence="1" required> diff --git a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.js b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.js index 7db43372..f1bb95e2 100644 --- a/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.js +++ b/biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/search-view.js @@ -45,8 +45,7 @@ define(["jquery", "backbone", "handlebars", "underscore", "search-interface/tag- //only include each tag once this.antiScopeTags = searchUtil.getAntiScopeTags(); - // Tour search term, use epilepsy by default because it is available in both open and authorized access - this.tourSearchTerm = opts.tourSearchTerm ?? "epilepsy"; + this.tourSearchTerm = opts.tourSearchTerm ?? "RECOVER"; this.render(); this.subviews(); @@ -107,12 +106,15 @@ define(["jquery", "backbone", "handlebars", "underscore", "search-interface/tag- ]; let title = 'Welcome to PIC-SURE Authorized Access'; let message1 = 'PIC-SURE Authorized Access provides access to complete, participant-level data, in addition to aggregate counts, and access to the Tool Suite.'; + let message2 = ''; if (this.isOpenAccess) { title = 'Welcome to PIC-SURE Open Access'; message1 = 'PIC-SURE Open Access allows you to search any clinical variable available in PIC-SURE. Your queries will return obfuscated aggregate counts per study and consent.'; + message2 = 'This tour uses the Researching COVID to Enhance Recovery (RECOVER) dataset as an example. The RECOVER initiative is focused on understanding, diagnosing, treating, and preventing Long COVID.'; } const modalMessages = [ message1, + message2, 'Once the tour starts you can click anywhere to go to the next step. You can press the escape key to stop the tour at any point. You may also use the arrow keys, enter key, or the spacebar to navigate the tour.' ]; const dialogView = new dialog({options: dialogOptions, messages: modalMessages}); @@ -272,8 +274,10 @@ define(["jquery", "backbone", "handlebars", "underscore", "search-interface/tag- Backbone.View.prototype.remove.call(this); }, render: function () { - this.$el.html(this.searchViewTemplate({genomicFilteringEnabled: this.state.hasGenomicData})); - if (JSON.parse(sessionStorage.getItem('isOpenAccess'))) { + const isOpenAccess = JSON.parse(sessionStorage.getItem('isOpenAccess')); + const searchBoxTourId = isOpenAccess ? "#search-box-open" : "#search-box"; + this.$el.html(this.searchViewTemplate({genomicFilteringEnabled: this.state.hasGenomicData, searchBoxTourId: searchBoxTourId})); + if (isOpenAccess) { this.$el.find('#genomic-filter-btn').remove(); } $('#search-box').focus();