@object-ui/plugin-kanban 0.5.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.tsx CHANGED
@@ -44,9 +44,18 @@ export const KanbanRenderer: React.FC<KanbanRendererProps> = ({ schema }) => {
44
44
 
45
45
  // If we have flat data and a grouping key, distribute items into columns
46
46
  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
48
56
  const groups = data.reduce((acc, item) => {
49
- const key = item[groupBy];
57
+ const rawKey = String(item[groupBy] ?? '');
58
+ const key = labelToColumnId[rawKey.toLowerCase()] ?? rawKey;
50
59
  if (!acc[key]) acc[key] = [];
51
60
  acc[key].push(item);
52
61
  return acc;
@@ -79,7 +88,7 @@ export const KanbanRenderer: React.FC<KanbanRendererProps> = ({ schema }) => {
79
88
 
80
89
  // Register the component with the ComponentRegistry
81
90
  ComponentRegistry.register(
82
- 'kanban',
91
+ 'kanban-ui',
83
92
  KanbanRenderer,
84
93
  {
85
94
  namespace: 'plugin-kanban',
@@ -250,7 +259,21 @@ ComponentRegistry.register(
250
259
  {
251
260
  namespace: 'plugin-kanban',
252
261
  label: 'Object Kanban',
253
- category: 'plugin',
262
+ category: 'view',
263
+ inputs: [
264
+ { name: 'objectName', type: 'string', label: 'Object Name', required: true },
265
+ { name: 'columns', type: 'array', label: 'Columns' }
266
+ ]
267
+ }
268
+ );
269
+
270
+ ComponentRegistry.register(
271
+ 'kanban',
272
+ ObjectKanbanRenderer,
273
+ {
274
+ namespace: 'view',
275
+ label: 'Kanban Board',
276
+ category: 'view',
254
277
  inputs: [
255
278
  { name: 'objectName', type: 'string', label: 'Object Name', required: true },
256
279
  { name: 'columns', type: 'array', label: 'Columns' }