Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

TEDY.12 — List bulk actions (CS / VS / MS)

State: Built — multi-select bulk actions on the main Code System / Value Set / Map Set lists and on a Space’s linked CS/VS/MS tabs. Template: tool-feature. Prefix: TEDY.

Overview

An enhancement over the reference editor (whose lists had only per-row actions): the CS/VS/MS lists gain a Select mode with a Gmail-style floating bulk-action bar, so lifecycle operations run across a selection. Built on ResourceList’s native selection config (a header Select toggle adds the checkbox column; bulkActions renders the bar while ≥1 row is selected).

Actions

Each action applies to the eligible subset of the selection (by each row’s latest-version status) and reports success/failure counts (Promise.allSettled):

  • Activate — the selected draft rows → changeXVersionStatus(id, latestVersion, 'active').
  • Retire — the selected active rows → …'retired'.
  • Add to releasedraft + active rows → a draft-release picker modal (GET /releases?status=draft) → POST /releases/{id}/resources {resourceType, resourceId, resourceVersion, resourceNames} per row.
  • Delete — every selected row → deleteX(id) (danger confirm).
  • Unlink (Space tabs only) — every selected row → unlinkResourceFromSpace(spaceId, type, id) (the space-context equivalent of delete; removes the link, not the resource).

Shared component

components/ResourceBulkActions.tsx — the bar content, parametrized so all four (main CS/VS/MS + the Space tab) reuse it: { resourceType:'CodeSystem'|'ValueSet'|'MapSet', items:BulkItem[], clear, changeStatus, remove, onUnlink?, onDone, canWrite, canMaintain, canRelease, canUnlink? }. BulkItem { id, version?, status?, names? } — each list normalizes its own rows (CS/VS use lastVersion, MS uses versions[0]; the Space tab uses latestOf() across both). The release picker uses releaseClient (searchReleases / addResourceToRelease).

Wiring

  • Main lists: CodeSystemList / ValueSetList / MapSetList pass selection={{ selectedKeys, onChange, bulkActions }}.
  • Space tabs: SpaceResourceListTab passes the same plus onUnlink + canUnlink; the space query is decorated (lastVersionDecorated / versionsDecorated) so the Status column and bulk actions have a version/status.

Privileges

Activate/Retire gate on *.{Type}.write; Delete on *.{Type}.maintain; Add to release on *.Release.write; Unlink on the space write privilege (*.Space.write / {id}.Space.write). Each button renders only when its privilege is held.

i18n

tedy.list.bulk.* (activateN, retireN, addToReleaseN, deleteN, unlinkN, deleteConfirm, unlinkConfirm, addToRelease, selectRelease, done, partial, …).

Notes / limits

  • The release success path is exercisable only with a draft release present; on a fresh backend create one first.
  • Destructive confirms (activate/retire/delete/add) mutate real resources — there is no dry-run.