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

Abierto Apto para principiantes
#1,774 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
85/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Empieza en apps/web/src/routes/_app/group/manage.tsx, especialmente en el tipo CategorizedInstruments y el bucle de categorización alrededor de las líneas 885–917; luego compara el manejo de FILE en admin/instruments.tsx:169. Después, ejecuta los casos indicados de manage.test.tsx y la especificación group-manage. Se habrá terminado cuando los instrumentos FILE aparezcan con controles de selección funcionales y guardar un instrumento sin marcar lo elimine de Administer Instrument.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
119
Forks
19
Merge medio
5 d 18 h
PR fusionados (30 d)
38

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DouglasNeuroInformatics/OpenDataCapture

Todos los issues de DouglasNeuroInformatics/OpenDataCapture

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.