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
18 changes: 18 additions & 0 deletions examples/app-showcase/src/objects/project.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ export const Project = ObjectSchema.create({
start_date: Field.date({ label: 'Start Date' }),
end_date: Field.date({ label: 'Target End Date' }),
owner: Field.text({ label: 'Owner', maxLength: 200 }),
// Multi-value fields — the payload for the grid's *bulk-edit* showcase. A
// multiselect (fixed options) and a multi-user field are exactly the two
// shapes that, before #2185, the bulk dialog could not set: its people /
// select picker collapsed to a single value and overwrote the array. The
// list view's `bulkActionDefs` below now sets both with real multi-select
// controls, writing an array patch.
labels: {
type: 'multiselect',
label: 'Labels',
options: [
{ label: 'Frontend', value: 'frontend', color: '#3B82F6' },
{ label: 'Backend', value: 'backend', color: '#8B5CF6' },
{ label: 'Design', value: 'design', color: '#EC4899' },
{ label: 'QA', value: 'qa', color: '#F59E0B' },
{ label: 'DevOps', value: 'devops', color: '#10B981' },
],
},
team_members: Field.user({ label: 'Team Members', multiple: true }),
// Roll-up summaries — recomputed server-side whenever a child task is
// inserted / updated / deleted (FK auto-detected: showcase_task.project).
task_count: Field.summary({
Expand Down
88 changes: 88 additions & 0 deletions examples/app-showcase/src/views/project.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,98 @@ export const ProjectViews = defineView({
{ field: 'account' },
{ field: 'status' },
{ field: 'health' },
{ field: 'labels' },
{ field: 'team_members' },
{ field: 'budget' },
{ field: 'budget_remaining' },
{ field: 'end_date' },
],
// Rich bulk-edit definitions (#2185) — select rows, then "set the same
// value on all of them" through the BulkActionDialog. Each def exercises a
// control the dialog gained in #2185:
// • set_labels → multi-select on a `select` param (fixed options)
// • assign_team → multi-select on a `lookup` param (users; array patch)
// • reassign_account → single-select on a `lookup` param (searchable
// reference picker, not a bare dropdown)
// • reschedule → the new `date` control + a single-select together
bulkActionDefs: [
{
name: 'set_labels',
label: 'Set Labels',
operation: 'update',
confirmText: 'Set these labels on every selected project?',
params: [
{
name: 'labels',
label: 'Labels',
type: 'select',
multiple: true,
required: true,
options: [
{ label: 'Frontend', value: 'frontend' },
{ label: 'Backend', value: 'backend' },
{ label: 'Design', value: 'design' },
{ label: 'QA', value: 'qa' },
{ label: 'DevOps', value: 'devops' },
],
},
],
},
{
name: 'assign_team',
label: 'Assign Team',
operation: 'update',
confirmText: 'Assign these team members to every selected project?',
params: [
{
name: 'team_members',
label: 'Team Members',
type: 'lookup',
object: 'sys_user',
multiple: true,
labelField: 'name',
required: true,
},
],
},
{
name: 'reassign_account',
label: 'Reassign Account',
operation: 'update',
confirmText: 'Move every selected project to this account?',
params: [
{
name: 'account',
label: 'Account',
type: 'lookup',
object: 'showcase_account',
labelField: 'name',
required: true,
},
],
},
{
name: 'reschedule',
label: 'Reschedule',
operation: 'update',
confirmText: 'Apply this schedule/status to every selected project?',
params: [
{ name: 'end_date', label: 'Target End Date', type: 'date' },
{
name: 'status',
label: 'Status',
type: 'select',
options: [
{ label: 'Planned', value: 'planned' },
{ label: 'Active', value: 'active' },
{ label: 'On Hold', value: 'on_hold' },
{ label: 'Completed', value: 'completed' },
{ label: 'Cancelled', value: 'cancelled' },
],
},
],
},
],
},
listViews: {
by_status: {
Expand Down