Files
cloudflare-domain-manager/apps/web/src/lib/kanban-utils.ts
T
DenozordecandCursor 29e57666e0
Build, Test, and Push CFDM Docker Image / test (push) Failing after 49s
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been skipped
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been skipped
Build, Test, and Push CFDM Docker Image / create-release (push) Has been skipped
feat: integrate ReUI components and update MCP configuration
- Added ReUI configuration to .mcp.json and .cursor/mcp.json for component integration.
- Updated pnpm-lock.yaml with new dependencies including react-phone-number-input and adjustments to existing packages.
- Enhanced SKILL.md documentation for ReUI to clarify usage and features.
- Removed unused components (ChartCard, DataGridCard, etc.) to streamline the codebase.
- Adjusted domain-related components and filters for improved functionality and UI consistency.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 00:37:40 +07:00

28 lines
922 B
TypeScript

export function boardColumnsToKanbanValue<T extends { id: string | number }>(
columns: Array<{ id: string; items: T[] }>,
): Record<string, T[]> {
const value: Record<string, T[]> = {}
for (const column of columns) {
value[column.id] = column.items
}
return value
}
export function detectKanbanItemMove<T extends { id: string | number }>(
prev: Record<string, T[]>,
next: Record<string, T[]>,
): { itemId: string; fromColumnId: string; toColumnId: string } | null {
for (const [fromColumnId, items] of Object.entries(prev)) {
for (const item of items) {
const itemId = String(item.id)
const nextColumnId = Object.entries(next).find(([, colItems]) =>
colItems.some((entry) => String(entry.id) === itemId),
)?.[0]
if (nextColumnId && nextColumnId !== fromColumnId) {
return { itemId, fromColumnId, toColumnId: nextColumnId }
}
}
}
return null
}