Skip to content

Commit d5373bd

Browse files
authored
Merge pull request #1177 from cmu-delphi/release/v3.2.1
Release v3.2.1
2 parents 678f57c + d1ce9c5 commit d5373bd

File tree

8 files changed

+51
-37
lines changed

8 files changed

+51
-37
lines changed

package-lock.json

Lines changed: 15 additions & 29 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.0",
3+
"version": "3.2.1",
44
"private": true,
55
"license": "MIT",
66
"description": "",

scripts/generateDescriptions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ function convertSurveyDescriptions(code) {
136136
return parseObject(doc, {
137137
overview: parseMarkdown,
138138
description: parseMarkdownInline,
139+
endOfSurveyWarning: parseMarkdownInline,
140+
endOfSurveyNotice: parseMarkdownInline,
139141
question: parseMarkdownInline,
140142
oldRevisions: parseArray,
141143
change: parseMarkdownInline,

src/components/KPIValue.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
export let loading = false;
1313
1414
$: scaled = value != null && !Number.isNaN(value) ? value * factor : null;
15+
$: digitsPow = Math.pow(10, digits);
16+
$: roundedValue = Math.round(Math.abs(scaled) * digitsPow);
1517
1618
$: hasFraction = loading || (scaled != null && digits > 0 && Math.floor(scaled) !== scaled);
17-
$: base = loading ? '00' : scaled == null ? 'N/A' : Math.floor(scaled);
18-
$: digitsPow = Math.pow(10, digits);
19-
$: fraction = !loading && hasFraction ? Math.round(Math.abs(scaled) * digitsPow) % digitsPow : 0;
19+
$: base = loading ? '00' : scaled == null ? 'N/A' : Math.floor(roundedValue / digitsPow);
20+
$: fraction = !loading && hasFraction ? roundedValue % digitsPow : 0;
2021
</script>
2122

2223
<KPI text={base.toLocaleString()} sub={hasFraction ? `.${fraction}` : null} {loading} />

src/modes/survey-results/Overview.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
<script>
2-
import { overviewText, dataAccessLink, surveyFullTextLink } from '../../stores/questions';
2+
import { overviewText, dataAccessLink, surveyFullTextLink, ctisWarning } from '../../stores/questions';
33
import SurveyStats from '../../blocks/SurveyStats.svelte';
44
</script>
55

6+
<div class="uk-alert-primary" uk-alert>
7+
<!-- svelte-ignore a11y-missing-attribute -->
8+
<!-- svelte-ignore a11y-missing-content -->
9+
<a class="uk-alert-close" uk-close />
10+
<p>{@html ctisWarning}</p>
11+
</div>
12+
613
<SurveyStats />
714

815
{@html overviewText}

src/stores/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type { RegionInfo, RegionLevel } from '../data/regions';
1616
import { MetaDataManager } from '../data/meta';
1717
import { callMetaAPI } from '../data/api';
1818
import { Sensor, sensorTypes } from '../data/sensor';
19+
import { SURVEY_EMD } from './questions';
1920

2021
export const appReady = writable(false);
2122

@@ -24,14 +25,14 @@ function deriveFromPath(url: Location) {
2425
const urlParams = new URLSearchParams(queryString);
2526

2627
const sensor = urlParams.get('sensor');
27-
const date = urlParams.get('date') ?? '';
2828

2929
const modeFromPath = () => {
3030
const pathName = url.pathname;
3131
// last path segment, e.g. /test/a -> a, /test/b/ -> b
3232
return pathName.split('/').filter(Boolean).reverse()[0];
3333
};
3434
const mode = urlParams.get('mode') || modeFromPath();
35+
const date = urlParams.get('date') ?? '';
3536

3637
const modeObj = modes.find((d) => d.id === mode) || DEFAULT_MODE;
3738
const isGenericPage = modeObj.isGeneric === true;
@@ -47,7 +48,12 @@ function deriveFromPath(url: Location) {
4748
return {
4849
mode: modeObj,
4950
sensor: resolveSensor,
50-
date: /\d{8}/.test(date) ? date : DEFAULT_DATE,
51+
date: /\d{8}/.test(date)
52+
? date
53+
: modeObj === modeByID['survey-results']
54+
? // min between default and survey end
55+
String(Math.min(SURVEY_EMD, Number.parseInt(DEFAULT_DATE)))
56+
: DEFAULT_DATE,
5157
region: urlParams.get('region') || '',
5258
};
5359
}
@@ -286,6 +292,6 @@ currentMode.subscribe((mode) => {
286292
// change sensor and date to the latest one within the survey
287293
currentSensor.set(DEFAULT_SURVEY_SENSOR);
288294
const timeFrame = get(metaDataManager).getTimeFrame(DEFAULT_SURVEY_SENSOR);
289-
currentDate.set(String(timeFrame.max_time));
295+
currentDate.set(String(Math.min(SURVEY_EMD, timeFrame.max_time)));
290296
}
291297
});

src/stores/questions.raw.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ Levels: [county, msa, state] # levels which the survey should be pickable
1414
# common properties for all questions
1515
Id: fb-survey
1616
Unit: per 100 people
17+
18+
19+
EndOfSurveyWarning: |
20+
The US COVID-19 Trends and Impact Survey will stop inviting new respondents to complete the survey on June 25, 2022. All survey data will remain available for research. For more information, see our [end-of-survey notice](https://cmu-delphi.github.io/delphi-epidata/symptom-survey/end-of-survey.html).
21+
EndOfSurveyNotice: |
22+
The US COVID-19 Trends and Impact Survey stopped inviting new respondents to complete the survey on June 25, 2022. All survey data remains available for research. For more information, see our [end-of-survey notice](https://cmu-delphi.github.io/delphi-epidata/symptom-survey/end-of-survey.html).
23+
24+
1725
---
1826
Name: COVID-Like Symptoms
1927
Category: Symptoms

src/stores/questions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import descriptions from './questions.generated.json';
22
import { isoParse } from 'd3-time-format';
33
import type { RegionLevel } from '../data/regions';
44
import type { SensorLike } from '../data/sensor';
5+
import { toTimeValue } from '../data/utils';
56

7+
export const SURVEY_EMD = 20220625;
68
export const overviewText = descriptions.overview;
9+
export const ctisWarning =
10+
toTimeValue(new Date()) > SURVEY_EMD ? descriptions.endOfSurveyNotice : descriptions.endOfSurveyWarning;
711
export const surveyFullTextLink = descriptions.fullSurveyLink;
812
export const dataAccessLink = descriptions.dataAccessLink;
913
export const referenceRawNationSensorLike: SensorLike = {

0 commit comments

Comments
 (0)