Skip to content

Commit

Permalink
Release/0006 (#262)
Browse files Browse the repository at this point in the history
- **[ALS-5339]** Create Data Hierarchy View (#256)
  - Initial creation of the Data Hierarchy View.

- **[ALS-5208]** Updates to Authorized BDC (#257)
  - Remove Open Access from Authorized BDC.
  - Remove the top panel from the Data Access Dashboard.

- **[ALS-5209]** Create Auth PIC-SURE Landing Page (#259)
  - Develop the authorized access landing page.

- **[ALS-5439]** Add Open Access Header (#258)
  - Implementation of the Open Access header.

- **[ALS-5379]** Bug Fixes and Improvements (#260)
  - Resolve actions and variable info modal bugs.
  - Update `biodatacatalyst-ui/src/main/webapp/picsureui/search-interface/filter-model.js`.
  - Address study mismatch issue.

- **[ALS-2794]** Enhancements to Cardiac Surgery Authorized Tour (#261)
  - Cardiac surgery now utilized for the Authorized tour.
  • Loading branch information
Gcolon021 authored Dec 8, 2023
1 parent c433619 commit 9c64ab3
Show file tree
Hide file tree
Showing 19 changed files with 1,077 additions and 780 deletions.
15 changes: 8 additions & 7 deletions biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@
}
</style>
<header id="top-header" class="space-out">
<img class="logo-img" src="{{logoPath}}" tabindex="0" title="BioData Catalyst Powered by PIC-SURE">
<a class="header-navigation" data-href="/picsureui/" href="#" tabindex="-1">
<img class="logo-img" src="{{logoPath}}" tabindex="0" title="BioData Catalyst Powered by PIC-SURE">
</a>
<nav id="header-tabs" class="nav-menu" role="navigation" aria-label="Main Navigation. You are on the main navigation of Pic-sure. Please use the arrow keys to navigate through the tabs. Use Enter or space to select the tab." tabindex="0">
{{#contains privileges 'FENCE_PRIV_OPEN_ACCESS'}}
<a class="header-btn header-navigation" data-href="/picsureui/dataAccess" href="#" id="data-access-btn" tabindex="-1" title="Explore" aria-label="Explore">Data Access Dashboard</a>
{{/contains}}
{{#contains privileges "FENCE_AUTHORIZED_ACCESS"}}
<a class="header-btn header-navigation" data-href="/picsureui/dataAccess" href="#" id="data-access-btn" tabindex="-1" title="Explore" aria-label="Explore">Data Access Dashboard</a>
<a class="header-btn authorized-access-visible header-navigation" data-href="/picsureui/queryBuilder" href="#" id="query-builder-btn" tabindex="-1" title="Authorized Access" aria-label="Authorized Access">Authorized Access</a>
{{/contains}}
{{#contains privileges 'FENCE_PRIV_OPEN_ACCESS'}}
<a class="header-btn header-navigation" data-href="/picsureui/openAccess#" href="#" id="open-access-btn" tabindex="-1" title="Open Access" aria-label="Open Access">Open Access</a>
<a class="header-btn header-navigation open-access-btn" id="open-access-btn"
tabindex="-1" title="Go to Open PIC-SURE"
href="https://openpicsure.biodatacatalyst.nhlbi.nih.gov/picsureui/"
aria-label="Go to Open Open PIC-SURE">Go to Open<br/> PIC-SURE</a>
<a id="api-btn" data-href="/picsureui/api" class="header-navigation header-btn authenticated-visible" href="#" tabindex="-1" title="API" aria-haspopup="true" aria-label="API">API</a>
<button data-intro="#help-header-button" data-sequence="14" class="dropdown-toggle nav-dropdown header-btn authenticated-visible" aria-expanded="false" id="help-dropdown-toggle" tabindex="-1" title="Help" aria-label="Help dropwdown" aria-controls="help-menu-list">
Help <i class="fa fa-caret-down" aria-hidden="true"></i>
Expand Down
148 changes: 148 additions & 0 deletions biodatacatalyst-ui/src/main/webapp/picsureui/landing/landing.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<style>
#main-content {
margin-top: unset;
padding-top: unset;
}
.landing-container {
width: 80%;
margin: 2% auto 0 auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
height: 75%;
}
.landing-nav-buttons {
display: flex;
flex-direction: row;
justify-content: space-around;
width: 80%;
}
.landing-anchor {
color: var(--catalyst-blue);
background-color: transparent;
text-decoration: none;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
.landing-anchor i {
font-size: 5rem;
padding-bottom: .3em;
margin: 0 auto;
text-decoration: none;
}
.landing-anchor p {
font-size: 1.6rem;
}
/* Grow landing anchor on hover */
.landing-anchor:hover {
transform: scale(1.1);
transition: transform .2s;
}
.landing-counts {
background: var(--catalyst-blue);
color: white;
border-radius: 8px;
display: flex;
flex-direction: row;
justify-content: space-around;
padding: 3rem 1rem;
width: 70%;
}
.landing-count {
display: flex;
flex-direction: column;
align-items: center;
font-size: 2.5rem;
font-weight: 100;
}
.search-container {
display: flex;
align-items: center;
margin-bottom: 2rem;
}
.search-container button {
margin-left: 1rem;
padding: .625rem 2.5rem;
border-radius: .625em;
}
#landingSearch {
flex-grow: 1;
padding: 1rem;
}
.search-container input {
padding: 10px;
width: 100%;
border: 1px solid #C2C2C2;
}
</style>
<div class="landing-container">
<div>
<div class="search-container">
<input type="text" placeholder="Search studies or variables" class="form-control" style="padding: 10px; width: 100%;"
id="landingSearchInput"/>
<button class="btn btn-primary" id="landingSearchButton">Search</button>
</div>
<div>
<p style="font-size: 1.3em"><i>NHLBI BioData Catalyst® Powered by PIC-SURE</i> can be used to explore studies, conduct feasibility tests, create cohorts,<br /> and select data at the variable-value and genomic variant level.</p>
</div>
</div>
<div class="landing-nav-buttons">
<a class="landing-anchor" href="/picsureui/queryBuilder" tabindex="0">
<div>
<i class="fa-solid fa-magnifying-glass-chart"></i>
<p>Search Variables,<br/> Build Cohorts, and<br /> Export Participant-<br/>Level Data in<br/> <b>Authorized Access</b></p>
</div>
</a>
<a class="landing-anchor" href="/picsureui/dataAccess" tabindex="0">
<div>
<i class="fa-solid fa-table-list"></i>
<p>Browse Your<br/>Access to<br/>Studies in<br/><b>Data Access<br/> Dashboard</b></p>
</div>
</a>
<a class="landing-anchor" href="https://biodatacatalyst.nhlbi.nih.gov/" target="_blank" tabindex="0">
<div>
<i class="fa-solid fa-graduation-cap"></i>
<p>Learn<br/> About the <br/><b>BDC Ecosystem</b></p>
</div>
</a>
<a href="https://openpicsure.biodatacatalyst.nhlbi.nih.gov/picsureui/" target="_blank" class="landing-anchor"
tabindex="0">
<div style="justify-content: center">
<i class="fa-solid fa-lock-open"></i>
<p>Discover and<br/> Explore All Studies in<br/><b>Open PIC-SURE</b></p>
</div>
</a>
</div>
<div class="landing-counts">
<div class="landing-count">
<div id="authorized-studies"></div>
<div id="authorized-studies-spinner">0</div>
<p>Available Studies</p>
</div>
<div class="landing-count">
<div id="authorized-participants"></div>
<div id="authorized-participants-spinner">0</div>
<p>Total Participants</p>
</div>
<div class="landing-count">
<div id="authorized-variables"></div>
<div id="authorized-variables-spinner">0</div>
<p>Total Variables</p>
</div>
</div>
</div>
106 changes: 106 additions & 0 deletions biodatacatalyst-ui/src/main/webapp/picsureui/landing/landing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
define(["underscore", "jquery", "backbone", "handlebars", "text!landing/landing.hbs", "picSure/search", "picSure/settings",
"picSure/queryBuilder", "common/spinner", "common/transportErrors", "studyAccess/study-utility",
"search-interface/search-util",],
function (_, $, BB, HBS, landingTemplate, search, settings, queryBuilder, spinner,
transportErrors, studyUtility, searchUtil) {
const landing = {
resources: {
auth: settings.picSureResourceId
}
};

return BB.View.extend({
initialize: function () {
this.template = HBS.compile(landingTemplate);
},
events: {
"click #landingSearchButton": "handleLandingSearch",
"keypress #landingSearchInput": "handleLandingSearchKeypress",
},
handleLandingSearchKeypress: function (event) {
if (event.keyCode === 13) {
this.handleLandingSearch(event);
}
},
handleLandingSearch: function (event) {
// Log the search event
let searchQuery = $("#landingSearchInput").val();

// encode the search query
searchQuery = encodeURIComponent(searchQuery);
sessionStorage.setItem("landingSearchQuery", searchQuery);

// Navigate to the explorer page
window.location.href = "/picsureui/queryBuilder";
},
render: function () {
// get counts for studies and participants
let records = studyUtility.groupRecordsByAccess();

// get counts for studies and participants
let temp = records.permitted.map((rec) => {
return rec.study_identifier;
});
temp = [...new Set(temp)];
let authStudiesCount = temp.length;

// query for participant counts of authorized and open access resources
let query = queryBuilder.createQueryNew({}, {}, landing.resources.auth);
query.query.expectedResultType = "COUNT";
queryBuilder.updateConsentFilters(query, settings);
let deferredParticipants = $.ajax({
url: window.location.origin + "/picsure/query/sync",
type: 'POST',
headers: {"Authorization": "Bearer " + JSON.parse(sessionStorage.getItem("session")).token},
contentType: 'application/json',
data: JSON.stringify(query),
success: (function (response) {
$("#authorized-participants").html(parseInt(response).toLocaleString());
$("#authorized-participants-spinner").html("");
$('#authorized-studies').html(authStudiesCount);
$('#authorized-studies-spinner').html("");
}).bind(this),
statusCode: {
401: function () {
}
},
error: function () {
$("#authorized-participants").html("0");
$("#authorized-participants-spinner").html("");
}
});

let excludedTags = searchUtil.getAntiScopeTags();
let deferredVariables = $.ajax({
url: window.location.origin + "/picsure/search/36363664-6231-6134-2D38-6538652D3131",
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"query": {
"searchTerm": "",
"includedTags": [],
"excludedTags": excludedTags,
"returnTags": false,
"limit": 1
}
}),
success: function (response) {
$("#authorized-variables").html(parseInt(response.results.numResults).toLocaleString());
$('#authorized-variables-spinner').html("");
},
error: function (response) {
console.log(response);
}
});

spinner.medium(deferredVariables, "#authorized-variables-spinner", "spinner2");
spinner.medium(deferredParticipants, "#authorized-participants-spinner", "spinner2");
spinner.medium(deferredParticipants, "#authorized-studies-spinner", "spinner2");

this.$el.html(this.template());
return this;
}
});
})
;

21 changes: 18 additions & 3 deletions biodatacatalyst-ui/src/main/webapp/picsureui/overrides/header.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
define([
"common/keyboard-nav",
"common/pic-dropdown",
"common/menu-nav-controls"
"common/menu-nav-controls",
"common/modal",
"common/redirect-modal"
],function (
keyboardNav,
dropdown,
menuNavControls,
modal,
redirectModal
) {

let headerTabs = undefined;
Expand Down Expand Up @@ -34,7 +38,14 @@ define([
if (!e.relatedTarget) {
dropdown.closeDropdown(e);
}
}
};

let goToOpen = function(event){
event.preventDefault();

let redirect = new redirectModal();
redirect.render(event);
};

return {
/*
Expand Down Expand Up @@ -64,10 +75,14 @@ define([
'keynav-end': menuNavControls.endKeyPressed,
'keynav-letters': menuNavControls.letterKeyPressed,
});

if (!keyboardNav.navigableViews || !keyboardNav.navigableViews['headerTabs']) {
keyboardNav.addNavigableView("headerTabs", view);
}

view.events['click #open-access-btn'] = goToOpen;

view.delegateEvents();
},
};
});
Loading

0 comments on commit 9c64ab3

Please sign in to comment.