From 236526e01c1fd5a58bac4df74be6d8d766e80d48 Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Wed, 17 Jun 2026 11:24:55 +0200 Subject: [PATCH 1/2] removes agent redirect for now --- src/app/[lang]/dashboard/agents/[id]/page.tsx | 11 ----------- .../Dashboard/Agents/AgentReadOnlyTableRow.tsx | 11 ++++++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/app/[lang]/dashboard/agents/[id]/page.tsx b/src/app/[lang]/dashboard/agents/[id]/page.tsx index ee1a7cf0..0cda7012 100644 --- a/src/app/[lang]/dashboard/agents/[id]/page.tsx +++ b/src/app/[lang]/dashboard/agents/[id]/page.tsx @@ -1,19 +1,8 @@ import ProfileLayout from "@/components/Dashboard/Profile/ProfileLayout"; -import { getServerUserRole } from "@/hooks/api/getUserRole"; import { RouteParams } from "@/types"; -import { UserRole } from "need4deed-sdk"; -import { cookies } from "next/headers"; -import { redirect } from "next/navigation"; export default async function DashboardAgentPage({ params }: RouteParams) { const { id } = await params; - const cookieStore = await cookies(); - const cookieHeader = cookieStore.toString(); - const userRole = await getServerUserRole(cookieHeader); - - if (!userRole || (userRole !== UserRole.COORDINATOR && userRole !== UserRole.ADMIN)) { - redirect(`/dashboard/agents`); - } return ; } diff --git a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx index 9f3b7113..b873f77f 100644 --- a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx +++ b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx @@ -1,5 +1,7 @@ import { ApiAgentGetList, OptionItem } from "need4deed-sdk"; import { ClickableRow, TableCell } from "@/components/core/common/Table"; +import { useTranslation } from "react-i18next"; +import { useRouter } from "next/navigation"; interface Props { agent: ApiAgentGetList; @@ -10,10 +12,17 @@ interface Props { } export function AgentReadOnlyTableRow({ agent, isLast, districtsList }: Props) { + const { i18n } = useTranslation(); + const router = useRouter(); const { id, title, type, district } = agent; const districtTitle = district?.id ? (districtsList?.find((d) => d.id === district.id)?.title ?? null) : null; + + const handleGoToProfile = () => { + if (!id) return; + router.push(`/${i18n.language}/dashboard/agents/${id}`); + }; return ( - + {title} {type} {districtTitle || "—"} From 5b542488a6dc72619a3c0d5ae664f40fd828439c Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Wed, 17 Jun 2026 11:50:47 +0200 Subject: [PATCH 2/2] removes click handler --- .../Dashboard/Agents/AgentReadOnlyTableRow.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx index b873f77f..faedaeae 100644 --- a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx +++ b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx @@ -1,7 +1,5 @@ import { ApiAgentGetList, OptionItem } from "need4deed-sdk"; import { ClickableRow, TableCell } from "@/components/core/common/Table"; -import { useTranslation } from "react-i18next"; -import { useRouter } from "next/navigation"; interface Props { agent: ApiAgentGetList; @@ -12,17 +10,11 @@ interface Props { } export function AgentReadOnlyTableRow({ agent, isLast, districtsList }: Props) { - const { i18n } = useTranslation(); - const router = useRouter(); const { id, title, type, district } = agent; const districtTitle = district?.id ? (districtsList?.find((d) => d.id === district.id)?.title ?? null) : null; - const handleGoToProfile = () => { - if (!id) return; - router.push(`/${i18n.language}/dashboard/agents/${id}`); - }; return ( - + {title} {type} {districtTitle || "—"}