Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: typhoidgenomics/TyphiNET
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5
Choose a base ref
...
head repository: typhoidgenomics/TyphiNET
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.1
Choose a head ref
  • 9 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 30, 2023

  1. Merge pull request #100 from typhoidgenomics/master

    Master update dev
    lcerdeira authored Nov 30, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3dc3bfc View commit details
  2. Update constants.js

    lcerdeira authored Nov 30, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    57f86ef View commit details

Commits on Feb 15, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    52eae55 View commit details
  2. serviceWorker

    lcerdeira committed Feb 15, 2024
    Copy the full SHA
    64d088f View commit details
  3. update serviceWorker

    vLSHTM committed Feb 15, 2024
    Copy the full SHA
    00c63c4 View commit details
  4. update file size

    vLSHTM committed Feb 15, 2024
    Copy the full SHA
    55df647 View commit details
  5. Merge pull request #111 from typhoidgenomics/autocompletetag

    Report download and size error fixed
    lcerdeira authored Feb 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e9b70a6 View commit details
  6. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    82251f7 View commit details
  7. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6ac8987 View commit details
Showing with 32 additions and 33 deletions.
  1. +3 −3 client/src/components/Elements/DownloadData/DownloadData.js
  2. +1 −1 client/src/constants.js
  3. +28 −29 client/src/registerServiceWorker.js
6 changes: 3 additions & 3 deletions client/src/components/Elements/DownloadData/DownloadData.js
Original file line number Diff line number Diff line change
@@ -387,9 +387,9 @@ export const DownloadData = () => {
graphImg.src = await domtoimage.toPng(document.getElementById(graphCards[index].id), { bgcolor: 'white' });
await graphImgPromise;
if (graphImg.width <= 741) {
doc.addImage(graphImg, 'PNG', 16, 110, undefined,'FAST');
doc.addImage(graphImg, 'PNG', 16, 110,undefined,undefined, undefined, 'FAST');
} else {
doc.addImage(graphImg, 'PNG', 16, 110, pageWidth - 80, 271, undefined,'FAST');
doc.addImage(graphImg, 'PNG', 16, 110, pageWidth - 80, 271, undefined, 'FAST');
}

doc.setFillColor(255, 255, 255);
@@ -468,7 +468,7 @@ export const DownloadData = () => {
startIcon={<PictureAsPdf />}
loadingPosition="start"
>
Download report from current view (PDF, 1MB)
Download report from current view (PDF, 2MB)
</LoadingButton>
<Snackbar open={showAlert} autoHideDuration={5000} onClose={handleCloseAlert}>
<Alert onClose={handleCloseAlert} severity="error" sx={{ width: '100%' }}>
2 changes: 1 addition & 1 deletion client/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Static routes to run the app. Only use one: local or heroku.
//export const API_ENDPOINT = 'http://localhost:8080/api/';
export const API_ENDPOINT = 'https://typhinet.herokuapp.com/api/';
export const API_ENDPOINT = 'https://typhinetdev.herokuapp.com/api/';
57 changes: 28 additions & 29 deletions client/src/registerServiceWorker.js
Original file line number Diff line number Diff line change
@@ -8,40 +8,39 @@
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.

const isLocalhost = Boolean(
window.location.hostname === "localhost" ||
// [::1] is the IPv6 localhost address.
window.location.hostname === "[::1]" ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
// const isLocalhost = Boolean(
// window.location.hostname === "localhost" ||
// // [::1] is the IPv6 localhost address.
// window.location.hostname === "[::1]" ||
// // 127.0.0.1/8 is considered localhost for IPv4.
// window.location.hostname.match(
// /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
// )
// );

export default function register() {
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
if (!process.env.PUBLIC_URL && process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return;
}
// const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
// if (publicUrl.origin !== window.location.origin) {
// // Our service worker won't work if PUBLIC_URL is on a different origin
// // from what our page is served on. This might happen if a CDN is used to
// // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
// return;
// }
// window.addEventListener("load", () => {
// const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;

window.addEventListener("load", () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;

if (!isLocalhost) {
// Is not local host. Just register service worker
registerValidSW(swUrl);
} else {
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker(swUrl);
}
});
// if (!isLocalhost) {
// // Is not local host. Just register service worker
// registerValidSW(swUrl);
// } else {
// // This is running on localhost. Lets check if a service worker still exists or not.
// checkValidServiceWorker(swUrl);
// }
// });
}
}
// }

function registerValidSW(swUrl) {
navigator.serviceWorker