diff --git a/src/app/dev/event/main/status_page/page.tsx b/src/app/dev/event/main/status_page/page.tsx index 1aade7b4..792bfdbc 100644 --- a/src/app/dev/event/main/status_page/page.tsx +++ b/src/app/dev/event/main/status_page/page.tsx @@ -1,13 +1,13 @@ import { Event_StatusPage } from "@/app_modules/event"; -import { Event_getByStatusId } from "@/app_modules/event/fun/get/get_event_by_status_id"; +import { Event_getListByStatusId } from "@/app_modules/event/fun/get/get_list_event_by_status_id"; import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; export default async function Page() { const authorId = await user_getOneUserId(); - const listPublish = await Event_getByStatusId("1", authorId); - const listReview = await Event_getByStatusId("2", authorId); - const listDraft = await Event_getByStatusId("3", authorId); - const listReject = await Event_getByStatusId("4", authorId); + const listPublish = await Event_getListByStatusId("1", authorId); + const listReview = await Event_getListByStatusId("2", authorId); + const listDraft = await Event_getListByStatusId("3", authorId); + const listReject = await Event_getListByStatusId("4", authorId); return ( - {e.title} - {e.lokasi} - {e.EventMaster_TipeAcara.name} - {e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} + {e?.Author?.Profile?.name} + {e?.title} + {e?.lokasi} + {e?.EventMaster_TipeAcara?.name} + {e?.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} {e.tanggal.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, })} @@ -121,23 +121,24 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: MODEL_EVENT[] }) { {peserta?.map((e) => ( - - - - - - - {e?.User?.Profile?.name} - - - - + + + + + + + {e?.User?.Profile?.name} + + + + ))} @@ -164,6 +165,9 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: MODEL_EVENT[] }) {
Aksi
+ +
Author
+
Judul
diff --git a/src/app_modules/admin/event/main/index.tsx b/src/app_modules/admin/event/main/index.tsx index e58afff2..680a3e74 100644 --- a/src/app_modules/admin/event/main/index.tsx +++ b/src/app_modules/admin/event/main/index.tsx @@ -50,13 +50,13 @@ export default function AdminEvent_Main({ path: RouterAdminEvent.table_review, color: "orange", }, - { - id: 3, - name: "Draft", - jumlah: countDraft, - path: "", - color: "yellow", - }, + // { + // id: 3, + // name: "Draft", + // jumlah: countDraft, + // path: "", + // color: "yellow", + // }, { id: 4, name: "Reject", diff --git a/src/app_modules/admin/event/table_status/table_publish.tsx b/src/app_modules/admin/event/table_status/table_publish.tsx index 3e6985b5..646bbae7 100644 --- a/src/app_modules/admin/event/table_status/table_publish.tsx +++ b/src/app_modules/admin/event/table_status/table_publish.tsx @@ -72,15 +72,15 @@ function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) { const TableRows = data.map((e, i) => ( - {e.title} - {e.lokasi} - {e.EventMaster_TipeAcara.name} - {e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} + {e?.Author?.Profile?.name} + {e?.title} + {e?.lokasi} + {e?.EventMaster_TipeAcara?.name} + {e?.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} {e.tanggal.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, })} @@ -121,28 +121,34 @@ function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) { Daftar Peserta - {peserta?.map((e) => ( - - - - - - - - {e?.User?.Profile?.name} - - - - - - ))} + {_.isEmpty(peserta) ? ( +
+ Tidak ada peserta +
+ ) : ( + peserta?.map((e) => ( + + + + + + + + {e?.User?.Profile?.name} + + + + + + )) + )}
@@ -163,6 +169,7 @@ function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) { > + Author Judul Lokasi Tipe Acara diff --git a/src/app_modules/admin/event/table_status/table_reject.tsx b/src/app_modules/admin/event/table_status/table_reject.tsx index e9920a7c..99471bc8 100644 --- a/src/app_modules/admin/event/table_status/table_reject.tsx +++ b/src/app_modules/admin/event/table_status/table_reject.tsx @@ -90,7 +90,6 @@ function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) { {e.tanggal.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, })} diff --git a/src/app_modules/admin/event/table_status/table_review.tsx b/src/app_modules/admin/event/table_status/table_review.tsx index fe4430bf..a3fe6ebc 100644 --- a/src/app_modules/admin/event/table_status/table_review.tsx +++ b/src/app_modules/admin/event/table_status/table_review.tsx @@ -75,7 +75,6 @@ function TableStatus({ listReview }: { listReview: MODEL_EVENT[] }) { {e.tanggal.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, })} @@ -90,7 +89,7 @@ function TableStatus({ listReview }: { listReview: MODEL_EVENT[] }) { color={"green"} leftIcon={} radius={"xl"} - onClick={() => onPublish(e.id, setData)} + onClick={() => onPublish(e.id, setData, e.tanggal)} > Publish @@ -194,7 +193,12 @@ function TableStatus({ listReview }: { listReview: MODEL_EVENT[] }) { ); } -async function onPublish(eventId: string, setData: any) { +async function onPublish(eventId: string, setData: any, tanggal: Date) { + if (moment(tanggal).diff(Date.now(), "minutes") < 0) + return ComponentGlobal_NotifikasiPeringatan( + "Waktu acara telah lewat, Report untuk memberitahu user !" + ); + await AdminEvent_funEditStatusPublishById(eventId, "1").then(async (res) => { if (res.status === 200) { await AdminEvent_getListTableByStatusId("2").then((res) => { diff --git a/src/app_modules/event/component/box_list_status.tsx b/src/app_modules/event/component/box_list_status.tsx index a53c04d7..a3266584 100644 --- a/src/app_modules/event/component/box_list_status.tsx +++ b/src/app_modules/event/component/box_list_status.tsx @@ -1,10 +1,12 @@ "use client"; import { RouterEvent } from "@/app/lib/router_hipmi/router_event"; -import { Paper, Stack, Group, Title, Text, Grid } from "@mantine/core"; +import { Paper, Stack, Group, Title, Text, Grid, Card } from "@mantine/core"; import moment from "moment"; import { MODEL_EVENT } from "../model/interface"; import { useRouter } from "next/navigation"; +import { useState } from "react"; +import ComponentGlobal_CardLoadingOverlay from "@/app_modules/component_global/loading_card"; export default function ComponentEvent_BoxListStatus({ data, @@ -14,15 +16,22 @@ export default function ComponentEvent_BoxListStatus({ path: string; }) { const router = useRouter(); + const [eventId, setEventId] = useState(""); + const [visible, setVisible] = useState(false); + return ( <> - router.push(path + data.id)} + onClick={() => { + setEventId(data?.id); + setVisible(true); + router.push(path + data.id); + }} > @@ -42,7 +51,12 @@ export default function ComponentEvent_BoxListStatus({ {data.deskripsi} - + {visible && eventId !== "" ? ( + + ) : ( + "" + )} + ); } diff --git a/src/app_modules/event/component/detail/detail_main.tsx b/src/app_modules/event/component/detail/detail_main.tsx index 08d49828..004c8ac9 100644 --- a/src/app_modules/event/component/detail/detail_main.tsx +++ b/src/app_modules/event/component/detail/detail_main.tsx @@ -16,74 +16,73 @@ export default function ComponentEvent_DetailMainData({ const jam = tgl.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", - hour12: false, }); return ( <> - - - - {data ? data.title : null} - - + + + + {data ? data.title : null} + + + + Lokasi + + + : + + {data ? data.lokasi : null} + + + + + + Tipe Acara + + + : + + {data ? data.EventMaster_TipeAcara.name : null} + + + + + + Tanggal + + + : + {hari} + + + + + Jam + + + : + {jam} + + - Lokasi + Deskripsi - - : - - {data ? data.lokasi : null} - - - - - - Tipe Acara - - - : - - {data ? data.EventMaster_TipeAcara.name : null} - - - - - - Tanggal - - - : - {hari} - - - - - Jam - - - : - {jam} - - - - Deskripsi - - - {data ? data.deskripsi : null} - + + {data ? data.deskripsi : null} + + - ); diff --git a/src/app_modules/event/create/create.tsx b/src/app_modules/event/create/create.tsx index 13d82d53..aa1008c5 100644 --- a/src/app_modules/event/create/create.tsx +++ b/src/app_modules/event/create/create.tsx @@ -36,6 +36,7 @@ import toast from "react-simple-toasts"; import moment from "moment"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input"; +import ComponentGlobal_InputCountDown from "@/app_modules/component_global/input_countdown"; export default function Event_Create({ listTipeAcara, @@ -69,13 +70,6 @@ export default function Event_Create({ placeholder="Masukan judul" withAsterisk maxLength={100} - error={ - value.title.length >= 100 ? ( - - ) : ( - "" - ) - } onChange={(val) => { setValue({ ...value, @@ -104,13 +98,6 @@ export default function Event_Create({ placeholder="Masukan lokasi acara" withAsterisk maxLength={100} - error={ - value.lokasi.length >= 100 ? ( - - ) : ( - "" - ) - } onChange={(val) => { setValue({ ...value, @@ -146,33 +133,38 @@ export default function Event_Create({ }); }} /> -