From 4b682a9bc16a049abf55a2b5bca42a468eba5a39 Mon Sep 17 00:00:00 2001 From: anishali2 Date: Thu, 8 Feb 2024 18:16:25 +0500 Subject: [PATCH 1/2] fix(Authentication): fix the authentication issue of re route to login --- apps/web/app/hooks/auth/useAuthenticationPasscode.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/app/hooks/auth/useAuthenticationPasscode.ts b/apps/web/app/hooks/auth/useAuthenticationPasscode.ts index 412b8b548..02a3149b0 100644 --- a/apps/web/app/hooks/auth/useAuthenticationPasscode.ts +++ b/apps/web/app/hooks/auth/useAuthenticationPasscode.ts @@ -13,6 +13,7 @@ import { AxiosError, isAxiosError } from 'axios'; import { usePathname, useSearchParams } from 'next/navigation'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useQuery } from '../useQuery'; +import { useRouter } from 'next/navigation'; type AuthCodeRef = { focus: () => void; @@ -22,7 +23,6 @@ type AuthCodeRef = { export function useAuthenticationPasscode() { const pathname = usePathname(); const query = useSearchParams(); - const queryTeamId = useMemo(() => { return query?.get('teamId'); }, [query]); @@ -51,7 +51,7 @@ export function useAuthenticationPasscode() { }); const [errors, setErrors] = useState({} as { [x: string]: any }); - + const router = useRouter(); // Queries const { queryCall: sendCodeQueryCall, loading: sendCodeLoading } = useQuery(sendAuthCodeAPI); @@ -150,8 +150,8 @@ export function useAuthenticationPasscode() { }) => { signInWorkspaceQueryCall(email, token, selectedTeam) .then(() => { - window.location.reload(); setAuthenticated(true); + router.push('/'); }) .catch((err: AxiosError) => { if (err.response?.status === 400) { From ce887ba873bbff17ba87996c6157f074c4339781 Mon Sep 17 00:00:00 2001 From: anishali2 Date: Thu, 8 Feb 2024 19:23:47 +0500 Subject: [PATCH 2/2] fix(Kanban): fix the kanban scrolling issue --- apps/web/app/[locale]/kanban/page.tsx | 2 +- apps/web/lib/components/Kanban.tsx | 6 +- .../lib/features/team-members-kanban-view.tsx | 93 +++++++++++-------- apps/web/lib/layout/main-layout.tsx | 14 ++- 4 files changed, 70 insertions(+), 45 deletions(-) diff --git a/apps/web/app/[locale]/kanban/page.tsx b/apps/web/app/[locale]/kanban/page.tsx index b6e555e88..3410f9edd 100644 --- a/apps/web/app/[locale]/kanban/page.tsx +++ b/apps/web/app/[locale]/kanban/page.tsx @@ -69,7 +69,7 @@ const Kanban = () => { }; return ( <> - +
diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index 2a35bd978..cd36fea9c 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -62,9 +62,7 @@ function headerStyleChanger(snapshot: DraggableStateSnapshot, bgColor: any) { function InnerItemList({ items, title }: { title: string; items: ITeamTask[]; dropSnapshot: DroppableStateSnapshot }) { return ( <> -
+
{items.map((item: ITeamTask, index: number) => ( {(dragProvided: DraggableProvided, dragSnapshot: DraggableStateSnapshot) => ( @@ -340,7 +338,7 @@ const KanbanDraggable = ({ {...provided.draggableProps} {...provided.dragHandleProps} // style={getItemStyle(snapshot.isDragging, provided.draggableProps.style)} - className="relative flex flex-col px-2 h-[1000px] w-[355px]" + className="relative flex flex-col px-2 h-fit w-[355px]" > {title ? ( <> diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index e2f17c87d..fba803c5f 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -1,8 +1,11 @@ import { useKanban } from '@app/hooks/features/useKanban'; import { ITaskStatus, ITaskStatusItemList, ITeamTask } from '@app/interfaces'; import { IKanban } from '@app/interfaces/IKanban'; +import { fullWidthState } from '@app/stores/fullWidth'; import { clsxm } from '@app/utils'; +import { Container, Divider } from 'lib/components'; import KanbanDraggable, { EmptyKanbanDroppable } from 'lib/components/Kanban'; +import { Footer } from 'lib/layout'; import React from 'react'; import { useEffect, useState } from 'react'; import { @@ -13,6 +16,7 @@ import { DroppableProvided, DroppableStateSnapshot } from 'react-beautiful-dnd'; +import { useRecoilValue } from 'recoil'; export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban }) => { const { @@ -24,6 +28,7 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban }) reorderStatus, addNewTask } = useKanban(); + const fullWidth = useRecoilValue(fullWidthState); const [columns, setColumn] = useState(Object.keys(kanbanBoardTasks)); const reorderTask = (list: ITeamTask[], startIndex: number, endIndex: number) => { const tasks = Array.from(list); @@ -177,40 +182,29 @@ export const KanbanView = ({ kanbanBoardTasks }: { kanbanBoardTasks: IKanban }) if (!enabled) return null; return ( <> + {/*
*/} {columns.length > 0 && ( {(provided: DroppableProvided, snapshot: DroppableStateSnapshot) => ( -
- {columns.length > 0 ? ( - <> - {columns.map((column: string, index: number) => { - return ( - -
- {isColumnCollapse(column) ? ( - - ) : ( - <> - +
+ {columns.length > 0 ? ( + <> + {columns.map((column: string, index: number) => { + return ( + +
+ {isColumnCollapse(column) ? ( + - - )} -
-
- ); - })} - - ) : null} - <>{provided.placeholder} + ) : ( + <> + + + )} +
+ + ); + })} + + ) : null} + <>{provided.placeholder} +
+ + +
+
)}
)}
+ {/* + +
+ +
*/} ); }; diff --git a/apps/web/lib/layout/main-layout.tsx b/apps/web/lib/layout/main-layout.tsx index d8d5c4e02..e0a979a77 100644 --- a/apps/web/lib/layout/main-layout.tsx +++ b/apps/web/lib/layout/main-layout.tsx @@ -15,9 +15,19 @@ type Props = PropsWithChildren<{ notFound?: boolean; className?: string; childrenClassName?: string; + footerClassName?: string; }>; -export function MainLayout({ children, title, showTimer, publicTeam, notFound, className, childrenClassName }: Props) { +export function MainLayout({ + children, + title, + showTimer, + publicTeam, + notFound, + className, + childrenClassName, + footerClassName = '' +}: Props) { const fullWidth = useRecoilValue(fullWidthState); return (
@@ -45,7 +55,7 @@ export function MainLayout({ children, title, showTimer, publicTeam, notFound, c >
{children}
- +