Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALS-5439] Add Open Access header #258

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
},
};
});