diff --git a/src/app/(main)/home/page.tsx b/src/app/(main)/home/page.tsx
index 5f3d40b..fe49aa6 100644
--- a/src/app/(main)/home/page.tsx
+++ b/src/app/(main)/home/page.tsx
@@ -1,18 +1,28 @@
import { Metadata } from "next";
import { I18nProvider } from "@/i18n";
-import DashboardPage from "@/components/DashboardPage/DashboardPage";
import DashboardPageButton from "@/components/DashboardPage/DashboardTabButton";
import ProgressByClientSearch from "@/components/ProgressByClientSearch";
import { Suspense } from "react";
import Tabs, { TabsProps } from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
+import { getServerI18n } from "@/i18n";
+import DashboardPage from "@/components/DashboardPage";
export const metadata: Metadata = {
title: "Dashboard",
};
-const Dashboard: React.FC = () => {
- return
test
;
+// type Props = {
+// test: string
+// }
+const Dashboard: React.FC = async () => {
+ const { t } = await getServerI18n("dashboard");
+
+ return (
+
+
+
+ )
};
export default Dashboard;
diff --git a/src/app/(main)/masterData/user/page.tsx b/src/app/(main)/settings/user/page.tsx
similarity index 100%
rename from src/app/(main)/masterData/user/page.tsx
rename to src/app/(main)/settings/user/page.tsx
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 54a5fa9..6c2083e 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -4,7 +4,7 @@ import ThemeRegistry from "@/theme/ThemeRegistry";
export const metadata: Metadata = {
title: "FPSMS",
- description: "FPSMS - Timesheet Management System",
+ description: "FPSMS - xxxx Management System",
};
export default async function RootLayout({
diff --git a/src/components/DashboardPage/DashboardPage.tsx b/src/components/DashboardPage/DashboardPage.tsx
index d3d70c7..a6c23ca 100644
--- a/src/components/DashboardPage/DashboardPage.tsx
+++ b/src/components/DashboardPage/DashboardPage.tsx
@@ -14,11 +14,19 @@ import { useRouter } from "next/navigation";
import ProgressByClient from "./ProgressByClient";
import ProgressByClientSearch from "@/components/ProgressByClientSearch";
import { Suspense } from "react";
+import { getSession } from "next-auth/react";
-const DashboardPage: React.FC = () => {
+type Props = {
+ abilities: string[]
+}
+const DashboardPage: React.FC = ({
+ abilities
+}) => {
const [tabIndex, setTabIndex] = useState(0);
const { t } = useTranslation("dashboard");
const router = useRouter();
+ window.localStorage.setItem("abilities", JSON.stringify(abilities))
+
const handleCancel = () => {
router.back();
};
@@ -32,10 +40,10 @@ const DashboardPage: React.FC = () => {
-
+ {/*
-
+ */}
{tabIndex === 2 && }
{/*
diff --git a/src/components/DashboardPage/DashboardWrapper.tsx b/src/components/DashboardPage/DashboardWrapper.tsx
new file mode 100644
index 0000000..cbe82fb
--- /dev/null
+++ b/src/components/DashboardPage/DashboardWrapper.tsx
@@ -0,0 +1,18 @@
+import { authOptions } from "@/config/authConfig"
+import { getServerSession, Session } from "next-auth"
+import DashboardPage from "./DashboardPage"
+
+export type SessionWithAbilities = {
+ abilities: string[]
+} & Session | null
+
+const DashboardWrapper: React.FC = async () => {
+ const session: SessionWithAbilities = await getServerSession(authOptions)
+
+ return (
+
+ )
+}
+export default DashboardWrapper
\ No newline at end of file
diff --git a/src/components/DashboardPage/index.ts b/src/components/DashboardPage/index.ts
index 4b5c5d1..0e3f339 100644
--- a/src/components/DashboardPage/index.ts
+++ b/src/components/DashboardPage/index.ts
@@ -1 +1 @@
-export { default } from "./DashboardPage";
+export { default } from "./DashboardWrapper";
diff --git a/src/components/NavigationContent/NavigationContent.tsx b/src/components/NavigationContent/NavigationContent.tsx
index 8818c05..c26e034 100644
--- a/src/components/NavigationContent/NavigationContent.tsx
+++ b/src/components/NavigationContent/NavigationContent.tsx
@@ -36,7 +36,7 @@ const navigationItems: NavigationItem[] = [
icon: ,
label: "Dashboard",
path: "",
- children: [
+ // children: [
// {
// icon: ,
// label: "Project Financial Summary",
@@ -62,7 +62,7 @@ const navigationItems: NavigationItem[] = [
// label: "Staff Utilization",
// path: "/dashboard/StaffUtilization",
// },
- ],
+ // ],
},
{
icon: ,
@@ -193,73 +193,73 @@ const navigationItems: NavigationItem[] = [
},
{
icon: ,
- label: "Master Data",
+ label: "Settings",
path: "",
children: [
{
icon: ,
label: "User",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "User Group",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Material",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Maintain By-product",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Finished Goods",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Equipment Type",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Equipment",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Warehouse",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Supplier",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "Customer",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "QC Check Item",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "QC Category",
- path: "/masterData/user",
+ path: "/settings/user",
},
{
icon: ,
label: "QC Check Template",
- path: "/masterData/user",
+ path: "/settings/user",
},
],
},
diff --git a/src/config/authConfig.ts b/src/config/authConfig.ts
index e0c2860..125f569 100644
--- a/src/config/authConfig.ts
+++ b/src/config/authConfig.ts
@@ -5,6 +5,7 @@ import { LOGIN_API_PATH } from "./api";
export interface SessionWithTokens extends Session {
accessToken?: string;
refreshToken?: string;
+ abilities: string[]
}
export const authOptions: AuthOptions = {
@@ -50,6 +51,7 @@ export const authOptions: AuthOptions = {
// Add the data from the token to the session
accessToken: token.accessToken as string | undefined,
refreshToken: token.refreshToken as string | undefined,
+ abilities: token.abilities as string[]
};
return sessionWithToken;