diff --git a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx index 833a2129..13d5db6a 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx +++ b/app/[locale]/(protected)/contributor/agenda-setting/calender-view.tsx @@ -575,7 +575,7 @@ const CalendarView = ({ categories }: CalendarViewProps) => { - {roleId == 11 || roleId == 2 || roleId == 12 ? ( + {roleId == 3 || roleId == 11 || roleId == 2 || roleId == 12 ? ( + + +
+

Filter

+
+ +
+ handleStatusCheckboxChange(1)} + /> + +
+
+ handleStatusCheckboxChange(2)} + /> + +
+
+ diff --git a/app/[locale]/(protected)/dashboard/executive/page.tsx b/app/[locale]/(protected)/dashboard/executive/page.tsx index 3152a7f8..4760bb6f 100644 --- a/app/[locale]/(protected)/dashboard/executive/page.tsx +++ b/app/[locale]/(protected)/dashboard/executive/page.tsx @@ -1,9 +1,239 @@ import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { LucideBoxSelect } from "lucide-react"; export default function ExecutiveDashboard() { + // const downloadReport = async () => { + // // const formattedDate = `${reportDate.year}-${String( + // // reportDate.month + // // ).padStart(2, "0")}-${String(reportDate.day).padStart(2, "0")}`; + // // const resLogin = await tableauSignin(); + // // const token = resLogin?.data.data?.credentials?.token; + // // const resCover = await tableauViewImage( + // // token, + // // "1df3df4a-0457-4483-a8e1-160f70e7834f", + // // formattedDate + // // ); + // // const resTotalLink = await tableauViewImage( + // // token, + // // "8f902032-a6eb-4083-817a-57350f509b75", + // // formattedDate + // // ); + // // const resCount = await tableauViewImage( + // // token, + // // "11b2fe3c-f853-4156-800e-43342bf8e5ce", + // // formattedDate + // // ); + // // const resCoverCommentTwitter = await tableauViewImage( + // // token, + // // "28183e0b-80d0-428d-8684-2cbb572e97b3", + // // formattedDate, + // // 2 + // // ); + // // const resCoverCommentTiktok = await tableauViewImage( + // // token, + // // "28183e0b-80d0-428d-8684-2cbb572e97b3", + // // formattedDate, + // // 3 + // // ); + // // const resCoverCommentFacebook = await tableauViewImage( + // // token, + // // "28183e0b-80d0-428d-8684-2cbb572e97b3", + // // formattedDate, + // // 4 + // // ); + // // const resCoverCommentInstagram = await tableauViewImage( + // // token, + // // "28183e0b-80d0-428d-8684-2cbb572e97b3", + // // formattedDate, + // // 5 + // // ); + // // const resCoverCommentYoutube = await tableauViewImage( + // // token, + // // "28183e0b-80d0-428d-8684-2cbb572e97b3", + // // formattedDate, + // // 6 + // // ); + // // const resCommentTwitter = await tableauViewImage( + // // token, + // // "9a6d05ed-dea7-4a93-b709-82d0dab4790d", + // // formattedDate, + // // 2 + // // ); + // // const resCommentTiktok = await tableauViewImage( + // // token, + // // "9a6d05ed-dea7-4a93-b709-82d0dab4790d", + // // formattedDate, + // // 3 + // // ); + // // const resCommentFacebook = await tableauViewImage( + // // token, + // // "9a6d05ed-dea7-4a93-b709-82d0dab4790d", + // // formattedDate, + // // 4 + // // ); + // // const resCommentInstagram = await tableauViewImage( + // // token, + // // "9a6d05ed-dea7-4a93-b709-82d0dab4790d", + // // formattedDate, + // // 5 + // // ); + // // const resCommentYoutube = await tableauViewImage( + // // token, + // // "9a6d05ed-dea7-4a93-b709-82d0dab4790d", + // // formattedDate, + // // 6 + // // ); + // // const blobCover = new Blob([resCover.data], { type: "image/png" }); + // // const blobTotalLink = new Blob([resTotalLink.data], { type: "image/png" }); + // // const blobCount = new Blob([resCount.data], { type: "image/png" }); + // // const blobCoverCommentTwitter = new Blob([resCoverCommentTwitter.data], { + // // type: "image/png", + // // }); + // // const blobCoverCommentTiktok = new Blob([resCoverCommentTiktok.data], { + // // type: "image/png", + // // }); + // // const blobCoverCommentFacebook = new Blob([resCoverCommentFacebook.data], { + // // type: "image/png", + // // }); + // // const blobCoverCommentInstagram = new Blob( + // // [resCoverCommentInstagram.data], + // // { type: "image/png" } + // // ); + // // const blobCoverCommentYoutube = new Blob([resCoverCommentYoutube.data], { + // // type: "image/png", + // // }); + // // const blobCommentTwitter = new Blob([resCommentTwitter.data], { + // // type: "image/png", + // // }); + // // const blobCommentTiktok = new Blob([resCommentTiktok.data], { + // // type: "image/png", + // // }); + // // const blobCommentFacebook = new Blob([resCommentFacebook.data], { + // // type: "image/png", + // // }); + // // const blobCommentInstagram = new Blob([resCommentInstagram.data], { + // // type: "image/png", + // // }); + // // const blobCommentYoutube = new Blob([resCommentYoutube.data], { + // // type: "image/png", + // // }); + // // await pdfGenerator([ + // // blobCover, + // // blobTotalLink, + // // blobCount, + // // blobCoverCommentTwitter, + // // blobCommentTwitter, + // // blobCoverCommentTiktok, + // // blobCommentTiktok, + // // blobCoverCommentFacebook, + // // blobCommentFacebook, + // // blobCoverCommentInstagram, + // // blobCommentInstagram, + // // blobCoverCommentYoutube, + // // blobCommentYoutube, + // // ]); + // }; + return (
+ + + + + + + Download Report + +
+
+ + setDateFilter(e.target.value)} + className="w-full" + /> +
+
+ + + +
+
+
+ +
+

+ Upload konten hari ini Polda +

+ +
+
+ +
+

+ Upload konten hari ini Satker +

+ +
+
+ +
+

+ Upload konten hari ini Polres +

+ +
+
+
+
+ +
+

Konten Paling Populer

+ +
+
+
+
+ +
+

+ Heatmap Konten Dengan Interaksi +

+

+ Heatmap Kategori Dengan Interaksi +

+ +
+
+
+
+ +
+

Emergency Issue

+ +
+
+
); } diff --git a/app/[locale]/(protected)/shared/contest/components/contest-table.tsx b/app/[locale]/(protected)/shared/contest/components/contest-table.tsx index 135fe118..735e1af5 100644 --- a/app/[locale]/(protected)/shared/contest/components/contest-table.tsx +++ b/app/[locale]/(protected)/shared/contest/components/contest-table.tsx @@ -46,7 +46,6 @@ import { listContest } from "@/service/contest/contest"; const TaskTable = () => { const router = useRouter(); const searchParams = useSearchParams(); - const [dataTable, setDataTable] = React.useState([]); const [totalData, setTotalData] = React.useState(1); const [sorting, setSorting] = React.useState([]); diff --git a/app/[locale]/(protected)/shared/contest/page.tsx b/app/[locale]/(protected)/shared/contest/page.tsx index 77f8ed14..c56e1589 100644 --- a/app/[locale]/(protected)/shared/contest/page.tsx +++ b/app/[locale]/(protected)/shared/contest/page.tsx @@ -1,11 +1,20 @@ +"use client"; + import SiteBreadcrumb from "@/components/site-breadcrumb"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import ContestTable from "./components/contest-table"; import { Link } from "@/components/navigation"; import { Button } from "@/components/ui/button"; import { UploadIcon } from "lucide-react"; +import { getCookiesDecrypt } from "@/lib/utils"; +import { useEffect, useState } from "react"; const ContestPage = () => { + const [userLevelId, setUserLevelId] = useState(null); + + useEffect(() => { + setUserLevelId(Number(getCookiesDecrypt("ulie"))); + }, []); return (
@@ -17,14 +26,16 @@ const ContestPage = () => {
Tabel Lomba
-
- - - -
+ {userLevelId !== 776 && userLevelId !== null && ( +
+ + + +
+ )}
diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index b0cb3340..43dd6194 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -27,6 +27,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + publishMedia, rejectFiles, submitApproval, } from "@/service/content/content"; @@ -50,7 +51,7 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Textarea } from "@/components/ui/textarea"; -import { close, loading } from "@/config/swal"; +import { close, loading, successCallback } from "@/config/swal"; import { getCookiesDecrypt } from "@/lib/utils"; import { Icon } from "@iconify/react/dist/iconify.js"; import { error } from "@/lib/swal"; @@ -406,6 +407,11 @@ export default function FormImageDetail() { }); }; + const publishToMabes = async () => { + const res = await publishMedia(id); + successCallback(); + }; + return (
{detail !== undefined ? ( @@ -521,7 +527,7 @@ export default function FormImageDetail() {
- +
@@ -624,6 +630,38 @@ export default function FormImageDetail() { ) : ( "" )} */} + + {detail?.isPublish == false && detail.isPublishOnPolda == true ? ( +
+ +
+ ) : ( + "" + )} + + {/* {detail?.isPublish == true ? ( + + ) : ( + "" + )} */} {Number(detail?.needApprovalFromLevel) == Number(userLevelId) ? ( Number(detail?.uploadedById) == Number(userId) ? ( "" diff --git a/service/content/content.ts b/service/content/content.ts index 7d2a4e0f..e40c5826 100644 --- a/service/content/content.ts +++ b/service/content/content.ts @@ -196,6 +196,11 @@ export async function rejectFiles(data: any) { return httpPostInterceptor(url, data); } +export async function publishMedia(id: any) { + const url = `media/public/publish-to-mabes?id=${id}`; + return httpPostInterceptor(url); +} + export async function saveContentRewrite(data: any) { const url = "media/rewrite"; return httpPostInterceptor(url, data);