From 4ce6ad3fcbefc2a301211f19bd0978f0729ec8f0 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Fri, 13 Jun 2025 17:04:25 +0700 Subject: [PATCH 1/4] fix:dashboard stats --- components/main/dashboard/dashboard-container.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/components/main/dashboard/dashboard-container.tsx b/components/main/dashboard/dashboard-container.tsx index ac0a2d6..f51ffbe 100644 --- a/components/main/dashboard/dashboard-container.tsx +++ b/components/main/dashboard/dashboard-container.tsx @@ -197,11 +197,16 @@ export default function DashboardContainer() { const getTableNumberStats = (data: any) => { if (data) { let iterate = 0; - const newData = data.map((value: any) => { - iterate++; - value.no = iterate; - return value; - }); + const newData = data + .filter( + (value: any) => + value.userLevelName !== "SATWIL" && value.userLevelName !== "SATKER" + ) + .map((value: any) => { + iterate++; + value.no = iterate; + return value; + }); return newData; } }; From c3e33351b1eb9a51d85cc1b81f504b884a486400 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Fri, 13 Jun 2025 18:38:46 +0700 Subject: [PATCH 2/4] fix:polda modal landing --- components/landing/RegionalNews.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/components/landing/RegionalNews.tsx b/components/landing/RegionalNews.tsx index a8eda2b..83cd2b6 100644 --- a/components/landing/RegionalNews.tsx +++ b/components/landing/RegionalNews.tsx @@ -82,12 +82,7 @@ const listPoldaAll = [ title: "Polda Kep.Riau", path: "polda-kepri", }, - { - id: 12, - img: "/assets/polda/polda-jambi.svg", - title: "Polda Jambi", - path: "polda-jambi", - }, + { id: 13, img: "/assets/polda/polda-jambi.svg", @@ -118,12 +113,7 @@ const listPoldaAll = [ title: "Polda Lampung", path: "polda-lampung", }, - { - id: 18, - img: "/assets/polda/polda-ntb.svg", - title: "Polda Nusa Tenggara Barat", - path: "polda-ntb", - }, + { id: 19, img: "/assets/polda/polda-ntb.svg", From 64c42f893422b610ec2beb258c715d857568604d Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Mon, 16 Jun 2025 12:51:07 +0700 Subject: [PATCH 3/4] [QUDO-235,237]:feat:ember tawkto, ui improve dashboard stats --- app/layout.tsx | 2 + .../main/dashboard/dashboard-container.tsx | 136 ++++++++++++++++-- components/page/detail-news.tsx | 42 +++--- components/ui/tawkto/load-tawk.tsx | 22 +++ 4 files changed, 172 insertions(+), 30 deletions(-) create mode 100644 components/ui/tawkto/load-tawk.tsx diff --git a/app/layout.tsx b/app/layout.tsx index 9777007..ef41878 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,6 +9,7 @@ import { Metadata } from "next"; import { Providers } from "./providers"; import LoadScript from "@/utils/global"; import { type ReactNode } from "react"; +import LoadTawk from "@/components/ui/tawkto/load-tawk"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { @@ -56,6 +57,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
{children}
+ ); diff --git a/components/main/dashboard/dashboard-container.tsx b/components/main/dashboard/dashboard-container.tsx index f51ffbe..7cf43fc 100644 --- a/components/main/dashboard/dashboard-container.tsx +++ b/components/main/dashboard/dashboard-container.tsx @@ -15,7 +15,12 @@ import { Calendar, Checkbox, CheckboxGroup, + CheckboxIcon, Image, + Modal, + ModalBody, + ModalContent, + ModalHeader, Pagination, Popover, PopoverContent, @@ -24,13 +29,14 @@ import { SelectItem, SelectSection, Skeleton, + useDisclosure, } from "@heroui/react"; import ApexChartColumn from "./chart/column-chart"; import ApexChartDonut from "./chart/donut-chart"; import ApexChartLineArea from "./chart/line-area-chart"; import Cookies from "js-cookie"; import Link from "next/link"; -import { useEffect, useState } from "react"; +import { Fragment, useEffect, useState } from "react"; import { getListArticle, getListArticleAdminPage, @@ -46,6 +52,7 @@ import { textEllipsis, } from "@/utils/global"; import { parseDate, getLocalTimeZone } from "@internationalized/date"; +import { Input } from "@heroui/input"; type ArticleData = Article & { no: number; @@ -67,6 +74,8 @@ interface PostCount { } export default function DashboardContainer() { + const { isOpen, onOpen, onOpenChange } = useDisclosure(); + const username = Cookies.get("username"); const fullname = Cookies.get("ufne"); const [page, setPage] = useState(1); @@ -74,6 +83,7 @@ export default function DashboardContainer() { const [topPagespage, setTopPagesPage] = useState(1); const [topPagesTotalPage, setTopPagesTotalPage] = useState(1); const [article, setArticle] = useState([]); + const [selectedCategory, setSelectedCategory] = useState("polda"); const [analyticsView, setAnalyticView] = useState([ "comment", "view", @@ -108,7 +118,9 @@ export default function DashboardContainer() { const [postCount, setPostCount] = useState([]); const [polresData, setPolresData] = useState({}); const [selectedAccordion, setSelectedAccordion] = useState(new Set([])); - + const [recapArticleList, setRecapArticleList] = useState([]); + const [timeValue, setTimeValue] = useState("--:--"); + const [selectedUnit, setSelectedUnit] = useState(""); const roleId = Cookies.get("urie"); useEffect(() => { @@ -281,6 +293,21 @@ export default function DashboardContainer() { } }; + const openModalArticle = async (limit: number) => { + const req = { + limit: `${limit}`, + page: topPagespage, + search: "", + sort: "desc", + startDate: getDate(topContentDate.startDate), + endDate: getDate(topContentDate.endDate), + }; + const res = await getTopArticles(req); + setRecapArticleList(getTableNumber(10, res.data?.data)); + // setTopPagesTotalPage(res?.data?.meta?.totalPage); + onOpen(); + }; + return (
@@ -342,7 +369,7 @@ export default function DashboardContainer() {

Rekapitulasi Post Berita Polda/Polres Pada Website

-
+
+ + + + } + classNames={{ + inputWrapper: [ + "border-none rounded-lg !h-[30px] lg:h-[40px]", + "dark:group-data-[focused=false]:bg-transparent border-none", + ], + }} + />
-
+
NO
-
POLDA/POLRES
+
+ {Number(roleId) < 3 ? ( + + ) : ( + "POLDA/POLRES" + )} +
JUMLAH POST BERITA
@@ -417,9 +487,9 @@ export default function DashboardContainer() {
{list?.no}
{list?.userLevelName}
{list?.totalArticle} @@ -443,14 +513,20 @@ export default function DashboardContainer() {
{child?.userLevelName}
-
{ + if (list?.totalArticle !== 0) { + setSelectedUnit(child?.userLevelName); + openModalArticle(list?.totalArticle); + } + }} + className={`w-[10%] text-start cursor-pointer ${ list?.totalArticle === 0 && - "bg-red-600 text-white" + "bg-red-600 text-white cursor-default" }`} > {child?.totalArticle} -
+
) ) @@ -705,6 +781,44 @@ export default function DashboardContainer() {
+ + + {(onClose) => ( + <> + + {selectedUnit} List Content + + +
+
No
+
Judul
+
Dibuat
+
+ {recapArticleList?.length > 0 && + recapArticleList?.map((list: any) => ( + +
{list.no}
+
+ + {textEllipsis(list.title, 80)} + +
+
+ {convertDateFormat(list?.createdAt)} +
+
+ ))} +
+
+
+ + )} +
+
); } diff --git a/components/page/detail-news.tsx b/components/page/detail-news.tsx index 9b98ec8..2856950 100644 --- a/components/page/detail-news.tsx +++ b/components/page/detail-news.tsx @@ -153,29 +153,33 @@ export default function DetailNews(props: { data: any; listArticle: any }) {

- {data.files[0].file_name.split(".")[1].includes("doc") || - data.files[0].file_name.split(".")[1].includes("pdf") ? ( - Main Image - ) : ( - data?.files?.length > 0 && ( + {data?.files ? ( + data?.files[0]?.file_name.split(".")[1].includes("doc") || + data?.files[0]?.file_name.split(".")[1].includes("pdf") ? ( Main Image + ) : ( + data?.files?.length > 0 && ( + Main Image + ) ) + ) : ( + "" )}
{data?.files?.length > 0 && diff --git a/components/ui/tawkto/load-tawk.tsx b/components/ui/tawkto/load-tawk.tsx new file mode 100644 index 0000000..c8031ba --- /dev/null +++ b/components/ui/tawkto/load-tawk.tsx @@ -0,0 +1,22 @@ +"use client"; +import { useEffect } from "react"; + +const LoadTawk = () => { + useEffect(() => { + const script = document.createElement("script"); + script.src = "https://embed.tawk.to/5d43069be5ae967ef80df561/default"; + script.async = true; + script.charset = "UTF-8"; + script.setAttribute("crossorigin", "*"); + + document.body.appendChild(script); + + return () => { + document.body.removeChild(script); + }; + }, []); + + return null; +}; + +export default LoadTawk; From 5f173def514e4a6c122adf43c305e93b714b1464 Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Mon, 16 Jun 2025 19:34:41 +0700 Subject: [PATCH 4/4] fix:landing footer, banner,static --- components/landing/banner-new.tsx | 5 ++++- components/landing/footer-new.tsx | 6 ++++-- config/site.ts | 14 +++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/components/landing/banner-new.tsx b/components/landing/banner-new.tsx index 7bcfb93..b837d56 100644 --- a/components/landing/banner-new.tsx +++ b/components/landing/banner-new.tsx @@ -420,7 +420,10 @@ export default function BannerHumasNew() { - +
diff --git a/components/landing/footer-new.tsx b/components/landing/footer-new.tsx index 0193192..0b80f3a 100644 --- a/components/landing/footer-new.tsx +++ b/components/landing/footer-new.tsx @@ -166,8 +166,9 @@ export default function FooterNew(props: { margin?: boolean }) {

@@ -176,8 +177,9 @@ export default function FooterNew(props: { margin?: boolean }) {
diff --git a/config/site.ts b/config/site.ts index bab68cf..76c96af 100644 --- a/config/site.ts +++ b/config/site.ts @@ -89,14 +89,14 @@ export const siteConfig = { }, { label: "Pelayanan Propam Presisi", - href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam&pli=1", + href: "https://apps.apple.com/id/app/propam-presisi/id1560263690?l=id", img: "/pm9.png", blank: true, desc: "Pelayanan Untuk Masyarakat Agar Mudah Melaporkan Sesuatu Kejadian atau Kejahatan", }, { label: "Pelayanan Dumas Presisi", - href: "https://dumaspresisi.polri.go.id/", + href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi", img: "/pm10.png", blank: true, desc: "Layanan Pengaduan Masyarakat Terintegrasi Berbasis Online", @@ -229,7 +229,7 @@ export const siteConfig = { }, { label: "Polisiku", - href: "https://play.google.com/store/apps/details?id=id.co.qlue.polisiku&hl=id&gl=ID", + href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi", img: "/at3.png", blank: true, desc: "Membantu anggota Kepolisian untuk mengindetifikasi masalah di lapangan", @@ -299,14 +299,14 @@ export const siteConfig = { }, { label: "Propam Presisi", - href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam", + href: "https://apps.apple.com/id/app/propam-presisi/id1560263690?l=id", img: "/pm9.png", blank: true, desc: "Aplikasi Pelayanan Masyarakat untuk Melapor Secara Mudah", }, { label: "Monitoring Presisi", - href: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam", + href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi", img: "/at14.png", blank: true, desc: "Aplikasi Anggota Binmas dan Satpam Polda Metro Jaya Melaporkan Tugas", @@ -320,14 +320,14 @@ export const siteConfig = { }, { label: "Whistle Blowing System", - href: "https://pengaduan-penerimaan.polri.go.id/", + href: "https://wbs.polri.go.id/", img: "/at16.png", blank: true, desc: "Website untuk Pengaduan Penerimaan Anggota POLRI", }, { label: "Dumas Presisi", - href: "https://play.google.com/store/apps/details?id=com.admasolusi.monitoringpresisi", + href: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi", img: "/pm10.png", blank: true, desc: "Website Layanan Pengaduan Masyarakat Terintegrasi",