-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathproject-workspace.page.ts
More file actions
66 lines (64 loc) · 2.37 KB
/
Copy pathproject-workspace.page.ts
File metadata and controls
66 lines (64 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import type { Page } from '@objectstack/spec/ui';
/**
* Project Workspace — a master-detail (header + line items) entry scenario.
*
* Demonstrates the `object-master-detail-form` renderer (ObjectUI ADR-0001):
* create a Project (parent) together with its Tasks (children) in one screen.
* `showcase_task.project` is a `master_detail` field, so the children are
* created with the parent FK set in a single client-orchestrated transaction.
*/
export const ProjectWorkspacePage: Page = {
name: 'showcase_project_workspace',
label: 'New Project + Tasks',
type: 'app',
template: 'default',
kind: 'full',
isDefault: false,
regions: [
{
name: 'header',
width: 'full',
components: [
{
type: 'page:header',
properties: {
title: 'New Project + Tasks',
subtitle:
'Master-detail entry — fill the project, add its tasks inline, and save them together.',
icon: 'folder-plus',
},
},
],
},
{
name: 'main',
width: 'large',
components: [
{
type: 'object-master-detail-form',
properties: {
objectName: 'showcase_project',
mode: 'create',
formType: 'simple',
submitText: 'Create Project + Tasks',
fields: ['name', 'account', 'status', 'health', 'budget', 'end_date'],
// Config-driven master-detail: only the child object is named. The
// relationship FK (showcase_task.project) and the editable grid
// columns are auto-derived from the child object's metadata — no
// hand-authored columns block. Add `columns`/`relationshipField`
// here only to override the derived defaults.
// `showcase_task` has rich fields (notes/location/cover), so the
// relationship's smart default resolves to the per-row `form`
// factor: a read-only Tasks list with an "Add task" button that
// opens the child's full form inline. (Thin children like invoice
// lines get the editable `grid` instead — see invoice.object.ts.)
details: [
{ title: 'Tasks', childObject: 'showcase_task', addLabel: 'Add task' },
],
},
},
],
},
],
};