Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into dev
  • Loading branch information
anthonypetersen committed Jul 29, 2024
2 parents 04df3e9 + 45058b6 commit 5f02786
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Study Manager Dashboard

This repo implements study manager dashboard for Connect project.

[Here](https://episphere.github.io/studyManagerDashboard/) is the dashboard hosted on GitHub.
6 changes: 5 additions & 1 deletion assets/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,8 @@ table {
font-size: 1rem;
border-radius: .25rem;
width: 100px;
}
}

#appVersion {
font-size: 0.8rem;
}
Binary file modified forms/Consent/BSWH_consent_V0.02_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/HFHS_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/HP_consent_V0.05_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/KPCO_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/KPGA_consent_V0.04_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/KPHI_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/KPNW_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/MFC_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/NCI_consent_V0.05_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/Sanford_consent_V0.03_Span.pdf
Binary file not shown.
Binary file modified forms/Consent/UCM_consent_V0.05_Span.pdf
Binary file not shown.
Binary file modified forms/Data Destruction/Data_Destruction_V1.0_Span.pdf
Binary file not shown.
Binary file modified forms/HIPAA Revocation/HIPAA_Revocation_V1.0_Span.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<li class="menu-item"><a class="footer-links" href="http://www.usa.gov/">USA.gov</a></li>
</ul>
<p class="menu footer-tagline">NIH…Turning Discovery Into Health<sup>®</sup></p>
<p id="appVersion"></p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js" defer></script>
Expand Down
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ import { appState } from './src/stateManager.js';
let saveFlag = false;
let counter = 0;

if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("./serviceWorker.js").catch((error) => {
console.error("Service worker registration failed.", error);
return;
});

navigator.serviceWorker.ready.then(() => {
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ action: "getAppVersion" });
}
});

navigator.serviceWorker.addEventListener("message", (event) => {
if (event.data.action === "sendAppVersion") {
document.getElementById("appVersion").textContent = event.data.payload;
}
});
}

const datadogConfig = {
clientToken: 'pubcb2a7770dcbc09aaf1da459c45ecff65',
applicationId: '571977b4-ca80-4a04-b8fe-5d5148508afd',
Expand Down
51 changes: 51 additions & 0 deletions serviceWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');

const appVersion = "v24.7.0";
workbox.setConfig({ debug: false });
const { registerRoute } = workbox.routing;
const { CacheFirst, NetworkFirst } = workbox.strategies;
const { ExpirationPlugin } = workbox.expiration;

const cacheNameMapper = {
"static-cache": `static-cache-${appVersion}`,
"images-cache": `images-cache-${appVersion}`,
};

const currCacheNameArray = Object.values(cacheNameMapper);

registerRoute(/\.(?:js|css|html|pdf)$/, new NetworkFirst({ cacheName: cacheNameMapper["static-cache"] }));
registerRoute(/\.(?:png|jpg|jpeg|svg|gif|ico)$/,
new CacheFirst({
cacheName: cacheNameMapper["images-cache"],
plugins: [
new ExpirationPlugin({
maxEntries: 30,
maxAgeSeconds: 7 * 24 * 60 * 60,
})
]
})
);

self.addEventListener("install", () => {
self.skipWaiting();
});

self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (!currCacheNameArray.includes(cacheName)) {
return caches.delete(cacheName);
}
})
);
})
);
});

self.addEventListener("message", (event) => {
if (event.data.action === "getAppVersion") {
event.source.postMessage({ action: "sendAppVersion", payload: appVersion });
}
});
8 changes: 4 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ export const pdfCoordinatesMap = {
'V0.04': [{x: 90, y: 402}, {x0: 90, y0: 362}, {x1: 110, y1: 322}],
'V0.05': {
'Eng': [{x: 90, y: 402}, {x0: 90, y0: 362}, {x1: 110, y1: 322}],
'Span': [{x: 90, y: 402}, {x0: 90, y0: 362}, {x1: 110, y1: 322}]
'Span': [{x: 105, y: 492}, {x0: 105, y0: 352}, {x1: 105, y1: 312}]
},
'V1.0': [{x: 90, y: 420}, {x0: 90, y0: 380}, {x1: 110, y1: 340}]
},
'HFHS': {
'V0.02': [{x: 110, y: 380}, {x0: 110, y0: 340}, {x1: 115, y1: 300}],
'V0.03': {
'Eng': [{x: 90, y: 410}, {x0: 90, y0: 370}, {x1: 110, y1: 330}],
'Span': [{x: 90, y: 410}, {x0: 90, y0: 370}, {x1: 110, y1: 330}]
'Span': [{x: 105, y: 410}, {x0: 105, y0: 370}, {x1: 105, y1: 330}]
},
'V1.0': [{x: 110, y: 380}, {x0: 110, y0: 340}, {x1: 115, y1: 300}],
},
Expand Down Expand Up @@ -204,15 +204,15 @@ export const pdfCoordinatesMap = {
'V0.02': [{x: 110, y: 425}, {x0: 110, y0: 385}, {x1: 115, y1: 345}],
'V0.03': {
'Eng': [{x: 110, y: 405}, {x0: 110, y0: 365}, {x1: 115, y1: 325}],
'Span': [{x: 110, y: 405}, {x0: 110, y0: 365}, {x1: 115, y1: 325}]
'Span': [{x: 110, y: 395}, {x0: 110, y0: 355}, {x1: 110, y1: 315}]
},
'V1.0': [{x: 110, y: 420}, {x0: 110, y0: 380}, {x1: 115, y1: 345}]
},
'Sanford': {
'V0.02': [{x: 120, y: 407}, {x0: 105, y0: 365}, {x1: 110, y1: 325}],
'V0.03': {
'Eng': [{x: 120, y: 730}, {x0: 120, y0: 690}, {x1: 120, y1: 655}],
'Span': [{x: 120, y: 730}, {x0: 120, y0: 690}, {x1: 120, y1: 655}]
'Span': [{x: 120, y: 200}, {x0: 120, y0: 160}, {x1: 120, y1: 125}]
},
'V1.0': [{x: 120, y: 407}, {x0: 120, y0: 367}, {x1: 120, y1: 330}]
},
Expand Down

0 comments on commit 5f02786

Please sign in to comment.