File tree Expand file tree Collapse file tree
packages/plugin-kanban/src Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments