Skip to content
Closed
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
10 changes: 10 additions & 0 deletions .changeset/26849-action-keys-disabled-reason.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/core': patch
---

fix(core): the action key inventory lists the spec's `disabledReason`, so an action carrying it is no longer reported as having an unknown key

Clause-②: no
Metadata-protocol: none

`@objectstack/spec`'s `ActionSchema` declares `disabledReason`, the display-only sentence a greyed action shows to say why. `SPEC_ACTION_KEYS` in `@object-ui/core`, which restates every key that schema declares, did not list it, so the dev-mode unknown-key warning named it on a spec-valid action and the inventory's pin test failed. The entry is added. `ActionDef` is unchanged and nothing in the runner reads the key: its readers ship with the console's disabled-reason work.
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,6 @@ describe('unknown-key warning', () => {
unknown: ['targt'],
retired: ['execute'],
});
expect(classifyActionKeys({ type: 'script', disabledReason: 'Closed deals are locked' })).toEqual({ unknown: [], retired: [] });
});
});
7 changes: 7 additions & 0 deletions ui/packages/core/src/actions/actionKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ export const SPEC_ACTION_KEYS = [
// key, which is the only thing the inventory is consulted for.
'description',
'disabled',
// Added to `ActionSchema` by objectstack#26786: the display-only sentence a
// greyed action shows to say why. Listed for the reason `description` is —
// this array restates the spec's declared keys, so an action carrying it is
// not reported as having an unknown key. `ActionDef` does NOT declare it and
// nothing here reads it: its readers ship with the console half of
// objectstack#26619.
'disabledReason',
'errorMessage',
// No `execute`: its spec-17 tombstone (`retiredKey()`, objectstack#3855) aged
// out of `ActionSchema` at objectstack#25767 — the spec now refuses it as an
Expand Down
Loading