Skip to content

Commit a815c14

Browse files
committed
添加示例应用程序和工作流配置,包含项目审批、状态报告和表单定义
1 parent b0ad73b commit a815c14

11 files changed

Lines changed: 545 additions & 1 deletion
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
kind: app
2+
name: demo_app
3+
label: Demo Application
4+
description: "A showcase of ObjectQL capabilities including all field types."
5+
home_page: /kitchen_sink
6+
7+
# Navigation Menu Structure
8+
navigation:
9+
- section: Core Business
10+
icon: briefcase
11+
items:
12+
- object: projects
13+
- object: tasks
14+
15+
- section: Showcase
16+
icon: flask
17+
items:
18+
- object: kitchen_sink
19+
label: Component Gallery
20+
21+
- section: Reporting
22+
icon: bar-chart
23+
items:
24+
# Placeholder for future views/reports
25+
- type: link
26+
label: Dashboard
27+
url: /dashboard
28+
29+
# App-level Configuration (Theming, etc.)
30+
layout:
31+
theme: light
32+
sidebar_width: 260
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './projects';
2-
export * from './tasks';
2+
export * from './tasks';
3+
export * from './kitchen_sink';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- simple_text: "Hello World"
2+
long_text: |
3+
This is a long text.
4+
It spans multiple lines.
5+
rich_content: "# Markdown Header\n\n- List Item 1\n- List Item 2"
6+
count: 42
7+
price: 99.99
8+
progress: 0.75
9+
is_active: true
10+
due_date: "2024-12-31"
11+
meeting_time: "2024-12-31T10:00:00Z"
12+
status: "published"
13+
tags: ["tech", "blog"]
14+
email_address: "test@example.com"
15+
website: "https://objectql.org"
16+
metadata:
17+
source: "seed_data"
18+
version: 1
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: kitchen_sink
2+
label: "Kitchen Sink (All Fields)"
3+
description: "A demonstration of every supported field type in ObjectQL"
4+
icon: "layout-grid-line"
5+
6+
fields:
7+
# --- String Types ---
8+
simple_text:
9+
type: text
10+
label: Simple Text
11+
required: true
12+
min_length: 3
13+
max_length: 100
14+
help_text: "Basic single-line text"
15+
16+
long_text:
17+
type: textarea
18+
label: Multi-line Text
19+
rows: 4
20+
21+
rich_content:
22+
type: markdown
23+
label: Markdown Content
24+
25+
raw_html:
26+
type: html
27+
label: HTML Content
28+
readonly: true # Usually HTML is generated or read-only
29+
30+
# --- Number Types ---
31+
count:
32+
type: number
33+
label: Integer Count
34+
scale: 0
35+
36+
price:
37+
type: currency
38+
label: Price
39+
currency: USD
40+
scale: 2
41+
42+
progress:
43+
type: percent
44+
label: Progress
45+
min: 0
46+
max: 1
47+
scale: 2 # 0.55 -> 55%
48+
49+
# --- Boolean ---
50+
is_active:
51+
type: boolean
52+
label: Is Active
53+
defaultValue: true
54+
55+
# --- Date & Time ---
56+
due_date:
57+
type: date
58+
label: Due Date
59+
60+
meeting_time:
61+
type: datetime
62+
label: Meeting (Date & Time)
63+
64+
alarm:
65+
type: time
66+
label: Alarm Time
67+
68+
# --- Selection ---
69+
status:
70+
type: select
71+
label: Status
72+
options:
73+
- label: Draft
74+
value: draft
75+
- label: Published
76+
value: published
77+
- label: Archived
78+
value: archived
79+
defaultValue: draft
80+
81+
tags:
82+
type: select
83+
label: Tags
84+
multiple: true
85+
options:
86+
- tech
87+
- news
88+
- blog # Simple string array shorthand
89+
90+
# --- Contact & Web ---
91+
email_address:
92+
type: email
93+
label: Email
94+
95+
phone_number:
96+
type: phone
97+
label: Phone
98+
99+
website:
100+
type: url
101+
label: Website URL
102+
103+
# --- Media ---
104+
profile_pic:
105+
type: avatar
106+
label: Avatar
107+
108+
attachment:
109+
type: file
110+
label: Attachment document
111+
112+
gallery:
113+
type: image
114+
label: Image Gallery
115+
multiple: true
116+
117+
# --- Security ---
118+
secret_code:
119+
type: password
120+
label: Secret Code
121+
122+
# --- Advanced / Complex ---
123+
coords:
124+
type: location
125+
label: GPS Coordinates
126+
127+
metadata:
128+
type: object
129+
label: JSON Metadata
130+
131+
embedding:
132+
type: vector
133+
label: Vector Embedding
134+
dimension: 1536 # e.g. OpenAI ada-002
135+
136+
# --- Relationships ---
137+
related_project:
138+
type: lookup
139+
label: Related Project
140+
reference_to: projects
141+
142+
# Note: master_detail requires this object to be the detail side
143+
# parent_project:
144+
# type: master_detail
145+
# reference_to: projects
146+
147+
# --- Computed ---
148+
# auto_id:
149+
# type: auto_number
150+
# prefix: "KS-"
151+
152+
# calc_value:
153+
# type: formula
154+
# expression: "{count} * 10"
155+
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// Auto-generated by ObjectQL. DO NOT EDIT.
2+
import { ObjectDoc } from '@objectql/types';
3+
4+
export interface KitchenSink extends ObjectDoc {
5+
/**
6+
* Simple Text
7+
*/
8+
simple_text: string;
9+
/**
10+
* Multi-line Text
11+
*/
12+
long_text?: string;
13+
/**
14+
* Markdown Content
15+
*/
16+
rich_content?: string;
17+
/**
18+
* HTML Content
19+
*/
20+
raw_html?: string;
21+
/**
22+
* Integer Count
23+
*/
24+
count?: number;
25+
/**
26+
* Price
27+
*/
28+
price?: number;
29+
/**
30+
* Progress
31+
*/
32+
progress?: number;
33+
/**
34+
* Is Active
35+
*/
36+
is_active?: boolean;
37+
/**
38+
* Due Date
39+
*/
40+
due_date?: Date | string;
41+
/**
42+
* Meeting (Date & Time)
43+
*/
44+
meeting_time?: Date | string;
45+
/**
46+
* Alarm Time
47+
*/
48+
alarm?: Date | string;
49+
/**
50+
* Status
51+
*/
52+
status?: string;
53+
/**
54+
* Tags
55+
*/
56+
tags?: string[]; // Multiple select
57+
/**
58+
* Email
59+
*/
60+
email_address?: string;
61+
/**
62+
* Phone
63+
*/
64+
phone_number?: string;
65+
/**
66+
* Website URL
67+
*/
68+
website?: string;
69+
/**
70+
* Avatar
71+
*/
72+
profile_pic?: any;
73+
/**
74+
* Attachment document
75+
*/
76+
attachment?: any;
77+
/**
78+
* Image Gallery
79+
*/
80+
gallery?: any[];
81+
/**
82+
* Secret Code
83+
*/
84+
secret_code?: string;
85+
/**
86+
* GPS Coordinates
87+
*/
88+
coords?: any;
89+
/**
90+
* JSON Metadata
91+
*/
92+
metadata?: any;
93+
/**
94+
* Vector Embedding
95+
*/
96+
embedding?: number[];
97+
/**
98+
* Related Project
99+
*/
100+
related_project?: string | number;
101+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: project_approval
2+
label: "High Budget Project Approval"
3+
type: approval
4+
object: projects
5+
description: "Approval process for high budget projects (> $50,000)"
6+
7+
trigger:
8+
event: create_or_update
9+
conditions:
10+
- field: budget
11+
operator: ">"
12+
value: 50000
13+
- field: status
14+
operator: "="
15+
value: "planned"
16+
17+
steps:
18+
- name: manager_review
19+
label: "Manager Review"
20+
type: approval
21+
22+
assignee:
23+
type: role
24+
role: manager
25+
26+
actions:
27+
approve:
28+
label: "Approve"
29+
next_step: finance_review
30+
reject:
31+
label: "Reject"
32+
outcome: rejected
33+
34+
- name: finance_review
35+
label: "Finance Review"
36+
type: approval
37+
38+
assignee:
39+
type: role
40+
role: finance_admin
41+
42+
actions:
43+
approve:
44+
label: "Approve Funding"
45+
outcome: approved
46+
updates:
47+
status: "in_progress"
48+
approved_at: "$now"
49+
reject:
50+
label: "Reject Funding"
51+
outcome: rejected

0 commit comments

Comments
 (0)