Skip to content

Commit

Permalink
2544 feature profile not found page (#2553)
Browse files Browse the repository at this point in the history
* feat: working on main changes

* feat: member not found

* feat: member not found

* feat: member not found

* feat: member not found

* feat: member not found

* feat: member not found

* feat: member not found

* Update useTaskStatistics.ts

* Update useTaskStatistics.ts

* Update useOrganizationTeams.ts

* Update useOrganizationTeams.ts

* Update yarn.lock

* Update yarn.lock
  • Loading branch information
Anishali2 authored May 28, 2024
1 parent 59d70d3 commit d8815b6
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 73 deletions.
142 changes: 83 additions & 59 deletions apps/web/app/[locale]/profile/[memberId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ITimerStatusEnum, OT_Member } from '@app/interfaces';
import { clsxm, isValidUrl } from '@app/utils';
import clsx from 'clsx';
import { withAuthentication } from 'lib/app/authenticator';
import { Avatar, Breadcrumb, Container, Text, VerticalSeparator } from 'lib/components';
import { Avatar, Breadcrumb, Button, Container, Text, VerticalSeparator } from 'lib/components';
import { ArrowLeftIcon } from 'assets/svg';
import { TaskFilter, Timer, TimerStatus, UserProfileTask, getTimerStatusValue, useTaskFilter } from 'lib/features';
import { MainHeader, MainLayout } from 'lib/layout';
Expand All @@ -29,6 +29,7 @@ const Profile = React.memo(function ProfilePage({ params }: { params: { memberId
const profile = useUserProfilePage();
const { user } = useAuthenticateUser();
const { isTrackingEnabled, activeTeam, activeTeamManagers } = useOrganizationTeams();
const members = activeTeam?.members;
const { getEmployeeDayPlans } = useDailyPlan();
const fullWidth = useRecoilValue(fullWidthState);
const [activityFilter, setActivityFilter] = useState<FilterTab>('Tasks');
Expand Down Expand Up @@ -75,71 +76,94 @@ const Profile = React.memo(function ProfilePage({ params }: { params: { memberId
}, [getEmployeeDayPlans, profile.member?.employeeId]);

// Example usage

// div
return (
<>
<MainLayout showTimer={profileIsAuthUser && isTrackingEnabled}>
<MainHeader
fullWidth={fullWidth}
className={clsxm(hookFilterType && ['pb-0'], 'pb-2', 'pt-20 sticky top-20 z-50')}
>
{/* Breadcrumb */}
<div className="flex items-center gap-8">
<Link href="/">
<ArrowLeftIcon className="w-6 h-6" />
</Link>

<Breadcrumb paths={breadcrumb} className="text-sm" />
{Array.isArray(members) && members.length && !profile.member ? (
<MainLayout>
<div className=" absolute top-[50%] left-[50%] transform -translate-x-1/2 -translate-y-1/2">
<div className="flex flex-col justify-center items-center gap-5">
<Text className="text-[40px] font-bold text-center text-[#282048] dark:text-light--theme">
{t('common.MEMBER')} {t('common.NOT_FOUND')}!
</Text>

<Text className=" font-light text-center text-gray-400">
{t('pages.profile.MEMBER_NOT_FOUND_MSG_1')}
</Text>
<Text className=" font-light text-center text-gray-400">
{t('pages.profile.MEMBER_NOT_FOUND_MSG_1')}
</Text>

<Button className="m-auto font-normal rounded-lg ">
<Link href="/">{t('pages.profile.GO_TO_HOME')}</Link>
</Button>
</div>
</div>
</MainLayout>
) : (
<MainLayout showTimer={profileIsAuthUser && isTrackingEnabled}>
<MainHeader
fullWidth={fullWidth}
className={clsxm(hookFilterType && ['pb-0'], 'pb-2', 'pt-20 sticky top-20 z-50')}
>
{/* Breadcrumb */}
<div className="flex items-center gap-8">
<Link href="/">
<ArrowLeftIcon className="w-6 h-6" />
</Link>

{/* User Profile Detail */}
<div className="flex flex-col items-center justify-between py-5 md:py-10 md:flex-row">
<UserProfileDetail member={profile.member} />

{profileIsAuthUser && isTrackingEnabled && (
<Timer
className={clsxm(
'p-5 rounded-2xl shadow-xlcard',
'dark:border-[0.125rem] dark:border-[#28292F]',
'dark:bg-[#1B1D22]'
)}
/>
)}
</div>
{/* TaskFilter */}
<TaskFilter profile={profile} hook={hook} />
</MainHeader>
{/* Divider */}
<div className="h-0.5 bg-[#FFFFFF14]"></div>
{hook.tab == 'worked' && canSeeActivity && (
<Container fullWidth={fullWidth} className="py-8">
<div className={clsxm('flex justify-start items-center gap-4 mt-3')}>
{Object.keys(activityScreens).map((filter, i) => (
<div key={i} className="flex cursor-pointer justify-start items-center gap-4">
{i !== 0 && <VerticalSeparator />}
<div
className={clsxm(
'text-gray-500',
activityFilter == filter && 'text-black dark:text-white'
)}
onClick={() => changeActivityFilter(filter as FilterTab)}
>
{filter}
</div>
</div>
))}
<Breadcrumb paths={breadcrumb} className="text-sm" />
</div>
</Container>
)}

<Container fullWidth={fullWidth} className="mb-10">
{hook.tab !== 'worked' || activityFilter == 'Tasks' ? (
<UserProfileTask profile={profile} tabFiltered={hook} />
) : (
activityScreens[activityFilter] ?? null
{/* User Profile Detail */}
<div className="flex flex-col items-center justify-between py-5 md:py-10 md:flex-row">
<UserProfileDetail member={profile.member} />

{profileIsAuthUser && isTrackingEnabled && (
<Timer
className={clsxm(
'p-5 rounded-2xl shadow-xlcard',
'dark:border-[0.125rem] dark:border-[#28292F]',
'dark:bg-[#1B1D22]'
)}
/>
)}
</div>
{/* TaskFilter */}
<TaskFilter profile={profile} hook={hook} />
</MainHeader>
{/* Divider */}
<div className="h-0.5 bg-[#FFFFFF14]"></div>
{hook.tab == 'worked' && canSeeActivity && (
<Container fullWidth={fullWidth} className="py-8">
<div className={clsxm('flex justify-start items-center gap-4 mt-3')}>
{Object.keys(activityScreens).map((filter, i) => (
<div key={i} className="flex cursor-pointer justify-start items-center gap-4">
{i !== 0 && <VerticalSeparator />}
<div
className={clsxm(
'text-gray-500',
activityFilter == filter && 'text-black dark:text-white'
)}
onClick={() => changeActivityFilter(filter as FilterTab)}
>
{filter}
</div>
</div>
))}
</div>
</Container>
)}
</Container>
</MainLayout>

<Container fullWidth={fullWidth} className="mb-10">
{hook.tab !== 'worked' || activityFilter == 'Tasks' ? (
<UserProfileTask profile={profile} tabFiltered={hook} />
) : (
activityScreens[activityFilter] ?? null
)}
</Container>
</MainLayout>
)}
</>
);
});
Expand Down
7 changes: 5 additions & 2 deletions apps/web/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@
"KANBAN_BOARD": "لوحة كانبان"
},
"profile": {
"BREADCRUMB": "[\"مهام العضو\"]"
},
"BREADCRUMB": "[\"مهام العضو\"]",
"MEMBER_NOT_FOUND_MSG_1": "العضو الذي تبحث عنه غير موجود في الفريق، يرجى المحاولة مرة أخرى ببحث مختلف.",
"MEMBER_NOT_FOUND_MSG_2": "إذا كنت تبحث عن عضو في فريق مختلف، يرجى تحديد الفريق من القائمة المنسدلة أعلاه.",
"GO_TO_HOME": "الذهاب إلى الصفحة الرئيسية"
},
"taskDetails": {
"BREADCRUMB": "[\"تفاصيل المهمة\"]",
"DESCRIPTION": "الوصف",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Канбан дъска"
},
"profile": {
"BREADCRUMB": "[\"Задачи за член\"]"
"BREADCRUMB": "[\"Задачи за член\"]",
"MEMBER_NOT_FOUND_MSG_1": "Членът, когото търсите, не съществува в отбора, моля опитайте да търсите с различен заявка.",
"MEMBER_NOT_FOUND_MSG_2": "Ако търсите член в различен отбор, моля изберете отбора от падащото меню по-горе.",
"GO_TO_HOME": "Отиди в началото"
},
"taskDetails": {
"BREADCRUMB": "[\"Детайли за задачата\"]",
Expand Down
6 changes: 5 additions & 1 deletion apps/web/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@
"KANBAN_BOARD": "Kanban-Board"
},
"profile": {
"BREADCRUMB": "[\"Aufgaben des Mitglieds\"]"
"BREADCRUMB": "[\"Aufgaben des Mitglieds\"]",
"MEMBER_NOT_FOUND_MSG_1": "Das gesuchte Mitglied existiert nicht in einem Team. Bitte versuchen Sie, mit einer anderen Abfrage zu suchen.",
"MEMBER_NOT_FOUND_MSG_2": "Wenn Sie nach einem Mitglied in einem anderen Team suchen, wählen Sie bitte das Team aus dem Dropdown-Menü oben aus.",
"GO_TO_HOME": "Zur Startseite"

},
"taskDetails": {
"BREADCRUMB": "[\"Aufgabendetails\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@
"CONFIRM_REJECT_INVITATION": "Are you sure you want to reject the invitation?"
},
"profile": {
"BREADCRUMB": "[\"Member Tasks\"]"
"BREADCRUMB": "[\"Member Tasks\"]",
"MEMBER_NOT_FOUND_MSG_1": "Member you are looking is not exist in a team please try to search with different query.",
"MEMBER_NOT_FOUND_MSG_2": "If you are looking for a member in a different team, please select the team from the dropdown above.",
"GO_TO_HOME": "Go to Home"
},
"kanban": {
"KANBAN_BOARD": "Kanban Board"
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "tablero kanban"
},
"profile": {
"BREADCRUMB": "[\"Tareas de miembro\"]"
"BREADCRUMB": "[\"Tareas de miembro\"]",
"MEMBER_NOT_FOUND_MSG_1": "El miembro que estás buscando no existe en un equipo, por favor intenta buscar con una consulta diferente.",
"MEMBER_NOT_FOUND_MSG_2": "Si estás buscando un miembro en un equipo diferente, por favor selecciona el equipo del menú desplegable de arriba.",
"GO_TO_HOME": "Ir a la página de inicio"
},
"taskDetails": {
"BREADCRUMB": "[\"Detalles de la tarea\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Tableau Kanban"
},
"profile": {
"BREADCRUMB": "[\"Tâches du membre\"]"
"BREADCRUMB": "[\"Tâches du membre\"]",
"MEMBER_NOT_FOUND_MSG_1": "Le membre que vous recherchez n'existe pas dans une équipe, veuillez essayer de rechercher avec une requête différente.",
"MEMBER_NOT_FOUND_MSG_2": "Si vous recherchez un membre dans une équipe différente, veuillez sélectionner l'équipe dans le menu déroulant ci-dessus.",
"GO_TO_HOME": "Aller à la page d'accueil"
},
"taskDetails": {
"BREADCRUMB": "[\"Détails de la tâche\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "לוח Kanban"
},
"profile": {
"BREADCRUMB": "[\"משימות חבר\"]"
"BREADCRUMB": "[\"משימות חבר\"]",
"MEMBER_NOT_FOUND_MSG_1": "החבר שאתה מחפש לא קיים בצוות, אנא נסה לחפש עם שאילתת חיפוש שונה.",
"MEMBER_NOT_FOUND_MSG_2": "אם אתה מחפש חבר בצוות שונה, אנא בחר את הצוות מהתפריט הנפתח למעלה.",
"GO_TO_HOME": "עבור לדף הבית"
},
"taskDetails": {
"BREADCRUMB": "[\"פרטי משימה\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Tabellone Kanban"
},
"profile": {
"BREADCRUMB": "[\"Compiti dei membri\"]"
"BREADCRUMB": "[\"Compiti dei membri\"]",
"MEMBER_NOT_FOUND_MSG_1": "Il membro che stai cercando non esiste in un team, prova a cercare con una query diversa.",
"MEMBER_NOT_FOUND_MSG_2": "Se stai cercando un membro in un team diverso, seleziona il team dal menu a discesa sopra.",
"GO_TO_HOME": "Vai alla Home"
},
"taskDetails": {
"BREADCRUMB": "[\"Dettagli attività\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Kanban-bord"
},
"profile": {
"BREADCRUMB": "[\"Taken teamlid\"]"
"BREADCRUMB": "[\"Taken teamlid\"]",
"MEMBER_NOT_FOUND_MSG_1": "Het lid dat u zoekt, bestaat niet in een team, probeer te zoeken met een andere query.",
"MEMBER_NOT_FOUND_MSG_2": "Als u op zoek bent naar een lid in een ander team, selecteert u het team uit de vervolgkeuzelijst hierboven.",
"GO_TO_HOME": "Ga naar de startpagina"
},
"taskDetails": {
"BREADCRUMB": "[\"Taakdetails\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Tablica Kanbana"
},
"profile": {
"BREADCRUMB": "[\"Member Tasks\"]"
"BREADCRUMB": "[\"Member Tasks\"]",
"MEMBER_NOT_FOUND_MSG_1": "Członek, którego szukasz, nie istnieje w zespole, spróbuj wyszukać z innym zapytaniem.",
"MEMBER_NOT_FOUND_MSG_2": "Jeśli szukasz członka w innym zespole, wybierz zespół z listy rozwijanej powyżej.",
"GO_TO_HOME": "Przejdź do strony głównej"
},
"taskDetails": {
"BREADCRUMB": "[\"Task Details\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Quadro Kanban"
},
"profile": {
"BREADCRUMB": "[\"Tarefas do Membro\"]"
"BREADCRUMB": "[\"Tarefas do Membro\"]",
"MEMBER_NOT_FOUND_MSG_1": "O membro que você está procurando não existe em uma equipe, tente pesquisar com uma consulta diferente.",
"MEMBER_NOT_FOUND_MSG_2": "Se você está procurando um membro em uma equipe diferente, selecione a equipe no menu suspenso acima.",
"GO_TO_HOME": "Ir para a página inicial"
},
"taskDetails": {
"BREADCRUMB": "[\"Detalhes da Tarefa\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "Канбан-доска"
},
"profile": {
"BREADCRUMB": "[\"Member Tasks\"]"
"BREADCRUMB": "[\"Member Tasks\"]",
"MEMBER_NOT_FOUND_MSG_1": "Участник, которого вы ищете, не существует в команде, попробуйте выполнить поиск с другим запросом.",
"MEMBER_NOT_FOUND_MSG_2": "Если вы ищете участника в другой команде, выберите команду из выпадающего списка выше.",
"GO_TO_HOME": "Перейти на главную страницу"
},
"taskDetails": {
"BREADCRUMB": "[\"Task Details\"]",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@
"KANBAN_BOARD": "看板"
},
"profile": {
"BREADCRUMB": "[\"成员任务\"]"
"BREADCRUMB": "[\"成员任务\"]",
"MEMBER_NOT_FOUND_MSG_1": "您正在寻找的成员在团队中不存在,请尝试使用不同的查询进行搜索。",
"MEMBER_NOT_FOUND_MSG_2": "如果您正在寻找不同团队中的成员,请从上面的下拉菜单中选择团队。",
"GO_TO_HOME": "返回主页"
},
"taskDetails": {
"BREADCRUMB": "[\"任务详情\"]",
Expand Down

0 comments on commit d8815b6

Please sign in to comment.