Skip to content

Commit ae271d0

Browse files
xuyushun441-sysos-zhuangclaude
authored
feat(identity): Org Chart tree view for sys_business_unit (#2189)
sys_business_unit is already a self-referencing hierarchy (parent_business_unit_id, ADR-0057 D2) with BFS graph traversal, but Setup only exposed flat grids. Adds an `org_chart` list view (type: 'tree') that renders the hierarchy as an indented, expand/collapse tree-grid, listed first so it's the default tab. No schema change — only surfaces the existing parent pointer. The active/inactive/by_kind/all grids stay for search, filter, and bulk edit. Uses the 'tree' view type added in #2184; renderer is objectui plugin-tree. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 25fc0e4 commit ae271d0

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@objectstack/platform-objects": minor
3+
---
4+
5+
feat(identity): add an Org Chart tree view to `sys_business_unit`
6+
7+
`sys_business_unit` is already a self-referencing hierarchy
8+
(`parent_business_unit_id`, ADR-0057 D2) but Setup only exposed flat grids. Adds
9+
an `org_chart` list view (`type: 'tree'`) that renders the hierarchy as an
10+
indented, expand/collapse tree-grid, listed first so it's the default tab. No
11+
schema change — the parent pointer and graph traversal already existed; this only
12+
surfaces them. The `active` / `inactive` / `by_kind` / `all` grids stay for
13+
search, filter, and bulk edit.

packages/platform-objects/src/identity/sys-business-unit.object.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ export const SysBusinessUnit = ObjectSchema.create({
3333
compactLayout: ['name', 'kind', 'parent_business_unit_id', 'manager_user_id'],
3434

3535
listViews: {
36+
// Org chart — the hierarchy view. Surfaces the self-referencing
37+
// `parent_business_unit_id` tree (ADR-0057 D2) as an indented, expand/
38+
// collapse tree-grid. Listed first so it's the default tab; the grids
39+
// below stay for search / filter / bulk edit.
40+
org_chart: {
41+
type: 'tree',
42+
name: 'org_chart',
43+
label: 'Org Chart',
44+
data: { provider: 'object', object: 'sys_business_unit' },
45+
columns: ['name', 'kind', 'manager_user_id', 'active'],
46+
tree: {
47+
parentField: 'parent_business_unit_id',
48+
labelField: 'name',
49+
fields: ['kind', 'manager_user_id', 'active'],
50+
defaultExpandedDepth: 1,
51+
},
52+
sort: [{ field: 'name', order: 'asc' }],
53+
},
3654
active: {
3755
type: 'grid',
3856
name: 'active',

0 commit comments

Comments
 (0)