Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Manage Group has no section for FILE instruments, so they cannot be enabled or disabled for a group

Aperta Adatta ai principianti
#1,774 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia in apps/web/src/routes/_app/group/manage.tsx, soprattutto dal tipo CategorizedInstruments e dal ciclo di categorizzazione intorno alle righe 885–917; poi confronta la gestione di FILE in admin/instruments.tsx:169. Esegui quindi i casi indicati di manage.test.tsx e la specifica group-manage. Il lavoro è completato quando gli strumenti FILE vengono visualizzati con controlli di selezione funzionanti e il salvataggio di uno strumento non selezionato lo rimuove da Administer Instrument.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area: Web Bug Difficulty: Low Priority: Medium

The Manage Group page lists a group's instruments in three sections: Forms, Interactive and Series. It has no section for FILE instruments. The page builds those sections from GET /v1/instruments/info, which does return FILE instruments, but the categorising loop only has branches for FORM, INTERACTIVE and SERIES, so a FILE instrument is counted as visible and then pushed nowhere. A group manager can therefore neither see nor change whether a FILE instrument is available to their group. FILE instruments that exist when a group is created are connected to it automatically (GroupsService.create connects every non-repo instrument), and stay switched on with no way to turn them off. A FILE instrument imported from a repository, or uploaded after the group was created, can never be switched on, so it never appears in Administer Instrument for that group. The admin Instruments page (admin/instruments.tsx:169) already handles FILE, so this page is the odd one out.

Where

apps/web/src/routes/_app/group/manage.tsx:58-62:

type CategorizedInstruments = {
  form: InstrumentItem[];
  interactive: InstrumentItem[];
  series: SeriesInstrumentItem[];
};

and manage.tsx:885-917, where visibleIds.add(instrument.id) runs for every kind but the item is pushed only for three of them:

visibleIds.add(instrument.id);
// ...
if (instrument.kind === 'FORM') {
  instruments.form.push(item);
} else if (instrument.kind === 'INTERACTIVE') {
  instruments.interactive.push(item);
} else if (instrument.kind === 'SERIES') {
  instruments.series.push({ ...item, seriesItems: instrument.seriesItems });
}

Reproduce

  1. Run a development instance with demo data (it seeds the built-in MRI Scan Session and Arbitrary File Upload FILE instruments before creating the demo groups).
  2. As a group manager, start a session and open Administer Instrument: MRI Scan Session is offered.
  3. Open Manage Group.

Actual: MRI Scan Session and Arbitrary File Upload appear in none of the sections, so they cannot be unticked. Likewise, a FILE instrument from a repository assigned to the group is never listed and cannot be ticked.
Expected: a "File" section (or FILE instruments within an existing section) lists them with the same checkbox, repository badge and preview as the other kinds, and saving honours the selection.

Tests

  • apps/web/src/routes/_app/group/__tests__/manage.test.tsx: it('should list FILE instruments so a group manager can enable or disable them') and it('should remove a FILE instrument from the group when it is unticked and saved').
  • testing/src/specs/group-manage.spec.ts: untick MRI Scan Session, save, and assert it no longer appears in Administer Instrument.

Suggested fix

Add a file bucket to CategorizedInstruments, push kind === 'FILE' items into it, and render it with InstrumentSection under a translated "File" heading. Ending the chain with an exhaustive match / satisfies never would make the next new kind fail to compile instead of disappearing silently.

Lingua principale
TypeScript
Stelle
119
Fork
19
Merge medio
4g 11h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DouglasNeuroInformatics/OpenDataCapture

Tutte le issue di DouglasNeuroInformatics/OpenDataCapture

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.