Commit e7eceec
feat(spec): add SelectOption.visibleWhen; generalize Field.dependsOn (objectui#2284) (#2635)
Add a per-option CEL visibility predicate `SelectOption.visibleWhen` for
select/multiselect/radio fields — the option is offered only when TRUE,
evaluated against the live record + `current_user` (same binding environment as
a field-level `visibleWhen`). Expresses cascading/dependent options
(`record.country == 'cn'`) and role/context gating
(`'admin' in current_user.roles`) without a bespoke dependent-picklist matrix.
Shared by `Field.options` and view `FormField.options`. Generalize the
`Field.dependsOn` description to be mechanism-neutral (declares dependent
sibling fields for both lookup candidate-scoping and select option gating);
`{field,param}` stays lookup-only.
Client-side hiding is UX only — authorization-gated values must be rejected
server-side by the rule-validator.
Claude-Session: https://claude.ai/code/session_019aYFm77ddLp6tzuJjt9hK2
Co-authored-by: Claude <noreply@anthropic.com>1 parent e128a77 commit e7eceec
2 files changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
94 | 109 | | |
95 | 110 | | |
96 | 111 | | |
| |||
495 | 510 | | |
496 | 511 | | |
497 | 512 | | |
498 | | - | |
| 513 | + | |
499 | 514 | | |
500 | 515 | | |
501 | 516 | | |
| |||
0 commit comments