Skip to content

Commit

Permalink
[ALS-5439] Add Open Access header (#258)
Browse files Browse the repository at this point in the history
* [ALS-5439] Add Open Access header
  • Loading branch information
Gcolon021 authored Dec 4, 2023
1 parent 6653b36 commit 0f51182
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
14 changes: 8 additions & 6 deletions biodatacatalyst-ui/src/main/webapp/picsureui/header/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +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 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
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();
},
};
});

0 comments on commit 0f51182

Please sign in to comment.