From 22efb9c60f082af96258a47cd31cbaa162462078 Mon Sep 17 00:00:00 2001 From: Reza Rahemtola Date: Sun, 5 Nov 2023 21:04:46 +0100 Subject: [PATCH] feat(web/activity): Basic page --- frontend/web/app/dashboard/activity/page.tsx | 65 +++++++++++++++++++ .../layouts/library/LibraryWorkflowTable.tsx | 2 +- frontend/web/locales/en-US.ts | 3 + frontend/web/locales/fr-FR.ts | 3 + frontend/web/locales/is-IS.ts | 3 + frontend/web/services/workflows/activity.ts | 15 +++++ frontend/web/services/workflows/index.ts | 2 + frontend/web/types/activity.ts | 16 +++++ 8 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 frontend/web/app/dashboard/activity/page.tsx create mode 100644 frontend/web/services/workflows/activity.ts create mode 100644 frontend/web/types/activity.ts diff --git a/frontend/web/app/dashboard/activity/page.tsx b/frontend/web/app/dashboard/activity/page.tsx new file mode 100644 index 00000000..be17afe6 --- /dev/null +++ b/frontend/web/app/dashboard/activity/page.tsx @@ -0,0 +1,65 @@ +"use client"; + +import { useTranslation } from "react-i18next"; + +import { useEffect, useState } from "react"; +import DashboardPageWrapper from "@/layouts/dashboard/DashboardPageWrapper"; +import { Activity } from "@/types/activity"; +import services from "@/services"; + +const ActivityPage = () => { + const { t } = useTranslation(); + const [page, setPage] = useState(0); + const [activities, setActivities] = useState([]); + + useEffect(() => { + (async () => { + const fetchedActivities = await services.workflows.getActivities(page); + setActivities(fetchedActivities.data ?? []); + })(); + }, [page]); + + return ( + + + + + + + + + + + {activities.map((activity) => ( + + + + + + ))} + +
TimeWorkflowActivity
{activity.createdAt}{activity.workflow.name}{activity.type}
+
+ + Page {page + 1} + +
+
+ ); +}; + +export default ActivityPage; diff --git a/frontend/web/layouts/library/LibraryWorkflowTable.tsx b/frontend/web/layouts/library/LibraryWorkflowTable.tsx index bb58c222..fbeaf045 100644 --- a/frontend/web/layouts/library/LibraryWorkflowTable.tsx +++ b/frontend/web/layouts/library/LibraryWorkflowTable.tsx @@ -112,7 +112,7 @@ const LibraryWorkflowTable = () => { -
+