From e521027c815556523731f6a9fa0d1addbbfbb387 Mon Sep 17 00:00:00 2001 From: cedric karungu Date: Sun, 28 Jan 2024 16:04:38 +0200 Subject: [PATCH 1/4] fix: font sizes --- .../task/activity/user-task-activity.tsx | 83 +++++++++++-------- apps/web/lib/features/task/task-activity.tsx | 21 +---- 2 files changed, 51 insertions(+), 53 deletions(-) diff --git a/apps/web/lib/features/task/activity/user-task-activity.tsx b/apps/web/lib/features/task/activity/user-task-activity.tsx index 97cf47f23..e3df9e1c3 100644 --- a/apps/web/lib/features/task/activity/user-task-activity.tsx +++ b/apps/web/lib/features/task/activity/user-task-activity.tsx @@ -1,44 +1,59 @@ +import React from 'react'; import { clsxm } from '@app/utils'; import { Tab } from '@headlessui/react'; import { ActivityFilters } from '@app/constants'; +import { ITaskTimesheet } from '@app/interfaces'; +import { ChevronDownIcon, ChevronUpIcon } from 'lib/components/svgs'; -export const UserTaskActivity = () => { - // get slots related to Task Id - // get apps visited related to Task Id - // get visited Sites related to Task Id +export const UserTaskActivity = ({ timesheet }: { timesheet: ITaskTimesheet }) => { + const [hidden, setHidden] = React.useState(false); return (
-
-

{'Cedric medium'}

- {'05:30'} +
+
+

{timesheet.employee?.fullName}

+ {timesheet.duration} +
+ +
+ +
+
+ - - - {Object.values(ActivityFilters) - .filter((filter) => filter !== 'Tasks') - .map((filter: string) => ( - - clsxm( - 'w-full rounded-lg py-2.5 text-sm font-medium leading-5', - ' focus:outline-none focus:ring-2', - selected - ? 'bg-white dark:bg-dark text-blue-700 shadow' - : ' hover:bg-white/[0.50]' - ) - } - > - {filter} - - ))} - - - {'Screenshoot Team Tab'} - {'Apps Tab'} - {'VisitedSites Tab'} - -
); }; diff --git a/apps/web/lib/features/task/task-activity.tsx b/apps/web/lib/features/task/task-activity.tsx index a325be303..ffffd49de 100644 --- a/apps/web/lib/features/task/task-activity.tsx +++ b/apps/web/lib/features/task/task-activity.tsx @@ -12,7 +12,6 @@ export function TaskActivity({ task }: { task: ITeamTask }) { const { getTaskTimesheets, taskTimesheets } = useTaskTimeSheets(task?.id); // order activity arr by Time const groupedData = groupByTime(taskTimesheets); - console.log(groupedData); React.useEffect(() => { getTaskTimesheets(); @@ -22,33 +21,17 @@ export function TaskActivity({ task }: { task: ITeamTask }) { className="w-full p-4 md:px-4 dark:bg-[#25272D] flex flex-col gap-6 border border-[#00000014] dark:border-[#26272C]" shadow="bigger" > - {/* TO DELETE: start */} -
-

{'05.01.2024'}

- - -
- {/* TO DELETE: end */} {groupedData.map((timesheet, i) => (
-

{timesheet.date}

+

{timesheet.date}

{timesheet.items.map((item) => ( - + ))}
))} - - {/* TO DELETE: start */} -
-

{'03.01.2024'}

- - - -
- {/* TO DELETE: end */} ); } From 242f67ca5e6d14cdc2d0aad7205fa838498477bf Mon Sep 17 00:00:00 2001 From: cedric karungu Date: Mon, 29 Jan 2024 02:47:41 +0200 Subject: [PATCH 2/4] feat: make collpsed Activity Sectioon --- .../task/activity/user-task-activity.tsx | 2 +- apps/web/lib/features/task/task-activity.tsx | 43 ++++++++++++++----- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/apps/web/lib/features/task/activity/user-task-activity.tsx b/apps/web/lib/features/task/activity/user-task-activity.tsx index e3df9e1c3..9bbee17b3 100644 --- a/apps/web/lib/features/task/activity/user-task-activity.tsx +++ b/apps/web/lib/features/task/activity/user-task-activity.tsx @@ -6,7 +6,7 @@ import { ITaskTimesheet } from '@app/interfaces'; import { ChevronDownIcon, ChevronUpIcon } from 'lib/components/svgs'; export const UserTaskActivity = ({ timesheet }: { timesheet: ITaskTimesheet }) => { - const [hidden, setHidden] = React.useState(false); + const [hidden, setHidden] = React.useState(true); return (
diff --git a/apps/web/lib/features/task/task-activity.tsx b/apps/web/lib/features/task/task-activity.tsx index ffffd49de..31be7b103 100644 --- a/apps/web/lib/features/task/task-activity.tsx +++ b/apps/web/lib/features/task/task-activity.tsx @@ -7,9 +7,13 @@ import { ITeamTask } from '@app/interfaces'; import { useTaskTimeSheets } from '@app/hooks/features/useTaskActivity'; import { groupByTime } from '@app/helpers/array-data'; +import { clsxm } from '@app/utils'; +import { ChevronDownIcon, ChevronUpIcon } from 'lib/components/svgs'; + export function TaskActivity({ task }: { task: ITeamTask }) { - // get users tasks const { getTaskTimesheets, taskTimesheets } = useTaskTimeSheets(task?.id); + const [hidden, setHidden] = React.useState(true); + // order activity arr by Time const groupedData = groupByTime(taskTimesheets); @@ -21,17 +25,34 @@ export function TaskActivity({ task }: { task: ITeamTask }) { className="w-full p-4 md:px-4 dark:bg-[#25272D] flex flex-col gap-6 border border-[#00000014] dark:border-[#26272C]" shadow="bigger" > - {groupedData.map((timesheet, i) => ( -
-

{timesheet.date}

- {timesheet.items.map((item) => ( - - ))} +
+
+

{'Timesheet'}

+
+ +
+
- ))} +
+ ); } From 308a265d417d5e97811bed0345a0305d2800da69 Mon Sep 17 00:00:00 2001 From: cedric karungu Date: Mon, 29 Jan 2024 12:41:14 +0200 Subject: [PATCH 3/4] fix: eslint dependacy error --- apps/web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/package.json b/apps/web/package.json index d1af861b1..68aac4517 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -110,7 +110,7 @@ "@types/react-dom": "18.0.6", "@types/react-google-recaptcha": "^2.1.5", "eslint": "^8.28.0", - "eslint-config-next": "^13.1.6", + "eslint-config-next": "^14.0.4", "typescript": "^4.9.4" }, "prettier": { From 59402b1db73134a14b038de6a7b01d5bc91f4ece Mon Sep 17 00:00:00 2001 From: cedric karungu Date: Mon, 29 Jan 2024 21:03:23 +0200 Subject: [PATCH 4/4] feat: display Activity source --- .../task/activity/user-task-activity.tsx | 44 ++++++++++++++++++- apps/web/lib/settings/JitsuRoot.tsx | 1 - 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/apps/web/lib/features/task/activity/user-task-activity.tsx b/apps/web/lib/features/task/activity/user-task-activity.tsx index 9bbee17b3..f572b9a01 100644 --- a/apps/web/lib/features/task/activity/user-task-activity.tsx +++ b/apps/web/lib/features/task/activity/user-task-activity.tsx @@ -4,9 +4,12 @@ import { Tab } from '@headlessui/react'; import { ActivityFilters } from '@app/constants'; import { ITaskTimesheet } from '@app/interfaces'; import { ChevronDownIcon, ChevronUpIcon } from 'lib/components/svgs'; +import { Tooltip } from 'lib/components'; +import ScreenshotItem from 'lib/features/activity/components/screenshot-item'; export const UserTaskActivity = ({ timesheet }: { timesheet: ITaskTimesheet }) => { const [hidden, setHidden] = React.useState(true); + // TODO: fetch Apps et Sites Visited return (
@@ -48,7 +51,46 @@ export const UserTaskActivity = ({ timesheet }: { timesheet: ITaskTimesheet }) = ))} - {'Screenshoot Team Tab'} + +
+ {timesheet.timeSlot?.screenshots?.map((screenshot, i) => ( +
+ + null} + /> + +
+
Source
+
+ + {timesheet.source} + + {screenshot.apps?.map((app, i) => ( + + {app} + + ))} +
+
+
+ ))} +
+
{'Apps Tab'} {'VisitedSites Tab'}
diff --git a/apps/web/lib/settings/JitsuRoot.tsx b/apps/web/lib/settings/JitsuRoot.tsx index de7f8e5c5..006c8b026 100644 --- a/apps/web/lib/settings/JitsuRoot.tsx +++ b/apps/web/lib/settings/JitsuRoot.tsx @@ -27,7 +27,6 @@ export function JitsuRoot({ pageProps, children }: MyAppProps) { const isJitsuEnvs: boolean = jitsuConf.host !== '' && jitsuConf.writeKey !== ''; console.log(`Jitsu Enabled: ${isJitsuEnvs}`); console.log(`Jitsu Configuration: ${JSON.stringify(jitsuConf)}`); - console.log(`Jitsu: ${pageProps}`); return (