Skip to content

Commit d7e2bd0

Browse files
authored
Merge pull request #1266 from cmu-delphi/release/v3.2.11
Release v3.2.11
2 parents 084b9be + 89fc472 commit d7e2bd0

File tree

11 files changed

+173
-125
lines changed

11 files changed

+173
-125
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-node@v2
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
1111
with:
12-
node-version: 16
12+
node-version: 18
1313
- name: Cache Node.js modules
14-
uses: actions/cache@v2
14+
uses: actions/cache@v4.0.1
1515
with:
1616
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
1717
key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }}

.github/workflows/create_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515
with:
1616
ref: main
1717
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
@@ -25,7 +25,7 @@ jobs:
2525
echo -n "::set-output name=next_tag::"
2626
npm version --no-git-tag-version ${{ github.event.inputs.versionName }}
2727
- name: Create pull request into main
28-
uses: peter-evans/create-pull-request@v3
28+
uses: peter-evans/create-pull-request@v4
2929
with:
3030
branch: release/${{ steps.version.outputs.next_tag }}
3131
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
@@ -37,7 +37,7 @@ jobs:
3737
body: |
3838
Releasing ${{ steps.version.outputs.next_tag }}.
3939
- name: Check out delphi epidata
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141
with:
4242
token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
4343
repository: cmu-delphi/delphi-epidata

.github/workflows/release_main.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check out code
20-
uses: actions/checkout@v2
21-
- uses: actions/setup-node@v2
20+
uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
2222
with:
23-
node-version: 16
23+
node-version: 18
2424
- name: Extract version
2525
id: extract_version
2626
run: node -pe "'::set-output name=version::' + require('./package.json').version"
2727
- name: Create Release
2828
id: create_release
29-
uses: release-drafter/release-drafter@v5
29+
uses: release-drafter/release-drafter@v6
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
with:
@@ -42,12 +42,12 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Check out code
45-
uses: actions/checkout@v2
46-
- uses: actions/setup-node@v2
45+
uses: actions/checkout@v4
46+
- uses: actions/setup-node@v4
4747
with:
48-
node-version: 16
48+
node-version: 18
4949
- name: Cache Node.js modules
50-
uses: actions/cache@v2
50+
uses: actions/cache@v4.0.1
5151
with:
5252
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
5353
key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }}
@@ -57,7 +57,7 @@ jobs:
5757
- name: Build Assets
5858
run: npm pack
5959
- name: Upload Release Asset
60-
uses: AButler/upload-release-assets@v2.0
60+
uses: AButler/upload-release-assets@v3.0
6161
with:
6262
files: 'www-covidcast-*.tgz'
6363
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -70,15 +70,15 @@ jobs:
7070
runs-on: ubuntu-latest
7171
steps:
7272
- name: Check out code
73-
uses: actions/checkout@v2
73+
uses: actions/checkout@v4
7474
with:
7575
repository: cmu-delphi/www-main
7676
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
77-
- uses: actions/setup-node@v2
77+
- uses: actions/setup-node@v4
7878
with:
79-
node-version: 16
79+
node-version: 18
8080
- name: Cache Node.js modules
81-
uses: actions/cache@v2
81+
uses: actions/cache@v4.0.1
8282
with:
8383
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
8484
key: ${{ runner.OS }}-main-node2-${{ hashFiles('**/package-lock.json') }}
@@ -89,7 +89,7 @@ jobs:
8989
run: |
9090
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
9191
- name: Create pull request to update COVIDcast
92-
uses: peter-evans/create-pull-request@v3
92+
uses: peter-evans/create-pull-request@v5
9393
with:
9494
token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
9595
branch: bot/update-covidcast
@@ -106,7 +106,7 @@ jobs:
106106
runs-on: ubuntu-latest
107107
steps:
108108
- name: Check out code
109-
uses: actions/checkout@v2
109+
uses: actions/checkout@v4
110110
with:
111111
ref: dev
112112
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}

.github/workflows/update_gdocs_data.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Check out code
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v4
1010
with:
1111
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
12-
- uses: actions/setup-node@v2
12+
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 16
14+
node-version: 18
1515
- name: Cache Node.js modules
16-
uses: actions/cache@v2
16+
uses: actions/cache@v4.0.1
1717
with:
1818
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
1919
key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }}
@@ -23,7 +23,7 @@ jobs:
2323
- name: Update Docs
2424
run: npm run gen
2525
- name: Create pull request into main
26-
uses: peter-evans/create-pull-request@v3
26+
uses: peter-evans/create-pull-request@v4
2727
with:
2828
branch: bot/update-docs
2929
commit-message: 'chore: update docs'

package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "www-covidcast",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"license": "MIT",
66
"description": "",

