Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/console/src/components/PageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function PageView() {
</div>
<SchemaRenderer
schema={{
type: 'page',
...page,
type: 'page',
context: { ...(page as any).context, params }
}}
/>
Expand Down
21 changes: 0 additions & 21 deletions examples/crm/src/objects/account.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,5 @@ export const AccountObject = ObjectSchema.create({
longitude: Field.number({ label: 'Longitude', scale: 6 }),
owner: Field.lookup('user', { label: 'Owner' }),
created_at: Field.datetime({ label: 'Created Date' })
},
list_views: {
all: {
label: 'All Accounts',
columns: ['name', 'industry', 'type', 'phone', 'website', 'employees', 'owner']
},
map_view: {
label: 'Map View',
type: 'map',
latitudeField: 'latitude',
longitudeField: 'longitude',
titleField: 'name',
descriptionField: 'billing_address',
zoom: 3,
center: [37.7749, -122.4194] // SF
} as any,
customers: {
label: 'Customers',
columns: ['name', 'industry', 'annual_revenue'],
filter: [['type', '=', 'Customer']]
}
}
});
23 changes: 0 additions & 23 deletions examples/crm/src/objects/contact.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,5 @@ export const ContactObject = ObjectSchema.create({
longitude: Field.number({ label: 'Longitude', scale: 6 }),
is_active: Field.boolean({ label: 'Active', defaultValue: true }),
notes: Field.textarea({ label: 'Notes' })
},
list_views: {
all: {
label: 'All Contacts',
type: 'grid',
columns: ['name', 'account', 'email', 'phone', 'title', 'status']
},
map_view: {
label: 'Map View',
type: 'map',
latitudeField: 'latitude',
longitudeField: 'longitude',
titleField: 'name',
descriptionField: 'title',
zoom: 12,
center: [-73.935242, 40.730610] // NYC
} as any,
mypending: {
label: 'My Pending Contacts',
type: 'grid',
columns: ['name', 'account', 'status', 'priority'],
filter: [['status', '!=', 'Active']]
}
}
});
14 changes: 0 additions & 14 deletions examples/crm/src/objects/event.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,5 @@ export const EventObject = ObjectSchema.create({
description: Field.textarea({ label: 'Description' }),
participants: Field.lookup('contact', { label: 'Participants', multiple: true }),
type: Field.select(['Meeting', 'Call', 'Email', 'Other'], { label: 'Type' })
},
list_views: {
all: {
label: 'All Events',
columns: ['subject', 'start', 'end', 'location', 'type']
},
calendar: {
label: 'Calendar',
type: 'calendar',
startDateField: 'start',
endDateField: 'end',
titleField: 'subject',
defaultView: 'month'
} as any
}
});
24 changes: 0 additions & 24 deletions examples/crm/src/objects/opportunity.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,5 @@ export const OpportunityObject = ObjectSchema.create({
lead_source: Field.select(['Web', 'Phone', 'Partner', 'Referral', 'Other'], { label: 'Lead Source' }),
next_step: Field.text({ label: 'Next Step' }),
description: Field.textarea({ label: 'Description' })
},
list_views: {
all: {
label: 'All Opportunities',
columns: ['name', 'account', 'amount', 'stage', 'probability', 'close_date', 'type']
},
closing_soon: {
label: 'Closing Soon',
columns: ['name', 'amount', 'stage', 'close_date', 'next_step'],
sort: [['close_date', 'asc']]
},
won: {
label: 'Won',
columns: ['name', 'amount', 'account', 'close_date'],
filter: [['stage', '=', 'Closed Won']]
},
pipeline: {
label: 'Pipeline',
type: 'kanban',
columns: ['name', 'amount', 'account'],
groupField: 'stage',
titleField: 'name',
cardFields: ['amount', 'account', 'close_date', 'probability']
} as any
}
});
12 changes: 0 additions & 12 deletions examples/crm/src/objects/order.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,5 @@ export const OrderObject = ObjectSchema.create({
amount: Field.currency({ label: 'Total Amount' }),
status: Field.select(['Draft', 'Pending', 'Paid', 'Shipped', 'Delivered', 'Cancelled'], { label: 'Status', defaultValue: 'Draft' }),
order_date: Field.date({ label: 'Order Date', defaultValue: 'now' })
},
list_views: {
all: {
label: 'All Orders',
columns: ['name', 'customer', 'amount', 'status', 'order_date'],
sort: [['order_date', 'desc']]
},
pending: {
label: 'Pending Orders',
columns: ['name', 'customer', 'amount', 'order_date'],
filter: [['status', '=', 'Pending']]
}
}
});
19 changes: 0 additions & 19 deletions examples/crm/src/objects/product.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,5 @@ export const ProductObject = ObjectSchema.create({
stock: Field.number({ label: 'Stock' }),
description: Field.textarea({ label: 'Description' }),
image: Field.url({ label: 'Image URL' })
},
list_views: {
all: {
label: 'All Products',
columns: ['name', 'sku', 'category', 'price', 'stock']
},
low_stock: {
label: 'Low Stock',
columns: ['name', 'stock', 'price'],
filter: [['stock', '<', 10]]
},
gallery: {
label: 'Product Gallery',
type: 'gallery',
columns: ['name', 'category', 'price'],
imageField: 'image',
titleField: 'name',
subtitleField: 'category'
} as any
}
});
26 changes: 0 additions & 26 deletions examples/crm/src/objects/project.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,5 @@ export const ProjectObject = ObjectSchema.create({
description: Field.textarea({ label: 'Description' }),
color: Field.text({ label: 'Color' }), // For Gantt bar color
dependencies: Field.text({ label: 'Dependencies' }), // Comma separated IDs
},
list_views: {
all: {
label: 'All Tasks',
columns: ['name', 'status', 'progress', 'start_date', 'end_date', 'priority', 'manager'],
sort: [['start_date', 'asc']]
},
gantt_view: {
label: 'Gantt View',
type: 'gantt',
columns: ['name', 'start_date', 'end_date', 'progress'],
// Standard Gantt configuration mapped to specific fields
startDateField: 'start_date',
endDateField: 'end_date',
titleField: 'name',
progressField: 'progress',
dependenciesField: 'dependencies',
colorField: 'color',
} as any, // Cast to allow extra properties if type definition is strict
timeline_view: {
label: 'Timeline',
type: 'timeline',
dateField: 'start_date',
titleField: 'name',
columns: ['status', 'priority']
} as any
}
});
6 changes: 0 additions & 6 deletions examples/crm/src/objects/user.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@ export const UserObject = ObjectSchema.create({
role: Field.select(['admin', 'user', 'guest'], { label: 'Role' }),
avatar: Field.url({ label: 'Avatar URL' }),
active: Field.boolean({ label: 'Active', defaultValue: true })
},
list_views: {
all: {
label: 'All Users',
columns: ['name', 'username', 'email', 'role', 'active']
}
}
});
13 changes: 1 addition & 12 deletions examples/kitchen-sink/src/objects/kitchen_sink.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,5 @@ export const KitchenSinkObject = ObjectSchema.create({
label: 'Formula (Amount * Price)'
}),
auto_number: Field.autonumber({ label: 'Auto Number' }),
},
list_views: {
all: {
label: 'All Records',
columns: ['name', 'category', 'amount', 'price', 'percent', 'rating', 'is_active', 'due_date', 'email'],
},
active: {
label: 'Active Only',
columns: ['name', 'category', 'amount', 'rating', 'due_date'],
filter: [['is_active', '=', true]],
},
},
}
});
165 changes: 1 addition & 164 deletions examples/kitchen-sink/src/objects/showcase.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,168 +90,5 @@ export const ShowcaseObject = ObjectSchema.create({

// Notes — rich text
notes: Field.richtext({ label: 'Notes' }),
},

list_views: {
all: {
label: 'All Items',
columns: ['title', 'category', 'sub_category', 'priority', 'status', 'price', 'start_date'],
},
active: {
label: 'Active Items',
columns: ['title', 'category', 'priority', 'price', 'owner_email'],
filter: [['status', '=', 'active']],
},
featured: {
label: 'Featured',
columns: ['title', 'category', 'price', 'tags'],
filter: [['is_featured', '=', true]],
},
},

form_views: {
default: {
label: 'Default Form',
type: 'simple',
sections: [
{
label: 'Basic Information',
columns: 2,
fields: [
{ field: 'title', colSpan: 2 },
{ field: 'description', colSpan: 2 },
{ field: 'category' },
// sub_category depends on category being selected
{ field: 'sub_category', dependsOn: 'category' },
{ field: 'priority' },
{ field: 'status' },
],
},
{
label: 'Pricing',
columns: 2,
fields: [
// Price fields only visible when status is 'active' or 'review'
{ field: 'price', visibleOn: "${data.status === 'active' || data.status === 'review'}" },
{ field: 'discount_percent', visibleOn: "${data.status === 'active' || data.status === 'review'}" },
],
},
{
label: 'Schedule & Contact',
columns: 2,
fields: [
{ field: 'start_date' },
{ field: 'end_date', dependsOn: 'start_date' },
{ field: 'owner_email' },
{ field: 'is_featured' },
],
},
{
label: 'Additional',
fields: [
{ field: 'tags' },
{ field: 'notes', colSpan: 2 },
],
},
],
},
},

actions: [
{
name: 'assign_owner',
label: 'Assign Owner',
icon: 'user-plus',
type: 'api',
locations: ['list_toolbar', 'record_header'],
params: [
{
name: 'owner_email',
label: 'Owner Email',
type: 'text',
required: true,
placeholder: 'owner@example.com',
helpText: 'Email address of the new owner',
},
{
name: 'notify',
label: 'Send Notification',
type: 'boolean',
defaultValue: true,
helpText: 'Send an email notification to the new owner',
},
],
successMessage: 'Owner assigned successfully',
refreshAfter: true,
},
{
name: 'change_status',
label: 'Change Status',
icon: 'arrow-right-circle',
type: 'api',
locations: ['list_item', 'record_header'],
params: [
{
name: 'new_status',
label: 'New Status',
type: 'select',
required: true,
options: [
{ label: 'Draft', value: 'draft' },
{ label: 'Active', value: 'active' },
{ label: 'Review', value: 'review' },
{ label: 'Completed', value: 'completed' },
{ label: 'Archived', value: 'archived' },
],
},
{
name: 'reason',
label: 'Reason for Change',
type: 'textarea',
placeholder: 'Describe why the status is changing...',
},
],
confirmText: 'Are you sure you want to change the status?',
successMessage: 'Status updated successfully',
refreshAfter: true,
},
{
name: 'export_report',
label: 'Export Report',
icon: 'download',
type: 'api',
locations: ['list_toolbar'],
params: [
{
name: 'format',
label: 'Export Format',
type: 'select',
required: true,
options: [
{ label: 'CSV', value: 'csv' },
{ label: 'Excel', value: 'xlsx' },
{ label: 'PDF', value: 'pdf' },
],
defaultValue: 'csv',
},
{
name: 'include_archived',
label: 'Include Archived',
type: 'boolean',
defaultValue: false,
},
{
name: 'date_range_start',
label: 'From Date',
type: 'date',
},
{
name: 'date_range_end',
label: 'To Date',
type: 'date',
},
],
successMessage: 'Report exported successfully',
},
],
}
});
Loading