Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/showcase-bulk-actions-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
---

Showcase-only: a `bulk_actions` view on `showcase_task` demonstrating
`bulkActions` (declared object actions fanned out over the selected records),
plus the UI tour note distinguishing it from `bulkActionDefs`. Releases
nothing — `@objectstack/example-showcase` is private.
6 changes: 6 additions & 0 deletions examples/app-showcase/src/docs/showcase_tour_ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ canonical example of each linked from that page.
surface.
- `src/ui/actions/` — the ActionType × location matrix (script / url /
modal / flow / api / form), visible as buttons across Task screens.
- Actions over a SELECTION come in two flavours, one view each: Task's
**Bulk Actions** names declared actions in `bulkActions`, and each selected
record is fanned out through the action runner (a script and a custom
endpoint, neither of them a field patch); Project's `bulkActionDefs` instead
mass-EDITS through the data API. `action.bulkEnabled` is not a third way —
it was retired in spec 17 and its tombstone points at `bulkActions`.

## Themes

Expand Down
1 change: 1 addition & 0 deletions examples/app-showcase/src/system/translations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export const ShowcaseTranslationBundle = {
map: { label: '工作地点地图' },
chart: { label: '工时按状态分布' },
legacy_row_actions: { label: '旧式行操作' },
bulk_actions: { label: '批量操作' },
},
},
showcase_account: {
Expand Down
36 changes: 36 additions & 0 deletions examples/app-showcase/src/ui/views/task.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,42 @@ export const TaskViews = defineView({
rowActions: ['showcase_recalc_estimate', 'showcase_quick_view'],
},

// ── Bulk actions — one declared action over the SELECTED records ──────
// The selection-bar twin of `legacy_row_actions` above, and — unlike that
// fixture — the CANONICAL authoring form, not a legacy one. `bulkActions`
// is the only way to declare a bulk action: `action.bulkEnabled` was
// retired in spec 17 (#3896 close-out) precisely because nothing ever
// consumed it, and its tombstone prescribes this key instead.
//
// Complements `project.view.ts`'s `bulkActionDefs`, which is the OTHER
// bulk vocabulary: inline defs that mass-EDIT records through the data
// API (`operation: 'update'` + a patch). Here the selected records are
// instead fanned out through the action runner, one dispatch each, so an
// action that is not a field patch at all — a script, a custom endpoint —
// works over a selection. Both names are already declared on the object:
//
// `showcase_mark_done` — type `script`; its sandboxed body flips
// `done`/`progress` per record via the platform action route.
// `showcase_recalc_estimate` — type `api`; POSTs the showcase's own
// `/api/v1/showcase/recalc`, with `recordIdParam: 'recordId'` (already
// declared for the row surface) carrying each record's id.
//
// Neither declares `list_toolbar`: a bulk action is not a toolbar action,
// it needs a selection. Naming it here is the whole declaration.
bulk_actions: {
label: 'Bulk Actions',
type: 'grid',
data,
columns: [
{ field: 'title' },
{ field: 'assignee' },
{ field: 'estimate_hours' },
{ field: 'progress' },
{ field: 'done' },
],
bulkActions: ['showcase_mark_done', 'showcase_recalc_estimate'],
},

// 0 ── Tabular ───────────────────────────────────────────────────────
// ADR-0021 Phase 2: replaces the former `showcase_task_list` report
// (a flat record list — a ListView concern, not analytics).
Expand Down
Loading