diff --git a/app/[locale]/(protected)/contributor/task-ta/components/columns.tsx b/app/[locale]/(protected)/contributor/task-ta/components/columns.tsx index db69f3b4..4d88788c 100644 --- a/app/[locale]/(protected)/contributor/task-ta/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/task-ta/components/columns.tsx @@ -22,7 +22,9 @@ import withReactContent from "sweetalert2-react-content"; import Swal from "sweetalert2"; import { useTranslations } from "next-intl"; -const useTableColumns = (activeTab: "ta" | "daily" | "special" |"mabes-koor") => { +const useTableColumns = ( + activeTab: "ta" | "daily" | "special" | "mabes-koor", +) => { const t = useTranslations("Table"); const columns: ColumnDef[] = [ { @@ -190,7 +192,11 @@ const useTableColumns = (activeTab: "ta" | "daily" | "special" |"mabes-koor") => - {(roleId == 11 || roleId == 12 || roleId == 19 || roleId ==3) && ( + {/* {(roleId == 11 || roleId == 12 || roleId == 19) && ( */} + {(roleId == 11 || + roleId == 12 || + roleId == 19 || + roleId == 3) && ( @@ -198,14 +204,15 @@ const useTableColumns = (activeTab: "ta" | "daily" | "special" |"mabes-koor") => )} - {roleId == 11 || roleId ==3 && ( - - - - Edit - - - )} + {roleId == 11 || + (roleId == 3 && ( + + + + Edit + + + ))} {(roleId == 12 || roleId == 19) && ( )} - {roleId == 11 || roleId ==3 && ( - TaskDelete(row.original.id)} - className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none" - > - - Delete - - )} + {roleId == 11 || + (roleId == 3 && ( + TaskDelete(row.original.id)} + className="p-2 border-b text-destructive bg-destructive/30 focus:bg-destructive focus:text-destructive-foreground rounded-none" + > + + Delete + + ))} ); diff --git a/app/[locale]/(protected)/contributor/task-ta/components/task-ta-table.tsx b/app/[locale]/(protected)/contributor/task-ta/components/task-ta-table.tsx index 87f57ae8..d7b153a5 100644 --- a/app/[locale]/(protected)/contributor/task-ta/components/task-ta-table.tsx +++ b/app/[locale]/(protected)/contributor/task-ta/components/task-ta-table.tsx @@ -91,6 +91,7 @@ export default function TaskTaTable() { const [page, setPage] = React.useState(1); const [totalPage, setTotalPage] = React.useState(1); + // const KOOR_KURATOR_USER_ID = "464"; const KOOR_KURATOR_USER_IDS = ["464", "8258"]; // ✅ columns based on tab @@ -135,6 +136,7 @@ export default function TaskTaTable() { activeTab, ]); + // const isKoorKurator = String(userId) === KOOR_KURATOR_USER_ID; const isKoorKurator = KOOR_KURATOR_USER_IDS.includes(String(userId)); async function fetchData() { diff --git a/app/[locale]/(protected)/contributor/task/page.tsx b/app/[locale]/(protected)/contributor/task/page.tsx index dc065173..174e7409 100644 --- a/app/[locale]/(protected)/contributor/task/page.tsx +++ b/app/[locale]/(protected)/contributor/task/page.tsx @@ -5,7 +5,11 @@ import { Button } from "@/components/ui/button"; import { UploadIcon } from "lucide-react"; import SiteBreadcrumb from "@/components/site-breadcrumb"; import { Link } from "@/components/navigation"; -import { checkAuthorization, checkLoginSession } from "@/lib/utils"; +import { + checkAuthorization, + checkLoginSession, + getCookiesDecrypt, +} from "@/lib/utils"; import React, { useEffect } from "react"; import { useTranslations } from "next-intl"; @@ -13,12 +17,13 @@ const TaskPage = () => { const t = useTranslations("AnalyticsDashboard"); useEffect(() => { function initState() { - checkAuthorization("admin"); + checkAuthorization("admin"); checkLoginSession(); } initState(); }, []); + const levelNumber = getCookiesDecrypt("ulne"); return (
@@ -29,16 +34,28 @@ const TaskPage = () => {
- {t("tabel", { defaultValue: "Tabel" })} {t("task", { defaultValue: "Task" })} + {t("tabel", { defaultValue: "Tabel" })}{" "} + {t("task", { defaultValue: "Task" })}
-
+ {Number(levelNumber) !== 3 && ( +
+ + + +
+ )} + + {/*
-
+
*/}
diff --git a/app/[locale]/(protected)/dashboard/page.tsx b/app/[locale]/(protected)/dashboard/page.tsx index 29ac3426..878846bb 100644 --- a/app/[locale]/(protected)/dashboard/page.tsx +++ b/app/[locale]/(protected)/dashboard/page.tsx @@ -24,6 +24,7 @@ import ReportTable from "../contributor/report/components/report-table"; const DashboardPage = () => { const t = useTranslations("AnalyticsDashboard"); const roleId = getCookiesDecrypt("urie"); + const levelNumber = Number(getCookiesDecrypt("ulne")); return Number(roleId) == 2 || Number(roleId) == 11 || Number(roleId) == 12 ? (
@@ -54,18 +55,23 @@ const DashboardPage = () => { > {t("schedule", { defaultValue: "Schedule" })} - - {t("indeks", { defaultValue: "Indeks" })} - - - {t("report", { defaultValue: "Report" })} - + {levelNumber !== 3 && ( + <> + + {t("indeks", { defaultValue: "Indeks" })} + + + + {t("report", { defaultValue: "Report" })} + + + )} @@ -75,18 +81,24 @@ const DashboardPage = () => {
{ - {t("Total-Content-Production", { defaultValue: "Total Content Production" })} + {t("Total-Content-Production", { + defaultValue: "Total Content Production", + })} @@ -113,7 +127,9 @@ const DashboardPage = () => {
- {t("tabel", { defaultValue: "Tabel" })} + + {t("tabel", { defaultValue: "Tabel" })} + {/* */} @@ -132,14 +148,26 @@ const DashboardPage = () => {
Tabel Penugasan
-
+ {Number(levelNumber) !== 3 && ( +
+ + + +
+ )} + {/*
-
+
*/}
diff --git a/app/[locale]/(protected)/shared/contest/page.tsx b/app/[locale]/(protected)/shared/contest/page.tsx index fa009c36..6fe3ef26 100644 --- a/app/[locale]/(protected)/shared/contest/page.tsx +++ b/app/[locale]/(protected)/shared/contest/page.tsx @@ -13,6 +13,8 @@ import { useTranslations } from "next-intl"; const ContestPage = () => { const [userLevelId, setUserLevelId] = useState(null); const t = useTranslations("Contest"); + const levelNumber = Number(getCookiesDecrypt("ulne")); + useEffect(() => { setUserLevelId(Number(getCookiesDecrypt("ulie"))); }, []); @@ -25,18 +27,36 @@ const ContestPage = () => {
- {t("table", { defaultValue: "Table" })} {t("contest", { defaultValue: "Contest" })} + {t("table", { defaultValue: "Table" })}{" "} + {t("contest", { defaultValue: "Contest" })}
- {userLevelId !== 776 && userLevelId !== null && ( + {userLevelId !== 776 && + userLevelId !== null && + levelNumber !== 3 && ( +
+ + + +
+ )} + + {/* {userLevelId !== 776 && userLevelId !== null && (
- )} + )} */}
diff --git a/lib/menus.ts b/lib/menus.ts index 913d6529..73867d43 100644 --- a/lib/menus.ts +++ b/lib/menus.ts @@ -168,7 +168,7 @@ export function getMenuList(pathname: string, t: any): Group[] { icon: "heroicons:shopping-cart", children: [], }, - { + { href: "/contributor/task-ta", label: "penugasan TA", active: pathname.includes("/contributor/task-ta"), @@ -2429,7 +2429,10 @@ export function getMenuList(pathname: string, t: any): Group[] { }, ]; } - } else if (Number(roleId) == 4 && Number(levelNumber) == 3) { + } else if ( + Number(roleId) == 4 || + (Number(roleId) == 3 && Number(levelNumber) == 3) + ) { menusSelected = [ { groupLabel: t("apps"), @@ -2516,35 +2519,35 @@ export function getMenuList(pathname: string, t: any): Group[] { }, ], }, - { - groupLabel: "", - id: "planning", - menus: [ - { - id: "planning", - href: "/contributor/planning", - label: t("planning"), - active: pathname.includes("/planning"), - icon: "pajamas:planning", - submenus: [ - { - href: "/contributor/planning/mediahub", - label: "mediaHub", - active: pathname.includes("/planning/mediahub"), - icon: "heroicons:arrow-trending-up", - children: [], - }, - { - href: "/contributor/planning/medsos-mediahub", - label: "medsos mediahub", - active: pathname.includes("/planning/medsos-mediahub"), - icon: "heroicons:shopping-cart", - children: [], - }, - ], - }, - ], - }, + // { + // groupLabel: "", + // id: "planning", + // menus: [ + // { + // id: "planning", + // href: "/contributor/planning", + // label: t("planning"), + // active: pathname.includes("/planning"), + // icon: "pajamas:planning", + // submenus: [ + // { + // href: "/contributor/planning/mediahub", + // label: "mediaHub", + // active: pathname.includes("/planning/mediahub"), + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, + // { + // href: "/contributor/planning/medsos-mediahub", + // label: "medsos mediahub", + // active: pathname.includes("/planning/medsos-mediahub"), + // icon: "heroicons:shopping-cart", + // children: [], + // }, + // ], + // }, + // ], + // }, { groupLabel: "", id: "task", @@ -2571,44 +2574,51 @@ export function getMenuList(pathname: string, t: any): Group[] { icon: "uil:schedule", submenus: [ { - href: "/contributor/schedule/press-conference", - label: t("press-conference"), - active: pathname.includes("/schedule/press-conference"), + href: "/contributor/schedule/live-report", + label: t("live-report"), + active: pathname.includes("/schedule/live-report"), icon: "heroicons:arrow-trending-up", children: [], }, - { - href: "/contributor/schedule/event", - label: t("event"), - active: pathname.includes("/schedule/event"), - icon: "heroicons:shopping-cart", - children: [], - }, - { - href: "/contributor/schedule/press-release", - label: t("press-release"), - active: pathname.includes("/schedule/press-release"), - icon: "heroicons:shopping-cart", - children: [], - }, + // { + // href: "/contributor/schedule/press-conference", + // label: t("press-conference"), + // active: pathname.includes("/schedule/press-conference"), + // icon: "heroicons:arrow-trending-up", + // children: [], + // }, + // { + // href: "/contributor/schedule/event", + // label: t("event"), + // active: pathname.includes("/schedule/event"), + // icon: "heroicons:shopping-cart", + // children: [], + // }, + // { + // href: "/contributor/schedule/press-release", + // label: t("press-release"), + // active: pathname.includes("/schedule/press-release"), + // icon: "heroicons:shopping-cart", + // children: [], + // }, ], }, ], }, - { - groupLabel: "", - id: "blog", - menus: [ - { - id: "blog", - href: "/contributor/blog", - label: t("blog"), - active: pathname.includes("/blog"), - icon: "fluent:clipboard-text-32-regular", - submenus: [], - }, - ], - }, + // { + // groupLabel: "", + // id: "blog", + // menus: [ + // { + // id: "blog", + // href: "/contributor/blog", + // label: t("blog"), + // active: pathname.includes("/blog"), + // icon: "fluent:clipboard-text-32-regular", + // submenus: [], + // }, + // ], + // }, { groupLabel: "", id: "curatedcontent", @@ -5222,7 +5232,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-area", label: t("areaCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-area" + "/charts/appex-charts/charts-appex-area", ), children: [], }, @@ -5230,7 +5240,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-bar", label: t("barCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-bar" + "/charts/appex-charts/charts-appex-bar", ), children: [], }, @@ -5238,7 +5248,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-boxplot", label: t("boxplotCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-boxplot" + "/charts/appex-charts/charts-appex-boxplot", ), children: [], }, @@ -5246,7 +5256,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-bubble", label: t("bubbleCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-bubble" + "/charts/appex-charts/charts-appex-bubble", ), children: [], }, @@ -5254,7 +5264,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-candlestick", label: t("candlestickCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-candlestick" + "/charts/appex-charts/charts-appex-candlestick", ), children: [], }, @@ -5262,7 +5272,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-column", label: t("columnCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-column" + "/charts/appex-charts/charts-appex-column", ), children: [], }, @@ -5270,7 +5280,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-combo", label: t("comboCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-combo" + "/charts/appex-charts/charts-appex-combo", ), children: [], }, @@ -5279,7 +5289,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-funnel", label: t("funnelCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-funnel" + "/charts/appex-charts/charts-appex-funnel", ), children: [], }, @@ -5287,7 +5297,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-heatmap", label: t("heatmapCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-heatmap" + "/charts/appex-charts/charts-appex-heatmap", ), children: [], }, @@ -5295,7 +5305,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-line", label: t("lineCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-line" + "/charts/appex-charts/charts-appex-line", ), children: [], }, @@ -5303,7 +5313,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-pie", label: t("pieCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-pie" + "/charts/appex-charts/charts-appex-pie", ), children: [], }, @@ -5311,7 +5321,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-polararea", label: t("ploarareaCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-polararea" + "/charts/appex-charts/charts-appex-polararea", ), children: [], }, @@ -5319,7 +5329,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-radar", label: t("radarCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-radar" + "/charts/appex-charts/charts-appex-radar", ), children: [], }, @@ -5327,7 +5337,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-radialbars", label: t("radialbarCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-radialbars" + "/charts/appex-charts/charts-appex-radialbars", ), children: [], }, @@ -5335,7 +5345,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-range", label: t("rangeCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-range" + "/charts/appex-charts/charts-appex-range", ), children: [], }, @@ -5343,7 +5353,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-scatter", label: t("scatterCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-scatter" + "/charts/appex-charts/charts-appex-scatter", ), children: [], }, @@ -5351,7 +5361,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-timeline", label: t("timelineCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-timeline" + "/charts/appex-charts/charts-appex-timeline", ), children: [], }, @@ -5359,7 +5369,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/appex-charts/charts-appex-treemap", label: t("treemapCharts"), active: pathname.includes( - "/charts/appex-charts/charts-appex-treemap" + "/charts/appex-charts/charts-appex-treemap", ), children: [], }, @@ -5375,7 +5385,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-area", label: t("areaCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-area" + "/charts/rechart/charts-rechart-area", ), children: [], }, @@ -5383,7 +5393,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-bar", label: t("barCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-bar" + "/charts/rechart/charts-rechart-bar", ), children: [], }, @@ -5391,7 +5401,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-composed", label: t("composedCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-composed" + "/charts/rechart/charts-rechart-composed", ), children: [], }, @@ -5399,7 +5409,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-line", label: t("lineCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-line" + "/charts/rechart/charts-rechart-line", ), children: [], }, @@ -5407,7 +5417,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-pie", label: t("pieCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-pie" + "/charts/rechart/charts-rechart-pie", ), children: [], }, @@ -5415,7 +5425,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-radar", label: t("radarCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-radar" + "/charts/rechart/charts-rechart-radar", ), children: [], }, @@ -5423,7 +5433,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-radialbar", label: t("radialbarCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-radialbar" + "/charts/rechart/charts-rechart-radialbar", ), children: [], }, @@ -5431,7 +5441,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-scatter", label: t("scatterCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-scatter" + "/charts/rechart/charts-rechart-scatter", ), children: [], }, @@ -5439,7 +5449,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/rechart/charts-rechart-treemap", label: t("treemapCharts"), active: pathname.includes( - "/charts/rechart/charts-rechart-treemap" + "/charts/rechart/charts-rechart-treemap", ), children: [], }, @@ -5455,7 +5465,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-area", label: t("areaCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-area" + "/charts/chart-js/charts-chartjs-area", ), children: [], }, @@ -5463,7 +5473,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-bar", label: t("barCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-bar" + "/charts/chart-js/charts-chartjs-bar", ), children: [], }, @@ -5471,7 +5481,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-line", label: t("lineCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-line" + "/charts/chart-js/charts-chartjs-line", ), children: [], }, @@ -5479,7 +5489,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-animations", label: t("animationCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-animations" + "/charts/chart-js/charts-chartjs-animations", ), children: [], }, @@ -5487,7 +5497,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-legend", label: t("legendCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-legend" + "/charts/chart-js/charts-chartjs-legend", ), children: [], }, @@ -5495,7 +5505,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-scaleoptions", label: t("scaleOptionCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-scaleoptions" + "/charts/chart-js/charts-chartjs-scaleoptions", ), children: [], }, @@ -5503,7 +5513,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-scales", label: t("scaleCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-scales" + "/charts/chart-js/charts-chartjs-scales", ), children: [], }, @@ -5511,7 +5521,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-scriptable", label: t("scriptableCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-scriptable" + "/charts/chart-js/charts-chartjs-scriptable", ), children: [], }, @@ -5519,7 +5529,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-title", label: t("titleCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-title" + "/charts/chart-js/charts-chartjs-title", ), children: [], }, @@ -5527,7 +5537,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-tooltip", label: t("tooltipChart"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-tooltip" + "/charts/chart-js/charts-chartjs-tooltip", ), children: [], }, @@ -5535,7 +5545,7 @@ export function getHorizontalMenuList(pathname: string, t: any): Group[] { href: "/charts/chart-js/charts-chartjs-other", label: t("otherCharts"), active: pathname.includes( - "/charts/chart-js/charts-chartjs-other" + "/charts/chart-js/charts-chartjs-other", ), children: [], },