Skip to content

Commit 47ce3a4

Browse files
authored
Merge pull request #1151 from cmu-delphi/release/v3.0.2
Release v3.0.2
2 parents 5998f30 + e83f9d1 commit 47ce3a4

20 files changed

+232
-96
lines changed

.github/workflows/release_main.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,5 @@ jobs:
113113
- name: Reset dev branch
114114
run: |
115115
git fetch origin main:main
116-
git reset --hard main
117-
- name: Create pull request into dev
118-
uses: peter-evans/create-pull-request@v3
119-
with:
120-
token: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
121-
branch: bot/sync-main-dev
122-
commit-message: 'chore: sync main-dev'
123-
base: dev
124-
title: 'chore: sync main->dev'
125-
labels: chore
126-
reviewers: krivard
127-
# assignees:
128-
body: |
129-
Syncing Main->Dev.
116+
git merge main
117+
git push

.github/workflows/update_gdocs_data.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
commit-message: 'chore: update docs'
3030
title: Update Google Docs Meta Data
3131
labels: chore
32-
reviewers: krivard,sgratzl
33-
assignees: sgratzl
32+
reviewers: krivard
33+
assignees: krivard
3434
body: |
3535
Updating Google Docs Meta Data

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ The release consists of multiple steps which can be all done via the GitHub webs
7171
1. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
7272
1. Once approved and merged, another GitHub action job starts which automatically will
7373
1. create a git tag
74-
1. create another [Pull Request](https://github.com/cmu-delphi/www-covidcast/pulls) to merge the changes back to the `dev` branch
7574
1. create a [GitHub release](https://github.com/cmu-delphi/www-covidcast/releases) with automatically derived release notes
7675
1. create a [Pull Request in www-main](https://github.com/cmu-delphi/www-main/pulls) to update the website to the new release
7776
1. Done

package-lock.json

Lines changed: 2 additions & 2 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.0.1",
3+
"version": "3.0.2",
44
"private": true,
55
"license": "MIT",
66
"description": "",

src/blocks/HistoryLineChart.svelte

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
}-${sensor.isWeeklySignal ? formatWeek(timeFrame.max_week) : formatDateISO(timeFrame.max)}${suffix}`;
253253
}
254254
255-
function injectRanges(spec, timeFrame, annotations) {
255+
function injectRanges(spec, timeFrame, annotations, multipleRegions) {
256256
if (annotations.length > 0) {
257257
spec.layer.unshift(genAnnotationLayer(annotations, timeFrame));
258258
}
@@ -264,7 +264,7 @@
264264
}
265265
const uncertaintyAnnotation = annotations.find((d) => d.uncertainty);
266266
if (uncertaintyAnnotation) {
267-
spec.layer.push(genUncertaintyLayer(uncertaintyAnnotation, { color }));
267+
spec.layer.push(genUncertaintyLayer(uncertaintyAnnotation, { color, multipleRegions }));
268268
}
269269
return spec;
270270
}
@@ -274,7 +274,15 @@
274274
275275
$: raw = singleRaw && sensor.rawValue != null && !($isMobileDevice && showFull);
276276
$: regions = raw ? [region.value] : resolveRegions(region.value, singleRegionOnly, showNeighbors);
277-
$: annotations = $annotationManager.getWindowAnnotations(sensor.value, regions, timeFrame.min, timeFrame.max, true);
277+
$: annotations = raw
278+
? $annotationManager.getMultiWindowAnnotations(
279+
[sensor.value, sensor.rawValue],
280+
regions,
281+
timeFrame.min,
282+
timeFrame.max,
283+
true,
284+
)
285+
: $annotationManager.getWindowAnnotations(sensor.value, regions, timeFrame.min, timeFrame.max, true);
278286
$: spec = injectRanges(
279287
genSpec(sensor, region, date, timeFrame, {
280288
height,
@@ -286,7 +294,8 @@
286294
stderr,
287295
}),
288296
timeFrame,
289-
annotations,
297+
annotations.filter((d) => !d.isAllTime),
298+
regions.length > 1,
290299
);
291300
$: data = raw
292301
? loadSingleData(sensor, region, timeFrame)
@@ -336,7 +345,7 @@
336345
<Toggle bind:checked={singleRaw}>Raw Data</Toggle>
337346
{/if}
338347
{#if !($isMobileDevice && raw)}
339-
<Toggle bind:checked={showFull}>Show All Dates</Toggle>
348+
<Toggle bind:checked={showFull}>All Dates</Toggle>
340349
{/if}
341350
<div class="spacer" />
342351
<DownloadMenu {fileName} {vegaRef} {data} {sensor} {raw} {stderr} />

src/blocks/MaxDateHint.svelte

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,28 @@
99
1010
export let suffix = '';
1111
12-
/**
13-
* @type {import("../../stores/params").DateParam | null}
14-
*/
15-
export let date = null;
16-
/**
17-
* @type {import("../../stores/params").RegionParam | null}
18-
*/
19-
export let region = null;
2012
/**
2113
* @type {import("../../stores/DataFetcher").DataFetcher | null}
2214
*/
2315
export let fetcher = null;
2416
25-
let maxTime;
2617
$: info = $metaDataManager.getMetaData(sensor);
27-
28-
function updateMaxTime(fetcher, sensor, region, date) {
29-
if (date.sparkLineTimeFrame.max <= maxTime) {
30-
return;
31-
}
32-
const sparkline = fetcher.fetch1Sensor1RegionSparkline(sensor, region, date);
33-
// use sparkline data to find the "real" max time
34-
sparkline.then((data) => {
35-
const maxDate = data.reduce((acc, v) => (v.date_value > acc ? v.date_value : acc), maxTime);
36-
if (maxDate > maxTime) {
37-
maxTime = maxDate;
38-
}
39-
});
40-
}
41-
$: {
42-
maxTime = info.maxTime;
43-
if (fetcher && region && date) {
44-
updateMaxTime(fetcher, sensor, region, date);
45-
}
46-
}
18+
$: maxTimeAndIssue = fetcher
19+
? fetcher.fetch1SensorMaxDateAndIssue(sensor, $metaDataManager)
20+
: info
21+
? Promise.resolve(info)
22+
: null;
4723
</script>
4824

4925
{#if info}
50-
<UIKitHint
51-
title="Most recent available date:<br>&nbsp;{formatDateYearDayOfWeekAbbr(
52-
maxTime,
53-
)}<br>Last update on:<br>&nbsp;{formatDateYearDayOfWeekAbbr(info.maxIssue)}"
54-
noMargin={suffix.length > 0}
55-
inline={suffix.length === 0}
56-
/>
26+
{#await maxTimeAndIssue then t}
27+
<UIKitHint
28+
title="Most recent available date:<br>&nbsp;{formatDateYearDayOfWeekAbbr(
29+
t.maxTime,
30+
)}<br>Last update on:<br>&nbsp;{formatDateYearDayOfWeekAbbr(t.maxIssue)}"
31+
noMargin={suffix.length > 0}
32+
inline={suffix.length === 0}
33+
/>
34+
{/await}
5735
{/if}
5836
{suffix}

src/components/IndicatorAnnotation.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export let annotation;
88
</script>
99

10-
<div class="uk-alert uk-alert-{annotation.uncertainty ? 'info' : 'warning'} {className}">
10+
<div class="uk-alert uk-alert-{annotation.uncertainty || annotation.isAllTime ? 'info' : 'warning'} {className}">
1111
<h5 class="alert-header">
1212
<div class="text">
1313
<span class="inline-svg-icon">
@@ -19,7 +19,9 @@
1919
</span>
2020
{annotation.problem}
2121
</div>
22-
<div class="date">{formatDateISO(annotation.dates[0])} - {formatDateISO(annotation.dates[1])}</div>
22+
{#if !annotation.isAllTime}
23+
<div class="date">{formatDateISO(annotation.dates[0])} - {formatDateISO(annotation.dates[1])}</div>
24+
{/if}
2325
</h5>
2426
<p class="uk-margin-remove-bottom">
2527
{annotation.explanation}

src/components/RegionDatePicker.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
$: if (selectedDate !== undefined) {
2323
currentDate.set(formatAPITime(selectedDate));
2424
}
25+
/**
26+
* @type {import("../../stores/DataFetcher").DataFetcher | null}
27+
*/
28+
export let fetcher = null;
2529
2630
/**
2731
* @param {import('../stores/params').Region} d
@@ -47,7 +51,7 @@
4751
maxItemsToShowInList={5}
4852
on:change={(e) => selectByInfo(e.detail && e.detail.level === 'nation' ? null : e.detail)}
4953
/>
50-
<SensorDatePicker2 className="survey-date grid-8-11" bind:value={selectedDate} {sensor} />
54+
<SensorDatePicker2 className="survey-date grid-8-11" bind:value={selectedDate} {sensor} {fetcher} />
5155
</div>
5256
<slot />
5357
</div>

src/components/SensorDatePicker2.svelte

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,19 @@
2020
export let value = null;
2121
2222
export let className = '';
23+
/**
24+
* @type {import("../../stores/DataFetcher").DataFetcher | null}
25+
*/
26+
export let fetcher = null;
2327
24-
$: timeFrame = $metaDataManager.getTimeFrame(sensor);
2528
$: info = $metaDataManager.getMetaData(sensor);
29+
$: maxTimeAndIssue = fetcher
30+
? fetcher.fetch1SensorMaxDateAndIssue(sensor, $metaDataManager)
31+
: info
32+
? Promise.resolve(info)
33+
: null;
34+
35+
$: timeFrame = $metaDataManager.getTimeFrame(sensor);
2636
2737
$: formatter = $isMobileDevice ? formatDateShortDayOfWeekAbbr : formatDateYearDayOfWeekAbbr;
2838
</script>
@@ -57,21 +67,21 @@
5767
</button>
5868
<svelte:fragment slot="footer">
5969
{#if info}
60-
<p class="date-info">
61-
Most recent available date is <button
62-
type="button"
63-
on:click={() => (value = info.maxTime)}
64-
class="uk-link-muted"
65-
>
66-
{sensor.isWeeklySignal ? formatWeek(info.maxWeek) : formatDateYearDayOfWeekAbbr(info.maxTime)}
67-
</button>
68-
updated on
69-
<span class="uk-text-nowrap"
70-
>{sensor.isWeeklySignal
71-
? formatWeek(info.maxIssueWeek)
72-
: formatDateYearDayOfWeekAbbr(info.maxIssue)}</span
73-
>.
74-
</p>
70+
{#await maxTimeAndIssue then t}
71+
<p class="date-info">
72+
Data is available for dates up through <button
73+
type="button"
74+
on:click={() => (value = t.maxTime)}
75+
class="uk-link-muted"
76+
>
77+
{sensor.isWeeklySignal ? formatWeek(t.maxTime) : formatDateYearDayOfWeekAbbr(t.maxTime)}
78+
</button>
79+
(last updated on
80+
<span class="uk-text-nowrap"
81+
>{sensor.isWeeklySignal ? formatWeek(t.maxIssue) : formatDateYearDayOfWeekAbbr(t.maxIssue)}</span
82+
>).
83+
</p>
84+
{/await}
7585
{/if}
7686
</svelte:fragment>
7787
</Datepicker>

0 commit comments

Comments
 (0)