Skip to content

Commit 093ab29

Browse files
authored
Merge pull request #450 from objectstack-ai/copilot/fix-msw-board-data-visibility
2 parents 60b4a3e + c8a7d6b commit 093ab29

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

packages/plugin-kanban/src/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,18 @@ export const KanbanRenderer: React.FC<KanbanRendererProps> = ({ schema }) => {
4444

4545
// If we have flat data and a grouping key, distribute items into columns
4646
if (data && groupBy && Array.isArray(data)) {
47-
// 1. Group data by key
47+
// Build label→id mapping so data values (labels like "In Progress")
48+
// match column IDs (option values like "in_progress")
49+
const labelToColumnId: Record<string, string> = {};
50+
columns.forEach((col: any) => {
51+
if (col.id) labelToColumnId[String(col.id).toLowerCase()] = col.id;
52+
if (col.title) labelToColumnId[String(col.title).toLowerCase()] = col.id;
53+
});
54+
55+
// 1. Group data by key, normalizing via label→id mapping
4856
const groups = data.reduce((acc, item) => {
49-
const key = item[groupBy];
57+
const rawKey = String(item[groupBy] ?? '');
58+
const key = labelToColumnId[rawKey.toLowerCase()] ?? rawKey;
5059
if (!acc[key]) acc[key] = [];
5160
acc[key].push(item);
5261
return acc;

0 commit comments

Comments
 (0)