diff --git a/apps/web/src/routes/_app/group/manage.tsx b/apps/web/src/routes/_app/group/manage.tsx index 5d2ff64ec..c614be356 100644 --- a/apps/web/src/routes/_app/group/manage.tsx +++ b/apps/web/src/routes/_app/group/manage.tsx @@ -30,6 +30,7 @@ type ManageGroupFormProps = { initialValues: { accessibleFormInstrumentIds: Set; accessibleInteractiveInstrumentIds: Set; + accessibleSeriesInstrumentIds: Set; defaultIdentificationMethod?: SubjectIdentificationMethod; idValidationRegex?: null | string; minimumAge?: null | number; @@ -68,6 +69,12 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) => label: t('group.manage.interactive'), options: availableInstrumentOptions.interactive, variant: 'listbox' + }, + accessibleSeriesInstrumentIds: { + kind: 'set', + label: t('group.manage.series'), + options: availableInstrumentOptions.series, + variant: 'listbox' } }, title: t('group.manage.accessibleInstruments') @@ -190,6 +197,7 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) => .object({ accessibleFormInstrumentIds: z.set(z.string()), accessibleInteractiveInstrumentIds: z.set(z.string()), + accessibleSeriesInstrumentIds: z.set(z.string()), defaultIdentificationMethod: $SubjectIdentificationMethod.optional(), idValidationRegex: $RegexString.optional(), idValidationRegexErrorMessageEn: z.string().optional(), @@ -214,7 +222,11 @@ const ManageGroupForm = ({ data, onSubmit, readOnly }: ManageGroupFormProps) => })} onSubmit={(data) => { void onSubmit({ - accessibleInstrumentIds: [...data.accessibleFormInstrumentIds, ...data.accessibleInteractiveInstrumentIds], + accessibleInstrumentIds: [ + ...data.accessibleFormInstrumentIds, + ...data.accessibleInteractiveInstrumentIds, + ...data.accessibleSeriesInstrumentIds + ], settings: { defaultIdentificationMethod: data.defaultIdentificationMethod, idValidationRegex: data.idValidationRegex, @@ -258,6 +270,7 @@ const RouteComponent = () => { const initialValues = { accessibleFormInstrumentIds: new Set(), accessibleInteractiveInstrumentIds: new Set(), + accessibleSeriesInstrumentIds: new Set(), defaultIdentificationMethod, idValidationRegex: settings?.idValidationRegex, idValidationRegexErrorMessageEn: settings?.idValidationRegexErrorMessage?.en, @@ -277,6 +290,11 @@ const RouteComponent = () => { if (accessibleInstrumentIds?.includes(instrument.id)) { initialValues.accessibleInteractiveInstrumentIds.add(instrument.id); } + } else if (instrument.kind === 'SERIES') { + availableInstrumentOptions.series[instrument.id] = instrument.details.title; + if (accessibleInstrumentIds?.includes(instrument.id)) { + initialValues.accessibleSeriesInstrumentIds.add(instrument.id); + } } } return { availableInstrumentOptions, initialValues }; diff --git a/apps/web/src/translations/group.json b/apps/web/src/translations/group.json index 9141799f1..f078ba2d5 100644 --- a/apps/web/src/translations/group.json +++ b/apps/web/src/translations/group.json @@ -28,6 +28,10 @@ "en": "Interactive Tasks", "fr": "Tâches interactives" }, + "series": { + "en": "Series", + "fr": "Séries" + }, "pageTitle": { "en": "Manage Group", "fr": "Gestion du groupe" diff --git a/package.json b/package.json index 39d0a9c65..bd3440153 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opendatacapture", "type": "module", - "version": "1.13.4", + "version": "1.13.5", "private": true, "packageManager": "pnpm@10.7.0", "license": "Apache-2.0", @@ -85,13 +85,18 @@ "@prisma/engines", "@swc/core", "@tailwindcss/oxide", + "cypress", "esbuild", "mongodb-memory-server", "msgpackr-extract", "msw", "oxc-resolver", "prisma", - "sharp" + "sharp", + "sqlite3" + ], + "ignoredBuiltDependencies": [ + "@scarf/scarf" ] }, "__isODCRepo": true