From a621fc56e863acc44742be1106c9ef4a9852bf37 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Fri, 15 Mar 2024 00:08:19 +0200 Subject: [PATCH 01/11] Set default values based on URL params --- src/modes/exportdata/ExportData.svelte | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index b04c2da7..da102de6 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -27,18 +27,31 @@ } } + const urlParams = new URLSearchParams(window.location.search); + + // Overwrite default source & sensor if these are present in the URL + if (urlParams.has('source')) { + sourceValue = urlParams.get('source'); + + if (urlParams.has('sensor')) { + sensorValue = urlParams.get('sensor'); + } + } + $: isWeekly = sensor ? sensor.isWeeklySignal : false; $: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO; - let geoType = 'county'; + let geoType = urlParams.has('geo') ? urlParams.get('geo') : 'county'; let startDate = new Date(); let endDate = new Date(); function initDate(date) { const param = new DateParam(date); - endDate = param.sparkLineTimeFrame.max; - startDate = param.sparkLineTimeFrame.min; + + // Populate date based on URL params or, if absent, the current date + startDate = urlParams.has('start') ? new Date(urlParams.get('start')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end') ? new Date(urlParams.get('end')) : param.sparkLineTimeFrame.max; } $: initDate($currentDateObject); From 0d5d1492c0fe41bb7ffce09f04e54ea436bbbfbc Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Fri, 15 Mar 2024 00:26:33 +0200 Subject: [PATCH 02/11] Also add geo_id --- src/modes/exportdata/ExportData.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index da102de6..a898a8c7 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -27,6 +27,8 @@ } } + // Pre-fill the form from URL parameters. + // Supported parameters: source, sensor, start, end, geo_type, geo_id const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL @@ -41,7 +43,7 @@ $: isWeekly = sensor ? sensor.isWeeklySignal : false; $: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO; - let geoType = urlParams.has('geo') ? urlParams.get('geo') : 'county'; + let geoType = urlParams.has('geo_type') ? urlParams.get('geo_type') : 'county'; let startDate = new Date(); let endDate = new Date(); @@ -72,12 +74,20 @@ let geoValuesMode = 'all'; let geoValues = []; + let geoURLSet = false; $: geoItems = [...(infosByLevel[geoType] || []), ...(geoType === 'county' ? infosByLevel.state : [])]; $: { if (geoItems != null) { geoValues = []; geoValuesMode = guessMode(geoItems.length); } + + // Populate region based on URL params... but let the user override this later + if (urlParams.has('geo_id') && !geoURLSet) { + let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_id')); + addRegion(infos[0]); + geoURLSet = true; + } } function flatIds(geoValues) { From cd448c32d932fc0e324d6acf5b5db1dee016ba0d Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 15:03:34 +0200 Subject: [PATCH 03/11] Fix review comments --- src/modes/exportdata/ExportData.svelte | 35 ++++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index a898a8c7..f469bdfe 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -32,11 +32,11 @@ const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL - if (urlParams.has('source')) { - sourceValue = urlParams.get('source'); + if (urlParams.has('data_source')) { + sourceValue = urlParams.get('data_source'); - if (urlParams.has('sensor')) { - sensorValue = urlParams.get('sensor'); + if (urlParams.has('signal')) { + sensorValue = urlParams.get('signal'); } } @@ -52,8 +52,14 @@ const param = new DateParam(date); // Populate date based on URL params or, if absent, the current date - startDate = urlParams.has('start') ? new Date(urlParams.get('start')) : param.sparkLineTimeFrame.min; - endDate = urlParams.has('end') ? new Date(urlParams.get('end')) : param.sparkLineTimeFrame.max; + if (sensor && !sensor.active) { + // If the sensor is inactive, set the start and end dates to its historical range rather than current date + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : sensor.meta.minTime; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : sensor.meta.maxTime; + } else { + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; + } } $: initDate($currentDateObject); @@ -83,8 +89,8 @@ } // Populate region based on URL params... but let the user override this later - if (urlParams.has('geo_id') && !geoURLSet) { - let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_id')); + if (urlParams.has('geo_value') && !geoURLSet) { + let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_value')); addRegion(infos[0]); geoURLSet = true; } @@ -113,6 +119,11 @@ } } $: usesAsOf = asOfMode !== 'latest' && asOfDate instanceof Date; + // set as_of based on URL params, if it's a valid date + if (urlParams.has('as_of') && !isNaN(new Date(urlParams.get('as_of')))) { + asOfMode = 'single'; + asOfDate = new Date(urlParams.get('as_of')); + } let form = null; @@ -127,6 +138,14 @@ ); }); } + // Fix up the UI if we got an inactive sensor from the URL parameters. + if (sensor && !sensor.active) { + showInActive = true; + // Force an update to sourceValue to set related reactive statements correctly. + let temp = sourceValue; + sourceValue = ''; + sourceValue = temp; + } }); function addRegion(detail) { From d9f12debc95d9ec6f8558f861df42ac28cd2af3d Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 15:11:20 +0200 Subject: [PATCH 04/11] Discard date from URL if it's not within the right range --- src/modes/exportdata/ExportData.svelte | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index f469bdfe..8a586f7d 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -54,8 +54,24 @@ // Populate date based on URL params or, if absent, the current date if (sensor && !sensor.active) { // If the sensor is inactive, set the start and end dates to its historical range rather than current date - startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : sensor.meta.minTime; - endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : sensor.meta.maxTime; + if ( + urlParams.has('start_day') && + new Date(urlParams.get('start_day')) >= sensor.meta.minTime && + new Date(urlParams.get('start_day')) <= sensor.meta.maxTime + ) { + startDate = new Date(urlParams.get('start_day')); + } else { + startDate = sensor.meta.minTime; + } + if ( + urlParams.has('end_day') && + new Date(urlParams.get('end_day')) <= sensor.meta.minTime && + new Date(urlParams.get('end_day')) <= sensor.meta.maxTime + ) { + endDate = new Date(urlParams.get('end_day')); + } else { + endDate = sensor.meta.maxTime; + } } else { startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; From f978fa7e48fc59adf73b4e40736f8f1405225f13 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:16:37 +0200 Subject: [PATCH 05/11] Revert time clamping, modify comment --- src/modes/exportdata/ExportData.svelte | 28 +++----------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index 8a586f7d..01f6f375 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -28,7 +28,7 @@ } // Pre-fill the form from URL parameters. - // Supported parameters: source, sensor, start, end, geo_type, geo_id + // Supported parameters: data_source, signal, start_day, end_day, geo_type, geo_value, as_of const urlParams = new URLSearchParams(window.location.search); // Overwrite default source & sensor if these are present in the URL @@ -52,30 +52,8 @@ const param = new DateParam(date); // Populate date based on URL params or, if absent, the current date - if (sensor && !sensor.active) { - // If the sensor is inactive, set the start and end dates to its historical range rather than current date - if ( - urlParams.has('start_day') && - new Date(urlParams.get('start_day')) >= sensor.meta.minTime && - new Date(urlParams.get('start_day')) <= sensor.meta.maxTime - ) { - startDate = new Date(urlParams.get('start_day')); - } else { - startDate = sensor.meta.minTime; - } - if ( - urlParams.has('end_day') && - new Date(urlParams.get('end_day')) <= sensor.meta.minTime && - new Date(urlParams.get('end_day')) <= sensor.meta.maxTime - ) { - endDate = new Date(urlParams.get('end_day')); - } else { - endDate = sensor.meta.maxTime; - } - } else { - startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; - endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; - } + startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; + endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; } $: initDate($currentDateObject); From b94ad01321817fb62ab539e8dc4a43d3cd9498a6 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:26:43 +0200 Subject: [PATCH 06/11] Date off-by-one error fix --- src/modes/exportdata/ExportData.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index 01f6f375..a45837f5 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -54,6 +54,10 @@ // Populate date based on URL params or, if absent, the current date startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min; endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; + + // Also normalize the dates to the current timezone + startDate = new Date(startDate.getTime() + Math.abs(startDate.getTimezoneOffset() * 60000)); + endDate = new Date(endDate.getTime() + Math.abs(endDate.getTimezoneOffset() * 60000)); } $: initDate($currentDateObject); @@ -117,6 +121,8 @@ if (urlParams.has('as_of') && !isNaN(new Date(urlParams.get('as_of')))) { asOfMode = 'single'; asOfDate = new Date(urlParams.get('as_of')); + // Also normalize the dates to the current timezone + asOfDate = new Date(asOfDate.getTime() + Math.abs(asOfDate.getTimezoneOffset() * 60000)); } let form = null; From 333a79c85f0a971045d1ba747b47f818626d1372 Mon Sep 17 00:00:00 2001 From: Rostyslav Zatserkovnyi Date: Wed, 27 Mar 2024 17:32:59 +0200 Subject: [PATCH 07/11] Better timezone offset --- src/modes/exportdata/ExportData.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modes/exportdata/ExportData.svelte b/src/modes/exportdata/ExportData.svelte index a45837f5..bde068c3 100644 --- a/src/modes/exportdata/ExportData.svelte +++ b/src/modes/exportdata/ExportData.svelte @@ -56,8 +56,8 @@ endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max; // Also normalize the dates to the current timezone - startDate = new Date(startDate.getTime() + Math.abs(startDate.getTimezoneOffset() * 60000)); - endDate = new Date(endDate.getTime() + Math.abs(endDate.getTimezoneOffset() * 60000)); + startDate = new Date(startDate.getTime() - startDate.getTimezoneOffset() * -60000); + endDate = new Date(endDate.getTime() - endDate.getTimezoneOffset() * -60000); } $: initDate($currentDateObject); @@ -122,7 +122,7 @@ asOfMode = 'single'; asOfDate = new Date(urlParams.get('as_of')); // Also normalize the dates to the current timezone - asOfDate = new Date(asOfDate.getTime() + Math.abs(asOfDate.getTimezoneOffset() * 60000)); + asOfDate = new Date(asOfDate.getTime() - asOfDate.getTimezoneOffset() * -60000); } let form = null; From db70761e4f33f458bce79c6ceabc266242ea17f6 Mon Sep 17 00:00:00 2001 From: george haff Date: Wed, 24 Apr 2024 12:24:20 -0400 Subject: [PATCH 08/11] updated gh actions versions to match those in www-main --- .github/workflows/ci.yml | 8 +++---- .github/workflows/create_release.yml | 6 ++--- .github/workflows/release_main.yml | 30 ++++++++++++------------- .github/workflows/update_gdocs_data.yml | 10 ++++----- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9260ff00..791c26c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2aa6320a..e95ef52b 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: main ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} @@ -25,7 +25,7 @@ jobs: echo -n "::set-output name=next_tag::" npm version --no-git-tag-version ${{ github.event.inputs.versionName }} - name: Create pull request into main - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: branch: release/${{ steps.version.outputs.next_tag }} commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}' @@ -37,7 +37,7 @@ jobs: body: | Releasing ${{ steps.version.outputs.next_tag }}. - name: Check out delphi epidata - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }} repository: cmu-delphi/delphi-epidata diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index c9a7516c..49414e70 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -17,16 +17,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Extract version id: extract_version run: node -pe "'::set-output name=version::' + require('./package.json').version" - name: Create Release id: create_release - uses: release-drafter/release-drafter@v5 + uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -42,12 +42,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} @@ -57,7 +57,7 @@ jobs: - name: Build Assets run: npm pack - name: Upload Release Asset - uses: AButler/upload-release-assets@v2.0 + uses: AButler/upload-release-assets@v3.0 with: files: 'www-covidcast-*.tgz' repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -70,15 +70,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: cmu-delphi/www-main ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-main-node2-${{ hashFiles('**/package-lock.json') }} @@ -89,7 +89,7 @@ jobs: run: | npm install https://github.com/cmu-delphi/www-covidcast/releases/download/${{ needs.create_release.outputs.tag_name }}/www-covidcast-${{ needs.create_release.outputs.version }}.tgz - name: Create pull request to update COVIDcast - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }} branch: bot/update-covidcast @@ -106,7 +106,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: dev ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} diff --git a/.github/workflows/update_gdocs_data.yml b/.github/workflows/update_gdocs_data.yml index ed9f9602..5e2582a4 100644 --- a/.github/workflows/update_gdocs_data.yml +++ b/.github/workflows/update_gdocs_data.yml @@ -6,14 +6,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }} - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4.0.1 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }} @@ -23,7 +23,7 @@ jobs: - name: Update Docs run: npm run gen - name: Create pull request into main - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: branch: bot/update-docs commit-message: 'chore: update docs' From 9dbf917b2ddf8182018b5b4b15f9fd168e445776 Mon Sep 17 00:00:00 2001 From: Dmytro Trotsko Date: Thu, 2 May 2024 23:21:13 +0300 Subject: [PATCH 09/11] Simplified 'No Recent Data' warning logic. (#1249) * Simplified 'No Recent Data' warning logic. * Added comments * Included DEATHS sensor to the list of indicators for which we are getting latest date we have data for all indicators. --- src/blocks/NoRecentDataWarning.svelte | 10 +++--- src/modes/summary/Overview.svelte | 46 ++++++++++----------------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/blocks/NoRecentDataWarning.svelte b/src/blocks/NoRecentDataWarning.svelte index 1b4d21cb..1a86e115 100644 --- a/src/blocks/NoRecentDataWarning.svelte +++ b/src/blocks/NoRecentDataWarning.svelte @@ -10,14 +10,15 @@ */ export let date; - export let warningType; - function switchDate() { date.set(minMaxDate); } -{#if warningType === 1} + + + +{#if minMaxDate.getTime() === date.value.getTime()}