src/blocks/NoRecentDataWarning.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
*/
1111
export let date;
1212
13-
export let warningType;
14-
1513
function switchDate() {
1614
date.set(minMaxDate);
1715
}
1816
</script>
1917

20-
{#if warningType === 1}
18+
<!-- We are not going to show any king of warning message in case the choosen date is less than the most recent date that has data for all three indicators. -->
19+
20+
<!-- If the choosen date is the same as the most recent date that has data for all three indicators, show this message. -->
21+
{#if minMaxDate.getTime() === date.value.getTime()}
2122
<div data-uk-alert class="uk-alert-warning">
2223
<p>
2324
This date, {formatDateYearDayOfWeekAbbr(minMaxDate)}, is the most recent that has data for all three of the
@@ -27,7 +28,8 @@
2728
</div>
2829
{/if}
2930

30-
{#if warningType === 2}
31+
<!-- If the chosen date is greater than the most recent date that has data for all three indicators, show this message. -->
32+
{#if minMaxDate.getTime() < date.value.getTime()}
3133
<div data-uk-alert class="uk-alert-warning">
3234
<p>
3335
This date ({formatDateYearDayOfWeekAbbr(date.value)}) does not yet have data for all of the highlighted

src/modes/exportdata/ExportData.svelte

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,37 @@
2727
}
2828
}
2929
30+
// Pre-fill the form from URL parameters.
31+
// Supported parameters: data_source, signal, start_day, end_day, geo_type, geo_value, as_of
32+
const urlParams = new URLSearchParams(window.location.search);
33+
34+
// Overwrite default source & sensor if these are present in the URL
35+
if (urlParams.has('data_source')) {
36+
sourceValue = urlParams.get('data_source');
37+
38+
if (urlParams.has('signal')) {
39+
sensorValue = urlParams.get('signal');
40+
}
41+
}
42+
3043
$: isWeekly = sensor ? sensor.isWeeklySignal : false;
3144
$: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO;
3245
33-
let geoType = 'county';
46+
let geoType = urlParams.has('geo_type') ? urlParams.get('geo_type') : 'county';
3447
3548
let startDate = new Date();
3649
let endDate = new Date();
3750
3851
function initDate(date) {
3952
const param = new DateParam(date);
40-
endDate = param.sparkLineTimeFrame.max;
41-
startDate = param.sparkLineTimeFrame.min;
53+
54+
// Populate date based on URL params or, if absent, the current date
55+
startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min;
56+
endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max;
57+
58+
// Also normalize the dates to the current timezone
59+
startDate = new Date(startDate.getTime() - startDate.getTimezoneOffset() * -60000);
60+
endDate = new Date(endDate.getTime() - endDate.getTimezoneOffset() * -60000);
4261
}
4362
$: initDate($currentDateObject);
4463
@@ -59,12 +78,20 @@
5978
6079
let geoValuesMode = 'all';
6180
let geoValues = [];
81+
let geoURLSet = false;
6282
$: geoItems = [...(infosByLevel[geoType] || []), ...(geoType === 'county' ? infosByLevel.state : [])];
6383
$: {
6484
if (geoItems != null) {
6585
geoValues = [];
6686
geoValuesMode = guessMode(geoItems.length);
6787
}
88+
89+
// Populate region based on URL params... but let the user override this later
90+
if (urlParams.has('geo_value') && !geoURLSet) {
91+
let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_value'));
92+
addRegion(infos[0]);
93+
geoURLSet = true;
94+
}
6895
}
6996
7097
function flatIds(geoValues) {
@@ -90,6 +117,13 @@
90117
}
91118
}
92119
$: usesAsOf = asOfMode !== 'latest' && asOfDate instanceof Date;
120+
// set as_of based on URL params, if it's a valid date
121+
if (urlParams.has('as_of') && !isNaN(new Date(urlParams.get('as_of')))) {
122+
asOfMode = 'single';
123+
asOfDate = new Date(urlParams.get('as_of'));
124+
// Also normalize the dates to the current timezone
125+
asOfDate = new Date(asOfDate.getTime() - asOfDate.getTimezoneOffset() * -60000);
126+
}
93127
94128
let form = null;
95129
@@ -104,6 +138,14 @@
104138
);
105139
});
106140
}
141+
// Fix up the UI if we got an inactive sensor from the URL parameters.
142+
if (sensor && !sensor.active) {
143+
showInActive = true;
144+
// Force an update to sourceValue to set related reactive statements correctly.
145+
let temp = sourceValue;
146+
sourceValue = '';
147+
sourceValue = temp;
148+
}
107149
});
108150
109151
function addRegion(detail) {

0 commit comments

Comments
 (0)