From d4c8f9bbbc913f38ef5c9d95fa15a136acc234eb Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 3 Feb 2026 12:00:46 +0700 Subject: [PATCH 1/5] feat: create not-found page in app --- src/app/not-found.tsx | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/app/not-found.tsx diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx new file mode 100644 index 00000000..b2b82a77 --- /dev/null +++ b/src/app/not-found.tsx @@ -0,0 +1,5 @@ +import PageNotFound from '@/components/helper/NotFoundPage'; + +export default function NotFound() { + return ; +} From 4fef966428f979dc5ec320b2097467ee08e95ccb Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 3 Feb 2026 12:02:43 +0700 Subject: [PATCH 2/5] chore: remove unnecessary code --- src/app/production/project-flock/detail/page.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/production/project-flock/detail/page.tsx b/src/app/production/project-flock/detail/page.tsx index 29a078dd..6187898e 100644 --- a/src/app/production/project-flock/detail/page.tsx +++ b/src/app/production/project-flock/detail/page.tsx @@ -50,5 +50,3 @@ const ProjectFlockDetailPage = () => { }; export default ProjectFlockDetailPage; -ProjectFlockDetail; -ProjectFlockDetail; From 2d13564538a8ba7100b4275703f377eee6cc7f8d Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 3 Feb 2026 12:03:24 +0700 Subject: [PATCH 3/5] chore: bypass 404 page --- src/components/MainDrawer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/MainDrawer.tsx b/src/components/MainDrawer.tsx index fdb65c38..71da0789 100644 --- a/src/components/MainDrawer.tsx +++ b/src/components/MainDrawer.tsx @@ -74,6 +74,8 @@ const MainDrawer = ({ const formattedPathname = pathname.endsWith('/') ? pathname : `${pathname}/`; + const isPathnameNotFoundPage = formattedPathname === '/404/'; + const isPermitted = ROUTE_PERMISSIONS[formattedPathname]?.some((permission) => permissionCheck(permission) ); @@ -82,10 +84,14 @@ const MainDrawer = ({ setMainDrawerOpen(!mainDrawerOpen); }; - if (!isPermitted) { + if (!isPermitted && !isPathnameNotFoundPage) { return ; } + if (isPathnameNotFoundPage) { + return children; + } + return ( Date: Tue, 3 Feb 2026 12:03:47 +0700 Subject: [PATCH 4/5] feat: create NotFoundPage component --- src/components/helper/NotFoundPage.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/components/helper/NotFoundPage.tsx diff --git a/src/components/helper/NotFoundPage.tsx b/src/components/helper/NotFoundPage.tsx new file mode 100644 index 00000000..fdff493a --- /dev/null +++ b/src/components/helper/NotFoundPage.tsx @@ -0,0 +1,17 @@ +import Button from '@/components/Button'; + +const PageNotFound = () => { + return ( +
+

Halaman Tidak Ditemukan

+

+ Halaman atau data yang anda cari tidak ditemukan. +

+ +
+ ); +}; + +export default PageNotFound; From 7f4eb2ad3594f4e7567523569cb506e4658b25c2 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 3 Feb 2026 12:04:28 +0700 Subject: [PATCH 5/5] chore: remove unnecessary code --- .../pages/report/DailyMarketingsTable.tsx | 2 -- .../daily-checklist/DailyChecklistContent.tsx | 21 +------------------ .../detail/DetailDailyChecklistContent.tsx | 8 +++---- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/components/pages/report/DailyMarketingsTable.tsx b/src/components/pages/report/DailyMarketingsTable.tsx index 2ed5a9cb..4904ef16 100644 --- a/src/components/pages/report/DailyMarketingsTable.tsx +++ b/src/components/pages/report/DailyMarketingsTable.tsx @@ -190,8 +190,6 @@ const DailyMarketingsTable = ({ ]; useEffect(() => { - // console.log({ sorting }); - if (sorting.length === 1) { onFilterByChange(sorting[0].id); onSortByChange(sorting[0].desc ? 'desc' : 'asc'); diff --git a/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx b/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx index 266b8740..8cef1da7 100644 --- a/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx +++ b/src/figma-make/components/pages/daily-checklist/DailyChecklistContent.tsx @@ -658,16 +658,6 @@ export function DailyChecklistContent() { ) => { const taskId = taskIdsByPhaseActivityId[activityId]; - // console.log('[CHECKBOX] Click detected:', { - // activityId, - // employeeId, - // checked, - // taskId, - // hasTaskId: !!taskId, - // checklistStatus, - // isChecklistStatusDraft, - // }); - if (!taskId) { console.error('[CHECKBOX] No taskId found for activityId:', activityId); console.error('[CHECKBOX] Available taskIds:', taskIdsByPhaseActivityId); @@ -695,10 +685,7 @@ export function DailyChecklistContent() { }, }, }; - // console.log( - // '[CHECKBOX] State updated optimistically:', - // updated[taskId]?.[employeeId] - // ); + return updated; }); @@ -710,8 +697,6 @@ export function DailyChecklistContent() { note: assignments[taskId]?.[employeeId]?.note || null, }; - // console.log('[CHECKBOX] Saving to database:', payload); - const checkOrUncheckAssignmentRes = await DailyChecklistApi.checkOrUncheckAssignment(payload); @@ -735,8 +720,6 @@ export function DailyChecklistContent() { })); return; } - - // console.log('[CHECKBOX] Saved successfully'); }; const handleNoteChange = async ( @@ -1247,8 +1230,6 @@ export function DailyChecklistContent() { }) ); - console.log(activities); - activities.forEach((activity, index) => { const taskId = taskIdsByPhaseActivityId[activity.id]; diff --git a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx index bc9653d4..846a2670 100644 --- a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx +++ b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx @@ -17,7 +17,7 @@ import { DialogFooter, } from '@/figma-make/components/base/dialog'; import { toast } from 'sonner'; -import { useRouter, useSearchParams } from 'next/navigation'; +import { notFound, useRouter, useSearchParams } from 'next/navigation'; import { DailyChecklistApi } from '@/services/api/daily-checklist/daily-checklist'; import { isResponseError } from '@/lib/api-helper'; import Link from 'next/link'; @@ -140,6 +140,8 @@ export function DetailDailyChecklistContent() { useEffect(() => { if (checklistId) { fetchChecklistDetail(); + } else { + router.push('/404'); } }, [checklistId]); @@ -802,10 +804,6 @@ export function DetailDailyChecklistContent() { ? 'pl-12' : 'pl-8'; - console.log({ - activity, - }); - rows.push(