Skip to content

Commit

Permalink
[ALS-6434] Use RECOVER for Open Access tour
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JamesPeck committed Jun 21, 2024
1 parent da96004 commit 68ac095
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? '<span class="search-result-icons row center"' + tourAttr + '>' : '<span class="search-result-icons row center">';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
<input class="btn bg-transparent reset-button" value="" accesskey="r" type="reset"></input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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});
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 68ac095

Please sign in to comment.