Skip to content

Commit

Permalink
Sample/Data Protocols Page created
Browse files Browse the repository at this point in the history
  • Loading branch information
bkop-ds committed Dec 17, 2024
1 parent f518a29 commit 4f4482c
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 7 deletions.
46 changes: 45 additions & 1 deletion confluence.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import { renderDescription, renderDescriptionNotSignedIn } from "./src/pages/des
import { dataDictionaryTemplate } from "./src/pages/dictionary.js";
import { showPreview } from "./src/components/boxPreview.js";
import { confluenceEventsPage, eventsBody } from './src/pages/events.js';
import { protocolsTemplate } from './src/pages/protocols.js';

/**
* 1. add Scientifix comitte to menu
Expand Down Expand Up @@ -126,6 +127,7 @@ export const confluence = async () => {
const dataSummaryElement = document.getElementById("dataSummary");
const dataSummarySubsetElement = document.getElementById("dataSummarySubset");
const dataDictionaryElement = document.getElementById("dataDictionary");
const dataProtocols = document.getElementById("dataProtocols");
const dataRequestElement = document.getElementById("dataRequest");
const dataFormElement = document.getElementById("dataForm");
const studyAcceptedElement = document.getElementById("studyAccepted");
Expand Down Expand Up @@ -207,7 +209,7 @@ export const confluence = async () => {
const confluenceDiv = document.getElementById("confluenceDiv");
showAnimation();
assignNavbarActive(dataDictionaryElement, 1);
document.title = "BCRPP - Data Dictionary";
document.title = "GBHS - Data Dictionary";
confluenceDiv.innerHTML = dataSummary(
"Data Dictionary",
true,
Expand All @@ -223,6 +225,28 @@ export const confluence = async () => {
dataDictionaryTemplate();
});
}
if (dataProtocols) {
dataProtocols.addEventListener("click", () => {
if (dataProtocols.classList.contains("navbar-active")) return;
const confluenceDiv = document.getElementById("confluenceDiv");
showAnimation();
assignNavbarActive(dataProtocols, 1);
document.title = "";
confluenceDiv.innerHTML = dataSummary(
"Protocols",
true,
false,
false
);
//addEventUpdateSummaryStatsData();
//addEventcreateaccessStats();
removeActiveClass("nav-link", "active");
document
.querySelectorAll('[href="#data_exploration/protocols"]')[1]
.classList.add("active");
protocolsTemplate();
});
}
if (dataFormElement) {
dataFormElement.addEventListener("click", async () => {
if (dataFormElement.classList.contains("navbar-active")) return;
Expand Down Expand Up @@ -501,6 +525,26 @@ const manageRouter = async () => {
.querySelectorAll('[href="#data_exploration/dictionary"]')[1]
.classList.add("active");
dataDictionaryTemplate();
} else if (hash === "#data_exploration/protocols") {
const dataProtocols = document.getElementById("dataProtocols");
if (
!dataProtocols ||
dataProtocols.classList.contains("navbar-active")
)
return;
showAnimation();
assignNavbarActive(dataProtocols, 1);
document.title = "GBHS - Protocols";
confluenceDiv.innerHTML = dataSummary(
"Sample/Data Collection Protocols",
true,
false,
false,
true
);
removeActiveClass("nav-link", "active");
document.querySelectorAll('[href="#data_exploration/protocols"]')[1].classList.add("active");
protocolsTemplate();
} else if (hash === "#userSubmissions") {
const viewUserSubmissionElement =
document.getElementById("userSubmissions");
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@
id="dataDictionary"
>Data Dictionary</a
>
<a
class="dropdown-item nav-link nav-menu-links dropdown-menu-links"
href="#data_exploration/protocols"
id="dataProtocols"
>Sample/Data Collection Protocols</a
>
</div>
</div>
<div class="grid-elements">
Expand Down
9 changes: 8 additions & 1 deletion src/components/navBarMenuItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export const navBarMenutemplate = () => {
<div class="dropdown-menu navbar-dropdown" aria-labelledby="navbarDropdown">
<!--h6 class="dropdown-header dropdown-header-bg font-bold">Explore Data</h6-->
<a class="dropdown-item nav-link nav-menu-links dropdown-menu-links pl-4" href="#data_exploration/dictionary" title="Data Dictionary" id="dataDictionary">
Dictionary
Dictionary
</a>
<a class="dropdown-item nav-link nav-menu-links dropdown-menu-links pl-4" href="#data_exploration/protocols" title="Protocols" id="dataProtocols">
Protocols
</a>
<a class="dropdown-item nav-link nav-menu-links dropdown-menu-links pl-4" href="#data_exploration/summary" title="Summary Statistics" id="dataSummary">
Summary Statistics
Expand Down Expand Up @@ -192,6 +195,10 @@ export function pageNavBar(page, activeTab, ...pageHeaders) {
link.href = `#${page}/dictionary`;
if (activeTab === "dictionary") link.classList.add("active");
}
if (header === "Protocols") {
link.href = `#${page}/protocols`;
if (activeTab === "protocols") link.classList.add("active");
}
if (header === "Subset Statistics") {
link.href = `#${page}/subset`;
if (activeTab === "subset") link.classList.add("active");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dataExploration.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const dataSummary = (
<div class="container2 body-min-height">
${
publicAccess
? pageNavBar("data_exploration", "dictionary", "Dictionary")
? pageNavBar("data_exploration", "dictionary", "Dictionary", "Protocols")
: pageNavBar(
"data_exploration",
"summary",
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const dataDictionaryTemplate = async () => {
<button id="filterBarToggle"><i class="fas fa-lg fa-caret-left"></i></button>
<div class="main-summary-row pl-2" style="min-height: 10px;margin-bottom: 1rem;">
<div class="col white-bg div-border align-left font-size-17" style="padding: 0.5rem;" id="listFilters">
<span class="font-bold">Categories:</span> All
<span class="font-bold">Variable Category:</span> All
</div>
</div>
<div class="main-summary-row pl-2">
Expand Down Expand Up @@ -289,7 +289,7 @@ const filterDataHandler = (dictionary) => {
${
variableTypeSelection.length > 0
? `
<span class="font-bold">Category: </span>${variableTypeSelection[0]} ${
<span class="font-bold">Variable Category: </span>${variableTypeSelection[0]} ${
variableTypeSelection.length > 1
? `and <span class="other-variable-count">${
variableTypeSelection.length - 1
Expand All @@ -298,7 +298,7 @@ const filterDataHandler = (dictionary) => {
}
`
: `
<span class="font-bold">Category:</span> All`
<span class="font-bold">Variable Category:</span> All`
}
`;

Expand Down
2 changes: 1 addition & 1 deletion src/pages/homePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const infoDeck = () => {
</div>
<div class="secondary-bg inverse-triangle"></div>
<div class="container align-center">
<div class="font-size-28 font-bold font-family-montserrat our-goals mt-3 mb-2">OUR GOALS</div>
<div class="font-size-28 font-bold font-family-montserrat our-goals mt-3 mb-2">Aims and Goals</div>
<div class="row">
<div class="col-lg-1"></div>
<div class="col-lg-10 font-size-18 align-left mb-3">
Expand Down

0 comments on commit 4f4482c

Please sign in to comment.