@objectstack/platform-objects 13.0.0 → 14.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/index.d.mts +1 -1
- package/dist/apps/index.d.ts +1 -1
- package/dist/apps/index.js +7 -6
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/index.mjs +7 -6
- package/dist/apps/index.mjs.map +1 -1
- package/dist/identity/index.d.mts +668 -39
- package/dist/identity/index.d.ts +668 -39
- package/dist/identity/index.js +120 -3
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/index.mjs +120 -3
- package/dist/identity/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +258 -265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +258 -266
- package/dist/index.mjs.map +1 -1
- package/dist/metadata-translations/index.js +20 -256
- package/dist/metadata-translations/index.js.map +1 -1
- package/dist/metadata-translations/index.mjs +20 -256
- package/dist/metadata-translations/index.mjs.map +1 -1
- package/dist/pages/index.d.mts +34 -3
- package/dist/pages/index.d.ts +34 -3
- package/dist/pages/index.js +111 -0
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/index.mjs +111 -1
- package/dist/pages/index.mjs.map +1 -1
- package/dist/plugin.js +25 -260
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +25 -260
- package/dist/plugin.mjs.map +1 -1
- package/package.json +3 -3
package/dist/pages/index.d.mts
CHANGED
|
@@ -58,8 +58,8 @@ declare const SysOrganizationDetailPage: Page;
|
|
|
58
58
|
* admin-internal audit columns. Banned / ban metadata is still
|
|
59
59
|
* editable from the header actions — we just don't show it in
|
|
60
60
|
* every user's body.
|
|
61
|
-
* - `tabs` is **explicitly curated** to the
|
|
62
|
-
* on a user profile (Sessions / Linked Accounts / Organizations /
|
|
61
|
+
* - `tabs` is **explicitly curated** to the 5 related lists that matter
|
|
62
|
+
* on a user profile (Positions / Sessions / Linked Accounts / Organizations /
|
|
63
63
|
* Personal OAuth Apps). Without this override, the synthesizer
|
|
64
64
|
* auto-generates a tab per object that has a FK to sys_user
|
|
65
65
|
* (sys_position.created_by, sys_email.updated_by, sys_user_preference,
|
|
@@ -70,4 +70,35 @@ declare const SysOrganizationDetailPage: Page;
|
|
|
70
70
|
*/
|
|
71
71
|
declare const SysUserDetailPage: Page;
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
/**
|
|
74
|
+
* sys_position — Record Detail Page (slotted, default for ALL sys_position
|
|
75
|
+
* records)
|
|
76
|
+
*
|
|
77
|
+
* **Audience**: admins managing capability distribution from Setup.
|
|
78
|
+
*
|
|
79
|
+
* A position (岗位, ADR-0090 D3) is the flat distribution group: users hold
|
|
80
|
+
* it (`sys_user_position`), and it binds permission sets
|
|
81
|
+
* (`sys_position_permission_set`). This page makes both edges manageable
|
|
82
|
+
* as PURE SDUI — two `record:related_list` tabs with Add pickers; no
|
|
83
|
+
* bespoke React:
|
|
84
|
+
*
|
|
85
|
+
* - **Holders** — who holds this position. `sys_user_position.position`
|
|
86
|
+
* stores the position's MACHINE NAME, so the list keys on
|
|
87
|
+
* `relationshipValueField: 'name'` (the generic name-keyed-junction
|
|
88
|
+
* affordance this page motivated). Assigning here inserts an ordinary
|
|
89
|
+
* assignment row; the ADR-0090 D12 delegated-admin gate governs the
|
|
90
|
+
* write and its denial reason surfaces in the Add dialog. The
|
|
91
|
+
* `business_unit_id` column is the assignment-level BU anchor
|
|
92
|
+
* (ADR-0090 Addendum); `valid_from`/`valid_until` columns join it when
|
|
93
|
+
* ADR-0091 L1 lands.
|
|
94
|
+
* - **Permission Sets** — what the position distributes
|
|
95
|
+
* (`sys_position_permission_set`, ordinary id-keyed junction). Binding
|
|
96
|
+
* is guarded by BOTH the audience-anchor gate (D5/D9 — high-privilege
|
|
97
|
+
* sets never bind to everyone/guest) and the D12 gate.
|
|
98
|
+
*
|
|
99
|
+
* Header/actions fall through to the synthesizer, so the object's declared
|
|
100
|
+
* row actions (activate/deactivate/clone/set-default) keep working.
|
|
101
|
+
*/
|
|
102
|
+
declare const SysPositionDetailPage: Page;
|
|
103
|
+
|
|
104
|
+
export { SysOrganizationDetailPage, SysPositionDetailPage, SysUserDetailPage };
|
package/dist/pages/index.d.ts
CHANGED
|
@@ -58,8 +58,8 @@ declare const SysOrganizationDetailPage: Page;
|
|
|
58
58
|
* admin-internal audit columns. Banned / ban metadata is still
|
|
59
59
|
* editable from the header actions — we just don't show it in
|
|
60
60
|
* every user's body.
|
|
61
|
-
* - `tabs` is **explicitly curated** to the
|
|
62
|
-
* on a user profile (Sessions / Linked Accounts / Organizations /
|
|
61
|
+
* - `tabs` is **explicitly curated** to the 5 related lists that matter
|
|
62
|
+
* on a user profile (Positions / Sessions / Linked Accounts / Organizations /
|
|
63
63
|
* Personal OAuth Apps). Without this override, the synthesizer
|
|
64
64
|
* auto-generates a tab per object that has a FK to sys_user
|
|
65
65
|
* (sys_position.created_by, sys_email.updated_by, sys_user_preference,
|
|
@@ -70,4 +70,35 @@ declare const SysOrganizationDetailPage: Page;
|
|
|
70
70
|
*/
|
|
71
71
|
declare const SysUserDetailPage: Page;
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
/**
|
|
74
|
+
* sys_position — Record Detail Page (slotted, default for ALL sys_position
|
|
75
|
+
* records)
|
|
76
|
+
*
|
|
77
|
+
* **Audience**: admins managing capability distribution from Setup.
|
|
78
|
+
*
|
|
79
|
+
* A position (岗位, ADR-0090 D3) is the flat distribution group: users hold
|
|
80
|
+
* it (`sys_user_position`), and it binds permission sets
|
|
81
|
+
* (`sys_position_permission_set`). This page makes both edges manageable
|
|
82
|
+
* as PURE SDUI — two `record:related_list` tabs with Add pickers; no
|
|
83
|
+
* bespoke React:
|
|
84
|
+
*
|
|
85
|
+
* - **Holders** — who holds this position. `sys_user_position.position`
|
|
86
|
+
* stores the position's MACHINE NAME, so the list keys on
|
|
87
|
+
* `relationshipValueField: 'name'` (the generic name-keyed-junction
|
|
88
|
+
* affordance this page motivated). Assigning here inserts an ordinary
|
|
89
|
+
* assignment row; the ADR-0090 D12 delegated-admin gate governs the
|
|
90
|
+
* write and its denial reason surfaces in the Add dialog. The
|
|
91
|
+
* `business_unit_id` column is the assignment-level BU anchor
|
|
92
|
+
* (ADR-0090 Addendum); `valid_from`/`valid_until` columns join it when
|
|
93
|
+
* ADR-0091 L1 lands.
|
|
94
|
+
* - **Permission Sets** — what the position distributes
|
|
95
|
+
* (`sys_position_permission_set`, ordinary id-keyed junction). Binding
|
|
96
|
+
* is guarded by BOTH the audience-anchor gate (D5/D9 — high-privilege
|
|
97
|
+
* sets never bind to everyone/guest) and the D12 gate.
|
|
98
|
+
*
|
|
99
|
+
* Header/actions fall through to the synthesizer, so the object's declared
|
|
100
|
+
* row actions (activate/deactivate/clone/set-default) keep working.
|
|
101
|
+
*/
|
|
102
|
+
declare const SysPositionDetailPage: Page;
|
|
103
|
+
|
|
104
|
+
export { SysOrganizationDetailPage, SysPositionDetailPage, SysUserDetailPage };
|
package/dist/pages/index.js
CHANGED
|
@@ -159,6 +159,38 @@ var SysUserDetailPage = {
|
|
|
159
159
|
type: "line",
|
|
160
160
|
position: "top",
|
|
161
161
|
items: [
|
|
162
|
+
{
|
|
163
|
+
label: "Positions",
|
|
164
|
+
icon: "shield-check",
|
|
165
|
+
children: [
|
|
166
|
+
{
|
|
167
|
+
// [ADR-0090 D3] Position assignments (岗位分派) — pure SDUI:
|
|
168
|
+
// the Add picker creates sys_user_position rows storing the
|
|
169
|
+
// position's MACHINE NAME (valueField: 'name'), and every
|
|
170
|
+
// server-side rule (the D12 delegated-admin gate, audience-
|
|
171
|
+
// anchor rejection) surfaces its error in the dialog.
|
|
172
|
+
type: "record:related_list",
|
|
173
|
+
properties: {
|
|
174
|
+
objectName: "sys_user_position",
|
|
175
|
+
relationshipField: "user_id",
|
|
176
|
+
columns: ["position", "business_unit_id", "granted_by", "created_at"],
|
|
177
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
178
|
+
limit: 25,
|
|
179
|
+
showViewAll: true,
|
|
180
|
+
title: "Positions",
|
|
181
|
+
add: {
|
|
182
|
+
picker: {
|
|
183
|
+
object: "sys_position",
|
|
184
|
+
valueField: "name",
|
|
185
|
+
labelField: "label"
|
|
186
|
+
},
|
|
187
|
+
linkField: "position",
|
|
188
|
+
label: "Assign position"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
162
194
|
{
|
|
163
195
|
label: "Sessions",
|
|
164
196
|
icon: "monitor",
|
|
@@ -365,7 +397,86 @@ var SysUserDetailPage = {
|
|
|
365
397
|
}
|
|
366
398
|
};
|
|
367
399
|
|
|
400
|
+
// src/pages/sys-position.page.ts
|
|
401
|
+
var SysPositionDetailPage = {
|
|
402
|
+
name: "sys_position_detail",
|
|
403
|
+
label: "Position",
|
|
404
|
+
type: "record",
|
|
405
|
+
object: "sys_position",
|
|
406
|
+
template: "default",
|
|
407
|
+
kind: "slotted",
|
|
408
|
+
isDefault: true,
|
|
409
|
+
regions: [],
|
|
410
|
+
slots: {
|
|
411
|
+
tabs: {
|
|
412
|
+
type: "page:tabs",
|
|
413
|
+
properties: {
|
|
414
|
+
type: "line",
|
|
415
|
+
position: "top",
|
|
416
|
+
items: [
|
|
417
|
+
{
|
|
418
|
+
label: "Holders",
|
|
419
|
+
icon: "users",
|
|
420
|
+
children: [
|
|
421
|
+
{
|
|
422
|
+
type: "record:related_list",
|
|
423
|
+
properties: {
|
|
424
|
+
objectName: "sys_user_position",
|
|
425
|
+
relationshipField: "position",
|
|
426
|
+
relationshipValueField: "name",
|
|
427
|
+
columns: ["user_id", "business_unit_id", "granted_by", "created_at"],
|
|
428
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
429
|
+
limit: 25,
|
|
430
|
+
showViewAll: true,
|
|
431
|
+
title: "Holders",
|
|
432
|
+
add: {
|
|
433
|
+
picker: {
|
|
434
|
+
object: "sys_user",
|
|
435
|
+
labelField: "name"
|
|
436
|
+
},
|
|
437
|
+
linkField: "user_id",
|
|
438
|
+
label: "Assign user"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
label: "Permission Sets",
|
|
446
|
+
icon: "lock",
|
|
447
|
+
children: [
|
|
448
|
+
{
|
|
449
|
+
type: "record:related_list",
|
|
450
|
+
properties: {
|
|
451
|
+
objectName: "sys_position_permission_set",
|
|
452
|
+
relationshipField: "position_id",
|
|
453
|
+
columns: ["permission_set_id", "created_at"],
|
|
454
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
455
|
+
limit: 25,
|
|
456
|
+
showViewAll: true,
|
|
457
|
+
title: "Permission Sets",
|
|
458
|
+
add: {
|
|
459
|
+
picker: {
|
|
460
|
+
object: "sys_permission_set",
|
|
461
|
+
labelField: "label"
|
|
462
|
+
},
|
|
463
|
+
linkField: "permission_set_id",
|
|
464
|
+
label: "Bind permission set"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
// No Chatter feed on an RBAC primitive.
|
|
474
|
+
discussion: []
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
|
|
368
478
|
exports.SysOrganizationDetailPage = SysOrganizationDetailPage;
|
|
479
|
+
exports.SysPositionDetailPage = SysPositionDetailPage;
|
|
369
480
|
exports.SysUserDetailPage = SysUserDetailPage;
|
|
370
481
|
//# sourceMappingURL=index.js.map
|
|
371
482
|
//# sourceMappingURL=index.js.map
|
package/dist/pages/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/sys-organization.page.ts","../../src/pages/sys-user.page.ts"],"names":[],"mappings":";;;AAiCO,IAAM,yBAAA,GAAkC;AAAA,EAC7C,IAAA,EAAM,yBAAA;AAAA,EAC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AAA,kBACP,WAAA,EAAa,CAAC,mBAAmB;AAAA;AACnC;AACF;AACF,WACF;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,YACE,KAAA,EAAO,UAAA;AAAA,YACP,IAAA,EAAM,WAAA;AAAA,YACN,QAAA,EAAU;AAAA,cACR;AAAA,gBACE,IAAA,EAAM,qBAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,UAAA,EAAY,aAAA;AAAA,kBACZ,iBAAA,EAAmB,SAAA;AAAA,kBACnB,SAAS,CAAC,MAAA,EAAQ,QAAA,EAAU,YAAA,EAAc,WAAW,YAAY,CAAA;AAAA,kBACjE,MAAM,CAAC,EAAE,OAAO,YAAA,EAAc,KAAA,EAAO,QAAQ,CAAA;AAAA,kBAC7C,KAAA,EAAO,EAAA;AAAA,kBACP,WAAA,EAAa,IAAA;AAAA,kBACb,KAAA,EAAO;AAAA;AACT;AACF;AACF;AACF;AACF;AACF,KACF;AAAA;AAAA,IAGA,YAAY;AAAC;AAEjB","file":"index.js","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_organization — Record Detail Page (slotted)\n *\n * Adds Members / Invitations / Teams tabs to the organization detail\n * page so an admin can manage the membership graph from a single place\n * instead of switching between three separate Setup list views.\n *\n * The page is `kind: 'slotted'` and overrides only the `tabs` slot —\n * header, actions, highlights, details and discussion fall through to\n * the synthesized default, so the organization's own fields and the\n * existing record-header actions (Set Active, Edit, Delete, Leave) are\n * preserved.\n *\n * Each tab is a `record:related_list` over a child object that already\n * has `organization_id` as a `Field.lookup('sys_organization')` — the\n * renderer scopes the list to the current organization automatically\n * (the related-list runtime uses the parent record id from the page\n * context as the filter value for `relationshipField`). The per-row\n * actions defined on each child object (invite_user, cancel_invitation,\n * remove_member, transfer_ownership, create_team, …) are inherited\n * unchanged — no admin endpoint has to be re-declared here.\n *\n * Notable omissions:\n * - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not\n * `organization_id`. They surface on the user's Account → Developer\n * section instead of the org detail.\n * - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,\n * add a fourth tab here.\n */\nexport const SysOrganizationDetailPage: Page = {\n name: 'sys_organization_detail',\n label: 'Organization',\n type: 'record',\n object: 'sys_organization',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n // `regions` is required by the Page schema even for slotted pages —\n // empty array lets the synthesizer fill in header/details/discussion\n // while the `slots.tabs` override below replaces the synthesized\n // tabs strip.\n regions: [],\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Members',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'organization_id',\n columns: ['user_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Members',\n },\n },\n ],\n },\n {\n label: 'Invitations',\n icon: 'mail',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_invitation',\n relationshipField: 'organization_id',\n columns: ['email', 'role', 'status', 'expires_at', 'inviter_id'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Invitations',\n },\n },\n ],\n },\n {\n label: 'Teams',\n icon: 'users-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_team',\n relationshipField: 'organization_id',\n columns: ['name', 'created_at', 'updated_at'],\n sort: [{ field: 'name', order: 'asc' }],\n limit: 25,\n showViewAll: true,\n title: 'Teams',\n },\n },\n ],\n },\n ],\n },\n },\n },\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_user — Record Detail Page (slotted, default for ALL sys_user records)\n *\n * **Audience**: admins browsing user records from Setup.\n *\n * The Account App's \"Profile\" entry no longer routes here — it points at\n * the `account:profile_card` Console component for a settings-form-style\n * personal profile. This page therefore optimizes for the admin\n * use case: scanning a user's signals (email/verification/2FA/role),\n * reviewing related sessions/orgs/oauth/api-keys, and triggering\n * admin actions (ban / impersonate / set_role).\n *\n * Strategy\n * --------\n * - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,\n * `details`, `tabs` and `discussion`. Header / actions fall through\n * to the synthesizer so the object's declared actions\n * (`update_my_profile / change_my_password / resend_verification_email\n * / ban_user / set_user_role / impersonate_user / …`) still appear\n * in the header overflow menu automatically.\n * - `highlights` promotes the four signals worth scanning at the top:\n * email, verification state, 2FA, platform role. Highlight fields\n * are auto-dropped from the details grid below.\n * - `details` re-groups remaining fields into sections and hides\n * admin-internal audit columns. Banned / ban metadata is still\n * editable from the header actions — we just don't show it in\n * every user's body.\n * - `tabs` is **explicitly curated** to the 4 related lists that matter\n * on a user profile (Sessions / Linked Accounts / Organizations /\n * Personal OAuth Apps). Without this override, the synthesizer\n * auto-generates a tab per object that has a FK to sys_user\n * (sys_position.created_by, sys_email.updated_by, sys_user_preference,\n * sys_email_template.created_by, …) producing dozens of noisy\n * \"查看全部\" cards on every profile.\n * - `discussion: []` removes the Chatter feed — it has no business\n * on a personal profile.\n */\nexport const SysUserDetailPage: Page = {\n name: 'sys_user_detail',\n label: 'User',\n type: 'record',\n object: 'sys_user',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n // ── Alert banners ─────────────────────────────────────────────\n // Conditional notices rendered between the page header and the\n // highlight strip. The unverified-email banner only shows for the\n // current user viewing their own profile (admins looking at other\n // users see nothing — they can use Setup actions instead).\n alerts: [\n {\n type: 'record:alert',\n properties: {\n severity: 'warning',\n icon: 'mail',\n title: '邮箱未验证',\n body: '验证你的邮箱以接收密码重置和重要的系统通知。',\n visible: 'record.id == ctx.user.id && record.email_verified == false',\n dismissible: false,\n action: {\n actionName: 'resend_verification_email',\n label: '重新发送验证邮件',\n },\n },\n },\n ],\n\n // ── Highlight chips above the fold ────────────────────────────\n highlights: {\n type: 'record:highlights',\n properties: {\n fields: ['email', 'email_verified', 'two_factor_enabled', 'role'],\n },\n },\n\n // ── Body / details grid ───────────────────────────────────────\n details: {\n type: 'record:details',\n properties: {\n hideFields: [\n 'id',\n 'banned',\n 'ban_reason',\n 'ban_expires',\n // already promoted to highlights:\n 'email',\n 'email_verified',\n 'two_factor_enabled',\n 'role',\n ],\n sections: [\n {\n label: 'Identity',\n fields: ['name', 'image'],\n },\n {\n label: 'Audit',\n fields: ['created_at', 'updated_at'],\n },\n ],\n },\n },\n\n // ── Tabs: curated related lists ───────────────────────────────\n // Only the 4 lists that are semantically about THIS user account.\n // Everything else (sys_position created_by, sys_email_template\n // updated_by, …) is incidental authorship metadata and would only\n // create noise.\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Sessions',\n icon: 'monitor',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_session',\n relationshipField: 'user_id',\n columns: ['user_agent', 'ip_address', 'created_at', 'expires_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Sessions',\n },\n },\n ],\n },\n {\n label: 'Linked Accounts',\n icon: 'link',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_account',\n relationshipField: 'user_id',\n columns: ['provider_id', 'account_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Linked Accounts',\n },\n },\n ],\n },\n {\n label: 'Organizations',\n icon: 'building-2',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'user_id',\n columns: ['organization_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Organizations',\n },\n },\n ],\n },\n {\n label: 'OAuth Apps',\n icon: 'key-square',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_oauth_application',\n relationshipField: 'user_id',\n columns: ['name', 'client_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'OAuth Apps',\n },\n },\n ],\n },\n // ── Security ──────────────────────────────────────────────\n // Grouped self-service security controls. Each `record:quick_actions`\n // pulls its actions by name from the sys_user object metadata\n // (DRY — definitions stay on the object) and filters by\n // `location: 'record_section'` so they only render here, not\n // in the global header row.\n {\n label: 'Security',\n icon: 'shield',\n children: [\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Password & Sign-in',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Change your password or the email address associated with this account.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['change_my_password', 'change_my_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Two-Factor Authentication',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['enable_two_factor', 'disable_two_factor', 'generate_backup_codes'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Email Verification',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Verify your email so password resets and notifications reach you. The button appears only while verification is pending.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['resend_verification_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Danger Zone',\n },\n className: 'text-destructive',\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Permanent. Once deleted, your account cannot be recovered.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['delete_my_account'],\n },\n },\n ],\n },\n // ── API Keys ──────────────────────────────────────────────\n // Programmatic credentials issued for this user. Filtered by\n // user_id FK; the sys_api_key object's own list-item actions\n // (revoke / restore) handle row operations.\n {\n label: 'API Keys',\n icon: 'key-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_api_key',\n relationshipField: 'user_id',\n columns: ['name', 'prefix', 'expires_at', 'revoked', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'API Keys',\n },\n },\n ],\n },\n ],\n },\n },\n\n // ── Suppress the Discussion / Chatter thread ──────────────────\n discussion: [],\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/pages/sys-organization.page.ts","../../src/pages/sys-user.page.ts","../../src/pages/sys-position.page.ts"],"names":[],"mappings":";;;AAiCO,IAAM,yBAAA,GAAkC;AAAA,EAC7C,IAAA,EAAM,yBAAA;AAAA,EACN,KAAA,EAAO,cAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,QAAA,EAAU,SAAA;AAAA,EACV,IAAA,EAAM,SAAA;AAAA,EACN,SAAA,EAAW,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKX,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,WAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,MAAA;AAAA,QACN,QAAA,EAAU,KAAA;AAAA,QACV,KAAA,EAAO;AAAA,UACL;AAAA,YACE,KAAA,EAAO,SAAA;AAAA,YACP,IAAA,EAAM,OAAA;AAAA,YACN,QAAA,EAAU;AAAA,cACR;AAAA,gBACE,IAAA,EAAM,qBAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,UAAA,EAAY,YAAA;AAAA,kBACZ,iBAAA,EAAmB,iBAAA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AAA,EAAW,mBAAA;AAAA,oBACX,KAAA,EAAO;AAAA;AACT;AACF;AACF;AACF;AACF;AACF;AACF,KACF;AAAA;AAAA,IAGA,YAAY;AAAC;AAEjB","file":"index.js","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_organization — Record Detail Page (slotted)\n *\n * Adds Members / Invitations / Teams tabs to the organization detail\n * page so an admin can manage the membership graph from a single place\n * instead of switching between three separate Setup list views.\n *\n * The page is `kind: 'slotted'` and overrides only the `tabs` slot —\n * header, actions, highlights, details and discussion fall through to\n * the synthesized default, so the organization's own fields and the\n * existing record-header actions (Set Active, Edit, Delete, Leave) are\n * preserved.\n *\n * Each tab is a `record:related_list` over a child object that already\n * has `organization_id` as a `Field.lookup('sys_organization')` — the\n * renderer scopes the list to the current organization automatically\n * (the related-list runtime uses the parent record id from the page\n * context as the filter value for `relationshipField`). The per-row\n * actions defined on each child object (invite_user, cancel_invitation,\n * remove_member, transfer_ownership, create_team, …) are inherited\n * unchanged — no admin endpoint has to be re-declared here.\n *\n * Notable omissions:\n * - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not\n * `organization_id`. They surface on the user's Account → Developer\n * section instead of the org detail.\n * - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,\n * add a fourth tab here.\n */\nexport const SysOrganizationDetailPage: Page = {\n name: 'sys_organization_detail',\n label: 'Organization',\n type: 'record',\n object: 'sys_organization',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n // `regions` is required by the Page schema even for slotted pages —\n // empty array lets the synthesizer fill in header/details/discussion\n // while the `slots.tabs` override below replaces the synthesized\n // tabs strip.\n regions: [],\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Members',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'organization_id',\n columns: ['user_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Members',\n },\n },\n ],\n },\n {\n label: 'Invitations',\n icon: 'mail',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_invitation',\n relationshipField: 'organization_id',\n columns: ['email', 'role', 'status', 'expires_at', 'inviter_id'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Invitations',\n },\n },\n ],\n },\n {\n label: 'Teams',\n icon: 'users-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_team',\n relationshipField: 'organization_id',\n columns: ['name', 'created_at', 'updated_at'],\n sort: [{ field: 'name', order: 'asc' }],\n limit: 25,\n showViewAll: true,\n title: 'Teams',\n },\n },\n ],\n },\n ],\n },\n },\n },\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_user — Record Detail Page (slotted, default for ALL sys_user records)\n *\n * **Audience**: admins browsing user records from Setup.\n *\n * The Account App's \"Profile\" entry no longer routes here — it points at\n * the `account:profile_card` Console component for a settings-form-style\n * personal profile. This page therefore optimizes for the admin\n * use case: scanning a user's signals (email/verification/2FA/role),\n * reviewing related sessions/orgs/oauth/api-keys, and triggering\n * admin actions (ban / impersonate / set_role).\n *\n * Strategy\n * --------\n * - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,\n * `details`, `tabs` and `discussion`. Header / actions fall through\n * to the synthesizer so the object's declared actions\n * (`update_my_profile / change_my_password / resend_verification_email\n * / ban_user / set_user_role / impersonate_user / …`) still appear\n * in the header overflow menu automatically.\n * - `highlights` promotes the four signals worth scanning at the top:\n * email, verification state, 2FA, platform role. Highlight fields\n * are auto-dropped from the details grid below.\n * - `details` re-groups remaining fields into sections and hides\n * admin-internal audit columns. Banned / ban metadata is still\n * editable from the header actions — we just don't show it in\n * every user's body.\n * - `tabs` is **explicitly curated** to the 5 related lists that matter\n * on a user profile (Positions / Sessions / Linked Accounts / Organizations /\n * Personal OAuth Apps). Without this override, the synthesizer\n * auto-generates a tab per object that has a FK to sys_user\n * (sys_position.created_by, sys_email.updated_by, sys_user_preference,\n * sys_email_template.created_by, …) producing dozens of noisy\n * \"查看全部\" cards on every profile.\n * - `discussion: []` removes the Chatter feed — it has no business\n * on a personal profile.\n */\nexport const SysUserDetailPage: Page = {\n name: 'sys_user_detail',\n label: 'User',\n type: 'record',\n object: 'sys_user',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n // ── Alert banners ─────────────────────────────────────────────\n // Conditional notices rendered between the page header and the\n // highlight strip. The unverified-email banner only shows for the\n // current user viewing their own profile (admins looking at other\n // users see nothing — they can use Setup actions instead).\n alerts: [\n {\n type: 'record:alert',\n properties: {\n severity: 'warning',\n icon: 'mail',\n title: '邮箱未验证',\n body: '验证你的邮箱以接收密码重置和重要的系统通知。',\n visible: 'record.id == ctx.user.id && record.email_verified == false',\n dismissible: false,\n action: {\n actionName: 'resend_verification_email',\n label: '重新发送验证邮件',\n },\n },\n },\n ],\n\n // ── Highlight chips above the fold ────────────────────────────\n highlights: {\n type: 'record:highlights',\n properties: {\n fields: ['email', 'email_verified', 'two_factor_enabled', 'role'],\n },\n },\n\n // ── Body / details grid ───────────────────────────────────────\n details: {\n type: 'record:details',\n properties: {\n hideFields: [\n 'id',\n 'banned',\n 'ban_reason',\n 'ban_expires',\n // already promoted to highlights:\n 'email',\n 'email_verified',\n 'two_factor_enabled',\n 'role',\n ],\n sections: [\n {\n label: 'Identity',\n fields: ['name', 'image'],\n },\n {\n label: 'Audit',\n fields: ['created_at', 'updated_at'],\n },\n ],\n },\n },\n\n // ── Tabs: curated related lists ───────────────────────────────\n // Only the 4 lists that are semantically about THIS user account.\n // Everything else (sys_position created_by, sys_email_template\n // updated_by, …) is incidental authorship metadata and would only\n // create noise.\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Positions',\n icon: 'shield-check',\n children: [\n {\n // [ADR-0090 D3] Position assignments (岗位分派) — pure SDUI:\n // the Add picker creates sys_user_position rows storing the\n // position's MACHINE NAME (valueField: 'name'), and every\n // server-side rule (the D12 delegated-admin gate, audience-\n // anchor rejection) surfaces its error in the dialog.\n type: 'record:related_list',\n properties: {\n objectName: 'sys_user_position',\n relationshipField: 'user_id',\n columns: ['position', 'business_unit_id', 'granted_by', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Positions',\n add: {\n picker: {\n object: 'sys_position',\n valueField: 'name',\n labelField: 'label',\n },\n linkField: 'position',\n label: 'Assign position',\n },\n },\n },\n ],\n },\n {\n label: 'Sessions',\n icon: 'monitor',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_session',\n relationshipField: 'user_id',\n columns: ['user_agent', 'ip_address', 'created_at', 'expires_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Sessions',\n },\n },\n ],\n },\n {\n label: 'Linked Accounts',\n icon: 'link',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_account',\n relationshipField: 'user_id',\n columns: ['provider_id', 'account_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Linked Accounts',\n },\n },\n ],\n },\n {\n label: 'Organizations',\n icon: 'building-2',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'user_id',\n columns: ['organization_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Organizations',\n },\n },\n ],\n },\n {\n label: 'OAuth Apps',\n icon: 'key-square',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_oauth_application',\n relationshipField: 'user_id',\n columns: ['name', 'client_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'OAuth Apps',\n },\n },\n ],\n },\n // ── Security ──────────────────────────────────────────────\n // Grouped self-service security controls. Each `record:quick_actions`\n // pulls its actions by name from the sys_user object metadata\n // (DRY — definitions stay on the object) and filters by\n // `location: 'record_section'` so they only render here, not\n // in the global header row.\n {\n label: 'Security',\n icon: 'shield',\n children: [\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Password & Sign-in',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Change your password or the email address associated with this account.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['change_my_password', 'change_my_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Two-Factor Authentication',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['enable_two_factor', 'disable_two_factor', 'generate_backup_codes'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Email Verification',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Verify your email so password resets and notifications reach you. The button appears only while verification is pending.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['resend_verification_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Danger Zone',\n },\n className: 'text-destructive',\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Permanent. Once deleted, your account cannot be recovered.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['delete_my_account'],\n },\n },\n ],\n },\n // ── API Keys ──────────────────────────────────────────────\n // Programmatic credentials issued for this user. Filtered by\n // user_id FK; the sys_api_key object's own list-item actions\n // (revoke / restore) handle row operations.\n {\n label: 'API Keys',\n icon: 'key-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_api_key',\n relationshipField: 'user_id',\n columns: ['name', 'prefix', 'expires_at', 'revoked', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'API Keys',\n },\n },\n ],\n },\n ],\n },\n },\n\n // ── Suppress the Discussion / Chatter thread ──────────────────\n discussion: [],\n },\n};\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_position — Record Detail Page (slotted, default for ALL sys_position\n * records)\n *\n * **Audience**: admins managing capability distribution from Setup.\n *\n * A position (岗位, ADR-0090 D3) is the flat distribution group: users hold\n * it (`sys_user_position`), and it binds permission sets\n * (`sys_position_permission_set`). This page makes both edges manageable\n * as PURE SDUI — two `record:related_list` tabs with Add pickers; no\n * bespoke React:\n *\n * - **Holders** — who holds this position. `sys_user_position.position`\n * stores the position's MACHINE NAME, so the list keys on\n * `relationshipValueField: 'name'` (the generic name-keyed-junction\n * affordance this page motivated). Assigning here inserts an ordinary\n * assignment row; the ADR-0090 D12 delegated-admin gate governs the\n * write and its denial reason surfaces in the Add dialog. The\n * `business_unit_id` column is the assignment-level BU anchor\n * (ADR-0090 Addendum); `valid_from`/`valid_until` columns join it when\n * ADR-0091 L1 lands.\n * - **Permission Sets** — what the position distributes\n * (`sys_position_permission_set`, ordinary id-keyed junction). Binding\n * is guarded by BOTH the audience-anchor gate (D5/D9 — high-privilege\n * sets never bind to everyone/guest) and the D12 gate.\n *\n * Header/actions fall through to the synthesizer, so the object's declared\n * row actions (activate/deactivate/clone/set-default) keep working.\n */\nexport const SysPositionDetailPage: Page = {\n name: 'sys_position_detail',\n label: 'Position',\n type: 'record',\n object: 'sys_position',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Holders',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_user_position',\n relationshipField: 'position',\n relationshipValueField: 'name',\n columns: ['user_id', 'business_unit_id', 'granted_by', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Holders',\n add: {\n picker: {\n object: 'sys_user',\n labelField: 'name',\n },\n linkField: 'user_id',\n label: 'Assign user',\n },\n },\n },\n ],\n },\n {\n label: 'Permission Sets',\n icon: 'lock',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_position_permission_set',\n relationshipField: 'position_id',\n columns: ['permission_set_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Permission Sets',\n add: {\n picker: {\n object: 'sys_permission_set',\n labelField: 'label',\n },\n linkField: 'permission_set_id',\n label: 'Bind permission set',\n },\n },\n },\n ],\n },\n ],\n },\n },\n\n // No Chatter feed on an RBAC primitive.\n discussion: [],\n },\n};\n"]}
|
package/dist/pages/index.mjs
CHANGED
|
@@ -157,6 +157,38 @@ var SysUserDetailPage = {
|
|
|
157
157
|
type: "line",
|
|
158
158
|
position: "top",
|
|
159
159
|
items: [
|
|
160
|
+
{
|
|
161
|
+
label: "Positions",
|
|
162
|
+
icon: "shield-check",
|
|
163
|
+
children: [
|
|
164
|
+
{
|
|
165
|
+
// [ADR-0090 D3] Position assignments (岗位分派) — pure SDUI:
|
|
166
|
+
// the Add picker creates sys_user_position rows storing the
|
|
167
|
+
// position's MACHINE NAME (valueField: 'name'), and every
|
|
168
|
+
// server-side rule (the D12 delegated-admin gate, audience-
|
|
169
|
+
// anchor rejection) surfaces its error in the dialog.
|
|
170
|
+
type: "record:related_list",
|
|
171
|
+
properties: {
|
|
172
|
+
objectName: "sys_user_position",
|
|
173
|
+
relationshipField: "user_id",
|
|
174
|
+
columns: ["position", "business_unit_id", "granted_by", "created_at"],
|
|
175
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
176
|
+
limit: 25,
|
|
177
|
+
showViewAll: true,
|
|
178
|
+
title: "Positions",
|
|
179
|
+
add: {
|
|
180
|
+
picker: {
|
|
181
|
+
object: "sys_position",
|
|
182
|
+
valueField: "name",
|
|
183
|
+
labelField: "label"
|
|
184
|
+
},
|
|
185
|
+
linkField: "position",
|
|
186
|
+
label: "Assign position"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
160
192
|
{
|
|
161
193
|
label: "Sessions",
|
|
162
194
|
icon: "monitor",
|
|
@@ -363,6 +395,84 @@ var SysUserDetailPage = {
|
|
|
363
395
|
}
|
|
364
396
|
};
|
|
365
397
|
|
|
366
|
-
|
|
398
|
+
// src/pages/sys-position.page.ts
|
|
399
|
+
var SysPositionDetailPage = {
|
|
400
|
+
name: "sys_position_detail",
|
|
401
|
+
label: "Position",
|
|
402
|
+
type: "record",
|
|
403
|
+
object: "sys_position",
|
|
404
|
+
template: "default",
|
|
405
|
+
kind: "slotted",
|
|
406
|
+
isDefault: true,
|
|
407
|
+
regions: [],
|
|
408
|
+
slots: {
|
|
409
|
+
tabs: {
|
|
410
|
+
type: "page:tabs",
|
|
411
|
+
properties: {
|
|
412
|
+
type: "line",
|
|
413
|
+
position: "top",
|
|
414
|
+
items: [
|
|
415
|
+
{
|
|
416
|
+
label: "Holders",
|
|
417
|
+
icon: "users",
|
|
418
|
+
children: [
|
|
419
|
+
{
|
|
420
|
+
type: "record:related_list",
|
|
421
|
+
properties: {
|
|
422
|
+
objectName: "sys_user_position",
|
|
423
|
+
relationshipField: "position",
|
|
424
|
+
relationshipValueField: "name",
|
|
425
|
+
columns: ["user_id", "business_unit_id", "granted_by", "created_at"],
|
|
426
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
427
|
+
limit: 25,
|
|
428
|
+
showViewAll: true,
|
|
429
|
+
title: "Holders",
|
|
430
|
+
add: {
|
|
431
|
+
picker: {
|
|
432
|
+
object: "sys_user",
|
|
433
|
+
labelField: "name"
|
|
434
|
+
},
|
|
435
|
+
linkField: "user_id",
|
|
436
|
+
label: "Assign user"
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
label: "Permission Sets",
|
|
444
|
+
icon: "lock",
|
|
445
|
+
children: [
|
|
446
|
+
{
|
|
447
|
+
type: "record:related_list",
|
|
448
|
+
properties: {
|
|
449
|
+
objectName: "sys_position_permission_set",
|
|
450
|
+
relationshipField: "position_id",
|
|
451
|
+
columns: ["permission_set_id", "created_at"],
|
|
452
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
453
|
+
limit: 25,
|
|
454
|
+
showViewAll: true,
|
|
455
|
+
title: "Permission Sets",
|
|
456
|
+
add: {
|
|
457
|
+
picker: {
|
|
458
|
+
object: "sys_permission_set",
|
|
459
|
+
labelField: "label"
|
|
460
|
+
},
|
|
461
|
+
linkField: "permission_set_id",
|
|
462
|
+
label: "Bind permission set"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
// No Chatter feed on an RBAC primitive.
|
|
472
|
+
discussion: []
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
export { SysOrganizationDetailPage, SysPositionDetailPage, SysUserDetailPage };
|
|
367
477
|
//# sourceMappingURL=index.mjs.map
|
|
368
478
|
//# sourceMappingURL=index.mjs.map
|
package/dist/pages/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/sys-organization.page.ts","../../src/pages/sys-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AAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,QAAA,EAAU,gBAAA;AAAA,kBACV,KAAA,EAAO,OAAA;AAAA,kBACP,WAAA,EAAa,CAAC,mBAAmB;AAAA;AACnC;AACF;AACF,WACF;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,YACE,KAAA,EAAO,UAAA;AAAA,YACP,IAAA,EAAM,WAAA;AAAA,YACN,QAAA,EAAU;AAAA,cACR;AAAA,gBACE,IAAA,EAAM,qBAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,UAAA,EAAY,aAAA;AAAA,kBACZ,iBAAA,EAAmB,SAAA;AAAA,kBACnB,SAAS,CAAC,MAAA,EAAQ,QAAA,EAAU,YAAA,EAAc,WAAW,YAAY,CAAA;AAAA,kBACjE,MAAM,CAAC,EAAE,OAAO,YAAA,EAAc,KAAA,EAAO,QAAQ,CAAA;AAAA,kBAC7C,KAAA,EAAO,EAAA;AAAA,kBACP,WAAA,EAAa,IAAA;AAAA,kBACb,KAAA,EAAO;AAAA;AACT;AACF;AACF;AACF;AACF;AACF,KACF;AAAA;AAAA,IAGA,YAAY;AAAC;AAEjB","file":"index.mjs","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_organization — Record Detail Page (slotted)\n *\n * Adds Members / Invitations / Teams tabs to the organization detail\n * page so an admin can manage the membership graph from a single place\n * instead of switching between three separate Setup list views.\n *\n * The page is `kind: 'slotted'` and overrides only the `tabs` slot —\n * header, actions, highlights, details and discussion fall through to\n * the synthesized default, so the organization's own fields and the\n * existing record-header actions (Set Active, Edit, Delete, Leave) are\n * preserved.\n *\n * Each tab is a `record:related_list` over a child object that already\n * has `organization_id` as a `Field.lookup('sys_organization')` — the\n * renderer scopes the list to the current organization automatically\n * (the related-list runtime uses the parent record id from the page\n * context as the filter value for `relationshipField`). The per-row\n * actions defined on each child object (invite_user, cancel_invitation,\n * remove_member, transfer_ownership, create_team, …) are inherited\n * unchanged — no admin endpoint has to be re-declared here.\n *\n * Notable omissions:\n * - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not\n * `organization_id`. They surface on the user's Account → Developer\n * section instead of the org detail.\n * - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,\n * add a fourth tab here.\n */\nexport const SysOrganizationDetailPage: Page = {\n name: 'sys_organization_detail',\n label: 'Organization',\n type: 'record',\n object: 'sys_organization',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n // `regions` is required by the Page schema even for slotted pages —\n // empty array lets the synthesizer fill in header/details/discussion\n // while the `slots.tabs` override below replaces the synthesized\n // tabs strip.\n regions: [],\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Members',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'organization_id',\n columns: ['user_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Members',\n },\n },\n ],\n },\n {\n label: 'Invitations',\n icon: 'mail',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_invitation',\n relationshipField: 'organization_id',\n columns: ['email', 'role', 'status', 'expires_at', 'inviter_id'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Invitations',\n },\n },\n ],\n },\n {\n label: 'Teams',\n icon: 'users-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_team',\n relationshipField: 'organization_id',\n columns: ['name', 'created_at', 'updated_at'],\n sort: [{ field: 'name', order: 'asc' }],\n limit: 25,\n showViewAll: true,\n title: 'Teams',\n },\n },\n ],\n },\n ],\n },\n },\n },\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_user — Record Detail Page (slotted, default for ALL sys_user records)\n *\n * **Audience**: admins browsing user records from Setup.\n *\n * The Account App's \"Profile\" entry no longer routes here — it points at\n * the `account:profile_card` Console component for a settings-form-style\n * personal profile. This page therefore optimizes for the admin\n * use case: scanning a user's signals (email/verification/2FA/role),\n * reviewing related sessions/orgs/oauth/api-keys, and triggering\n * admin actions (ban / impersonate / set_role).\n *\n * Strategy\n * --------\n * - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,\n * `details`, `tabs` and `discussion`. Header / actions fall through\n * to the synthesizer so the object's declared actions\n * (`update_my_profile / change_my_password / resend_verification_email\n * / ban_user / set_user_role / impersonate_user / …`) still appear\n * in the header overflow menu automatically.\n * - `highlights` promotes the four signals worth scanning at the top:\n * email, verification state, 2FA, platform role. Highlight fields\n * are auto-dropped from the details grid below.\n * - `details` re-groups remaining fields into sections and hides\n * admin-internal audit columns. Banned / ban metadata is still\n * editable from the header actions — we just don't show it in\n * every user's body.\n * - `tabs` is **explicitly curated** to the 4 related lists that matter\n * on a user profile (Sessions / Linked Accounts / Organizations /\n * Personal OAuth Apps). Without this override, the synthesizer\n * auto-generates a tab per object that has a FK to sys_user\n * (sys_position.created_by, sys_email.updated_by, sys_user_preference,\n * sys_email_template.created_by, …) producing dozens of noisy\n * \"查看全部\" cards on every profile.\n * - `discussion: []` removes the Chatter feed — it has no business\n * on a personal profile.\n */\nexport const SysUserDetailPage: Page = {\n name: 'sys_user_detail',\n label: 'User',\n type: 'record',\n object: 'sys_user',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n // ── Alert banners ─────────────────────────────────────────────\n // Conditional notices rendered between the page header and the\n // highlight strip. The unverified-email banner only shows for the\n // current user viewing their own profile (admins looking at other\n // users see nothing — they can use Setup actions instead).\n alerts: [\n {\n type: 'record:alert',\n properties: {\n severity: 'warning',\n icon: 'mail',\n title: '邮箱未验证',\n body: '验证你的邮箱以接收密码重置和重要的系统通知。',\n visible: 'record.id == ctx.user.id && record.email_verified == false',\n dismissible: false,\n action: {\n actionName: 'resend_verification_email',\n label: '重新发送验证邮件',\n },\n },\n },\n ],\n\n // ── Highlight chips above the fold ────────────────────────────\n highlights: {\n type: 'record:highlights',\n properties: {\n fields: ['email', 'email_verified', 'two_factor_enabled', 'role'],\n },\n },\n\n // ── Body / details grid ───────────────────────────────────────\n details: {\n type: 'record:details',\n properties: {\n hideFields: [\n 'id',\n 'banned',\n 'ban_reason',\n 'ban_expires',\n // already promoted to highlights:\n 'email',\n 'email_verified',\n 'two_factor_enabled',\n 'role',\n ],\n sections: [\n {\n label: 'Identity',\n fields: ['name', 'image'],\n },\n {\n label: 'Audit',\n fields: ['created_at', 'updated_at'],\n },\n ],\n },\n },\n\n // ── Tabs: curated related lists ───────────────────────────────\n // Only the 4 lists that are semantically about THIS user account.\n // Everything else (sys_position created_by, sys_email_template\n // updated_by, …) is incidental authorship metadata and would only\n // create noise.\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Sessions',\n icon: 'monitor',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_session',\n relationshipField: 'user_id',\n columns: ['user_agent', 'ip_address', 'created_at', 'expires_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Sessions',\n },\n },\n ],\n },\n {\n label: 'Linked Accounts',\n icon: 'link',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_account',\n relationshipField: 'user_id',\n columns: ['provider_id', 'account_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Linked Accounts',\n },\n },\n ],\n },\n {\n label: 'Organizations',\n icon: 'building-2',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'user_id',\n columns: ['organization_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Organizations',\n },\n },\n ],\n },\n {\n label: 'OAuth Apps',\n icon: 'key-square',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_oauth_application',\n relationshipField: 'user_id',\n columns: ['name', 'client_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'OAuth Apps',\n },\n },\n ],\n },\n // ── Security ──────────────────────────────────────────────\n // Grouped self-service security controls. Each `record:quick_actions`\n // pulls its actions by name from the sys_user object metadata\n // (DRY — definitions stay on the object) and filters by\n // `location: 'record_section'` so they only render here, not\n // in the global header row.\n {\n label: 'Security',\n icon: 'shield',\n children: [\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Password & Sign-in',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Change your password or the email address associated with this account.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['change_my_password', 'change_my_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Two-Factor Authentication',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['enable_two_factor', 'disable_two_factor', 'generate_backup_codes'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Email Verification',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Verify your email so password resets and notifications reach you. The button appears only while verification is pending.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['resend_verification_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Danger Zone',\n },\n className: 'text-destructive',\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Permanent. Once deleted, your account cannot be recovered.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['delete_my_account'],\n },\n },\n ],\n },\n // ── API Keys ──────────────────────────────────────────────\n // Programmatic credentials issued for this user. Filtered by\n // user_id FK; the sys_api_key object's own list-item actions\n // (revoke / restore) handle row operations.\n {\n label: 'API Keys',\n icon: 'key-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_api_key',\n relationshipField: 'user_id',\n columns: ['name', 'prefix', 'expires_at', 'revoked', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'API Keys',\n },\n },\n ],\n },\n ],\n },\n },\n\n // ── Suppress the Discussion / Chatter thread ──────────────────\n discussion: [],\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/pages/sys-organization.page.ts","../../src/pages/sys-user.page.ts","../../src/pages/sys-position.page.ts"],"names":[],"mappings":";AAiCO,IAAM,yBAAA,GAAkC;AAAA,EAC7C,IAAA,EAAM,yBAAA;AAAA,EACN,KAAA,EAAO,cAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,QAAA,EAAU,SAAA;AAAA,EACV,IAAA,EAAM,SAAA;AAAA,EACN,SAAA,EAAW,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKX,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,WAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,MAAA;AAAA,QACN,QAAA,EAAU,KAAA;AAAA,QACV,KAAA,EAAO;AAAA,UACL;AAAA,YACE,KAAA,EAAO,SAAA;AAAA,YACP,IAAA,EAAM,OAAA;AAAA,YACN,QAAA,EAAU;AAAA,cACR;AAAA,gBACE,IAAA,EAAM,qBA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A,EAAQ;AAAA,sBACN,MAAA,EAAQ,oBAAA;AAAA,sBACR,UAAA,EAAY;AAAA,qBACd;AAAA,oBACA,SAAA,EAAW,mBAAA;AAAA,oBACX,KAAA,EAAO;AAAA;AACT;AACF;AACF;AACF;AACF;AACF;AACF,KACF;AAAA;AAAA,IAGA,YAAY;AAAC;AAEjB","file":"index.mjs","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_organization — Record Detail Page (slotted)\n *\n * Adds Members / Invitations / Teams tabs to the organization detail\n * page so an admin can manage the membership graph from a single place\n * instead of switching between three separate Setup list views.\n *\n * The page is `kind: 'slotted'` and overrides only the `tabs` slot —\n * header, actions, highlights, details and discussion fall through to\n * the synthesized default, so the organization's own fields and the\n * existing record-header actions (Set Active, Edit, Delete, Leave) are\n * preserved.\n *\n * Each tab is a `record:related_list` over a child object that already\n * has `organization_id` as a `Field.lookup('sys_organization')` — the\n * renderer scopes the list to the current organization automatically\n * (the related-list runtime uses the parent record id from the page\n * context as the filter value for `relationshipField`). The per-row\n * actions defined on each child object (invite_user, cancel_invitation,\n * remove_member, transfer_ownership, create_team, …) are inherited\n * unchanged — no admin endpoint has to be re-declared here.\n *\n * Notable omissions:\n * - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not\n * `organization_id`. They surface on the user's Account → Developer\n * section instead of the org detail.\n * - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,\n * add a fourth tab here.\n */\nexport const SysOrganizationDetailPage: Page = {\n name: 'sys_organization_detail',\n label: 'Organization',\n type: 'record',\n object: 'sys_organization',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n // `regions` is required by the Page schema even for slotted pages —\n // empty array lets the synthesizer fill in header/details/discussion\n // while the `slots.tabs` override below replaces the synthesized\n // tabs strip.\n regions: [],\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Members',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'organization_id',\n columns: ['user_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Members',\n },\n },\n ],\n },\n {\n label: 'Invitations',\n icon: 'mail',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_invitation',\n relationshipField: 'organization_id',\n columns: ['email', 'role', 'status', 'expires_at', 'inviter_id'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Invitations',\n },\n },\n ],\n },\n {\n label: 'Teams',\n icon: 'users-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_team',\n relationshipField: 'organization_id',\n columns: ['name', 'created_at', 'updated_at'],\n sort: [{ field: 'name', order: 'asc' }],\n limit: 25,\n showViewAll: true,\n title: 'Teams',\n },\n },\n ],\n },\n ],\n },\n },\n },\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_user — Record Detail Page (slotted, default for ALL sys_user records)\n *\n * **Audience**: admins browsing user records from Setup.\n *\n * The Account App's \"Profile\" entry no longer routes here — it points at\n * the `account:profile_card` Console component for a settings-form-style\n * personal profile. This page therefore optimizes for the admin\n * use case: scanning a user's signals (email/verification/2FA/role),\n * reviewing related sessions/orgs/oauth/api-keys, and triggering\n * admin actions (ban / impersonate / set_role).\n *\n * Strategy\n * --------\n * - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,\n * `details`, `tabs` and `discussion`. Header / actions fall through\n * to the synthesizer so the object's declared actions\n * (`update_my_profile / change_my_password / resend_verification_email\n * / ban_user / set_user_role / impersonate_user / …`) still appear\n * in the header overflow menu automatically.\n * - `highlights` promotes the four signals worth scanning at the top:\n * email, verification state, 2FA, platform role. Highlight fields\n * are auto-dropped from the details grid below.\n * - `details` re-groups remaining fields into sections and hides\n * admin-internal audit columns. Banned / ban metadata is still\n * editable from the header actions — we just don't show it in\n * every user's body.\n * - `tabs` is **explicitly curated** to the 5 related lists that matter\n * on a user profile (Positions / Sessions / Linked Accounts / Organizations /\n * Personal OAuth Apps). Without this override, the synthesizer\n * auto-generates a tab per object that has a FK to sys_user\n * (sys_position.created_by, sys_email.updated_by, sys_user_preference,\n * sys_email_template.created_by, …) producing dozens of noisy\n * \"查看全部\" cards on every profile.\n * - `discussion: []` removes the Chatter feed — it has no business\n * on a personal profile.\n */\nexport const SysUserDetailPage: Page = {\n name: 'sys_user_detail',\n label: 'User',\n type: 'record',\n object: 'sys_user',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n // ── Alert banners ─────────────────────────────────────────────\n // Conditional notices rendered between the page header and the\n // highlight strip. The unverified-email banner only shows for the\n // current user viewing their own profile (admins looking at other\n // users see nothing — they can use Setup actions instead).\n alerts: [\n {\n type: 'record:alert',\n properties: {\n severity: 'warning',\n icon: 'mail',\n title: '邮箱未验证',\n body: '验证你的邮箱以接收密码重置和重要的系统通知。',\n visible: 'record.id == ctx.user.id && record.email_verified == false',\n dismissible: false,\n action: {\n actionName: 'resend_verification_email',\n label: '重新发送验证邮件',\n },\n },\n },\n ],\n\n // ── Highlight chips above the fold ────────────────────────────\n highlights: {\n type: 'record:highlights',\n properties: {\n fields: ['email', 'email_verified', 'two_factor_enabled', 'role'],\n },\n },\n\n // ── Body / details grid ───────────────────────────────────────\n details: {\n type: 'record:details',\n properties: {\n hideFields: [\n 'id',\n 'banned',\n 'ban_reason',\n 'ban_expires',\n // already promoted to highlights:\n 'email',\n 'email_verified',\n 'two_factor_enabled',\n 'role',\n ],\n sections: [\n {\n label: 'Identity',\n fields: ['name', 'image'],\n },\n {\n label: 'Audit',\n fields: ['created_at', 'updated_at'],\n },\n ],\n },\n },\n\n // ── Tabs: curated related lists ───────────────────────────────\n // Only the 4 lists that are semantically about THIS user account.\n // Everything else (sys_position created_by, sys_email_template\n // updated_by, …) is incidental authorship metadata and would only\n // create noise.\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Positions',\n icon: 'shield-check',\n children: [\n {\n // [ADR-0090 D3] Position assignments (岗位分派) — pure SDUI:\n // the Add picker creates sys_user_position rows storing the\n // position's MACHINE NAME (valueField: 'name'), and every\n // server-side rule (the D12 delegated-admin gate, audience-\n // anchor rejection) surfaces its error in the dialog.\n type: 'record:related_list',\n properties: {\n objectName: 'sys_user_position',\n relationshipField: 'user_id',\n columns: ['position', 'business_unit_id', 'granted_by', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Positions',\n add: {\n picker: {\n object: 'sys_position',\n valueField: 'name',\n labelField: 'label',\n },\n linkField: 'position',\n label: 'Assign position',\n },\n },\n },\n ],\n },\n {\n label: 'Sessions',\n icon: 'monitor',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_session',\n relationshipField: 'user_id',\n columns: ['user_agent', 'ip_address', 'created_at', 'expires_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Sessions',\n },\n },\n ],\n },\n {\n label: 'Linked Accounts',\n icon: 'link',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_account',\n relationshipField: 'user_id',\n columns: ['provider_id', 'account_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Linked Accounts',\n },\n },\n ],\n },\n {\n label: 'Organizations',\n icon: 'building-2',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'user_id',\n columns: ['organization_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Organizations',\n },\n },\n ],\n },\n {\n label: 'OAuth Apps',\n icon: 'key-square',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_oauth_application',\n relationshipField: 'user_id',\n columns: ['name', 'client_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'OAuth Apps',\n },\n },\n ],\n },\n // ── Security ──────────────────────────────────────────────\n // Grouped self-service security controls. Each `record:quick_actions`\n // pulls its actions by name from the sys_user object metadata\n // (DRY — definitions stay on the object) and filters by\n // `location: 'record_section'` so they only render here, not\n // in the global header row.\n {\n label: 'Security',\n icon: 'shield',\n children: [\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Password & Sign-in',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Change your password or the email address associated with this account.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['change_my_password', 'change_my_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Two-Factor Authentication',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['enable_two_factor', 'disable_two_factor', 'generate_backup_codes'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Email Verification',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Verify your email so password resets and notifications reach you. The button appears only while verification is pending.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['resend_verification_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Danger Zone',\n },\n className: 'text-destructive',\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Permanent. Once deleted, your account cannot be recovered.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['delete_my_account'],\n },\n },\n ],\n },\n // ── API Keys ──────────────────────────────────────────────\n // Programmatic credentials issued for this user. Filtered by\n // user_id FK; the sys_api_key object's own list-item actions\n // (revoke / restore) handle row operations.\n {\n label: 'API Keys',\n icon: 'key-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_api_key',\n relationshipField: 'user_id',\n columns: ['name', 'prefix', 'expires_at', 'revoked', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'API Keys',\n },\n },\n ],\n },\n ],\n },\n },\n\n // ── Suppress the Discussion / Chatter thread ──────────────────\n discussion: [],\n },\n};\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_position — Record Detail Page (slotted, default for ALL sys_position\n * records)\n *\n * **Audience**: admins managing capability distribution from Setup.\n *\n * A position (岗位, ADR-0090 D3) is the flat distribution group: users hold\n * it (`sys_user_position`), and it binds permission sets\n * (`sys_position_permission_set`). This page makes both edges manageable\n * as PURE SDUI — two `record:related_list` tabs with Add pickers; no\n * bespoke React:\n *\n * - **Holders** — who holds this position. `sys_user_position.position`\n * stores the position's MACHINE NAME, so the list keys on\n * `relationshipValueField: 'name'` (the generic name-keyed-junction\n * affordance this page motivated). Assigning here inserts an ordinary\n * assignment row; the ADR-0090 D12 delegated-admin gate governs the\n * write and its denial reason surfaces in the Add dialog. The\n * `business_unit_id` column is the assignment-level BU anchor\n * (ADR-0090 Addendum); `valid_from`/`valid_until` columns join it when\n * ADR-0091 L1 lands.\n * - **Permission Sets** — what the position distributes\n * (`sys_position_permission_set`, ordinary id-keyed junction). Binding\n * is guarded by BOTH the audience-anchor gate (D5/D9 — high-privilege\n * sets never bind to everyone/guest) and the D12 gate.\n *\n * Header/actions fall through to the synthesizer, so the object's declared\n * row actions (activate/deactivate/clone/set-default) keep working.\n */\nexport const SysPositionDetailPage: Page = {\n name: 'sys_position_detail',\n label: 'Position',\n type: 'record',\n object: 'sys_position',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Holders',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_user_position',\n relationshipField: 'position',\n relationshipValueField: 'name',\n columns: ['user_id', 'business_unit_id', 'granted_by', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Holders',\n add: {\n picker: {\n object: 'sys_user',\n labelField: 'name',\n },\n linkField: 'user_id',\n label: 'Assign user',\n },\n },\n },\n ],\n },\n {\n label: 'Permission Sets',\n icon: 'lock',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_position_permission_set',\n relationshipField: 'position_id',\n columns: ['permission_set_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Permission Sets',\n add: {\n picker: {\n object: 'sys_permission_set',\n labelField: 'label',\n },\n linkField: 'permission_set_id',\n label: 'Bind permission set',\n },\n },\n },\n ],\n },\n ],\n },\n },\n\n // No Chatter feed on an RBAC primitive.\n discussion: [],\n },\n};\n"]}
|