diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index d30ce01e4..b5f7b2ac0 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -7,13 +7,14 @@ import Item from './kanban-card'; import { ITeamTask } from '@app/interfaces'; import { TaskStatus } from '@app/constants'; import { useKanban } from '@app/hooks/features/useKanban'; +import { AddIcon } from './svgs'; const grid = 8; const getItemStyle = (isDragging: any, draggableStyle: any) => ({ userSelect: "none", margin: `0 0 ${grid}px 0`, - background: isDragging ? "lightgreen" : null, + background: isDragging ? "" : null, ...draggableStyle }); @@ -334,11 +335,9 @@ const KanbanDraggable = ({index,title, items, backgroundColor}: { items: ITeamTask[]; }) => { - - return ( <> - { items && + { title && - { items ? + { title ? <> +
+
+ +

Create Issues

+
+
: null diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 10ce4efb2..24e60723f 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -3,7 +3,6 @@ import { ITaskStatus, ITaskStatusItemList, ITeamTask } from "@app/interfaces"; import { IKanban } from "@app/interfaces/IKanban"; import { clsxm } from "@app/utils"; import KanbanDraggable, { EmptyKanbanDroppable } from "lib/components/Kanban" -import { AddIcon } from "lib/components/svgs"; import React from "react"; import { useEffect, useState } from "react"; import { DragDropContext, DraggableLocation, DropResult, Droppable, DroppableProvided, DroppableStateSnapshot } from "react-beautiful-dnd"; @@ -17,13 +16,20 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = const [columns, setColumn] = useState(Object.keys(kanbanBoardTasks)); - const reorderTask = (list: ITeamTask[], startIndex:number , endIndex:number ) => { + const reorderTask = (list: ITeamTask[] , startIndex:number , endIndex:number ) => { 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 [removedColumn] = columns.splice(startIndex, 1); + columns.splice(endIndex, 0, removedColumn); + return columns; + }; const reorderKanbanTasks = ({ kanbanTasks, source, destination }: { kanbanTasks: IKanban, @@ -129,15 +135,13 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = return; } - // TODO: fix issues with reordering column - // if (result.type === 'COLUMN') { - // const reorderedItem = reorder(items, source.index, destination.index); - - // setItems(reorderedItem); - // // updateKanbanBoard(reorderedItem); - // // console.log('data '+ kanbandata) - // return; - // } + + if (result.type === 'COLUMN') { + const reorderedItem = reorderColumn(items, source.index, destination.index); + setColumn(reorderedItem); + + return; + } const data = reorderKanbanTasks({ kanbanTasks: items, @@ -194,17 +198,15 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban}) = : <> -
+
-
- -

Create Issues

-
+
} diff --git a/apps/web/next.config.js b/apps/web/next.config.js index eabcfd6e9..f9e38962c 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -7,7 +7,7 @@ console.log(`NEXT_PUBLIC_GAUZY_API_SERVER_URL: ${process.env.NEXT_PUBLIC_GAUZY_A /** @type {import('next').NextConfig} */ const nextConfig = { output: process.env.NEXT_BUILD_OUTPUT_TYPE === 'standalone' ? 'standalone' : undefined, - reactStrictMode: true, + reactStrictMode: false, swcMinify: true, webpack: (config, { isServer }) => { config.resolve.alias['@app'] = path.join(__dirname, 'app');