You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(managedBy): one parser for the userActions override shape (completes #2712, framework#3343) (#2724)
#2712 consolidated the bucket union + affordance set mirrors but left four
surfaces still parsing the `userActions.{create,edit,delete}` override shape by
hand. They now all route through the shared @object-ui/core policy — no package
re-implements the boolean / #2614-object-form parse locally.
- core: promote internal `normalizeOverride` to exported `normalizeUserAction`
(the one parser) + add `userActionPredicates` for per-record predicate extraction.
- app-shell/managedByEmptyState: writable-`system` create check + local
`EmptyStateUserActions` → `resolveCrudAffordances({ managedBy, userActions }).create`.
- plugin-grid/rowCrudAffordances: local `isOptedOut`/`predicatesOf` + duplicated
types fold into `normalizeUserAction`; historical type names stay re-exported.
- plugin-detail/RelatedList: inline `predicatesOf` → `userActionPredicates`.
- plugin-form/ObjectForm: hand-rolled `managedBy !== 'platform'` blanket lock +
userActions unlock → resolved affordance for the mode (edit/create), the same
`resolveCrudAffordances` contract detail (`isObjectInlineEditable`) and grid use.
Behavior-preserving for platform/system/append-only/better-auth, with one
deliberate alignment: an admin-editable `config` object (sys_webhook,
sys_permission_set) is now editable in ObjectForm — it was over-locked as
non-`platform` while detail/grid already treated it as editable (config resolves
edit:true). New unit coverage for the shared parser + the config/create-mode form
gate; all existing affordance/edit-gate tests stay green.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
**Finish the `managedBy` / `userActions` de-dup — one parser for the override shape (completes objectui#2712, framework#3343).**#2712 consolidated the bucket *union* + affordance *set* mirrors but left four surfaces still parsing the `userActions.{create,edit,delete}` override shape by hand. They now all route through the shared `@object-ui/core` policy, so no package re-implements the boolean / #2614-object-form parse locally.
10
+
11
+
-**`@object-ui/core`** promotes the internal `normalizeOverride` to the exported **`normalizeUserAction(v, base)`** (the one parser) and adds **`userActionPredicates(v)`** for per-record CEL predicate extraction.
12
+
-**`app-shell/utils/managedByEmptyState.ts`** — the writable-`system` create check and its local `EmptyStateUserActions` interface are replaced by `resolveCrudAffordances({ managedBy, userActions }).create`.
13
+
-**`plugin-grid/rowCrudAffordances.ts`** — the local `isOptedOut` / `predicatesOf` helpers (and duplicated `RowCrudUserAction` / `RowCrudPredicates` types) fold into `normalizeUserAction`; the historical type names stay re-exported for compat.
14
+
-**`plugin-detail/RelatedList.tsx`** — its inline `predicatesOf` fold into `userActionPredicates`.
15
+
-**`plugin-form/ObjectForm.tsx`** — the hand-rolled `managedBy !== 'platform'` blanket lock + `userActions` unlock is replaced by the resolved affordance for the current mode (`edit` / `create`), the **same**`resolveCrudAffordances` contract the detail (`isObjectInlineEditable`) and grid surfaces use.
16
+
17
+
Behavior-preserving for `platform` / `system` / `append-only` / `better-auth`, with one deliberate alignment: an admin-editable **`config`**-bucket object (e.g. `sys_webhook`, `sys_permission_set`) is now editable in `ObjectForm` — it was previously over-locked as "non-`platform`", while detail/grid already treated it as editable (`config` resolves `edit: true`). New unit coverage for the shared parser and the config / create-mode form gate; all existing affordance/edit-gate tests stay green.
0 commit comments