Skip to content

Commit

Permalink
Merge pull request #1266 from cmu-delphi/release/v3.2.11
Browse files Browse the repository at this point in the history
Release v3.2.11
  • Loading branch information
melange396 authored Dec 6, 2024
2 parents 084b9be + 89fc472 commit d7e2bd0
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 125 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}'
Expand All @@ -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
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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') }}
Expand All @@ -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 }}
Expand All @@ -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') }}
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/update_gdocs_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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'
Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "www-covidcast",
"version": "3.2.10",
"version": "3.2.11",
"private": true,
"license": "MIT",
"description": "",
Expand Down
10 changes: 6 additions & 4 deletions src/blocks/NoRecentDataWarning.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
*/
export let date;
export let warningType;
function switchDate() {
date.set(minMaxDate);
}
</script>

{#if warningType === 1}
<!-- 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. -->

<!-- If the choosen date is the same as the most recent date that has data for all three indicators, show this message. -->
{#if minMaxDate.getTime() === date.value.getTime()}
<div data-uk-alert class="uk-alert-warning">
<p>
This date, {formatDateYearDayOfWeekAbbr(minMaxDate)}, is the most recent that has data for all three of the
Expand All @@ -27,7 +28,8 @@
</div>
{/if}

{#if warningType === 2}
<!-- If the chosen date is greater than the most recent date that has data for all three indicators, show this message. -->
{#if minMaxDate.getTime() < date.value.getTime()}
<div data-uk-alert class="uk-alert-warning">
<p>
This date ({formatDateYearDayOfWeekAbbr(date.value)}) does not yet have data for all of the highlighted
Expand Down
48 changes: 45 additions & 3 deletions src/modes/exportdata/ExportData.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,37 @@
}
}
// Pre-fill the form from URL parameters.
// 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
if (urlParams.has('data_source')) {
sourceValue = urlParams.get('data_source');
if (urlParams.has('signal')) {
sensorValue = urlParams.get('signal');
}
}
$: isWeekly = sensor ? sensor.isWeeklySignal : false;
$: formatDate = isWeekly ? (d) => formatWeek(d).replace('W', '') : formatDateISO;
let geoType = 'county';
let geoType = urlParams.has('geo_type') ? urlParams.get('geo_type') : '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_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() - startDate.getTimezoneOffset() * -60000);
endDate = new Date(endDate.getTime() - endDate.getTimezoneOffset() * -60000);
}
$: initDate($currentDateObject);
Expand All @@ -59,12 +78,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_value') && !geoURLSet) {
let infos = infosByLevel[geoType].filter((d) => d.propertyId == urlParams.get('geo_value'));
addRegion(infos[0]);
geoURLSet = true;
}
}
function flatIds(geoValues) {
Expand All @@ -90,6 +117,13 @@
}
}
$: 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'));
// Also normalize the dates to the current timezone
asOfDate = new Date(asOfDate.getTime() - asOfDate.getTimezoneOffset() * -60000);
}
let form = null;
Expand All @@ -104,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) {
Expand Down
Loading

0 comments on commit d7e2bd0

Please sign in to comment.