-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ALS-5208] Remove Open Access from Authorized BDC (#257)
* [ALS-5208] Remove Open Access from Authorized BDC * [ALS-5208] Remove top panel from Data Access Dashboard
- Loading branch information
Showing
5 changed files
with
84 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/study-utility.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
define(["jquery", "backbone", "handlebars", "text!studyAccess/studies-data.json"], | ||
function ($, bb, hbs, studyAccessConfiguration) { | ||
function getStudyAccessConfiguration() { | ||
return JSON.parse(studyAccessConfiguration); | ||
} | ||
|
||
function groupRecordsByAccess() { | ||
// extract the consent identifiers from the query template | ||
let session = JSON.parse(sessionStorage.getItem("session")); | ||
let validConsents = []; | ||
if (session.queryTemplate) { | ||
let temp = JSON.parse(session.queryTemplate); | ||
|
||
if (temp && temp.categoryFilters && temp.categoryFilters["\\_consents\\"]) { | ||
validConsents = temp.categoryFilters["\\_consents\\"]; | ||
} | ||
} | ||
|
||
// process the study data into permission granted or not groups | ||
let records = { | ||
permitted: [], | ||
denied: [], | ||
na: [] | ||
}; | ||
let configurationData = JSON.parse(studyAccessConfiguration); | ||
for (let groupid in configurationData) { | ||
for (idx = 0; idx < configurationData[groupid].length; idx++) { | ||
// determine if logged in user is permmited access | ||
let tmpStudy = configurationData[groupid][idx]; | ||
const cvc = parseInt(tmpStudy["clinical_variable_count"]).toLocaleString(); | ||
tmpStudy["clinical_variable_count"] = cvc == '-1' || cvc == 'NaN' ? 'N/A' : cvc; | ||
const css = parseInt(tmpStudy["clinical_sample_size"]).toLocaleString(); | ||
tmpStudy["clinical_sample_size"] = css == '-1' || cvc == 'NaN' ? 'N/A' : css; | ||
const gsc = parseInt(tmpStudy["genetic_sample_size"]).toLocaleString(); | ||
tmpStudy["genetic_sample_size"] = gsc == '-1' || gsc == 'NaN' ? 'N/A' : gsc; | ||
|
||
let studyConsent = tmpStudy["study_identifier"] + (tmpStudy["consent_group_code"] && tmpStudy["consent_group_code"] != "" ? "." + tmpStudy["consent_group_code"] : ""); | ||
tmpStudy['accession'] = tmpStudy["consent_group_code"] ? | ||
tmpStudy["study_identifier"] + "." + tmpStudy["study_version"] + "." + tmpStudy["study_phase"] + "." + tmpStudy["consent_group_code"] : | ||
""; // Show empty string if no consent group code (open dataset) | ||
if (validConsents.includes(studyConsent)) { | ||
tmpStudy['isGranted'] = true; | ||
records.permitted.push(tmpStudy); | ||
} else { | ||
if (!tmpStudy['authZ']) { | ||
tmpStudy['isSuspended'] = true; | ||
} | ||
if (tmpStudy["consent_group_code"] == "c0") { | ||
tmpStudy['isGranted'] = false; | ||
records.na.push(tmpStudy); | ||
} else { | ||
records.denied.push(tmpStudy); | ||
} | ||
} | ||
} | ||
} | ||
|
||
// sort by "consent group" then "abbreviated name" | ||
var funcSort = function (a, b) { | ||
if (a["abbreviated_name"] == b["abbreviated_name"]) { | ||
return (a["study_identifier"].localeCompare(b["study_identifier"])); | ||
} else { | ||
return (a["abbreviated_name"].localeCompare(b["abbreviated_name"])); | ||
} | ||
}; | ||
records.permitted.sort(funcSort); | ||
records.denied.sort(funcSort); | ||
records.na.sort(funcSort); | ||
|
||
return records; | ||
} | ||
|
||
return { | ||
getStudyAccessConfiguration: getStudyAccessConfiguration, | ||
groupRecordsByAccess: groupRecordsByAccess | ||
}; | ||
}); |
89 changes: 4 additions & 85 deletions
89
biodatacatalyst-ui/src/main/webapp/picsureui/studyAccess/studyAccess.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,16 @@ | ||
<div class="center-panel"> | ||
<div class="panel panel-outline explor-panel"> | ||
<div class="panel-heading no-border center-panel"> | ||
<div class="side-border heading-space"> | ||
<div> | ||
<h4 class="access-title">Authorized Access</h4> | ||
<button type="button" data-href="/picsureui/queryBuilder" aria-label="Explore Authorized Access" | ||
{{#if authorizedAccess}}class="btn btn-primary btn-blue clickable-button"{{/if}} | ||
{{#unless authorizedAccess}}class="btn btn-primary btn-grey"{{/unless}} | ||
{{#unless authorizedAccess}}disabled="disabled"{{/unless}}> | ||
Explore Now | ||
</button> | ||
</div> | ||
<div class="participants-container"> | ||
<h4 class="">{{auth_studies_cnt}} Studies</h4> | ||
<h5 class="" id="authorized-participants"></h5> | ||
<div id="authorized-participants-spinner"></div> | ||
</div> | ||
</div> | ||
<div class="heading-space"> | ||
<div> | ||
<h4 class="access-title">Open Access</h4> | ||
<button type="button" class="btn btn-primary btn-blue clickable-button" data-href="/picsureui/openAccess" aria-label="Explore Open Access">Explore Now</button> | ||
</div> | ||
<div class="participants-container"> | ||
<h4 id="open-studies-count" class=""></h4> | ||
<h5 id="open-participants" class=""></h5> | ||
<div id="open-participants-spinner"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="panel-body" style="display: flex;"> | ||
<div class="body-space side-border"> | ||
<ul class="plain-list"> | ||
<li style="display: flex; flex-direction:row"> | ||
<i class="fa-regular fa-address-card" aria-hidden="true"></i> | ||
<i class="fa-solid fa-dna" aria-hidden="true"></i> | ||
<span>Authorized Phenotypic and Genomic Datasets</span> | ||
</li> | ||
<li> | ||
<i class="fa fa-users" aria-hidden="true"></i> | ||
<span>Aggregate Counts</span> | ||
</li> | ||
<li> | ||
<i class="fa-regular fa-user" aria-hidden="true"></i> | ||
<span>Participant-level Data</span> | ||
</li> | ||
<li> | ||
<i class="fa fa-pie-chart" aria-hidden="true"></i> | ||
<span>Visualizations</span> | ||
</li> | ||
<li> | ||
<i class="fa-solid fa-laptop-code" aria-hidden="true"></i> | ||
<span>R and Python API Access</span> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="body-space"> | ||
<ul class="plain-list"> | ||
<li> | ||
<i class="fa-regular fa-circle-check" aria-hidden="true"></i> | ||
<span>No Authorization Required</span> | ||
</li> | ||
<li> | ||
<i class="fa-regular fa-address-card" aria-hidden="true"></i> | ||
<span>All Phenotypic Datasets Available in PIC-SURE</span> | ||
</li> | ||
<li> | ||
<i class="fa fa-users" aria-hidden="true"></i> | ||
<span>Aggregate Counts Only</span> | ||
</li> | ||
<li> | ||
<i class="fa-solid fa-laptop-code" aria-hidden="true"></i> | ||
<span>R and Python API Access</span> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
<div id="studies-access"> | ||
<div class="space-out"> | ||
<div> | ||
<h2 class="studies-title">Data Access Table</h2> | ||
<h4 class="studies-sub-title">View all studies and associated information available in PIC-SURE separated by consent group. Check personalized authorization for available studies in the "Access" column.</h4> | ||
<h4 class="studies-sub-title">View all studies and associated information available in PIC-SURE separated by | ||
consent group. Check personalized authorization for available studies in the "Access" column.</h4> | ||
</div> | ||
<div class="freeze-message"> | ||
<div>{{freeze_msg}}</div> | ||
</div> | ||
</div> | ||
<div class="flex-col table-responsive" style="overflow-x: visible !important;"> | ||
<table id="data-access-table" style="width:100%" class="table table-striped row-border hover" role="region" aria-label="A table showing infomation about studies included in Pic-sure. Use the first column to request access to studies."></table> | ||
<table id="data-access-table" style="width:100%" class="table table-striped row-border hover" role="region" | ||
aria-label="A table showing infomation about studies included in Pic-sure. Use the first column to request access to studies."></table> | ||
</div> | ||
</div> |
Oops, something went wrong.