This date, {formatDateYearDayOfWeekAbbr(minMaxDate)}, is the most recent that has data for all three of the @@ -27,7 +28,8 @@

{/if} -{#if warningType === 2} + +{#if minMaxDate.getTime() < date.value.getTime()}

This date ({formatDateYearDayOfWeekAbbr(date.value)}) does not yet have data for all of the highlighted diff --git a/src/modes/summary/Overview.svelte b/src/modes/summary/Overview.svelte index fc4b4a8a..cc96f3d0 100644 --- a/src/modes/summary/Overview.svelte +++ b/src/modes/summary/Overview.svelte @@ -6,7 +6,7 @@ import MaxDateHint from '../../blocks/MaxDateHint.svelte'; import NoRecentDataWarning from '../../blocks/NoRecentDataWarning.svelte'; import { defaultDeathSensor, defaultCasesSensor, defaultHospitalSensor, metaDataManager } from '../../stores'; - import { onMount, beforeUpdate } from 'svelte'; + import { onMount } from 'svelte'; /** * @type {import("../../stores/params").DateParam} @@ -30,44 +30,30 @@ $: hospitalTrend = trends[1]; $: deathTrend = trends[2]; - let minMaxDate = new Date(); + // Get the latest date that has data for all 3 indicators(CASES, HOSPITAL_ADMISSION and DEATHS). + $: minMaxDate = new Date( + Math.min( + ...[CASES, HOSPITAL_ADMISSION, DEATHS].map((s) => { + // As DEATHS sensor is weekly based, we need to add 6 days to the max date of DEATHS sensor to get the last day of the week. + if (s.name === 'COVID Deaths') { + return s.timeFrame.max.getTime() + 6 * 24 * 60 * 60 * 1000; // add 6 days to the max date of DEATHS sensor to get the last day of the week. + } else { + return s.timeFrame.max; + } + }), + ), + ); onMount(() => { - [CASES, HOSPITAL_ADMISSION].map((s) => { - if (s.timeFrame.max < minMaxDate) { - minMaxDate = s.timeFrame.max; - } - }); let urlSearchParams = new URLSearchParams(window.location.search); if (!urlSearchParams.has('date')) { - // if no date is specified in the URL, default to the latest day before today with data from all 3 highlighted indicators + // if no date is specified in the URL, default to the latest day with data from 3 highlighted indicators (CASES, HOSPITAL_ADMISSION and DEATHS). date.set(minMaxDate); } }); - - // warningType is indicator of which exact warning message should be shown. - // By default, when user opens page with no specified date, the date will be set to the latest date we have data for all 3 indicators. - // In this case, warningType should be set to 1. - // In case selected date is set to future date (date > minMaxDate, where we don't have recent data for all 3 indicators), the warningType will be set to 2 - // which has different warning message. - // In case selected date is set to some date which is < minMaxDate, the warningType will be set to 0 which means that we will not show - // any warning message. - - // warningType should be set in beforeUpdate() method, to guess correct warningType. - - let warningType = 1; - beforeUpdate(() => { - if (date.value > minMaxDate) { - warningType = 2; - } else if (date.value < minMaxDate) { - warningType = 0; - } else { - warningType = 1; - } - }); - +

From 39a8e9a5dbdd0c060cef4061731c05680114f1c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:56:22 +0000 Subject: [PATCH 10/11] build(deps-dev): bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca067315..cd85c329 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4557,12 +4557,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7249,9 +7249,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -19588,12 +19588,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-process-hrtime": { @@ -21581,9 +21581,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From c3fd8b2fef2d2563b401086114d1114f453cb9ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:38:29 +0000 Subject: [PATCH 11/11] build(deps-dev): bump ws from 8.8.0 to 8.17.1 Bumps [ws](https://github.com/websockets/ws) from 8.8.0 to 8.17.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.8.0...8.17.1) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd85c329..483e3c8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16064,16 +16064,16 @@ } }, "node_modules/ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -28111,9 +28111,9 @@ } }, "ws": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "requires": {} },