diff --git a/examples/crm/src/domains/crm/account.object.ts b/examples/crm/src/domains/crm/account.object.ts index 0a2e09302..ed9c74c16 100644 --- a/examples/crm/src/domains/crm/account.object.ts +++ b/examples/crm/src/domains/crm/account.object.ts @@ -6,7 +6,8 @@ export const Account = ObjectSchema.create({ pluralLabel: 'Accounts', icon: 'building', description: 'Companies and organizations doing business with us', - nameField: 'name', + titleFormat: '{account_number} - {name}', + compactLayout: ['account_number', 'name', 'type', 'owner'], fields: { // AutoNumber field - Unique account identifier @@ -131,81 +132,10 @@ export const Account = ObjectSchema.create({ apiEnabled: true, // Expose via REST/GraphQL apiMethods: ['get', 'list', 'create', 'update', 'delete', 'search', 'export'], // Whitelist allowed API operations files: true, // Allow file attachments - feedEnabled: true, // Enable activity feed/chatter + feeds: true, // Enable activity feed/chatter (Chatter-like) + activities: true, // Enable tasks and events tracking trash: true, // Recycle bin support - }, - - // List Views - Different visualization types - list_views: { - all: { - label: 'All Accounts', - type: 'grid', - columns: ['account_number', 'name', 'type', 'industry', 'annual_revenue', 'owner'], - sort: [{ field: 'name', order: 'asc' }], - searchableFields: ['name', 'account_number', 'phone', 'website'], - }, - my_accounts: { - label: 'My Accounts', - type: 'grid', - columns: ['name', 'type', 'industry', 'annual_revenue', 'last_activity_date'], - filter: [['owner', '=', '{current_user}']], - sort: [{ field: 'last_activity_date', order: 'desc' }], - }, - active_customers: { - label: 'Active Customers', - type: 'grid', - columns: ['name', 'industry', 'annual_revenue', 'number_of_employees'], - filter: [ - ['type', '=', 'customer'], - ['is_active', '=', true] - ], - }, - by_type: { - label: 'Accounts by Type', - type: 'kanban', - columns: ['name', 'industry', 'annual_revenue'], - kanban: { - groupByField: 'type', - summarizeField: 'annual_revenue', - columns: ['name', 'industry', 'owner'], - } - } - }, - - // Form Views - form_views: { - default: { - type: 'tabbed', - sections: [ - { - label: 'Account Information', - columns: 2, - fields: ['account_number', 'name', 'type', 'industry', 'owner', 'parent_account', 'is_active'] - }, - { - label: 'Financial Information', - columns: 2, - fields: ['annual_revenue', 'number_of_employees'] - }, - { - label: 'Contact Details', - columns: 2, - fields: ['phone', 'website', 'brand_color'] - }, - { - label: 'Location & Address', - columns: 2, - fields: ['billing_address', 'office_location'] - }, - { - label: 'Additional Information', - columns: 1, - collapsible: true, - collapsed: true, - fields: ['description', 'last_activity_date'] - } - ] - } + mru: true, // Track Most Recently Used }, // Validation Rules diff --git a/examples/crm/src/domains/crm/case.object.ts b/examples/crm/src/domains/crm/case.object.ts index 1823f8d01..788cfefa0 100644 --- a/examples/crm/src/domains/crm/case.object.ts +++ b/examples/crm/src/domains/crm/case.object.ts @@ -174,113 +174,16 @@ export const Case = ObjectSchema.create({ searchable: true, apiEnabled: true, files: true, - feedEnabled: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking trash: true, + mru: true, // Track Most Recently Used }, - nameField: 'subject', + titleFormat: '{case_number} - {subject}', + compactLayout: ['case_number', 'subject', 'account', 'status', 'priority'], - list_views: { - all: { - label: 'All Cases', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'contact', 'status', 'priority', 'owner'], - sort: [{ field: 'created_date', order: 'desc' }], - searchableFields: ['case_number', 'subject', 'description'], - }, - my_cases: { - label: 'My Cases', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'status', 'priority'], - filter: [['owner', '=', '{current_user}']], - sort: [{ field: 'priority', order: 'desc' }], - }, - open_cases: { - label: 'Open Cases', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'status', 'priority', 'owner'], - filter: [['is_closed', '=', false]], - sort: [{ field: 'priority', order: 'desc' }], - }, - critical_cases: { - label: 'Critical Cases', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'contact', 'status', 'owner'], - filter: [ - ['priority', '=', 'critical'], - ['is_closed', '=', false], - ], - sort: [{ field: 'created_date', order: 'asc' }], - }, - escalated_cases: { - label: 'Escalated Cases', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'priority', 'escalation_reason', 'owner'], - filter: [['is_escalated', '=', true]], - }, - by_status: { - label: 'Cases by Status', - type: 'kanban', - columns: ['case_number', 'subject', 'account', 'priority'], - filter: [['is_closed', '=', false]], - kanban: { - groupByField: 'status', - columns: ['case_number', 'subject', 'contact', 'priority'], - } - }, - sla_violations: { - label: 'SLA Violations', - type: 'grid', - columns: ['case_number', 'subject', 'account', 'sla_due_date', 'owner'], - filter: [['is_sla_violated', '=', true]], - sort: [{ field: 'sla_due_date', order: 'asc' }], - } - }, - - form_views: { - default: { - type: 'tabbed', - sections: [ - { - label: 'Case Information', - columns: 2, - fields: ['case_number', 'subject', 'type', 'origin', 'priority', 'status', 'owner'], - }, - { - label: 'Customer Information', - columns: 2, - fields: ['account', 'contact'], - }, - { - label: 'Description', - columns: 1, - fields: ['description'], - }, - { - label: 'Resolution', - columns: 1, - fields: ['resolution', 'customer_rating', 'customer_feedback', 'customer_signature'], - }, - { - label: 'SLA & Metrics', - columns: 2, - fields: ['created_date', 'first_response_date', 'closed_date', 'resolution_time_hours', 'sla_due_date', 'is_sla_violated'], - }, - { - label: 'Escalation', - columns: 2, - collapsible: true, - fields: ['is_escalated', 'escalation_reason', 'parent_case'], - }, - { - label: 'Internal Information', - columns: 1, - collapsible: true, - fields: ['internal_notes'], - } - ] - } - }, + // Removed: list_views and form_views belong in UI configuration, not object definition validations: [ { diff --git a/examples/crm/src/domains/crm/contact.object.ts b/examples/crm/src/domains/crm/contact.object.ts index 81b1c9901..ab2a6bd4e 100644 --- a/examples/crm/src/domains/crm/contact.object.ts +++ b/examples/crm/src/domains/crm/contact.object.ts @@ -123,84 +123,15 @@ export const Contact = ObjectSchema.create({ searchable: true, apiEnabled: true, files: true, - feedEnabled: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking trash: true, + mru: true, // Track Most Recently Used }, - // Name field configuration - nameField: 'full_name', - - // List Views - list_views: { - all: { - label: 'All Contacts', - type: 'grid', - columns: ['full_name', 'account', 'title', 'email', 'phone', 'owner'], - sort: [{ field: 'last_name', order: 'asc' }], - searchableFields: ['first_name', 'last_name', 'email', 'phone'], - }, - my_contacts: { - label: 'My Contacts', - type: 'grid', - columns: ['full_name', 'account', 'title', 'email', 'phone'], - filter: [['owner', '=', '{current_user}']], - }, - primary_contacts: { - label: 'Primary Contacts', - type: 'grid', - columns: ['full_name', 'account', 'title', 'email', 'phone'], - filter: [['is_primary', '=', true]], - }, - by_department: { - label: 'By Department', - type: 'kanban', - columns: ['full_name', 'account', 'title', 'email'], - kanban: { - groupByField: 'department', - columns: ['full_name', 'title', 'email', 'phone'], - } - }, - birthdays: { - label: 'Birthdays', - type: 'calendar', - columns: ['full_name', 'account', 'phone'], - calendar: { - startDateField: 'birthdate', - titleField: 'full_name', - colorField: 'department', - } - } - }, - - // Form Views - form_views: { - default: { - type: 'simple', - sections: [ - { - label: 'Contact Information', - columns: 2, - fields: ['salutation', 'first_name', 'last_name', 'full_name', 'account', 'title', 'department'], - }, - { - label: 'Contact Details', - columns: 2, - fields: ['email', 'phone', 'mobile', 'reports_to', 'owner'], - }, - { - label: 'Mailing Address', - columns: 2, - fields: ['mailing_street', 'mailing_city', 'mailing_state', 'mailing_postal_code', 'mailing_country'], - }, - { - label: 'Additional Information', - columns: 2, - collapsible: true, - fields: ['birthdate', 'lead_source', 'is_primary', 'do_not_call', 'email_opt_out', 'description'], - } - ] - } - }, + // Display configuration + titleFormat: '{full_name}', + compactLayout: ['full_name', 'email', 'account', 'phone'], // Validation Rules validations: [ diff --git a/examples/crm/src/domains/crm/lead.object.ts b/examples/crm/src/domains/crm/lead.object.ts index ef99b78aa..e4f180ca3 100644 --- a/examples/crm/src/domains/crm/lead.object.ts +++ b/examples/crm/src/domains/crm/lead.object.ts @@ -173,94 +173,16 @@ export const Lead = ObjectSchema.create({ searchable: true, apiEnabled: true, files: true, - feedEnabled: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking trash: true, + mru: true, // Track Most Recently Used }, - nameField: 'full_name', + titleFormat: '{full_name} - {company}', + compactLayout: ['full_name', 'company', 'email', 'status', 'owner'], - list_views: { - all: { - label: 'All Leads', - type: 'grid', - columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating', 'owner'], - sort: [{ field: 'last_name', order: 'asc' }], - searchableFields: ['first_name', 'last_name', 'company', 'email'], - }, - my_leads: { - label: 'My Leads', - type: 'grid', - columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating'], - filter: [['owner', '=', '{current_user}']], - }, - new_leads: { - label: 'New Leads', - type: 'grid', - columns: ['full_name', 'company', 'email', 'phone', 'lead_source', 'owner'], - filter: [['status', '=', 'new']], - sort: [{ field: 'created_date', order: 'desc' }], - }, - hot_leads: { - label: 'High Score Leads', - type: 'grid', - columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating', 'owner'], - filter: [ - ['rating', '>=', 4], - ['is_converted', '=', false], - ], - }, - by_status: { - label: 'Leads by Status', - type: 'kanban', - columns: ['full_name', 'company', 'email', 'rating'], - filter: [['is_converted', '=', false]], - kanban: { - groupByField: 'status', - columns: ['full_name', 'company', 'email', 'phone', 'rating'], - } - }, - }, - - form_views: { - default: { - type: 'simple', - sections: [ - { - label: 'Lead Information', - columns: 2, - fields: ['salutation', 'first_name', 'last_name', 'full_name', 'company', 'title', 'owner'], - }, - { - label: 'Contact Information', - columns: 2, - fields: ['email', 'phone', 'mobile', 'website'], - }, - { - label: 'Lead Details', - columns: 2, - fields: ['status', 'rating', 'lead_source', 'industry', 'annual_revenue', 'number_of_employees'], - }, - { - label: 'Address', - columns: 2, - fields: ['address'], - }, - { - label: 'Additional Information', - columns: 2, - collapsible: true, - fields: ['do_not_call', 'email_opt_out', 'description', 'notes'], - }, - { - label: 'Conversion Information', - columns: 2, - collapsible: true, - collapsed: true, - fields: ['is_converted', 'converted_account', 'converted_contact', 'converted_opportunity', 'converted_date'], - } - ] - } - }, + // Removed: list_views and form_views belong in UI configuration, not object definition validations: [ { diff --git a/examples/crm/src/domains/crm/opportunity.object.ts b/examples/crm/src/domains/crm/opportunity.object.ts index e1b01bc53..6385c832e 100644 --- a/examples/crm/src/domains/crm/opportunity.object.ts +++ b/examples/crm/src/domains/crm/opportunity.object.ts @@ -6,7 +6,8 @@ export const Opportunity = ObjectSchema.create({ pluralLabel: 'Opportunities', icon: 'dollar-sign', description: 'Sales opportunities and deals in the pipeline', - nameField: 'name', + titleFormat: '{name} - {stage}', + compactLayout: ['name', 'account', 'amount', 'stage', 'owner'], fields: { // Basic Information @@ -142,111 +143,13 @@ export const Opportunity = ObjectSchema.create({ apiEnabled: true, apiMethods: ['get', 'list', 'create', 'update', 'delete', 'aggregate', 'search'], // Whitelist allowed API operations files: true, // Attach proposals, contracts - feedEnabled: true, // Team collaboration + feeds: true, // Team collaboration (Chatter-like) + activities: true, // Enable tasks and events tracking trash: true, + mru: true, // Track Most Recently Used }, - // List Views - Multiple visualization types - list_views: { - all: { - label: 'All Opportunities', - type: 'grid', - columns: ['name', 'account', 'amount', 'close_date', 'stage', 'probability', 'owner'], - sort: [{ field: 'close_date', order: 'asc' }], - searchableFields: ['name', 'account'], - }, - my_opportunities: { - label: 'My Opportunities', - type: 'grid', - columns: ['name', 'account', 'amount', 'close_date', 'stage', 'probability'], - filter: [['owner', '=', '{current_user}']], - sort: [{ field: 'close_date', order: 'asc' }], - }, - closing_this_month: { - label: 'Closing This Month', - type: 'grid', - columns: ['name', 'account', 'amount', 'stage', 'probability', 'owner'], - filter: [ - ['close_date', '>=', '{current_month_start}'], - ['close_date', '<=', '{current_month_end}'], - ['stage', '!=', 'closed_won'], - ['stage', '!=', 'closed_lost'], - ], - sort: [{ field: 'amount', order: 'desc' }], - }, - won_opportunities: { - label: 'Won Opportunities', - type: 'grid', - columns: ['name', 'account', 'amount', 'close_date', 'owner'], - filter: [['stage', '=', 'closed_won']], - sort: [{ field: 'close_date', order: 'desc' }], - }, - pipeline: { - label: 'Sales Pipeline', - type: 'kanban', - columns: ['name', 'account', 'amount', 'probability', 'close_date'], - filter: [ - ['stage', '!=', 'closed_won'], - ['stage', '!=', 'closed_lost'], - ], - kanban: { - groupByField: 'stage', - summarizeField: 'amount', - columns: ['name', 'account', 'amount', 'close_date'], - } - }, - timeline: { - label: 'Close Date Timeline', - type: 'gantt', - columns: ['name', 'account', 'amount', 'stage'], - filter: [ - ['stage', '!=', 'closed_won'], - ['stage', '!=', 'closed_lost'], - ], - gantt: { - startDateField: 'created_date', - endDateField: 'close_date', - titleField: 'name', - progressField: 'probability', - } - } - }, - - // Form Views - form_views: { - default: { - type: 'tabbed', - sections: [ - { - label: 'Opportunity Information', - columns: 2, - fields: ['name', 'account', 'primary_contact', 'owner', 'amount', 'close_date'], - }, - { - label: 'Sales Process', - columns: 2, - fields: ['stage', 'probability', 'forecast_category', 'expected_revenue', 'days_in_stage'], - }, - { - label: 'Classification', - columns: 2, - fields: ['type', 'lead_source', 'campaign', 'competitors'], - }, - { - label: 'Details', - columns: 1, - fields: ['description', 'next_step'], - }, - { - label: 'System Information', - columns: 2, - collapsible: true, - collapsed: true, - fields: ['created_date', 'is_private'], - } - ] - } - }, + // Removed: list_views and form_views belong in UI configuration, not object definition // Validation Rules validations: [ diff --git a/examples/crm/src/domains/crm/task.object.ts b/examples/crm/src/domains/crm/task.object.ts index a93a40490..fcf0368ee 100644 --- a/examples/crm/src/domains/crm/task.object.ts +++ b/examples/crm/src/domains/crm/task.object.ts @@ -155,113 +155,16 @@ export const Task = ObjectSchema.create({ searchable: true, apiEnabled: true, files: true, - feedEnabled: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking trash: true, + mru: true, // Track Most Recently Used }, - nameField: 'subject', + titleFormat: '{subject}', + compactLayout: ['subject', 'status', 'priority', 'due_date', 'owner'], - list_views: { - all: { - label: 'All Tasks', - type: 'grid', - columns: ['subject', 'status', 'priority', 'due_date', 'owner'], - sort: [{ field: 'due_date', order: 'asc' }], - searchableFields: ['subject', 'description'], - }, - my_tasks: { - label: 'My Tasks', - type: 'grid', - columns: ['subject', 'status', 'priority', 'due_date', 'related_to_type'], - filter: [['owner', '=', '{current_user}']], - sort: [{ field: 'due_date', order: 'asc' }], - }, - open_tasks: { - label: 'Open Tasks', - type: 'grid', - columns: ['subject', 'priority', 'due_date', 'owner'], - filter: [['is_completed', '=', false]], - sort: [{ field: 'priority', order: 'desc' }], - }, - overdue_tasks: { - label: 'Overdue Tasks', - type: 'grid', - columns: ['subject', 'priority', 'due_date', 'owner'], - filter: [ - ['is_overdue', '=', true], - ['is_completed', '=', false], - ], - sort: [{ field: 'due_date', order: 'asc' }], - }, - today_tasks: { - label: 'Today\'s Tasks', - type: 'grid', - columns: ['subject', 'status', 'priority', 'owner'], - filter: [ - ['due_date', '=', 'TODAY()'], - ], - }, - by_status: { - label: 'Tasks by Status', - type: 'kanban', - columns: ['subject', 'priority', 'due_date'], - filter: [['is_completed', '=', false]], - kanban: { - groupByField: 'status', - columns: ['subject', 'priority', 'due_date', 'owner'], - } - }, - calendar: { - label: 'Task Calendar', - type: 'calendar', - columns: ['subject', 'priority', 'owner'], - calendar: { - startDateField: 'due_date', - titleField: 'subject', - colorField: 'priority', - } - }, - }, - - form_views: { - default: { - type: 'simple', - sections: [ - { - label: 'Task Information', - columns: 2, - fields: ['subject', 'status', 'priority', 'type', 'owner'], - }, - { - label: 'Description', - columns: 1, - fields: ['description'], - }, - { - label: 'Dates & Progress', - columns: 2, - fields: ['due_date', 'reminder_date', 'completed_date', 'progress_percent'], - }, - { - label: 'Time Tracking', - columns: 2, - fields: ['estimated_hours', 'actual_hours'], - }, - { - label: 'Related To', - columns: 2, - fields: ['related_to_type', 'related_to_account', 'related_to_contact', 'related_to_opportunity', 'related_to_lead', 'related_to_case'], - }, - { - label: 'Recurrence', - columns: 2, - collapsible: true, - collapsed: true, - fields: ['is_recurring', 'recurrence_type', 'recurrence_interval', 'recurrence_end_date'], - } - ] - } - }, + // Removed: list_views and form_views belong in UI configuration, not object definition validations: [ { diff --git a/examples/modern-fields/src/event.object.ts b/examples/modern-fields/src/event.object.ts index 3b26cff35..595080719 100644 --- a/examples/modern-fields/src/event.object.ts +++ b/examples/modern-fields/src/event.object.ts @@ -12,10 +12,14 @@ export const Event = ObjectSchema.create({ name: 'event', label: 'Event', icon: 'calendar', - nameField: 'title', + titleFormat: '{title}', + compactLayout: ['title', 'start_date', 'venue_address', 'status'], enable: { apiEnabled: true, trackHistory: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking + mru: true, // Track Most Recently Used }, fields: { title: Field.text({ diff --git a/examples/modern-fields/src/product.object.ts b/examples/modern-fields/src/product.object.ts index f4c239940..28ae94f3b 100644 --- a/examples/modern-fields/src/product.object.ts +++ b/examples/modern-fields/src/product.object.ts @@ -12,10 +12,14 @@ export const Product = ObjectSchema.create({ name: 'product', label: 'Product', icon: 'package', - nameField: 'name', + titleFormat: '{name}', + compactLayout: ['name', 'price', 'status', 'stock_level'], enable: { apiEnabled: true, trackHistory: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking + mru: true, // Track Most Recently Used }, fields: { // Basic fields diff --git a/examples/todo/src/domains/todo/task.object.ts b/examples/todo/src/domains/todo/task.object.ts index 3e3cfc849..5303c7b2e 100644 --- a/examples/todo/src/domains/todo/task.object.ts +++ b/examples/todo/src/domains/todo/task.object.ts @@ -4,10 +4,14 @@ export const TodoTask = ObjectSchema.create({ name: 'todo_task', label: 'Todo Task', icon: 'check-square', - nameField: 'subject', + titleFormat: '{subject}', + compactLayout: ['subject', 'due_date', 'priority', 'is_completed'], enable: { apiEnabled: true, trackHistory: true, + feeds: true, // Enable social feed, comments, and mentions + activities: true, // Enable tasks and events tracking + mru: true, // Track Most Recently Used }, fields: { subject: Field.text({ required: true }),