From 5183ce8374455d53ff0d58d8670a5e57d0701d43 Mon Sep 17 00:00:00 2001 From: sabdayagra Date: Tue, 31 Dec 2024 17:32:09 +0700 Subject: [PATCH 1/4] feat: add api --- .../(public)/content-management/page.tsx | 82 ++++++++++--------- components/landing-page/navbar.tsx | 43 +++++++--- 2 files changed, 75 insertions(+), 50 deletions(-) diff --git a/app/[locale]/(public)/content-management/page.tsx b/app/[locale]/(public)/content-management/page.tsx index fe4c2f99..387cd808 100644 --- a/app/[locale]/(public)/content-management/page.tsx +++ b/app/[locale]/(public)/content-management/page.tsx @@ -85,16 +85,18 @@ const ContentManagement = (props: { type: string }) => {
avatar -

{profile?.fullname}

-

{profile?.username}

-

- Aktif Sejak - {`${new Date(profile?.createdAt).getDate()}/${new Date(profile?.createdAt).getMonth() + 1}/${new Date(profile?.createdAt).getFullYear()} ${new Date(profile?.createdAt).getHours()}:${new Date( - profile?.createdAt - ).getMinutes()}`} -

+
+

{profile?.fullname}

+

{profile?.username}

+

+ Aktif Sejak  + {`${new Date(profile?.createdAt).getDate()}/${new Date(profile?.createdAt).getMonth() + 1}/${new Date(profile?.createdAt).getFullYear()} ${new Date(profile?.createdAt).getHours()}:${new Date( + profile?.createdAt + ).getMinutes()}`} +

+
- + Pengaturan @@ -110,29 +112,29 @@ const ContentManagement = (props: { type: string }) => {
  • -

    Email

    -

    msabdayagra@gmail.com

    - {/*

    {profile?.email}

    */} +

    Email :

    + {/*

    msabdayagra@gmail.com

    */} +

    {profile?.email}

  • -

    No Handphone

    -

    0812-7561-7204

    - {/*

    {profile?.phoneNumber}

    */} +

    No Handphone :

    + {/*

    0812-7561-7204

    */} +

    {profile?.phoneNumber}

  • -

    Alamat

    -

    Jl. Besar Tembung no.12

    - {/*

    {profile?.address}

    */} +

    Alamat :

    + {/*

    Jl. Besar Tembung no.12

    */} +

    {profile?.address}

  • -

    Kategori

    -

    POLRI

    - {/*

    {profile?.institute?.categoryRole?.name}

    */} +

    Kategori :

    + {/*

    POLRI

    */} +

    {profile?.institute?.categoryRole?.name}

  • -

    Instansi/Perusahaan

    -

    Div Humas Polri

    - {/*

    {profile?.institute?.name}

    */} +

    Instansi/Perusahaan :

    + {/*

    Div Humas Polri

    */} +

    {profile?.institute?.name}

@@ -143,7 +145,7 @@ const ContentManagement = (props: { type: string }) => {
-

Galeri Div Humas

+

Galeri {profile?.institute?.name}

@@ -189,7 +191,7 @@ const ContentManagement = (props: { type: string }) => { {/* Kontent Kanan */}
-

Galeri Div Humas

+

Galeri {profile?.institute?.name}

@@ -228,9 +230,9 @@ const ContentManagement = (props: { type: string }) => {
{selectedTab == "video" ? ( - dummyContent?.length > 0 ? ( + profile?.length > 0 ? (
- {dummyContent?.map((video: any) => ( + {profile?.map((video: any) => ( @@ -257,9 +259,9 @@ const ContentManagement = (props: { type: string }) => {

) ) : selectedTab == "audio" ? ( - dummyContent?.length > 0 ? ( + profile?.length > 0 ? (
- {dummyContent?.map((audio: any) => ( + {profile?.map((audio: any) => ( {

) ) : selectedTab == "image" ? ( - dummyContent?.length > 0 ? ( + profile?.length > 0 ? (
- {dummyContent?.map((video: any) => ( - + {profile?.map((image: any) => ( + - - + +
- {formatDateToIndonesian(new Date(video?.createdAt))} {video?.timezone ? video?.timezone : "WIB"}| - {video?.clickCount}{" "} + {formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"}| + {image?.clickCount}{" "} { /> {" "}
-
{video?.title}
+
{image?.title}
@@ -332,9 +334,9 @@ const ContentManagement = (props: { type: string }) => { empty

) - ) : dummyContent.length > 0 ? ( + ) : profile.length > 0 ? (
- {dummyContent?.map((document: any) => ( + {profile?.map((document: any) => (
diff --git a/components/landing-page/navbar.tsx b/components/landing-page/navbar.tsx index 39029e31..b9a28c9e 100644 --- a/components/landing-page/navbar.tsx +++ b/components/landing-page/navbar.tsx @@ -56,7 +56,7 @@ const Navbar = () => { setLanguage(lang); setIsOpen(false); }; - + useEffect(() => { async function initState() { const response = await getInfoProfile(); @@ -68,7 +68,6 @@ const Navbar = () => { initState(); }, []); - return (
@@ -237,7 +236,7 @@ const Navbar = () => { - + Profile @@ -515,7 +514,37 @@ const Navbar = () => {
{fullName ? ( -

{fullName}

+ <> + + + avatar-profile + +

{fullName}

+

{`(${roleName})`}

+
+
+ + + + + Profile + + + + + + Kelola Konten + + + + + + Keluar + + + +
+ ) : ( <> @@ -526,12 +555,6 @@ const Navbar = () => { {" "} )} - - Masuk - - - Daftar -
)} From 884ddcee6393f820302c5c3712e62970ba165c9c Mon Sep 17 00:00:00 2001 From: Rama Priyanto Date: Wed, 1 Jan 2025 11:56:58 +0700 Subject: [PATCH 2/4] feat:admin menu --- .../analysis/content-management/page.tsx | 196 +++++++++++ .../admin/analysis/emergency-issue/page.tsx | 113 ++++++ .../admin/analysis/feedback-center/page.tsx | 113 ++++++ .../admin/analysis/schedule/page.tsx | 330 ++++++++++++++++++ .../admin/management-user/page.tsx | 10 + .../admin/performance-polda/page.tsx | 10 + .../(protected)/dashboard/executive/page.tsx | 9 + lib/menus.ts | 16 +- messages/en.json | 2 +- messages/in.json | 2 +- 10 files changed, 791 insertions(+), 10 deletions(-) create mode 100644 app/[locale]/(protected)/admin/analysis/content-management/page.tsx create mode 100644 app/[locale]/(protected)/admin/analysis/emergency-issue/page.tsx create mode 100644 app/[locale]/(protected)/admin/analysis/feedback-center/page.tsx create mode 100644 app/[locale]/(protected)/admin/analysis/schedule/page.tsx create mode 100644 app/[locale]/(protected)/admin/management-user/page.tsx create mode 100644 app/[locale]/(protected)/admin/performance-polda/page.tsx create mode 100644 app/[locale]/(protected)/dashboard/executive/page.tsx diff --git a/app/[locale]/(protected)/admin/analysis/content-management/page.tsx b/app/[locale]/(protected)/admin/analysis/content-management/page.tsx new file mode 100644 index 00000000..bd14ea00 --- /dev/null +++ b/app/[locale]/(protected)/admin/analysis/content-management/page.tsx @@ -0,0 +1,196 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; +import { useState } from "react"; +import { addDays, format } from "date-fns"; +import { Calendar as CalendarIcon } from "lucide-react"; +import { DateRange } from "react-day-picker"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; + +const users = [ + { id: 1, name: "POLRI" }, + { id: 2, name: "JURNALIS" }, +]; + +export default function ContentManagement() { + const [startDate, setStartDate] = useState(new Date()); + const [endDate, setEndDate] = useState(new Date()); + + return ( +
+ +
+ {users.map((user) => ( + + + + KONTEN YANG DISIMPAN OLEH PENGGUNA {user.name} INDONESIA + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+ ))} + {users.map((user) => ( + + + + PENAMBAHAN JUMLAH PENGGUNA {user.name} INDONESIA + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+ ))} +
+
+ ); +} diff --git a/app/[locale]/(protected)/admin/analysis/emergency-issue/page.tsx b/app/[locale]/(protected)/admin/analysis/emergency-issue/page.tsx new file mode 100644 index 00000000..620fca5e --- /dev/null +++ b/app/[locale]/(protected)/admin/analysis/emergency-issue/page.tsx @@ -0,0 +1,113 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; +import { useState } from "react"; +import { addDays, format } from "date-fns"; +import { Calendar as CalendarIcon } from "lucide-react"; +import { DateRange } from "react-day-picker"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; + +const users = [ + { id: 1, name: "POLRI" }, + { id: 2, name: "JURNALIS" }, +]; + +export default function EmergencyIssue() { + const [startDate, setStartDate] = useState(new Date()); + const [endDate, setEndDate] = useState(new Date()); + + return ( +
+ +
+ + + + ANALISA BERKAITAN DENGAN AKUN PELAPOR{" "} + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+
+
+ ); +} diff --git a/app/[locale]/(protected)/admin/analysis/feedback-center/page.tsx b/app/[locale]/(protected)/admin/analysis/feedback-center/page.tsx new file mode 100644 index 00000000..bf3cb51c --- /dev/null +++ b/app/[locale]/(protected)/admin/analysis/feedback-center/page.tsx @@ -0,0 +1,113 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; +import { useState } from "react"; +import { addDays, format } from "date-fns"; +import { Calendar as CalendarIcon } from "lucide-react"; +import { DateRange } from "react-day-picker"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; + +const users = [ + { id: 1, name: "POLRI" }, + { id: 2, name: "JURNALIS" }, +]; + +export default function FeedbackCenter() { + const [startDate, setStartDate] = useState(new Date()); + const [endDate, setEndDate] = useState(new Date()); + + return ( +
+ +
+ + + + TICKET PADA FEEDBACK CENTER{" "} + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+
+
+ ); +} diff --git a/app/[locale]/(protected)/admin/analysis/schedule/page.tsx b/app/[locale]/(protected)/admin/analysis/schedule/page.tsx new file mode 100644 index 00000000..06a74a1b --- /dev/null +++ b/app/[locale]/(protected)/admin/analysis/schedule/page.tsx @@ -0,0 +1,330 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; +import { useState } from "react"; +import { addDays, format } from "date-fns"; +import { Calendar as CalendarIcon } from "lucide-react"; +import { DateRange } from "react-day-picker"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; + +export default function ContentManagement() { + const [startDate, setStartDate] = useState(new Date()); + const [endDate, setEndDate] = useState(new Date()); + + return ( +
+ +
+ + + + PUBLISH JADWAL PRESS CONFERENCE TERBANYAK + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+ + + + JUMLAH PRODUKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+ + + + TINGKAT INTERAKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+ + + + AKTIFITAS MEDIA BERKAITAN DENGAN PERS RILIS + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+

Tanggal Mulai

+ + + + + + + + +
+
+
+
+
+
+
+ ); +} diff --git a/app/[locale]/(protected)/admin/management-user/page.tsx b/app/[locale]/(protected)/admin/management-user/page.tsx new file mode 100644 index 00000000..76beb900 --- /dev/null +++ b/app/[locale]/(protected)/admin/management-user/page.tsx @@ -0,0 +1,10 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; + +export default function ManagementUser() { + return ( +
+ +

STATISTIK JUMLAH PENGGUNA

+
+ ); +} diff --git a/app/[locale]/(protected)/admin/performance-polda/page.tsx b/app/[locale]/(protected)/admin/performance-polda/page.tsx new file mode 100644 index 00000000..f3d145fe --- /dev/null +++ b/app/[locale]/(protected)/admin/performance-polda/page.tsx @@ -0,0 +1,10 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; + +export default function PerformancePolda() { + return ( +
+ +

PERFORMANCE KUMULATIF PER POLDA

+
+ ); +} diff --git a/app/[locale]/(protected)/dashboard/executive/page.tsx b/app/[locale]/(protected)/dashboard/executive/page.tsx new file mode 100644 index 00000000..3152a7f8 --- /dev/null +++ b/app/[locale]/(protected)/dashboard/executive/page.tsx @@ -0,0 +1,9 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; + +export default function ExecutiveDashboard() { + return ( +
+ +
+ ); +} diff --git a/lib/menus.ts b/lib/menus.ts index 06f13a35..7d5e8937 100644 --- a/lib/menus.ts +++ b/lib/menus.ts @@ -1692,15 +1692,15 @@ export function getMenuList(pathname: string, t: any): Group[] { submenus: [ { href: "/dashboard", - label: "Executive", + label: "Breakdown", active: pathname === "/dashboard", icon: "heroicons:arrow-trending-up", children: [], }, { - href: "/dashboard/breakdown", - label: "Breakdown", - active: pathname === "/dashboard/breakdown", + href: "/dashboard/executive", + label: "Executive", + active: pathname === "/dashboard/executive", icon: "heroicons:arrow-trending-up", children: [], }, @@ -1728,7 +1728,7 @@ export function getMenuList(pathname: string, t: any): Group[] { menus: [ { id: "management-user-menu", - href: "/adminn/management-user", + href: "/admin/management-user", label: "Management User", active: pathname.includes("/management-user"), icon: "clarity:users-solid", @@ -1790,9 +1790,9 @@ export function getMenuList(pathname: string, t: any): Group[] { icon: "mdi:chart-line", submenus: [ { - href: "/admin/analysis/magement-content", + href: "/admin/analysis/content-management", label: t("management-content"), - active: pathname === "/admin/analysis/magement-content", + active: pathname === "/admin/analysis/content-management", icon: "", children: [], }, @@ -1887,7 +1887,7 @@ export function getMenuList(pathname: string, t: any): Group[] { id: "feedback", href: "/curator/feedback", label: t("feedback"), - active: pathname.includes("/feedback"), + active: pathname.includes("/curator/feedback"), icon: "mdi:feedback-outline", submenus: [], }, diff --git a/messages/en.json b/messages/en.json index b88b12f9..de5b72e7 100644 --- a/messages/en.json +++ b/messages/en.json @@ -297,7 +297,7 @@ "colors": "Colors", "performance-polda": "Performance Polda", "analysis": "Analysis", - "management-content": "Management Content", + "management-content": "Content Management ", "add-experts": "Add Experts" }, "Changelog": { diff --git a/messages/in.json b/messages/in.json index f057ae12..4fa6981b 100644 --- a/messages/in.json +++ b/messages/in.json @@ -297,7 +297,7 @@ "colors": "Colors", "performance-polda": "Performa Polda", "analysis": "Analisa", - "management-content": "Manajemen Konten", + "content-management": "Manajemen Konten", "add-experts": "Tambah Tenaga Ahli" }, "Changelog": { From 8d7f90a48f9ba89f652a351f0442104200b4cc19 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Wed, 1 Jan 2025 21:10:58 +0700 Subject: [PATCH 3/4] feat: update fixing error build --- .eslintrc.json | 3 -- .../supervisor/knowledge-base/page.tsx | 32 +++++++++---------- .../(public)/content-management/page.tsx | 2 +- components/form/content/image-ai-form.tsx | 2 +- components/form/content/image-form.tsx | 4 +-- components/partials/header/notifications.tsx | 1 - eslint.config.mjs | 13 ++++++++ next.config.mjs | 5 +++ 8 files changed, 37 insertions(+), 25 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index bffb357a..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/app/[locale]/(protected)/supervisor/knowledge-base/page.tsx b/app/[locale]/(protected)/supervisor/knowledge-base/page.tsx index fca7d79a..0e49ad74 100644 --- a/app/[locale]/(protected)/supervisor/knowledge-base/page.tsx +++ b/app/[locale]/(protected)/supervisor/knowledge-base/page.tsx @@ -50,24 +50,22 @@ const KnowledgeBase = () => { {categories?.map((category: any, index: number) => ( -
- { - fetchQuestions(category?.id); - }} - className="data-[state=active]:bg-secondary data-[state=active]:text-default rounded-md px-6 py-3 w-full justify-start" + { + fetchQuestions(category?.id); + }} + className="data-[state=active]:bg-secondary data-[state=active]:text-default rounded-md px-6 py-3 w-full justify-start" + > + {category?.name} +
deleteCategory(category?.id)} > - {category?.name} -
deleteCategory(category?.id)} - > - -
- -
+ +
+ ))}
diff --git a/app/[locale]/(public)/content-management/page.tsx b/app/[locale]/(public)/content-management/page.tsx index 387cd808..cdcf5a4f 100644 --- a/app/[locale]/(public)/content-management/page.tsx +++ b/app/[locale]/(public)/content-management/page.tsx @@ -19,7 +19,7 @@ const dummyContent = [ { title: "Operasi Zebra Nataru", thumbnail: "/assets/hot-topik-1.jpg", createdAt: "17 Agustus 2025", timezone: "14:20 WIB", clickCount: "28" }, ]; -const ContentManagement = (props: { type: string }) => { +const ContentManagement = () => { const [profile, setProfile] = useState(); const [province, setProvince] = useState([]); const [, setUser] = useState(); diff --git a/components/form/content/image-ai-form.tsx b/components/form/content/image-ai-form.tsx index 20365b7b..3a9e4f3b 100644 --- a/components/form/content/image-ai-form.tsx +++ b/components/form/content/image-ai-form.tsx @@ -564,7 +564,7 @@ export default function FormImageAI() { JIka Anda tidak Memberikan kata kunci, kami akan secara otomatis membuat kata kunci yang relevan dari kata kunci utama untuk setiap bagian dan menggunakannya untuk membuat artikel. - Untuk menambahkan kata kunci baru, ketik ', + kata kunci'. + Untuk menambahkan kata kunci baru, ketik ', + kata kunci'.