Skip to content

Commit 66216b8

Browse files
committed
chore(platform-objects): sys_organization section labels in every bundle; regenerate spec references; changeset
Claude-Session: https://claude.ai/code/session_016WV4cyCnzVPr9GuD38DdGt Co-authored-by: Claude <noreply@anthropic.com>
1 parent 53c5a49 commit 66216b8

7 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/lint': minor
4+
'@objectstack/platform-objects': minor
5+
---
6+
7+
feat(spec): a field group's `requiresFeature` hides the group where a deployment feature is off; Edit organization hides Parent Organization and Sort Order on a single-organization deployment
8+
9+
Clause-②: yes
10+
Metadata-protocol: added
11+
Skills-docs: follow-up owed — skills/objectstack-data/references/examples-objects.md (its Field Groups section teaches `fieldGroups` and should name `visibleWhen` and `requiresFeature` beside `collapse`); kept out of this diff so it does not become a governed (`skills/**`) change
12+
13+
On a deployment that runs one organization, Edit organization showed Parent Organization and Sort Order, two fields that order and group organizations against each other and so do nothing there. They are now hidden wherever the deployment does not run several organizations.
14+
15+
- **`@objectstack/spec`: `fieldGroups[].requiresFeature`.** A field group can name a deployment feature flag, from the same set an action's `requiresFeature` names (`PUBLIC_AUTH_FEATURES`), and a flag outside it is refused at parse. It is lowered at parse into the group's `visibleWhen`, exactly as the action key is lowered into `visible`, and the key is stripped from the output: `{ key: 'group_structure', label: 'Group Structure', requiresFeature: 'multiOrgEnabled' }` parses to a group whose `visibleWhen` is `features.multiOrgEnabled != false`. Beside an authored `visibleWhen` the two are AND-composed, the author's predicate first: `visibleWhen: "record.kind == 'child'"` gives `(record.kind == 'child') && features.multiOrgEnabled != false`. The form and the record page already evaluate a group's `visibleWhen` with the host's `features` in scope, so the gate holds on both. Like every group predicate it is presentation only: the fields stay readable and writable through the API. `lowerRequiresFeature` takes an optional third argument, the slot it lowers into (`'visible'`, the default, or `'visibleWhen'`), and its refusals name that slot. `PUBLIC_AUTH_FEATURES` books `sys_organization.fieldGroups.group_structure` under `multiOrgEnabled`; a `gatedInputs` path may now name a field group as `OBJECT.fieldGroups.KEY`.
16+
- **`@objectstack/lint`: the lowered gate is accepted.** A field group's `visibleWhen` keeps its root verdict (it binds `record`, `previous` and `parent`), except for the one trailing gate a `requiresFeature` lowers to, which `os validate`, `os build` and the object save door now accept. Any other `features` read in a group predicate is refused as before, and the message now points at `requiresFeature`.
17+
- **`@objectstack/platform-objects`: `sys_organization` declares its field groups.** Identity, Branding, Configuration and Group Structure, in the fields' own order, so every field keeps its place; `id`, `created_at` and `updated_at` stay ungrouped and last, as before. Group Structure (Parent Organization, Sort Order) carries `requiresFeature: 'multiOrgEnabled'`. The two fields' help, which says they matter only with several organizations, is unchanged.

