From 4f4482ca3f319bda9aa8cf0a3e1135e685ab61c0 Mon Sep 17 00:00:00 2001 From: bkop-ds <84399410+bkop-ds@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:17:08 -0500 Subject: [PATCH] Sample/Data Protocols Page created --- confluence.js | 46 ++++++++++++++++++++++++++++++- index.html | 6 ++++ src/components/navBarMenuItems.js | 9 +++++- src/pages/dataExploration.js | 2 +- src/pages/dictionary.js | 6 ++-- src/pages/homePage.js | 2 +- 6 files changed, 64 insertions(+), 7 deletions(-) diff --git a/confluence.js b/confluence.js index b4a1f93..cf082b0 100644 --- a/confluence.js +++ b/confluence.js @@ -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 @@ -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"); @@ -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, @@ -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; @@ -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"); diff --git a/index.html b/index.html index dbd9d4a..5f327fd 100644 --- a/index.html +++ b/index.html @@ -190,6 +190,12 @@ id="dataDictionary" >Data Dictionary + Sample/Data Collection Protocols