From d7fdbc2adad1c121fac5a2259f177c592d726c3f Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 22:32:48 +0100 Subject: [PATCH 01/10] feat:add reorderstatus to usekanban --- apps/web/app/hooks/features/useKanban.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/web/app/hooks/features/useKanban.ts b/apps/web/app/hooks/features/useKanban.ts index 4217299aa..24ea3c505 100644 --- a/apps/web/app/hooks/features/useKanban.ts +++ b/apps/web/app/hooks/features/useKanban.ts @@ -62,6 +62,16 @@ export function useKanban() { return columnData[0].isCollapsed } + const reorderStatus = (itemStatus: String, index: number) => { + taskStatusHook.taskStatus.filter((status: ITaskStatusItemList)=> { + return status.name === itemStatus + }).map((status: ITaskStatusItemList)=> { + taskStatusHook.editTaskStatus(status.id, { + order: index + }); + }) + } + return { data: kanbanBoard, isLoading: loading, @@ -69,6 +79,7 @@ export function useKanban() { updateKanbanBoard: setKanbanBoard, updateTaskStatus: updateTask, toggleColumn, - isColumnCollapse + isColumnCollapse, + reorderStatus } } \ No newline at end of file From f8eaa52c9d376cddd8a44bbe364672d3eb1fc328 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 22:34:20 +0100 Subject: [PATCH 02/10] update:reorder serverside column ondrag --- apps/web/lib/features/team-members-kanban-view.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 24e60723f..70d064fd6 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -10,7 +10,7 @@ import { DragDropContext, DraggableLocation, DropResult, Droppable, DroppablePro export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) => { - const { columns:kanbanColumns, updateKanbanBoard, updateTaskStatus, isColumnCollapse } = useKanban(); + const { columns:kanbanColumns, updateKanbanBoard, updateTaskStatus, isColumnCollapse, reorderStatus } = useKanban(); const [items, setItems] = useState(kanbanBoardTasks); @@ -20,12 +20,11 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = const tasks = Array.from(list); const [removedTask] = tasks.splice(startIndex, 1); tasks.splice(endIndex, 0, removedTask); - return tasks; }; const reorderColumn = (list: IKanban , startIndex:number , endIndex:number ) => { - const columns = Object.keys(list) + const columns = Object.keys(list); const [removedColumn] = columns.splice(startIndex, 1); columns.splice(endIndex, 0, removedColumn); return columns; @@ -138,6 +137,12 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = if (result.type === 'COLUMN') { const reorderedItem = reorderColumn(items, source.index, destination.index); + + //update column order in server side + reorderedItem.map((item: string, index: number) => { + reorderStatus(item, index); + }); + setColumn(reorderedItem); return; @@ -206,7 +211,6 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = items={items[column]} backgroundColor={getHeaderBackground(kanbanColumns, column)} /> - } From fda2dc1668ae688dad58018a13eb67e17b186305 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 22:48:27 +0100 Subject: [PATCH 03/10] update:add backgroundColor to props --- apps/web/lib/components/Kanban.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index b5f7b2ac0..740706648 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -174,9 +174,10 @@ export const KanbanDroppable = ({ title, droppableId, type, content }: { * @param param0 * @returns */ -export const EmptyKanbanDroppable = ({index,title, items}: { +export const EmptyKanbanDroppable = ({index,title, items, backgroundColor}: { index: number; title: string; + backgroundColor: any; items: ITeamTask[]; })=> { const [enabled, setEnabled] = useState(false); @@ -219,7 +220,7 @@ export const EmptyKanbanDroppable = ({index,title, items}: { <>
Date: Tue, 19 Dec 2023 22:48:56 +0100 Subject: [PATCH 04/10] update:change collapse column backgroundcolor --- apps/web/lib/features/team-members-kanban-view.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 70d064fd6..2064083c2 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -199,6 +199,7 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = index={index} title={column} items={items[column]} + backgroundColor={getHeaderBackground(kanbanColumns, column)} />
: From 0624d9eaa4a397bb3d8365bd6700397c0d468180 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 22:54:02 +0100 Subject: [PATCH 05/10] update:hide scrollbar on empty column --- apps/web/lib/components/Kanban.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index 740706648..85cebb8de 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -62,7 +62,7 @@ function InnerItemList({items, title, dropSnapshot}: { minHeight: ((items.length < 0) && dropSnapshot.isDraggingOver) ? '120px' : '20px', marginTop: (items.length > 0) ? '20px' : '0px' }} - className="flex flex-col gap-2.5 max-h-[520px] overflow-y-scroll overflow-x-hidden"> + className="flex flex-col gap-2.5 max-h-[520px] overflow-y-auto overflow-x-hidden"> {items.map((item: ITeamTask, index: number) => ( {(dragProvided: DraggableProvided, dragSnapshot: DraggableStateSnapshot) => ( From 718043ed4b01429a3c55f863d926c6cf569f1686 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 23:08:27 +0100 Subject: [PATCH 06/10] update:make all tags text color white --- apps/web/lib/components/kanban-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/components/kanban-card.tsx b/apps/web/lib/components/kanban-card.tsx index c1e33aa82..c3a481500 100644 --- a/apps/web/lib/components/kanban-card.tsx +++ b/apps/web/lib/components/kanban-card.tsx @@ -80,7 +80,7 @@ function TagList({tags}: { key={index} title={tag.name} backgroundColor={tag.color} - color={tag.color} + color={"#FFFFFF"} /> ) })} From 1b924256d7798695a3749050484551b694ddc936 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 23:12:26 +0100 Subject: [PATCH 07/10] fix:add just flexwrap to kanban card tags --- apps/web/lib/components/kanban-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/components/kanban-card.tsx b/apps/web/lib/components/kanban-card.tsx index c3a481500..c25d53573 100644 --- a/apps/web/lib/components/kanban-card.tsx +++ b/apps/web/lib/components/kanban-card.tsx @@ -73,7 +73,7 @@ function TagList({tags}: { }){ return ( <> -
+
{tags.map((tag: Tag, index: number)=> { return ( Date: Tue, 19 Dec 2023 23:15:56 +0100 Subject: [PATCH 08/10] update:add justify-between on kanban card --- apps/web/lib/components/kanban-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/components/kanban-card.tsx b/apps/web/lib/components/kanban-card.tsx index c25d53573..ff327dd46 100644 --- a/apps/web/lib/components/kanban-card.tsx +++ b/apps/web/lib/components/kanban-card.tsx @@ -195,7 +195,7 @@ export default function Item(props: any) {
-
+
From f3a0475e1a23fbaa72bdafa5b6cff36f546cdda9 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 23:21:43 +0100 Subject: [PATCH 09/10] fix:use string intend of String --- apps/web/app/hooks/features/useKanban.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/hooks/features/useKanban.ts b/apps/web/app/hooks/features/useKanban.ts index 24ea3c505..cf6fed18b 100644 --- a/apps/web/app/hooks/features/useKanban.ts +++ b/apps/web/app/hooks/features/useKanban.ts @@ -62,7 +62,7 @@ export function useKanban() { return columnData[0].isCollapsed } - const reorderStatus = (itemStatus: String, index: number) => { + const reorderStatus = (itemStatus: string, index: number) => { taskStatusHook.taskStatus.filter((status: ITaskStatusItemList)=> { return status.name === itemStatus }).map((status: ITaskStatusItemList)=> { From e4e52d539b23575f1948af7cd260ec9c1980d1f0 Mon Sep 17 00:00:00 2001 From: maceteligolden Date: Tue, 19 Dec 2023 23:31:47 +0100 Subject: [PATCH 10/10] fix:add missing return --- apps/web/lib/features/team-members-kanban-view.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 2064083c2..88d61c953 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -140,7 +140,7 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = //update column order in server side reorderedItem.map((item: string, index: number) => { - reorderStatus(item, index); + return reorderStatus(item, index); }); setColumn(reorderedItem);