‎content/docs/references/data/object.mdx‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ const result = ApiMethod.parse(data);
320320
| **description** | `string` | optional | Optional description shown under the group header |
321321
| **relatedList** | `string` | optional | Places a related list's body table at this position in the record's details column instead of a section of fields: names one inbound relationship, as a relatedLists entry does (child object, or object.field when that child has more than one relationship to this object). A group with relatedList holds no fields: a field that names it as its group is refused. The name is judged as a relatedLists entry is: refused when its child is in the stack with no inbound lookup / master_detail field, or exists nowhere (by os validate / os build, which leave a sys_ / cloud_ / ai_ name to the runtime, and by a metadata write that names no package); a write into a package stores it, and the record page places nothing for it. It names a body table only (a FK declaring relatedList: 'primary', or a master_detail FK that sets inlineEdit and declares no relatedList): a group naming a side card or a list hidden by relatedList: false draws nothing, so it is refused where the child's fields are known (os validate / os build and the metadata write door), naming the FK and the remedy (set relatedList: 'primary' on it, name only the body table as object.field when a bare child name also names a side card, or remove the group's relatedList). |
322322
| **visibleWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Section visibility predicate (CEL) — the whole group (header included) is shown only when TRUE, else hidden (fail-closed). e.g. P`record.type == 'invoice'` |
323+
| **requiresFeature** | `Enum<'twoFactor' \| 'organization' \| 'multiOrgEnabled' \| 'degradedTenancy' \| …>` | optional | Deployment feature flag gating this group, from the same set an action's `requiresFeature` names (e.g. 'multiOrgEnabled'). Lowered at parse time into the group's `visibleWhen` (AND-composed after an authored `visibleWhen`) and stripped from the output; the whole group is hidden where the flag is off. Presentation only: the fields stay readable through the API. |
323324
| **collapse** | `Enum<'none' \| 'expanded' \| 'collapsed'>` | optional (default: `"none"`) | [ADR-0085] Section collapse behaviour: 'none' (always open, no toggle), 'expanded' (collapsible, starts open), 'collapsed' (collapsible, starts closed). |
324325
| **defaultExpanded** | `boolean` | optional | [DEPRECATED → collapse] true → 'expanded', false → 'collapsed'. |
325326
| **collapsible** | `boolean` | optional | [DEPRECATED → collapse] Boolean pair with `collapsed`; use the `collapse` enum. |
@@ -724,11 +725,28 @@ External datasource binding (ADR-0015)
724725
| **description** | `string` | optional | Optional description shown under the group header |
725726
| **relatedList** | `string` | optional | Places a related list's body table at this position in the record's details column instead of a section of fields: names one inbound relationship, as a relatedLists entry does (child object, or object.field when that child has more than one relationship to this object). A group with relatedList holds no fields: a field that names it as its group is refused. The name is judged as a relatedLists entry is: refused when its child is in the stack with no inbound lookup / master_detail field, or exists nowhere (by os validate / os build, which leave a sys_ / cloud_ / ai_ name to the runtime, and by a metadata write that names no package); a write into a package stores it, and the record page places nothing for it. It names a body table only (a FK declaring relatedList: 'primary', or a master_detail FK that sets inlineEdit and declares no relatedList): a group naming a side card or a list hidden by relatedList: false draws nothing, so it is refused where the child's fields are known (os validate / os build and the metadata write door), naming the FK and the remedy (set relatedList: 'primary' on it, name only the body table as object.field when a bare child name also names a side card, or remove the group's relatedList). |
726727
| **visibleWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Section visibility predicate (CEL) — the whole group (header included) is shown only when TRUE, else hidden (fail-closed). e.g. P`record.type == 'invoice'` |
728+
| **requiresFeature** | `Enum<'twoFactor' \| 'organization' \| 'multiOrgEnabled' \| 'degradedTenancy' \| 'oidcProvider' \| 'sso' \| 'ssoEnforced' \| 'deviceAuthorization' \| 'admin' \| 'phoneNumber' \| … +3 more>` | optional | Deployment feature flag gating this group, from the same set an action's `requiresFeature` names (e.g. 'multiOrgEnabled'). Lowered at parse time into the group's `visibleWhen` (AND-composed after an authored `visibleWhen`) and stripped from the output; the whole group is hidden where the flag is off. Presentation only: the fields stay readable through the API. |
727729
| **collapse** | `Enum<'none' \| 'expanded' \| 'collapsed'>` | optional (default: `"none"`) | [ADR-0085] Section collapse behaviour: 'none' (always open, no toggle), 'expanded' (collapsible, starts open), 'collapsed' (collapsible, starts closed). |
728730
| **defaultExpanded** | `boolean` | optional | [DEPRECATED → collapse] true → 'expanded', false → 'collapsed'. |
729731
| **collapsible** | `boolean` | optional | [DEPRECATED → collapse] Boolean pair with `collapsed`; use the `collapse` enum. |
730732
| **collapsed** | `boolean` | optional | [DEPRECATED → collapse] true → 'collapsed' (collapsible, starts closed) on its own — it needs no `collapsible` and outranks `collapsible: false`; false → 'none', or 'expanded' beside `collapsible: true`. Use the `collapse` enum. |
731733

