feat: update category in landing, update menu admin polda
This commit is contained in:
parent
31e3b6f218
commit
9ea4d15611
|
|
@ -494,7 +494,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => {
|
|||
<Card className="col-span-12 lg:col-span-4 2xl:col-span-3 pb-5">
|
||||
<CardContent className="p-0">
|
||||
<CardHeader className="border-none mb-2 pt-5">
|
||||
{roleId == 10 || roleId == 11 ?
|
||||
{roleId == 11 || roleId == 12 ?
|
||||
<Button
|
||||
onClick={handleDateClick}
|
||||
className="dark:bg-background dark:text-foreground"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const page = () => {
|
|||
<WelcomePolda />
|
||||
<NewContent group="polda" type="latest" />
|
||||
<NewContent group="polda" type="popular" />
|
||||
<ContentCategory />
|
||||
<ContentCategory group="polda" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const page = () => {
|
|||
<WelcomeSatker />
|
||||
<NewContent group="satker" type="latest" />
|
||||
<NewContent group="satker" type="popular" />
|
||||
<ContentCategory />
|
||||
<ContentCategory group="satker" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const Home = ({ params: { locale } }: { params: { locale: string } }) => {
|
|||
<NewContent group="mabes" type="latest" />
|
||||
<NewContent group="mabes" type="popular" />
|
||||
{/* <PopularContent /> */}
|
||||
<ContentCategory />
|
||||
<ContentCategory group="mabes" />
|
||||
<Coverage />
|
||||
<Division />
|
||||
<Footer />
|
||||
|
|
|
|||
|
|
@ -1156,48 +1156,68 @@ export default function FormTaskDetail() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-row justify-end gap-3 my-3">
|
||||
<div className="">
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"outline"}
|
||||
onClick={handleToggleInput}
|
||||
>
|
||||
Beri Tanggapan
|
||||
</Button>
|
||||
</div>
|
||||
<div className="">
|
||||
<Button
|
||||
className="btn btn-primary ml-3 mr-3"
|
||||
style={
|
||||
statusAcceptance || detail?.createdBy?.id == Number(userId)
|
||||
? {
|
||||
display: "none",
|
||||
}
|
||||
: {}
|
||||
}
|
||||
onClick={() => handleAcceptAcceptance()}
|
||||
>
|
||||
Terima Tugas
|
||||
</Button>
|
||||
</div>
|
||||
<div
|
||||
className="task-response w-100 px-3 "
|
||||
style={
|
||||
isSentResult || detail?.createdBy?.id == Number(userId)
|
||||
? {}
|
||||
: {
|
||||
display: "none",
|
||||
}
|
||||
<div className="flex flex-row justify-between gap-3 my-3">
|
||||
<div className="px-1">
|
||||
{detail?.isDone !== true &&
|
||||
(Number(userLevelNumber) !== 3 ||
|
||||
Number(userLevelNumber) == 2) ? (
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"outline"}
|
||||
type="button"
|
||||
className="btn btn-outline-primary ml-3"
|
||||
onClick={() => handleForward()}
|
||||
>
|
||||
Forward
|
||||
</Button>
|
||||
) : (
|
||||
""
|
||||
)
|
||||
}
|
||||
>
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"default"}
|
||||
onClick={() => setIsTableResult(!isTableResult)}
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<div className="">
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"outline"}
|
||||
onClick={handleToggleInput}
|
||||
>
|
||||
Beri Tanggapan
|
||||
</Button>
|
||||
</div>
|
||||
<div className="">
|
||||
<Button
|
||||
className="btn btn-primary ml-3 mr-3"
|
||||
style={
|
||||
statusAcceptance || detail?.createdBy?.id !== Number(userId)
|
||||
? {
|
||||
display: "none",
|
||||
}
|
||||
: {}
|
||||
}
|
||||
onClick={() => handleAcceptAcceptance()}
|
||||
>
|
||||
Terima Tugas
|
||||
</Button>
|
||||
</div>
|
||||
<div
|
||||
className="task-response w-100 px-3 "
|
||||
// style={
|
||||
// Number(detail?.createdBy?.id) == Number(userId)
|
||||
// ? {}
|
||||
// : {
|
||||
// display: "none",
|
||||
// }
|
||||
// }
|
||||
>
|
||||
Hasil Upload
|
||||
</Button>
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"default"}
|
||||
onClick={() => setIsTableResult(!isTableResult)}
|
||||
>
|
||||
Hasil Upload {Number(userId)}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{isTableResult && (
|
||||
|
|
@ -1223,184 +1243,186 @@ export default function FormTaskDetail() {
|
|||
</table>
|
||||
)}
|
||||
{showInput && (
|
||||
<div className="mt-4 border p-4 rounded bg-gray-50">
|
||||
<Textarea
|
||||
placeholder="Tulis tanggapan Anda di sini..."
|
||||
value={message}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
<div className="flex justify-end mt-3">
|
||||
<Button
|
||||
color="primary"
|
||||
onClick={() => postData()}
|
||||
type="button"
|
||||
>
|
||||
Kirim Tanggapan
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="mt-6">
|
||||
<h3 className="text-lg font-bold text-center">Tanggapan</h3>
|
||||
{listData?.map((item: any) => (
|
||||
<div key={item.id} className="flex flex-col gap-3 mt-2 ">
|
||||
<div className="flex flex-row gap-3">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${item.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{item.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(item.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">{item.message}</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-blue-500 cursor-pointer"
|
||||
onClick={() => handleReply(item.id)}
|
||||
>
|
||||
<DotSquare className="w-4 h-4" />
|
||||
<span className="ml-1">Balas</span>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(item.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<>
|
||||
<div className="mt-4 border p-4 rounded bg-gray-50">
|
||||
<Textarea
|
||||
placeholder="Tulis tanggapan Anda di sini..."
|
||||
value={message}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
<div className="flex justify-end mt-3">
|
||||
<Button
|
||||
color="primary"
|
||||
onClick={() => postData()}
|
||||
type="button"
|
||||
>
|
||||
Kirim Tanggapan
|
||||
</Button>
|
||||
</div>
|
||||
{replyingTo === item.id && (
|
||||
<div className="ml-10 mt-2">
|
||||
<textarea
|
||||
id={`input-comment-${item.id}`}
|
||||
className="w-full p-2 border rounded"
|
||||
placeholder="Masukkan tanggapan anda"
|
||||
/>
|
||||
<button
|
||||
className="mt-2 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
onClick={() => sendReplyData(item.id)}
|
||||
>
|
||||
Kirim
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{item.children?.length > 0 && (
|
||||
<div className="ml-10 mt-2 flex flex-col">
|
||||
{item.children.map((child: any) => (
|
||||
<div
|
||||
key={child.id}
|
||||
className="flex flex-col gap-3 mt-2"
|
||||
>
|
||||
<div className="flex flex-row gap-3">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${child.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{child.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(child.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">
|
||||
{child.message}
|
||||
</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-blue-500 cursor-pointer"
|
||||
onClick={() => handleReply(child.id)}
|
||||
>
|
||||
<DotSquare className="w-4 h-4" />
|
||||
<span className="ml-1">Balas</span>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(child.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6">
|
||||
<h3 className="text-lg font-bold text-center">Tanggapan</h3>
|
||||
{listData?.map((item: any) => (
|
||||
<div key={item.id} className="flex flex-col gap-3 mt-2 ">
|
||||
<div className="flex flex-row gap-3">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${item.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{item.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(item.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">{item.message}</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-blue-500 cursor-pointer"
|
||||
onClick={() => handleReply(item.id)}
|
||||
>
|
||||
<DotSquare className="w-4 h-4" />
|
||||
<span className="ml-1">Balas</span>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(item.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
{replyingTo === child.id && (
|
||||
<div className="ml-10 mt-2">
|
||||
<textarea
|
||||
id={`input-comment-${child.id}`}
|
||||
className="w-full p-2 border rounded"
|
||||
placeholder="Masukkan tanggapan anda"
|
||||
/>
|
||||
<button
|
||||
className="mt-2 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
onClick={() => sendReplyData(child.id)}
|
||||
>
|
||||
Kirim
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{child.children?.length > 0 && (
|
||||
<div className="ml-10 mt-2 flex flex-col mb-3">
|
||||
{child.children.map((child2: any) => (
|
||||
<div
|
||||
key={child2.id}
|
||||
className="flex flex-col gap-3 mt-2"
|
||||
>
|
||||
<div className="flex flex-row gap-3 ">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${child2.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{child2.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(child2.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">
|
||||
{child2.message}
|
||||
</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(child2.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{replyingTo === item.id && (
|
||||
<div className="ml-10 mt-2">
|
||||
<textarea
|
||||
id={`input-comment-${item.id}`}
|
||||
className="w-full p-2 border rounded"
|
||||
placeholder="Masukkan tanggapan anda"
|
||||
/>
|
||||
<button
|
||||
className="mt-2 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
onClick={() => sendReplyData(item.id)}
|
||||
>
|
||||
Kirim
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{item.children?.length > 0 && (
|
||||
<div className="ml-10 mt-2 flex flex-col">
|
||||
{item.children.map((child: any) => (
|
||||
<div
|
||||
key={child.id}
|
||||
className="flex flex-col gap-3 mt-2"
|
||||
>
|
||||
<div className="flex flex-row gap-3">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${child.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{child.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(child.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">
|
||||
{child.message}
|
||||
</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-blue-500 cursor-pointer"
|
||||
onClick={() => handleReply(child.id)}
|
||||
>
|
||||
<DotSquare className="w-4 h-4" />
|
||||
<span className="ml-1">Balas</span>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(child.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
{replyingTo === child.id && (
|
||||
<div className="ml-10 mt-2">
|
||||
<textarea
|
||||
id={`input-comment-${child.id}`}
|
||||
className="w-full p-2 border rounded"
|
||||
placeholder="Masukkan tanggapan anda"
|
||||
/>
|
||||
<button
|
||||
className="mt-2 px-4 py-2 bg-blue-500 text-white rounded"
|
||||
onClick={() => sendReplyData(child.id)}
|
||||
>
|
||||
Kirim
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{child.children?.length > 0 && (
|
||||
<div className="ml-10 mt-2 flex flex-col mb-3">
|
||||
{child.children.map((child2: any) => (
|
||||
<div
|
||||
key={child2.id}
|
||||
className="flex flex-col gap-3 mt-2"
|
||||
>
|
||||
<div className="flex flex-row gap-3 ">
|
||||
<Avatar className="mt-2">
|
||||
<AvatarImage
|
||||
src={"/assets/avatar-profile.png"}
|
||||
alt={`@${child2.username}`}
|
||||
/>
|
||||
</Avatar>
|
||||
<div className="flex flex-col bg-slate-200 w-full px-2 py-2 rounded-md">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-gray-700 font-semibold">
|
||||
{child2.suggestionFrom.username}
|
||||
</span>
|
||||
<span className="text-gray-500 text-sm">
|
||||
{formatDate(child2.createdAt)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-800 mt-1">
|
||||
{child2.message}
|
||||
</p>
|
||||
<div className="flex flex-row gap-2">
|
||||
<div
|
||||
className="flex items-center mt-1 text-red-500 cursor-pointer"
|
||||
onClick={() => deleteData(child2.id)}
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
<span className="ml-1">Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className="flex justify-center mt-4">
|
||||
{detail?.createdBy?.id == Number(userId) &&
|
||||
detail?.isDone !== true ? (
|
||||
|
|
@ -1427,21 +1449,6 @@ export default function FormTaskDetail() {
|
|||
) : (
|
||||
""
|
||||
)}
|
||||
{detail?.isDone !== true &&
|
||||
(Number(userLevelNumber) !== 3 ||
|
||||
Number(userLevelNumber) == 2) ? (
|
||||
<Button
|
||||
color="primary"
|
||||
variant={"outline"}
|
||||
type="button"
|
||||
className="btn btn-outline-primary ml-3"
|
||||
onClick={() => handleForward()}
|
||||
>
|
||||
Forward
|
||||
</Button>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,31 @@
|
|||
import { getCategoryData } from "@/service/landing/landing";
|
||||
import { getCategoryData, getPublicCategoryData } from "@/service/landing/landing";
|
||||
import Link from "next/link";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Button } from "../ui/button";
|
||||
import { Reveal } from "./Reveal";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
const ContentCategory = () => {
|
||||
const ContentCategory = (props: { group?: string }) => {
|
||||
const [categories, setCategories] = useState<any>();
|
||||
const t = useTranslations("LandingPage");
|
||||
const params = useParams();
|
||||
const locale = params?.locale;
|
||||
const poldaName = params?.polda_name;
|
||||
const satkerName = params?.satker_name;
|
||||
|
||||
useEffect(() => {
|
||||
initFetch();
|
||||
}, []);
|
||||
const initFetch = async () => {
|
||||
const response = await getCategoryData();
|
||||
const response = await getPublicCategoryData(
|
||||
props.group == "mabes" ? "" :
|
||||
props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName :
|
||||
props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-"+satkerName : "",
|
||||
"",
|
||||
locale == "en" ? true : false
|
||||
);
|
||||
console.log("category", response);
|
||||
setCategories(response?.data?.data?.content);
|
||||
};
|
||||
|
|
|
|||
763
lib/menus.ts
763
lib/menus.ts
|
|
@ -2403,314 +2403,461 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
|||
},
|
||||
];
|
||||
} else if (Number(roleId) === 2) {
|
||||
menusSelected = [
|
||||
{
|
||||
groupLabel: t("apps"),
|
||||
id: "dashboard",
|
||||
menus: [
|
||||
{
|
||||
id: "dashboard",
|
||||
href: "/dashboard",
|
||||
label: t("dashboard"),
|
||||
active: pathname.includes("/dashboard"),
|
||||
icon: "material-symbols:dashboard",
|
||||
submenus: [
|
||||
{
|
||||
href: "/dashboard",
|
||||
label: "Breakdown",
|
||||
active: pathname === "/dashboard",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/dashboard/executive",
|
||||
label: "Executive",
|
||||
active: pathname === "/dashboard/executive",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "agenda-setting",
|
||||
menus: [
|
||||
{
|
||||
id: "agenda-setting",
|
||||
href: "/contributor/agenda-setting",
|
||||
label: t("agenda-setting"),
|
||||
active: pathname.includes("/agenda-setting"),
|
||||
icon: "iconoir:journal-page",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "management-user",
|
||||
menus: [
|
||||
{
|
||||
id: "management-user-menu",
|
||||
href: "/admin/management-user",
|
||||
label: "Management User",
|
||||
active: pathname.includes("/management-user"),
|
||||
icon: "clarity:users-solid",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "content-production",
|
||||
menus: [
|
||||
{
|
||||
id: "content-production",
|
||||
href: "/curator/content-production",
|
||||
label: t("content-production"),
|
||||
active: pathname.includes("/content-production"),
|
||||
icon: "fluent:content-view-gallery-16-regular",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "pattern-relation",
|
||||
menus: [
|
||||
{
|
||||
id: "pattern-relation",
|
||||
href: "/curator/pattern-relation",
|
||||
label: t("pattern-relation"),
|
||||
active: pathname.includes("/pattern-relation"),
|
||||
icon: "oui:app-index-pattern",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "performance-polda",
|
||||
menus: [
|
||||
{
|
||||
id: "performance-polda",
|
||||
href: "/admin/performance-polda",
|
||||
label: t("performance-polda"),
|
||||
active: pathname.includes("/admin/performance-polda"),
|
||||
icon: "ant-design:signal-filled",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "analysis",
|
||||
menus: [
|
||||
{
|
||||
id: "analysis",
|
||||
href: "/admin/analysis",
|
||||
label: t("analysis"),
|
||||
active: pathname.includes("/task-plan"),
|
||||
icon: "mdi:chart-line",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/analysis/content-management",
|
||||
label: t("management-content"),
|
||||
active: pathname === "/admin/analysis/content-management",
|
||||
icon: "",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/schedule",
|
||||
label: t("schedule"),
|
||||
active: pathname === "/admin/analysis/schedule",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/feedback-center",
|
||||
label: "Feedback Center",
|
||||
active: pathname === "/admin/analysis/feedback-center",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/emergency-issue",
|
||||
label: "Emergency Issue",
|
||||
active: pathname === "/admin/analysis/emergency-issue",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "media-tracking",
|
||||
menus: [
|
||||
{
|
||||
id: "media-tracking",
|
||||
href: "/curator/media-tracking",
|
||||
label: t("media-tracking"),
|
||||
active: pathname.includes("/media-tracking"),
|
||||
icon: "material-symbols:map-search-outline",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/media-tracking/media-online",
|
||||
label: "Media Online",
|
||||
active: pathname === "/media-tracking/media-online",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/media-tracking/news",
|
||||
label: "Tracking Beritra Hari Ini",
|
||||
active: pathname === "/media-tracking/news",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "contest",
|
||||
menus: [
|
||||
{
|
||||
id: "contest",
|
||||
href: "/shared/contest",
|
||||
label: t("contest"),
|
||||
active: pathname.includes("/contest"),
|
||||
icon: "ic:outline-emoji-events",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "communication",
|
||||
menus: [
|
||||
{
|
||||
id: "communication",
|
||||
href: "/shared/communication",
|
||||
label: t("communication"),
|
||||
active: pathname.includes("/communication"),
|
||||
icon: "token:chat",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "feedback",
|
||||
menus: [
|
||||
{
|
||||
id: "feedback",
|
||||
href: "/curator/feedback",
|
||||
label: t("feedback"),
|
||||
active: pathname.includes("/curator/feedback"),
|
||||
icon: "mdi:feedback-outline",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "broadcast",
|
||||
menus: [
|
||||
{
|
||||
id: "broadcast",
|
||||
href: "/admin/broadcast",
|
||||
label: "Broadcast",
|
||||
active: pathname.includes("/broadcast"),
|
||||
icon: "mdi:broadcast",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "experts",
|
||||
menus: [
|
||||
{
|
||||
id: "experts",
|
||||
href: "/admin/add-experts",
|
||||
label: t("add-experts"),
|
||||
active: pathname.includes("/add-experts"),
|
||||
icon: "majesticons:user",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "settings",
|
||||
menus: [
|
||||
{
|
||||
id: "settings",
|
||||
href: "/admin/settings",
|
||||
label: t("settings"),
|
||||
active: pathname.includes("/settinng"),
|
||||
icon: "material-symbols:settings",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/settings/category",
|
||||
label: t("category"),
|
||||
active: pathname === "/admin/settings/category",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/tag",
|
||||
label: "Tag",
|
||||
active: pathname === "/admin/settings/tag",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/banner",
|
||||
label: "Banner",
|
||||
active: pathname === "/admin/settings/banner",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/feedback",
|
||||
label: "Feedback",
|
||||
active: pathname === "/admin/settings/feedback",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/faq",
|
||||
label: "FAQ",
|
||||
active: pathname === "/admin/settings/faq",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "https://nat-mediahub.polri.go.id/",
|
||||
label: "Mediahub 2022",
|
||||
active: pathname === "/admin/settings/mediahub-2022",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/privacy",
|
||||
label: t("privacy"),
|
||||
active: pathname === "/admin/settings/privacy",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
if (Number(levelNumber) == 2) {
|
||||
menusSelected = [
|
||||
{
|
||||
groupLabel: t("apps"),
|
||||
id: "dashboard",
|
||||
menus: [
|
||||
{
|
||||
id: "dashboard",
|
||||
href: "/dashboard",
|
||||
label: t("dashboard"),
|
||||
active: pathname.includes("/dashboard"),
|
||||
icon: "material-symbols:dashboard",
|
||||
submenus: [
|
||||
{
|
||||
href: "/dashboard",
|
||||
label: "Breakdown",
|
||||
active: pathname === "/dashboard",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/dashboard/executive",
|
||||
label: "Executive",
|
||||
active: pathname === "/dashboard/executive",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "agenda-setting",
|
||||
menus: [
|
||||
{
|
||||
id: "agenda-setting",
|
||||
href: "/contributor/agenda-setting",
|
||||
label: t("agenda-setting"),
|
||||
active: pathname.includes("/agenda-setting"),
|
||||
icon: "iconoir:journal-page",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "management-user",
|
||||
menus: [
|
||||
{
|
||||
id: "management-user-menu",
|
||||
href: "/admin/management-user",
|
||||
label: "Management User",
|
||||
active: pathname.includes("/management-user"),
|
||||
icon: "clarity:users-solid",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "content-production",
|
||||
menus: [
|
||||
{
|
||||
id: "content-production",
|
||||
href: "/curator/content-production",
|
||||
label: t("content-production"),
|
||||
active: pathname.includes("/content-production"),
|
||||
icon: "fluent:content-view-gallery-16-regular",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "pattern-relation",
|
||||
menus: [
|
||||
{
|
||||
id: "pattern-relation",
|
||||
href: "/curator/pattern-relation",
|
||||
label: t("pattern-relation"),
|
||||
active: pathname.includes("/pattern-relation"),
|
||||
icon: "oui:app-index-pattern",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "performance-polda",
|
||||
menus: [
|
||||
{
|
||||
id: "performance-polda",
|
||||
href: "/admin/performance-polda",
|
||||
label: t("performance-polda"),
|
||||
active: pathname.includes("/admin/performance-polda"),
|
||||
icon: "ant-design:signal-filled",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "communication",
|
||||
menus: [
|
||||
{
|
||||
id: "communication",
|
||||
href: "/shared/communication",
|
||||
label: t("communication"),
|
||||
active: pathname.includes("/communication"),
|
||||
icon: "token:chat",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "settings",
|
||||
menus: [
|
||||
{
|
||||
id: "settings",
|
||||
href: "/admin/settings",
|
||||
label: t("settings"),
|
||||
active: pathname.includes("/settinng"),
|
||||
icon: "material-symbols:settings",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/settings/category",
|
||||
label: t("category"),
|
||||
active: pathname === "/admin/settings/category",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/tag",
|
||||
label: "Tag",
|
||||
active: pathname === "/admin/settings/tag",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
} else {
|
||||
menusSelected = [
|
||||
{
|
||||
groupLabel: t("apps"),
|
||||
id: "dashboard",
|
||||
menus: [
|
||||
{
|
||||
id: "dashboard",
|
||||
href: "/dashboard",
|
||||
label: t("dashboard"),
|
||||
active: pathname.includes("/dashboard"),
|
||||
icon: "material-symbols:dashboard",
|
||||
submenus: [
|
||||
{
|
||||
href: "/dashboard",
|
||||
label: "Breakdown",
|
||||
active: pathname === "/dashboard",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/dashboard/executive",
|
||||
label: "Executive",
|
||||
active: pathname === "/dashboard/executive",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "agenda-setting",
|
||||
menus: [
|
||||
{
|
||||
id: "agenda-setting",
|
||||
href: "/contributor/agenda-setting",
|
||||
label: t("agenda-setting"),
|
||||
active: pathname.includes("/agenda-setting"),
|
||||
icon: "iconoir:journal-page",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "management-user",
|
||||
menus: [
|
||||
{
|
||||
id: "management-user-menu",
|
||||
href: "/admin/management-user",
|
||||
label: "Management User",
|
||||
active: pathname.includes("/management-user"),
|
||||
icon: "clarity:users-solid",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "content-production",
|
||||
menus: [
|
||||
{
|
||||
id: "content-production",
|
||||
href: "/curator/content-production",
|
||||
label: t("content-production"),
|
||||
active: pathname.includes("/content-production"),
|
||||
icon: "fluent:content-view-gallery-16-regular",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "pattern-relation",
|
||||
menus: [
|
||||
{
|
||||
id: "pattern-relation",
|
||||
href: "/curator/pattern-relation",
|
||||
label: t("pattern-relation"),
|
||||
active: pathname.includes("/pattern-relation"),
|
||||
icon: "oui:app-index-pattern",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "performance-polda",
|
||||
menus: [
|
||||
{
|
||||
id: "performance-polda",
|
||||
href: "/admin/performance-polda",
|
||||
label: t("performance-polda"),
|
||||
active: pathname.includes("/admin/performance-polda"),
|
||||
icon: "ant-design:signal-filled",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "analysis",
|
||||
menus: [
|
||||
{
|
||||
id: "analysis",
|
||||
href: "/admin/analysis",
|
||||
label: t("analysis"),
|
||||
active: pathname.includes("/task-plan"),
|
||||
icon: "mdi:chart-line",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/analysis/content-management",
|
||||
label: t("management-content"),
|
||||
active: pathname === "/admin/analysis/content-management",
|
||||
icon: "",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/schedule",
|
||||
label: t("schedule"),
|
||||
active: pathname === "/admin/analysis/schedule",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/feedback-center",
|
||||
label: "Feedback Center",
|
||||
active: pathname === "/admin/analysis/feedback-center",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/analysis/emergency-issue",
|
||||
label: "Emergency Issue",
|
||||
active: pathname === "/admin/analysis/emergency-issue",
|
||||
icon: "heroicons:shopping-cart",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "media-tracking",
|
||||
menus: [
|
||||
{
|
||||
id: "media-tracking",
|
||||
href: "/curator/media-tracking",
|
||||
label: t("media-tracking"),
|
||||
active: pathname.includes("/media-tracking"),
|
||||
icon: "material-symbols:map-search-outline",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/media-tracking/media-online",
|
||||
label: "Media Online",
|
||||
active: pathname === "/media-tracking/media-online",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/media-tracking/news",
|
||||
label: "Tracking Beritra Hari Ini",
|
||||
active: pathname === "/media-tracking/news",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "contest",
|
||||
menus: [
|
||||
{
|
||||
id: "contest",
|
||||
href: "/shared/contest",
|
||||
label: t("contest"),
|
||||
active: pathname.includes("/contest"),
|
||||
icon: "ic:outline-emoji-events",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "communication",
|
||||
menus: [
|
||||
{
|
||||
id: "communication",
|
||||
href: "/shared/communication",
|
||||
label: t("communication"),
|
||||
active: pathname.includes("/communication"),
|
||||
icon: "token:chat",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "feedback",
|
||||
menus: [
|
||||
{
|
||||
id: "feedback",
|
||||
href: "/curator/feedback",
|
||||
label: t("feedback"),
|
||||
active: pathname.includes("/curator/feedback"),
|
||||
icon: "mdi:feedback-outline",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "broadcast",
|
||||
menus: [
|
||||
{
|
||||
id: "broadcast",
|
||||
href: "/admin/broadcast",
|
||||
label: "Broadcast",
|
||||
active: pathname.includes("/broadcast"),
|
||||
icon: "mdi:broadcast",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "experts",
|
||||
menus: [
|
||||
{
|
||||
id: "experts",
|
||||
href: "/admin/add-experts",
|
||||
label: t("add-experts"),
|
||||
active: pathname.includes("/add-experts"),
|
||||
icon: "majesticons:user",
|
||||
submenus: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupLabel: "",
|
||||
id: "settings",
|
||||
menus: [
|
||||
{
|
||||
id: "settings",
|
||||
href: "/admin/settings",
|
||||
label: t("settings"),
|
||||
active: pathname.includes("/settinng"),
|
||||
icon: "material-symbols:settings",
|
||||
submenus: [
|
||||
{
|
||||
href: "/admin/settings/category",
|
||||
label: t("category"),
|
||||
active: pathname === "/admin/settings/category",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/tag",
|
||||
label: "Tag",
|
||||
active: pathname === "/admin/settings/tag",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/banner",
|
||||
label: "Banner",
|
||||
active: pathname === "/admin/settings/banner",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/feedback",
|
||||
label: "Feedback",
|
||||
active: pathname === "/admin/settings/feedback",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/faq",
|
||||
label: "FAQ",
|
||||
active: pathname === "/admin/settings/faq",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "https://nat-mediahub.polri.go.id/",
|
||||
label: "Mediahub 2022",
|
||||
active: pathname === "/admin/settings/mediahub-2022",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
href: "/admin/settings/privacy",
|
||||
label: t("privacy"),
|
||||
active: pathname === "/admin/settings/privacy",
|
||||
icon: "heroicons:arrow-trending-up",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return menusSelected;
|
||||
|
|
|
|||
|
|
@ -5,13 +5,17 @@ export async function getHeroData() {
|
|||
return await httpGetInterceptor(`media/public/list?enablePage=1&sort=desc&sortBy=createdAt&size=5&page=0&typeId=1&title=&categoryId=&fileFormats=&tags=&group=&startDate=&endDate=&month=&year=`);
|
||||
}
|
||||
|
||||
export async function getPublicCategoryData(group: any = "", type: string = "", isInt: Boolean = false) {
|
||||
return await httpGetInterceptor(`media/categories/list/publish?enablePage=0&group=${group}&type=${type}&isInt=${isInt}`);
|
||||
}
|
||||
|
||||
export async function getCategoryData() {
|
||||
return await httpGetInterceptor(`media/categories/list/publish?enablePage=1&sort=desc&sortBy=updatedAt&size=12&type=`);
|
||||
}
|
||||
|
||||
export async function getListContent(props: any) {
|
||||
return await httpGetInterceptor(
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${props.size}&isInt=${props.isInt}&typeId=${props.contentTypeId}&title=${props.title}&group=${props.group}&group=${props.group}&categoryId=&fileFormats=&tags=&startDate=&endDate=&month=&year=`
|
||||
`media/public/list?enablePage=1&sort=desc&sortBy=${props.sortBy}&size=${props.size}&isInt=${props.isInt}&typeId=${props.contentTypeId}&title=${props.title}&group=${props.group}&categoryId=&fileFormats=&tags=&startDate=&endDate=&month=&year=`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue