diff --git a/.cspell.json b/.cspell.json index e3d1426b9..7347918a7 100644 --- a/.cspell.json +++ b/.cspell.json @@ -16,6 +16,7 @@ "cacheable", "camelcase", "Chatwoot", + "chetwode", "cloc", "cloudinary", "clsx", diff --git a/apps/web/app/hooks/features/useKanban.ts b/apps/web/app/hooks/features/useKanban.ts index 94b0c653c..dac4f75d8 100644 --- a/apps/web/app/hooks/features/useKanban.ts +++ b/apps/web/app/hooks/features/useKanban.ts @@ -2,7 +2,8 @@ import { kanbanBoardState } from "@app/stores/kanban"; import { useTaskStatus } from "./useTaskStatus"; import { useRecoilState } from "recoil"; import { useEffect, useState } from "react"; -import { ITaskStatusItemList } from "@app/interfaces"; +import { ITaskStatusItemList, ITeamTask } from "@app/interfaces"; +import { useTeamTasks } from "./useTeamTasks"; export function useKanban() { @@ -11,23 +12,32 @@ export function useKanban() { const [kanbanBoard, setKanbanBoard] = useRecoilState(kanbanBoardState); const taskStatusHook = useTaskStatus(); + const { tasks, tasksFetching } = useTeamTasks(); + /** * format data for kanban board */ useEffect(()=> { - if(taskStatusHook.loading) { + if(!taskStatusHook.loading && !tasksFetching) { let kanban = {}; + + const getTasksByStatus = (status: string | undefined) => { + return tasks.filter((task: ITeamTask)=> { + return task.status === status + }) + } + taskStatusHook.taskStatus.map((taskStatus: ITaskStatusItemList,)=> { kanban = { ...kanban, - [taskStatus.name ? taskStatus.name : ''] : [] + [taskStatus.name ? taskStatus.name : ''] : getTasksByStatus(taskStatus.name) } }); setKanbanBoard(kanban) setLoading(false) } - },[taskStatusHook.loading]) + },[taskStatusHook.loading, tasksFetching]) return { data: kanbanBoard, diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx new file mode 100644 index 000000000..4c886f071 --- /dev/null +++ b/apps/web/app/layout.tsx @@ -0,0 +1,15 @@ +import '../styles/globals.css'; + +export default function RootLayout({ + children +}: { + children: React.ReactNode +}) { + return ( + + + {children} + + + ) +} diff --git a/apps/web/app/not-found.tsx b/apps/web/app/not-found.tsx new file mode 100644 index 000000000..e903081e0 --- /dev/null +++ b/apps/web/app/not-found.tsx @@ -0,0 +1,15 @@ +'use client'; +import NotFound from '@components/pages/404'; +import { AuthLayout } from 'lib/layout'; + +const NotFoundPage = () => { + // TODO: + // Fix localisation issue + return ( + + + + ); +}; + +export default NotFoundPage; diff --git a/apps/web/components/pages/404/index.tsx b/apps/web/components/pages/404/index.tsx index 4a8b06f89..a26d8643a 100644 --- a/apps/web/components/pages/404/index.tsx +++ b/apps/web/components/pages/404/index.tsx @@ -1,25 +1,27 @@ +'use client'; +import SadCry from '@components/ui/svgs/sad-cry'; import { Button, Text } from 'lib/components'; import Link from 'next/link'; -import { useTranslation } from 'react-i18next'; + function NotFound() { - const { t } = useTranslation(); return ( -
-
- 404 +
+
+ + 404!
- - {t('pages.page404.HEADING_TITLE')} - - - {t('pages.page404.HEADING_DESCRIPTION')} + + Page not found ! - - - +
+ + {`We looked, but can't find it ....`} + + + + +
); } diff --git a/apps/web/components/pages/offline/index.tsx b/apps/web/components/pages/offline/index.tsx new file mode 100644 index 000000000..060c5f690 --- /dev/null +++ b/apps/web/components/pages/offline/index.tsx @@ -0,0 +1,27 @@ +import SadCry from '@components/ui/svgs/sad-cry'; +import { Text } from 'lib/components'; +import { useTranslation } from 'react-i18next'; + +function Offline() { + const { t } = useTranslation(); + + return ( +
+
+ + Offline! +
+ + + {t('pages.offline.HEADING_TITLE')} + +
+ + {t('pages.offline.HEADING_DESCRIPTION')} + +
+
+ ); +} + +export default Offline; diff --git a/apps/web/components/ui/data-table.tsx b/apps/web/components/ui/data-table.tsx index cae448f7f..2e7afeea2 100644 --- a/apps/web/components/ui/data-table.tsx +++ b/apps/web/components/ui/data-table.tsx @@ -72,7 +72,7 @@ function DataTable({ }) return ( - +
{table.getHeaderGroups().map((headerGroup) => ( @@ -81,12 +81,9 @@ function DataTable({ {header.isPlaceholder ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} + : flexRender(header.column.columnDef.header, header.getContext())} - ) + ); })} ))} @@ -94,44 +91,29 @@ function DataTable({ {table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => ( - + {row.getVisibleCells().map((cell) => ( - - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} + + {flexRender(cell.column.columnDef.cell, cell.getContext())} ))} )) ) : ( - + No results. )} - { - footerRows && footerRows?.length > 0 && ( - - {footerRows.map((row, index) => ( - {row} - ))} - - ) - } - + {footerRows && footerRows?.length > 0 && ( + + {footerRows.map((row, index) => ( + {row} + ))} + + )}
); } diff --git a/apps/web/components/ui/svgs/sad-cry.tsx b/apps/web/components/ui/svgs/sad-cry.tsx new file mode 100644 index 000000000..63d2bbd38 --- /dev/null +++ b/apps/web/components/ui/svgs/sad-cry.tsx @@ -0,0 +1,21 @@ + +const SadCry = ({ + width, + height, + fill="#8C7AE4" +}:{ + width: number, + height: number, + fill?: string, +}) => { + return ( + <> + + + + + ) +} + +export default SadCry; \ No newline at end of file diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index 37d11a5d7..b615790f0 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -4,6 +4,7 @@ import React from 'react'; import { useEffect, useState } from 'react'; import { Draggable, DraggableProvided, DraggableStateSnapshot, Droppable, DroppableProvided, DroppableStateSnapshot } from 'react-beautiful-dnd'; import Item from './kanban-card'; +import { ITeamTask } from '@app/interfaces'; const grid = 8; @@ -48,12 +49,12 @@ function headerStyleChanger(snapshot: DraggableStateSnapshot, bgColor: any){ */ function InnerItemList({items, title}: { title: string, - items: any[] + items: ITeamTask[] }) { return ( <>
- {items.map((item: any, index: number) => ( + {items.map((item: ITeamTask, index: number) => ( {(dragProvided: DraggableProvided, dragSnapshot: DraggableStateSnapshot) => ( { const [enabled, setEnabled] = useState(false); @@ -319,7 +320,7 @@ const KanbanDraggable = ({index,title, items, backgroundColor}: { index: number; title: string; backgroundColor: any - items: any; + items: ITeamTask[]; }) => { diff --git a/apps/web/lib/components/kanban-card.tsx b/apps/web/lib/components/kanban-card.tsx index 849211720..2a7d5e9be 100644 --- a/apps/web/lib/components/kanban-card.tsx +++ b/apps/web/lib/components/kanban-card.tsx @@ -152,13 +152,16 @@ export default function Item(props: any) { >
- + {item.tags && ( + + )} +
- #213 - {item.content} + #{item.number} + {item.title}
@@ -175,16 +178,16 @@ export default function Item(props: any) {
- {images.map((image: any, index: number)=> { + {item.members.map((option: any, index: number)=> { return ( {""} ) })} @@ -202,27 +205,4 @@ export default function Item(props: any) { }
); -} - -const images = [ - { - id: 0, - url: '/assets/cover/auth-bg-cover-dark.png' - }, - { - id: 1, - url: '/assets/cover/auth-bg-cover-dark.png' - }, - { - id: 2, - url: '/assets/cover/auth-bg-cover-dark.png' - }, - { - id: 3, - url: '/assets/cover/auth-bg-cover-dark.png' - }, - { - id: 4, - url: '/assets/cover/auth-bg-cover-dark.png' - }, -] \ No newline at end of file +} \ No newline at end of file diff --git a/apps/web/lib/features/team-members-kanban-view.tsx b/apps/web/lib/features/team-members-kanban-view.tsx index 9b116c7c3..da8d4dbf4 100644 --- a/apps/web/lib/features/team-members-kanban-view.tsx +++ b/apps/web/lib/features/team-members-kanban-view.tsx @@ -54,8 +54,9 @@ const reorderItemMap = ({ itemMap, source, destination }: { }; const getHeaderBackground = (columns: any, column: any) => { + const selectState = columns.filter((item: any)=> { - return item.name === column.toUpperCase() + return item.name === column }); return selectState[0].color diff --git a/apps/web/lib/layout/auth-layout.tsx b/apps/web/lib/layout/auth-layout.tsx index 78d12a281..3585f3014 100644 --- a/apps/web/lib/layout/auth-layout.tsx +++ b/apps/web/lib/layout/auth-layout.tsx @@ -9,14 +9,15 @@ import { Footer } from './footer'; type Props = { title?: string; description?: string | ReactNode; + isAuthPage?: boolean; } & PropsWithChildren; -export function AuthLayout({ children, title, description }: Props) { +export function AuthLayout({ children, title, description, isAuthPage = true }: Props) { const { t } = useTranslation(); return ( <> -
+
{/* Bg Cover side */}
-
- {title && ( - - {title} - - )} + {isAuthPage && +
+ {title && ( + + {title} + + )} - {description && ( - - {description} - - )} -
+ {description && ( + + {description} + + )} +
+ } {children}
diff --git a/apps/web/pages/404.tsx b/apps/web/pages/404.tsx index 5f605023b..2fac4eac8 100644 --- a/apps/web/pages/404.tsx +++ b/apps/web/pages/404.tsx @@ -1,11 +1,18 @@ import NotFound from '@components/pages/404'; -import { MainLayout } from 'lib/layout'; +import { AuthLayout } from 'lib/layout'; +import { useTranslation } from 'react-i18next'; const NotFoundPage = () => { + + const { t } = useTranslation(); + return ( - + - + ); }; diff --git a/apps/web/pages/index.tsx b/apps/web/pages/index.tsx index 2bad5347e..5d4759600 100644 --- a/apps/web/pages/index.tsx +++ b/apps/web/pages/index.tsx @@ -19,6 +19,7 @@ import { useState } from 'react'; import { IssuesView } from '@app/constants'; import { TableCellsIcon, QueueListIcon, Squares2X2Icon } from '@heroicons/react/24/solid'; import { useNetworkState } from '@uidotdev/usehooks'; +import Offline from '@components/pages/offline'; function MainPage() { const { t } = useTranslation(); @@ -28,9 +29,7 @@ function MainPage() { const { online } = useNetworkState(); if (!online) { - return ( -
You are Currently Offline
- ); + return ; } return ( diff --git a/apps/web/public/locales/ar/common.json b/apps/web/public/locales/ar/common.json index 06e0fd6f7..466d54f52 100644 --- a/apps/web/public/locales/ar/common.json +++ b/apps/web/public/locales/ar/common.json @@ -426,6 +426,10 @@ "HEADING_TITLE": "غير موجود", "HEADING_DESCRIPTION": "المورد الذي تبحث عنه غير موجود!", "LINK_LABEL": "الذهاب إلى الصفحة الرئيسية" + }, + "offline": { + "HEADING_TITLE": "انقطاع الشبكة!", + "HEADING_DESCRIPTION": "أنت غير متصل حاليًا، يرجى التحقق من اتصالك بالإنترنت..." } }, diff --git a/apps/web/public/locales/bg/common.json b/apps/web/public/locales/bg/common.json index eb09aeb2e..ab40f88f9 100644 --- a/apps/web/public/locales/bg/common.json +++ b/apps/web/public/locales/bg/common.json @@ -429,6 +429,10 @@ "HEADING_TITLE": "Ненамерено", "HEADING_DESCRIPTION": "Търсеният ресурс не беше намерен!", "LINK_LABEL": "Отиди на началната страница" + }, + "offline": { + "HEADING_TITLE": "Мрежата е прекъсната!", + "HEADING_DESCRIPTION": "В момента сте извън линия, моля, проверете интернет връзката си..." } }, diff --git a/apps/web/public/locales/de/common.json b/apps/web/public/locales/de/common.json index b0d614157..ec3048498 100644 --- a/apps/web/public/locales/de/common.json +++ b/apps/web/public/locales/de/common.json @@ -422,6 +422,10 @@ "HEADING_TITLE": "Nicht gefunden", "HEADING_DESCRIPTION": "Die gesuchte Ressource wurde nicht gefunden!", "LINK_LABEL": "Zur Startseite" + }, + "offline": { + "HEADING_TITLE": "Netzwerk getrennt!", + "HEADING_DESCRIPTION": "Sie sind derzeit offline, bitte überprüfen Sie Ihre Internetverbindung..." } }, "timer": { diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json index 812911aaa..7bb852b95 100644 --- a/apps/web/public/locales/en/common.json +++ b/apps/web/public/locales/en/common.json @@ -420,9 +420,13 @@ "SELECT_ROLES": "Select Roles" }, "page404": { - "HEADING_TITLE": "Not Found", - "HEADING_DESCRIPTION": "Resource you are looking for not found!", - "LINK_LABEL": "Go to homepage" + "HEADING_TITLE": "Page not found !", + "HEADING_DESCRIPTION": "We looked, but can't find it .... ", + "LINK_LABEL": "Home" + }, + "offline": { + "HEADING_TITLE": "Network Disconnected!", + "HEADING_DESCRIPTION": "You are currently Offline, please check your internet connection..." } }, diff --git a/apps/web/public/locales/es/common.json b/apps/web/public/locales/es/common.json index d7352b283..f80f351b2 100644 --- a/apps/web/public/locales/es/common.json +++ b/apps/web/public/locales/es/common.json @@ -406,6 +406,10 @@ "HEADING_TITLE": "No encontrado", "HEADING_DESCRIPTION": "¡El recurso que buscas no se encuentra!", "LINK_LABEL": "Ir a la página de inicio" + }, + "offline": { + "HEADING_TITLE": "¡Red Desconectada!", + "HEADING_DESCRIPTION": "Actualmente estás desconectado, por favor verifica tu conexión a Internet..." } }, "timer": { diff --git a/apps/web/public/locales/fr/common.json b/apps/web/public/locales/fr/common.json index 9e72f2651..f07338187 100644 --- a/apps/web/public/locales/fr/common.json +++ b/apps/web/public/locales/fr/common.json @@ -417,6 +417,10 @@ "HEADING_TITLE": "Page non trouvée", "HEADING_DESCRIPTION": "La ressource que vous recherchez est introuvable !", "LINK_LABEL": "Aller à la page d'accueil" + }, + "offline": { + "HEADING_TITLE": "Réseau déconnecté !", + "HEADING_DESCRIPTION": "Vous êtes actuellement hors ligne, veuillez vérifier votre connexion Internet..." } }, diff --git a/apps/web/public/locales/he/common.json b/apps/web/public/locales/he/common.json index aada3d6ee..9330a1f1a 100644 --- a/apps/web/public/locales/he/common.json +++ b/apps/web/public/locales/he/common.json @@ -417,6 +417,10 @@ "HEADING_TITLE": "לא נמצא", "HEADING_DESCRIPTION": "המשאב שאתה מחפש לא נמצא!", "LINK_LABEL": "לך לדף הבית" + }, + "offline": { + "HEADING_TITLE": "רשת מנותקת!", + "HEADING_DESCRIPTION": "אתה לא מחובר כרגע, בבקשה בדוק את חיבור האינטרנט שלך..." } }, "timer": { diff --git a/apps/web/public/locales/it/common.json b/apps/web/public/locales/it/common.json index 652fb9be6..20e197ad8 100644 --- a/apps/web/public/locales/it/common.json +++ b/apps/web/public/locales/it/common.json @@ -419,6 +419,10 @@ "HEADING_TITLE": "Not Found", "HEADING_DESCRIPTION": "Resource you are looking for not found!", "LINK_LABEL": "Go to homepage" + }, + "offline": { + "HEADING_TITLE": "Rete Disconnessa!", + "HEADING_DESCRIPTION": "Attualmente sei offline, controlla la tua connessione Internet..." } }, diff --git a/apps/web/public/locales/nl/common.json b/apps/web/public/locales/nl/common.json index 8b156ff2a..07d81d72a 100644 --- a/apps/web/public/locales/nl/common.json +++ b/apps/web/public/locales/nl/common.json @@ -419,6 +419,10 @@ "HEADING_TITLE": "Not Found", "HEADING_DESCRIPTION": "Resource you are looking for not found!", "LINK_LABEL": "Go to homepage" + }, + "offline": { + "HEADING_TITLE": "Netwerk Verbroken!", + "HEADING_DESCRIPTION": "U bent momenteel offline, controleer uw internetverbinding..." } }, diff --git a/apps/web/public/locales/pl/common.json b/apps/web/public/locales/pl/common.json index 5eb383e2b..c1d668bbf 100644 --- a/apps/web/public/locales/pl/common.json +++ b/apps/web/public/locales/pl/common.json @@ -419,6 +419,10 @@ "HEADING_TITLE": "Not Found", "HEADING_DESCRIPTION": "Resource you are looking for not found!", "LINK_LABEL": "Go to homepage" + }, + "offline": { + "HEADING_TITLE": "Rozłączono sieć!", + "HEADING_DESCRIPTION": "Jesteś obecnie offline, sprawdź swoje połączenie z internetem..." } }, diff --git a/apps/web/public/locales/pt/common.json b/apps/web/public/locales/pt/common.json index 33cec78fe..9c42485e8 100644 --- a/apps/web/public/locales/pt/common.json +++ b/apps/web/public/locales/pt/common.json @@ -419,6 +419,10 @@ "HEADING_TITLE": "Not Found", "HEADING_DESCRIPTION": "Resource you are looking for not found!", "LINK_LABEL": "Go to homepage" + }, + "offline": { + "HEADING_TITLE": "Rede Desconectada!", + "HEADING_DESCRIPTION": "Você está atualmente offline, por favor, verifique sua conexão com a Internet..." } }, diff --git a/apps/web/public/locales/ru/common.json b/apps/web/public/locales/ru/common.json index bae449628..7c0a269b5 100644 --- a/apps/web/public/locales/ru/common.json +++ b/apps/web/public/locales/ru/common.json @@ -419,6 +419,10 @@ "HEADING_TITLE": "Not Found", "HEADING_DESCRIPTION": "Resource you are looking for not found!", "LINK_LABEL": "Go to homepage" + }, + "offline": { + "HEADING_TITLE": "Сеть отключена!", + "HEADING_DESCRIPTION": "В настоящее время вы не подключены к Интернету, проверьте ваше соединение..." } }, diff --git a/apps/web/public/locales/zh/common.json b/apps/web/public/locales/zh/common.json index f9bb24a2e..82ab1fae9 100644 --- a/apps/web/public/locales/zh/common.json +++ b/apps/web/public/locales/zh/common.json @@ -396,6 +396,10 @@ "NO_INVITATIONS": "目前没有邀请!", "NO_MEMBERS": "目前没有成员!" + }, + "offline": { + "HEADING_TITLE": "网络断开连接!", + "HEADING_DESCRIPTION": "您目前处于离线状态,请检查您的互联网连接..." } }, diff --git a/apps/web/tailwind.config.js b/apps/web/tailwind.config.js index 9cbcbd3ba..d7203d899 100644 --- a/apps/web/tailwind.config.js +++ b/apps/web/tailwind.config.js @@ -33,6 +33,7 @@ module.exports = { transparent: 'transparent', current: 'currentColor', neutral: '#7E7991', + chetwodeBlue: '#8C7AE4', indianRed: '#D95F5F', grey: '#868296', transparentWhite: 'rgba(255, 255, 255, 0.30)',