Datahub Collected filter labels rolling windows as This week, This month and This year
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia da apps/web/src/routes/_app/datahub/subjects/index.tsx, in particolare dalle etichette delle opzioni alle righe 249–256 e da presetMinDate alle righe 61–80; confrontale con datahub.visualization.timeframeOptions. Esegui il test subjects indicato, apps/web/src/routes/_app/datahub/subjects/__tests__/index.test.tsx, per verificare le etichette rispetto alle finestre mobili. Il lavoro è completato quando le etichette descrivono accuratamente i periodi applicati e il test pertinente ha esito positivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The datahub's "Collected" filter offers "This week", "This month" and "This year", but these apply rolling windows: the past 7 days, the past month and the past 12 months (presetMinDate subtracts 7 days, 1 month and 1 year from now). Read as calendar periods, the labels select the wrong subjects. On 7 October, "This month" also includes subjects last seen on 8–30 September, and on 5 January "This year" includes most of the previous year. The other options are worded as spans ("3 months", "6 months", "2 years"), and the subject Graph and Table tabs label the same computation "Past Month" / "Past Year" (datahub.visualization.timeframeOptions). A user narrowing a cohort to "this month" for a monthly report gets a different set of subjects than they asked for, with nothing to show the window is rolling.
Where
apps/web/src/routes/_app/datahub/subjects/index.tsx:249-256:
<option value="all">{t({ en: 'Any time', es: 'Cualquier fecha', fr: 'Toute période' })}</option>
<option value="pastWeek">{t({ en: 'This week', es: 'Esta semana', fr: 'Cette semaine' })}</option>
<option value="pastMonth">{t({ en: 'This month', es: 'Este mes', fr: 'Ce mois-ci' })}</option>
<option value="pastThreeMonths">{t({ en: '3 months', es: '3 meses', fr: '3 mois' })}</option>
<option value="pastSixMonths">{t({ en: '6 months', es: '6 meses', fr: '6 mois' })}</option>
<option value="pastYear">{t({ en: 'This year', es: 'Este año', fr: 'Cette année' })}</option>
and the windows they map to, index.tsx:61-80:
case 'pastMonth':
return monthsAgo(1);
// ...
case 'pastWeek':
return new Date(new Date(now).setDate(now.getDate() - 7));
case 'pastYear':
return yearsAgo(1);
Reproduce
- Have a subject whose last record was collected on 20 September and another on 3 October.
- On 7 October, open Datahub → Subjects → Filters and set Collected to "This month".
Actual: both subjects are listed.
Expected: only the subject collected in October is listed, or, if the rolling window is intended, the option reads "Past month" (and "Past week", "Past year") like the subject graph's timeframe menu.
Tests
apps/web/src/routes/_app/datahub/subjects/__tests__/index.test.tsx:it('should label the rolling collected windows as past periods, so they are not read as calendar months'), or, if calendar periods are chosen,it('should start the This month window on the first of the month')with fake timers.testing/src/specs/datahub.spec.ts: select the month preset and assert the option text matches the window applied.
Suggested fix
Relabel the three options "Past week", "Past month", "Past year" (es: "Última semana", "Último mes", "Último año"; fr: "Semaine écoulée", "Mois écoulé", "Année écoulée", matching datahub.json), so all presets describe spans. Alternatively, keep the labels and compute calendar boundaries in presetMinDate.
- Lingua principale
- TypeScript
- Stelle
- 119
- Fork
- 19
- Merge medio
- 1g 2h
- PR unite (30g)
- 56
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DouglasNeuroInformatics/OpenDataCapture
-
Area: Playground Bug Difficulty: Low Good First Issue Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
DouglasNeuroInformatics/OpenDataCapture#1805 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Instruments Bug Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
DouglasNeuroInformatics/OpenDataCapture#1801 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Instruments Bug Difficulty: Low Good First Issue Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
DouglasNeuroInformatics/OpenDataCapture#1800 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Instruments Bug Difficulty: Low Good First Issue Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
DouglasNeuroInformatics/OpenDataCapture#1799 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Instruments Bug Difficulty: Low Performance Priority: Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
DouglasNeuroInformatics/OpenDataCapture#1795 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di DouglasNeuroInformatics/OpenDataCapture
Issue simili
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
maniator/verticopolis#880 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
siyuan-note/siyuan#20353 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
black-forest-labs/skills#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Albert-Weasker/niubigeo#168 ·
I maintainer di solito rispondono entro 1 giorno