Skip to content

Commit c3a0668

Browse files
committed
fix: adjust column handling in ObjectKanban to respect grouping logic
1 parent 45a77c9 commit c3a0668

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

examples/todo/src/domains/todo/task.object.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ export const TodoTask = ObjectSchema.create({
5050
board: {
5151
label: 'Board',
5252
type: 'kanban',
53-
groupBy: 'priority',
54-
columns: ['subject', 'due_date', 'is_completed']
53+
groupBy: 'priority'
5554
}
5655
}
5756
});

packages/plugin-kanban/src/ObjectKanban.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,16 @@ export const ObjectKanban: React.FC<ObjectKanbanProps> = ({
117117
if (schema.columns && schema.columns.length > 0) {
118118
// If columns is array of strings, normalize to objects
119119
if (typeof schema.columns[0] === 'string') {
120-
return (schema.columns as unknown as string[]).map(val => ({
121-
id: val,
122-
title: val
123-
}));
120+
// If grouping is active, assume string columns are meant for data display, not lanes
121+
if (!schema.groupBy) {
122+
return (schema.columns as unknown as string[]).map(val => ({
123+
id: val,
124+
title: val
125+
}));
126+
}
127+
} else {
128+
return schema.columns;
124129
}
125-
return schema.columns;
126130
}
127131

128132
// Try to get options from metadata

0 commit comments

Comments
 (0)