734+
### Allowed Values: `ObjectFieldGroup.requiresFeature`
735+
736+
* `twoFactor`
737+
* `organization`
738+
* `multiOrgEnabled`
739+
* `degradedTenancy`
740+
* `oidcProvider`
741+
* `sso`
742+
* `ssoEnforced`
743+
* `deviceAuthorization`
744+
* `admin`
745+
* `phoneNumber`
746+
* `cloudManaged`
747+
* `phoneNumberOtp`
748+
* `emailDelivery`
749+
732750

733751
---
734752

‎packages/platform-objects/src/apps/translations/en.objects.generated.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,20 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
634634
confirmText: "Leave this organization? You will lose access to its environments and members.",
635635
successMessage: "You have left the organization"
636636
}
637+
},
638+
_sections: {
639+
identity: {
640+
label: "Identity"
641+
},
642+
branding: {
643+
label: "Branding"
644+
},
645+
configuration: {
646+
label: "Configuration"
647+
},
648+
group_structure: {
649+
label: "Group Structure"
650+
}
637651
}
638652
},
639653
sys_member: {

‎packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,20 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
634634
confirmText: "¿Abandonar esta organización? Perderá el acceso a sus entornos y miembros.",
635635
successMessage: "Ha abandonado la organización"
636636
}
637+
},
638+
_sections: {
639+
identity: {
640+
label: "Identidad"
641+
},
642+
branding: {
643+
label: "Marca"
644+
},
645+
configuration: {
646+
label: "Configuración"
647+
},
648+
group_structure: {
649+
label: "Estructura del grupo"
650+
}
637651
}
638652
},
639653
sys_member: {

‎packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,20 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
634634
confirmText: "この組織から退出しますか?この組織の環境とメンバーへのアクセスを失います。",
635635
successMessage: "組織から退出しました"
636636
}
637+
},
638+
_sections: {
639+
identity: {
640+
label: "基本情報"
641+
},
642+
branding: {
643+
label: "ブランディング"
644+
},
645+
configuration: {
646+
label: "設定"
647+
},
648+
group_structure: {
649+
label: "グループ構成"
650+
}
637651
}
638652
},
639653
sys_member: {

‎packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,20 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
634634
confirmText: "要退出该组织吗?退出后你将失去对其环境和成员的访问权限。",
635635
successMessage: "你已退出该组织"
636636
}
637+
},
638+
_sections: {
639+
identity: {
640+
label: "基本信息"
641+
},
642+
branding: {
643+
label: "品牌"
644+
},
645+
configuration: {
646+
label: "配置"
647+
},
648+
group_structure: {
649+
label: "集团结构"
650+
}
637651
}
638652
},
639653
sys_member: {

‎packages/spec/authorable-surface/data.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@
713713
"data/ObjectFieldGroup:key",
714714
"data/ObjectFieldGroup:label",
715715
"data/ObjectFieldGroup:relatedList",
716+
"data/ObjectFieldGroup:requiresFeature",
716717
"data/ObjectFieldGroup:visibleWhen",
717718
"data/PerOperationRequiredPermissions:create",
718719
"data/PerOperationRequiredPermissions:delete",

0 commit comments

Comments
 (0)