Commit 85761cf
test(showcase): a specimen for legacy string rowActions (objectui#2960) (#4101)
* test(showcase): a specimen for legacy string rowActions (objectui#2960)
objectui#2960: a list view declaring `rowActions: ['<action name>']` — the
pre-`rowActionDefs` authoring form — rendered a menu item that performed zero
network requests and reported success, and where the object ALSO declared the
same action at `list_item`, the row menu showed a working entry and a dead
duplicate of it side by side. Nothing in the showcase was authored the legacy
way, so the whole class was invisible here.
`showcase_task.legacy_row_actions` covers both cases a client has to handle,
using actions the object already declares:
showcase_recalc_estimate — `record_more` / `record_section`, i.e. NOT a
`list_item` action, so no def is derived for it. The client must resolve
the name against the object's actions or the entry is dead.
showcase_quick_view — already a `list_item` action, so a def IS derived
independently. Naming it here too must not produce a second, dead copy.
`showcase_recalc_estimate` also gains `recordIdParam: 'recordId'`. Its endpoint
is record-scoped and rejects a body without an id; on a record surface the page
supplies one, but invoked from a list row nothing else can — the row id is
injected only for an action that names the body key it belongs in. Without it
the specimen's own action answers 400 "recordId required" from a row. This is
additive on the record surfaces, where the id was already being supplied.
Browser-verified against this specimen (objectui PR #2996 in the console):
the row menu carries `Recalculate Estimate` and exactly ONE `Quick View`, and
clicking the former issues POST /api/v1/showcase/recalc -> 200 with the
action's own "Estimate recalculated." toast — not the runner's generic
"Action completed successfully", which is what the dead-end used to emit.
check:i18n-coverage unchanged (665, none new — a `listViews` label is not in
the i18n lint's scope, so no new debt), os lint 0 errors, 60 tests pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore: empty changeset — the specimen releases nothing
The Check Changeset gate requires every PR to add one, and names the empty
changeset as the sanctioned "this PR releases nothing" declaration. The change
is confined to `@objectstack/example-showcase` (`"private": true`), so no
published package moves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 4d7bebf commit 85761cf
3 files changed
Lines changed: 39 additions & 0 deletions
File tree
- .changeset
- examples/app-showcase/src/ui
- actions
- views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
| |||
0 commit comments