Commit 092bd85
* test(e2e-live): B3 cascading-options live e2e — client re-filter + server rejection (#2559 / #1583)
Adds e2e/live/cascading-options.spec.ts, the live-backend counterpart to the
no-backend docs e2e (e2e/cascading-options.spec.ts). Against the real console +
backend it drives the showcase `showcase_cascade` create form and asserts the
dual-side B3 contract:
- CLIENT: the child `province`'s offered option set re-filters as the parent
`country` changes, and a now-invalid child value clears (cascade-clear).
- SERVER: POST /api/v1/data/showcase_cascade rejects an out-of-set option value
(400 VALIDATION_FAILED / invalid_option) and accepts the in-set one — client
hiding is UX, the server is the boundary.
Excluded from the default/CI run (testIgnore '**/live/**'); opt-in via
`pnpm test:e2e:live` with the stack up. Requires the framework showcase_cascade
fixture (framework #2559).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S91NyYJURiQTKmF9q3AXxg
* fix(app-shell): bind current_user.positions into the client predicate scope; align role-gating examples (#1583 / ADR-0058)
The console forwarded only id/name/email/role/roles/isPlatformAdmin into the
expression scope, so a position-gated option predicate
(`'admin' in current_user.positions` — the shape the framework rule-validator
binds and enforces, EvalUser) faulted client-side and FAILED OPEN: the gated
option stayed visible to everyone and was only rejected by the server on
submit. Forward `positions` (auth payload already carries it) in AppContent and
RecordFormPage so client hiding and the server verdict agree.
Also switch every role-gating example from `current_user.roles` — a key the
server never binds, so a predicate written that way is never enforced — to
`current_user.positions`: schema-catalog role-gated-options.json, fields/select
docs, the skills guide, ADR-0058 example spellings, TSDoc on
SelectOption.visibleWhen, evaluator header comments, and the three unit tests'
mock scopes. Matches @objectstack/spec's own SelectOption.visibleWhen example.
Verified: optionRules/optionLint/SelectField.cascade/useExpression 51/51,
schema-catalog 836/836 (incl. the option-predicate guard), eslint 0 errors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S91NyYJURiQTKmF9q3AXxg
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent eeef906 commit 092bd85
15 files changed
Lines changed: 39 additions & 21 deletions
File tree
- .changeset
- content/docs/fields
- docs/adr
- examples/schema-catalog/src/schemas/fields-select
- packages
- app-shell/src
- console
- views
- core/src/evaluator
- __tests__
- fields/src/widgets
- types/src
- skills/objectui/guides
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
622 | 628 | | |
623 | | - | |
| 629 | + | |
624 | 630 | | |
625 | 631 | | |
626 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments