From 71d227538705e3d6c4bbd6cfd75e299533150966 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 24 Jul 2024 12:06:45 +0800 Subject: [PATCH 1/6] simpan --- .gitignore | 3 +++ src/app_modules/auth/validasi/view.tsx | 3 ++- src/app_modules/katalog/profile/create/view.tsx | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 786b7c83..87e72d97 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ npm-debug.log* rn-debug.log* yarn-error.log* +# env +.env + # local env files .env*.local diff --git a/src/app_modules/auth/validasi/view.tsx b/src/app_modules/auth/validasi/view.tsx index 502b62c7..40398736 100644 --- a/src/app_modules/auth/validasi/view.tsx +++ b/src/app_modules/auth/validasi/view.tsx @@ -48,7 +48,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) { if (res.role === "1") { ComponentGlobal_NotifikasiBerhasil(res.message); setLoading(true); - router.push(RouterHome.main_home, {scroll: false}); + router.push(RouterHome.main_home, { scroll: false }); } else { router.push(RouterAdminDashboard.splash_admin); } @@ -102,6 +102,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
router.push(RouterHome.main_home), 2000); + // setTimeout(() => router.push(RouterHome.main_home), 2000); + router.push(RouterHome.main_home); } else { ComponentGlobal_NotifikasiGagal(res.message); } From 6bdacd137ef8b17783ecea7a663a0358e0dbe311 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Wed, 24 Jul 2024 12:07:41 +0800 Subject: [PATCH 2/6] simpan --- .env | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 85072cdf..00000000 --- a/.env +++ /dev/null @@ -1,10 +0,0 @@ -# Environment variables declared in this file are automatically made available to Prisma. -# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema - -# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. -# See the documentation for all the connection string options: https://pris.ly/d/connection-strings - -DATABASE_URL="postgresql://bip:Production_123@localhost:5433/hipmi?schema=public" -PWD="QWERTYUIOPLKJHGFDSAZXCVBNMQAZWSXEDCRFVTGBYHNUJMIKOLPPOIUYTREWQLKJHGFDSAMNBVCXZlghvftyguhijknhbgvcfytguu8okjnhbgvfty7u8oilkjnhgvtygu7u8ojilnkhbgvhujnkhghvjhukjnhb" -Client_KEY="SB-Mid-client-9NDTxltqdZrEB9m-" -Server_KEY="SB-Mid-server-NyltU-U7fLVQd1nv1LWBKylr" \ No newline at end of file From f336e8ad30bad7d34fdc563a2db189556707d02e Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Thu, 25 Jul 2024 10:15:21 +0800 Subject: [PATCH 3/6] # fix ## Deskripsi : - Prisma seeder ### No Issue --- .gitignore | 6 +- .../fun/get/get_list_table_by_status_id.ts | 8 +-- src/app_modules/admin/layout.tsx | 13 ++++ src/app_modules/admin/list_page.tsx | 10 +-- .../admin/notifikasi/route_setting/event.ts | 28 +++++++++ src/app_modules/event/create/create.tsx | 35 +++++++++-- src/app_modules/event/detail/draft/index.tsx | 62 ++++++++++++------- src/app_modules/event/detail/review/index.tsx | 52 +++++++++++----- .../event/fun/create/fun_create.ts | 11 ++++ .../event/fun/edit/fun_edit_status_by_id.ts | 20 +++++- .../vote/fun/edit/fun_edit_status_by_id.ts | 2 - 11 files changed, 185 insertions(+), 62 deletions(-) create mode 100644 src/app_modules/admin/notifikasi/route_setting/event.ts diff --git a/.gitignore b/.gitignore index 87e72d97..76fc4102 100644 --- a/.gitignore +++ b/.gitignore @@ -25,12 +25,12 @@ npm-debug.log* rn-debug.log* yarn-error.log* -# env -.env - # local env files .env*.local +# env +.env + # vercel .vercel diff --git a/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts b/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts index 5e04a9a6..56cb6cc5 100644 --- a/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts +++ b/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts @@ -11,9 +11,8 @@ export async function AdminEvent_getListTableByStatusId(statudId: string) { where: { eventMaster_StatusId: "1", tanggal: { - gte: new Date - } - + gte: new Date(), + }, }, select: { id: true, @@ -52,10 +51,11 @@ export async function AdminEvent_getListTableByStatusId(statudId: string) { if (statudId === "2") { const getReview = await prisma.event.findMany({ orderBy: { - createdAt: "desc", + updatedAt: "desc", }, where: { eventMaster_StatusId: "2", + active: true, }, select: { id: true, diff --git a/src/app_modules/admin/layout.tsx b/src/app_modules/admin/layout.tsx index 8f5e261b..d9bea8d8 100644 --- a/src/app_modules/admin/layout.tsx +++ b/src/app_modules/admin/layout.tsx @@ -52,6 +52,7 @@ import adminNotifikasi_funUpdateIsReadById from "./notifikasi/fun/update/fun_upd import adminNotifikasi_findRouterJob from "./notifikasi/route_setting/job"; import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum"; import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting"; +import { adminNotifikasi_findRouterEvent } from "./notifikasi/route_setting/event"; export default function AdminLayout({ children, @@ -428,6 +429,18 @@ function DrawerNotifikasi({ }, }); + e?.kategoriApp === "EVENT" && + adminNotifikasi_findRouterEvent({ + data: e, + router: router, + onChangeNavbar(val) { + onChangeNavbar(val); + }, + onToggleNavbar(val) { + onToggleNavbar(val); + }, + }); + const updateIsRead = await adminNotifikasi_funUpdateIsReadById({ notifId: e?.id, }); diff --git a/src/app_modules/admin/list_page.tsx b/src/app_modules/admin/list_page.tsx index d7e09358..8fdd5160 100644 --- a/src/app_modules/admin/list_page.tsx +++ b/src/app_modules/admin/list_page.tsx @@ -9,24 +9,20 @@ import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote"; import { RouterAdminUserAccess } from "@/app/lib/router_admin/router_admn_user_acces"; import { RouterAdminAppInformation } from "@/app/lib/router_admin/router_app_information"; import { - RouterAdminDashboard, - RouterAdminDonasi_OLD, - RouterAdminInvestasi_OLD, + RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin"; import { IconAffiliate, IconBriefcase, IconDashboard, IconDeviceMobile, - IconMessages, - IconUserCog, -} from "@tabler/icons-react"; -import { IconHeartHandshake, IconHome, + IconMessages, IconMoneybag, IconPackageImport, IconPresentation, + IconUserCog, } from "@tabler/icons-react"; export const listAdminPage = [ diff --git a/src/app_modules/admin/notifikasi/route_setting/event.ts b/src/app_modules/admin/notifikasi/route_setting/event.ts new file mode 100644 index 00000000..15f55fd0 --- /dev/null +++ b/src/app_modules/admin/notifikasi/route_setting/event.ts @@ -0,0 +1,28 @@ +import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event"; +import { RouterAdminVote } from "@/app/lib/router_admin/router_admin_vote"; +import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; + +export async function adminNotifikasi_findRouterEvent({ + data, + router, + onChangeNavbar, + onToggleNavbar, +}: { + data: MODEL_NOTIFIKASI; + router: AppRouterInstance; + onChangeNavbar: (val: any) => void; + onToggleNavbar: (val: any) => void; +}) { + const path = RouterAdminEvent.table_review + + if (data.status === "Review") { + router.push(path, { scroll: false }); + onChangeNavbar({ + id: 4, + childId: 43, + }); + } + + onToggleNavbar(true); +} diff --git a/src/app_modules/event/create/create.tsx b/src/app_modules/event/create/create.tsx index f3c0f629..5ab7a90c 100644 --- a/src/app_modules/event/create/create.tsx +++ b/src/app_modules/event/create/create.tsx @@ -16,6 +16,8 @@ import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input" import { Event_funCreate } from "../fun/create/fun_create"; import { gs_event_hotMenu, gs_event_status } from "../global_state"; import { MainColor } from "@/app_modules/_global/color/color_pallet"; +import mqtt_client from "@/util/mqtt_client"; +import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin"; export default function Event_Create({ listTipeAcara, @@ -175,7 +177,7 @@ export default function Event_Create({ radius={"xl"} mt={"xl"} onClick={() => { - onSave(router, setTabsStatus, value, setHotMenu, setLoading) + onSave(router, setTabsStatus, value, setHotMenu, setLoading); }} bg={MainColor.yellow} color="yellow" @@ -205,15 +207,36 @@ async function onSave( // ) // return null; - await Event_funCreate(value).then((res) => { - if (res.status === 201) { + const res = await Event_funCreate(value); + if (res.status === 201) { + const dataNotif: any = { + appId: res.data?.id as any, + status: res.data?.EventMaster_Status?.name as any, + userId: res.data?.authorId as any, + pesan: res.data?.title as any, + kategoriApp: "EVENT", + title: "Event baru", + }; + + const notif = await notifikasiToAdmin_funCreate({ + data: dataNotif as any, + }); + + if (notif.status === 201) { + mqtt_client.publish( + "ADMIN", + JSON.stringify({ + count: 1, + }) + ); + ComponentGlobal_NotifikasiBerhasil(res.message); setTabsStatus("Review"); setHotMenu(1); setLoading(true); router.push(RouterEvent.status_page); - } else { - ComponentGlobal_NotifikasiGagal(res.message); } - }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } diff --git a/src/app_modules/event/detail/draft/index.tsx b/src/app_modules/event/detail/draft/index.tsx index 72e1907b..6eb84a28 100644 --- a/src/app_modules/event/detail/draft/index.tsx +++ b/src/app_modules/event/detail/draft/index.tsx @@ -1,24 +1,22 @@ "use client"; -import { Button, Group, Modal, Stack, Title } from "@mantine/core"; +import { Button, Group, Stack } from "@mantine/core"; import ComponentEvent_DetailData from "../../component/detail/detail_data"; - -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; -import { useAtom } from "jotai"; -import { gs_event_status } from "../../global_state"; -import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { MODEL_EVENT } from "../../model/interface"; -import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id"; -import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; -import React, { useState } from "react"; -import ComponentEvent_CatatanReject from "../../component/catatan_reject"; -import { useRouter } from "next/navigation"; -import moment from "moment"; -import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; -import { Event_funDeleteById } from "../../fun/delete/fun_delete"; -import { useDisclosure } from "@mantine/hooks"; -import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal"; import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; +import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal"; +import { useAtom } from "jotai"; +import moment from "moment"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { Event_funDeleteById } from "../../fun/delete/fun_delete"; +import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id"; +import { gs_event_status } from "../../global_state"; +import { MODEL_EVENT } from "../../model/interface"; +import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin"; +import mqtt_client from "@/util/mqtt_client"; export default function Event_DetailDraft({ dataEvent, @@ -70,16 +68,36 @@ function ButtonAction({ eventId, tanggal }: { eventId: string; tanggal: any }) { if (moment(tanggal.toISOString().toString()).diff(moment(), "minutes") < 0) return ComponentGlobal_NotifikasiPeringatan("Waktu acara telah lewat"); - await Event_funEditStatusById("2", eventId).then((res) => { - if (res.status === 200) { + const res = await Event_funEditStatusById("2", eventId); + if (res.status === 200) { + const dataNotif: any = { + appId: res.data?.id as any, + status: res.data?.EventMaster_Status?.name as any, + userId: res.data?.authorId as any, + pesan: res.data?.title as any, + kategoriApp: "EVENT", + title: "Mengajukan review", + }; + + const notif = await notifikasiToAdmin_funCreate({ + data: dataNotif as any, + }); + + if (notif.status === 201) { + mqtt_client.publish( + "ADMIN", + JSON.stringify({ + count: 1, + }) + ); ComponentGlobal_NotifikasiBerhasil(res.message, 2000); setTabsStatus("Review"); setLoadingAjukan(true); router.back(); - } else { - ComponentGlobal_NotifikasiGagal(res.message); } - }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } return ( diff --git a/src/app_modules/event/detail/review/index.tsx b/src/app_modules/event/detail/review/index.tsx index bebb500f..489db857 100644 --- a/src/app_modules/event/detail/review/index.tsx +++ b/src/app_modules/event/detail/review/index.tsx @@ -1,18 +1,19 @@ "use client"; -import { Button, Stack } from "@mantine/core"; -import ComponentEvent_DetailData from "../../component/detail/detail_data"; -import { useRouter } from "next/navigation"; -import { useAtom } from "jotai"; -import { gs_event_status } from "../../global_state"; -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; -import { MODEL_EVENT } from "../../model/interface"; -import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; -import ComponentEvent_CatatanReject from "../../component/catatan_reject"; -import { useState } from "react"; import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal"; +import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin"; +import mqtt_client from "@/util/mqtt_client"; +import { Button, Stack } from "@mantine/core"; +import { useAtom } from "jotai"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import ComponentEvent_DetailData from "../../component/detail/detail_data"; +import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id"; +import { gs_event_status } from "../../global_state"; +import { MODEL_EVENT } from "../../model/interface"; export default function Event_DetailReview({ dataEvent, @@ -75,14 +76,35 @@ async function onClick( eventId: string, setLoading: any ) { - await Event_funEditStatusById("3", eventId).then((res) => { - if (res.status === 200) { + const res = await Event_funEditStatusById("3", eventId); + if (res.status === 200) { + const dataNotif: any = { + appId: res.data?.id as any, + status: res.data?.EventMaster_Status?.name as any, + userId: res.data?.authorId as any, + pesan: res.data?.title as any, + kategoriApp: "EVENT", + title: "Membatalkan review", + }; + + const notif = await notifikasiToAdmin_funCreate({ + data: dataNotif as any, + }); + + if (notif.status === 201) { + mqtt_client.publish( + "ADMIN", + JSON.stringify({ + count: 1, + }) + ); + ComponentGlobal_NotifikasiBerhasil(res.message, 1500); setTabsStatus("Draft"); setLoading(true); router.back(); - } else { - ComponentGlobal_NotifikasiGagal(res.message); } - }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } diff --git a/src/app_modules/event/fun/create/fun_create.ts b/src/app_modules/event/fun/create/fun_create.ts index 327c0e82..6f87d9a0 100644 --- a/src/app_modules/event/fun/create/fun_create.ts +++ b/src/app_modules/event/fun/create/fun_create.ts @@ -14,11 +14,22 @@ export async function Event_funCreate(req: MODEL_EVENT) { tanggal: req.tanggal, authorId: req.authorId, }, + select: { + id: true, + title: true, + EventMaster_Status: { + select: { + name: true, + } + }, + authorId: true, + } }); if (!res) return { status: 400, message: "Gagal Disimpan" }; revalidatePath("/dev/event/main/status_page"); return { + data: res, status: 201, message: "Berhasil Disimpan", }; diff --git a/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts b/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts index 64e01170..a6ecd2e5 100644 --- a/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts +++ b/src/app_modules/event/fun/edit/fun_edit_status_by_id.ts @@ -4,13 +4,16 @@ import prisma from "@/app/lib/prisma"; import { revalidatePath } from "next/cache"; /** - * + * * @param statusid | Review: 2, Draft: 3, Reject: 4 - * @param eventId + * @param eventId * @type string * @returns Update status id dari setiap event */ -export async function Event_funEditStatusById(statusid: string, eventId: string) { +export async function Event_funEditStatusById( + statusid: string, + eventId: string +) { const updt = await prisma.event.update({ where: { id: eventId, @@ -18,11 +21,22 @@ export async function Event_funEditStatusById(statusid: string, eventId: string) data: { eventMaster_StatusId: statusid, }, + select: { + id: true, + title: true, + authorId: true, + EventMaster_Status: { + select: { + name: true, + }, + }, + }, }); if (!updt) return { status: 400, message: "Gagal Update Status" }; revalidatePath("/dev/event/main/status_page"); return { + data: updt, status: 200, message: "Berhasil Update Status", }; diff --git a/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts b/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts index cf4e73fc..1a3cf888 100644 --- a/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts +++ b/src/app_modules/vote/fun/edit/fun_edit_status_by_id.ts @@ -1,8 +1,6 @@ "use server"; import prisma from "@/app/lib/prisma"; -import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; -import { data } from "autoprefixer"; import { revalidatePath } from "next/cache"; export async function Vote_funEditStatusByStatusId( From 01114e8405cff27f1002e1c6f9fc75f743f9a161 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Thu, 25 Jul 2024 15:06:14 +0800 Subject: [PATCH 4/6] # feat: ## Deskripsi: - Notifikasi admin to user - Notifikasi user to user ### Issue: - Pada table admin harus di sediakan untuk triger update data saat ada notifikasi --- .../dev/event/detail/publish/[id]/loading.tsx | 9 -- .../dev/event/detail/publish/[id]/page.tsx | 13 ++- .../fun/edit/fun_edit_status_publish_by_id.ts | 12 +- .../fun/edit/fun_edit_status_reject_by_id.ts | 13 ++- src/app_modules/admin/event/main/index.tsx | 15 +-- .../admin/event/table_status/table_review.tsx | 110 +++++++++++------- .../component/card_view/card_riwayat.tsx | 7 +- src/app_modules/event/create/create.tsx | 2 +- .../event/detail/main_detail/index.tsx | 56 ++++++--- .../event/detail/publish/index.tsx | 11 +- .../event/detail/publish/layout.tsx | 8 +- src/app_modules/event/edit/index.tsx | 2 +- .../event/fun/create/fun_join_event.ts | 15 ++- .../event/fun/get/get_list_all_publish.ts | 8 +- src/app_modules/event/global_state/index.ts | 9 ++ src/app_modules/home/component/ui_home.tsx | 20 +++- .../notifikasi/component/card_view.tsx | 31 +++-- .../notifikasi/component/path/event.ts | 36 ++++++ .../notifikasi/component/ui_notifiaksi.tsx | 38 +++--- x.sh | 1 + 20 files changed, 292 insertions(+), 124 deletions(-) delete mode 100644 src/app/dev/event/detail/publish/[id]/loading.tsx create mode 100644 src/app_modules/notifikasi/component/path/event.ts create mode 100644 x.sh diff --git a/src/app/dev/event/detail/publish/[id]/loading.tsx b/src/app/dev/event/detail/publish/[id]/loading.tsx deleted file mode 100644 index 380b3fcd..00000000 --- a/src/app/dev/event/detail/publish/[id]/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app/dev/event/detail/publish/[id]/page.tsx b/src/app/dev/event/detail/publish/[id]/page.tsx index 2e3de6da..e3f7347d 100644 --- a/src/app/dev/event/detail/publish/[id]/page.tsx +++ b/src/app/dev/event/detail/publish/[id]/page.tsx @@ -1,9 +1,20 @@ import { Event_DetailPublish } from "@/app_modules/event"; +import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id"; +import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id"; import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; export default async function Page({ params }: { params: { id: string } }) { let eventId = params.id; const dataEvent = await Event_getOneById(eventId); + const listPeserta = await Event_getListPesertaById(eventId); + const totalPeserta = await Event_countTotalPesertaById(eventId); - return ; + + return ( + + ); } diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts index 05e8baab..01d85962 100644 --- a/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts +++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts @@ -7,7 +7,6 @@ export async function AdminEvent_funEditStatusPublishById( eventId: string, statusId: string ) { - console.log(eventId); const updt = await prisma.event.update({ where: { id: eventId, @@ -15,11 +14,22 @@ export async function AdminEvent_funEditStatusPublishById( data: { eventMaster_StatusId: statusId, }, + select: { + id: true, + title: true, + authorId: true, + EventMaster_Status: { + select: { + name: true, + }, + }, + } }); if (!updt) return { status: 400, message: "Update Gagal" }; revalidatePath("/dev/admin/event/main"); return { + data: updt, status: 200, message: "Berhasil Update Status", }; diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts index ba8603c8..28961c33 100644 --- a/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts +++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts @@ -14,13 +14,24 @@ export async function AdminEvent_funEditCatatanById( }, data: { eventMaster_StatusId: statudId, - catatan: data.catatan + catatan: data.catatan, + }, + select: { + id: true, + title: true, + authorId: true, + EventMaster_Status: { + select: { + name: true, + }, + }, }, }); if (!updt) return { status: 400, message: "Update Gagal" }; revalidatePath("/dev/admin/event/main"); return { + data: updt, status: 200, message: "Berhasil Update Status", }; diff --git a/src/app_modules/admin/event/main/index.tsx b/src/app_modules/admin/event/main/index.tsx index acb7a734..1f4cb67e 100644 --- a/src/app_modules/admin/event/main/index.tsx +++ b/src/app_modules/admin/event/main/index.tsx @@ -3,18 +3,13 @@ import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event"; import { - Stack, - Title, - Divider, - SimpleGrid, - Paper, - Center, - Text, - Box, Group, - ActionIcon, + Paper, + SimpleGrid, + Stack, + Text, + Title } from "@mantine/core"; -import { IconChevronsRight } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; 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 01a8dbdc..74477536 100644 --- a/src/app_modules/admin/event/table_status/table_review.tsx +++ b/src/app_modules/admin/event/table_status/table_review.tsx @@ -1,8 +1,6 @@ "use client"; -import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin"; import { - ActionIcon, Box, Button, Center, @@ -11,37 +9,27 @@ import { Spoiler, Stack, Table, - Text, - TextInput, Textarea, Title, } from "@mantine/core"; -import { - IconBan, - IconChevronLeft, - IconEyeCheck, - IconEyeShare, - IconShare, -} from "@tabler/icons-react"; +import { IconBan, IconEyeShare } from "@tabler/icons-react"; import { useRouter } from "next/navigation"; import { useDisclosure } from "@mantine/hooks"; -import { useState } from "react"; -import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah"; -import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali"; -import { MODEL_EVENT } from "@/app_modules/event/model/interface"; -import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; -import moment from "moment"; -import _ from "lodash"; -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; -import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id"; -import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil"; import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal"; -import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id"; import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan"; - +import { MODEL_EVENT } from "@/app_modules/event/model/interface"; +import mqtt_client from "@/util/mqtt_client"; +import _ from "lodash"; +import moment from "moment"; +import { useState } from "react"; +import ComponentAdminGlobal_HeaderTamplate from "../../component_global/header_tamplate"; +import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user"; +import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id"; +import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id"; +import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id"; export default function AdminEvent_TableReview({ listReview, }: { @@ -197,16 +185,35 @@ async function onPublish(eventId: string, setData: any, tanggal: Date) { "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) => { - setData(res); - ComponentGlobal_NotifikasiBerhasil("Berhasil update status"); - }); - } else { - ComponentGlobal_NotifikasiGagal(res.message); + const res = await AdminEvent_funEditStatusPublishById(eventId, "1"); + if (res.status === 200) { + const dataNotif = { + appId: res.data?.id, + status: res.data?.EventMaster_Status?.name as any, + userId: res.data?.authorId as any, + pesan: res.data?.title as any, + kategoriApp: "EVENT", + title: "Event publish", + }; + + const notif = await adminNotifikasi_funCreateToUser({ + data: dataNotif as any, + }); + + if (notif.status === 201) { + mqtt_client.publish( + "USER", + JSON.stringify({ userId: res?.data?.authorId, count: 1 }) + ); } - }); + + await AdminEvent_getListTableByStatusId("2").then((res) => { + setData(res); + ComponentGlobal_NotifikasiBerhasil("Berhasil update status"); + }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } async function onReject( @@ -222,15 +229,34 @@ async function onReject( catatan: catatan, }; - await AdminEvent_funEditCatatanById(body as any, "4").then(async (res) => { - if (res.status === 200) { - await AdminEvent_getListTableByStatusId("2").then((val) => { - setData(val); - ComponentGlobal_NotifikasiBerhasil(res.message); - close(); - }); - } else { - ComponentGlobal_NotifikasiGagal(res.message); + const res = await AdminEvent_funEditCatatanById(body as any, "4"); + if (res.status === 200) { + const dataNotif = { + appId: res.data?.id, + status: res.data?.EventMaster_Status?.name as any, + userId: res.data?.authorId as any, + pesan: res.data?.title as any, + kategoriApp: "EVENT", + title: "Event anda di tolak !", + }; + + const notif = await adminNotifikasi_funCreateToUser({ + data: dataNotif as any, + }); + + if (notif.status === 201) { + mqtt_client.publish( + "USER", + JSON.stringify({ userId: res?.data?.authorId, count: 1 }) + ); } - }); + + await AdminEvent_getListTableByStatusId("2").then((val) => { + setData(val); + ComponentGlobal_NotifikasiBerhasil(res.message); + close(); + }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } diff --git a/src/app_modules/event/component/card_view/card_riwayat.tsx b/src/app_modules/event/component/card_view/card_riwayat.tsx index b2f7964e..541eebdf 100644 --- a/src/app_modules/event/component/card_view/card_riwayat.tsx +++ b/src/app_modules/event/component/card_view/card_riwayat.tsx @@ -1,12 +1,13 @@ import { RouterEvent } from "@/app/lib/router_hipmi/router_event"; import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header"; import { AccentColor } from "@/app_modules/_global/color/color_pallet"; -import { Card, Stack, Grid, Title, Text, Group } from "@mantine/core"; -import moment from "moment"; -import router from "next/router"; +import { Card, Group, Stack, Text, Title } from "@mantine/core"; + +import { useRouter } from "next/navigation"; import { MODEL_EVENT } from "../../model/interface"; export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) { + const router = useRouter(); return ( <> {/*
{JSON.stringify(value, null, 2)}
*/} - + { - if (res.status === 200) { - await Event_getListPesertaById(eventId).then(async (val) => { - await Event_countTotalPesertaById(eventId).then((ttl) => { - setPeserta(val); - setTotal(ttl); - setLoading(true); - ComponentGlobal_NotifikasiBerhasil(res.message, 2000); - }); + const userLoginId = userId; + + const res = await Event_funJoinEvent(body as any); + if (res.status === 200) { + if (userLoginId !== res.data?.Event?.authorId) { + const dataNotif = { + appId: res?.data?.Event?.id, + userId: res?.data?.Event?.authorId, + pesan: res?.data?.Event?.title, + status: "Peserta event", + kategoriApp: "EVENT", + title: "Peserta baru telah masuk !", + }; + + const createNotifikasi = await notifikasiToUser_funCreate({ + data: dataNotif as any, }); - } else { - ComponentGlobal_NotifikasiGagal(res.message); + + if (createNotifikasi.status === 201) { + mqtt_client.publish( + "USER", + JSON.stringify({ + userId: dataNotif.userId, + count: 1, + }) + ); + } } - }); + + const resPeserta = await Event_getListPesertaById(eventId); + setPeserta(resPeserta); + + const resTotal = await Event_countTotalPesertaById(eventId); + setTotal(resTotal); + setLoading(true); + ComponentGlobal_NotifikasiBerhasil(res.message, 2000); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } diff --git a/src/app_modules/event/detail/publish/index.tsx b/src/app_modules/event/detail/publish/index.tsx index 006013de..9afb7e66 100644 --- a/src/app_modules/event/detail/publish/index.tsx +++ b/src/app_modules/event/detail/publish/index.tsx @@ -1,18 +1,25 @@ "use client"; -import { Button, Grid, Group, Stack, Text, Title } from "@mantine/core"; -import moment from "moment"; import ComponentEvent_DetailData from "../../component/detail/detail_data"; +import ComponentEvent_ListPeserta from "../../component/detail/list_peserta"; import { MODEL_EVENT } from "../../model/interface"; export default function Event_DetailPublish({ dataEvent, + listPeserta, + totalPeserta, }: { dataEvent: MODEL_EVENT; + listPeserta: any[]; + totalPeserta: number; }) { return ( <> + ); } diff --git a/src/app_modules/event/detail/publish/layout.tsx b/src/app_modules/event/detail/publish/layout.tsx index 7c092370..a0f701fb 100644 --- a/src/app_modules/event/detail/publish/layout.tsx +++ b/src/app_modules/event/detail/publish/layout.tsx @@ -4,6 +4,8 @@ import { AppShell } from "@mantine/core"; import React from "react"; import ComponentEvent_HeaderTamplate from "../../component/header_tamplate"; import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"; +import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"; +import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"; export default function LayoutEvent_DetailPublish({ children, @@ -12,11 +14,11 @@ export default function LayoutEvent_DetailPublish({ }) { return ( <> - } + } > {children} - + ); } diff --git a/src/app_modules/event/edit/index.tsx b/src/app_modules/event/edit/index.tsx index cc859fa4..b9d424e9 100644 --- a/src/app_modules/event/edit/index.tsx +++ b/src/app_modules/event/edit/index.tsx @@ -37,7 +37,7 @@ export default function Event_Edit({ return ( <> {/*
{JSON.stringify(value, null, 2)}
*/} - + ("gs_status_event", "Publish") + +/** + * @param riwayat | "Semua", "Saya" + * @type string + */ export const gs_event_riwayat = atomWithStorage("gs_event_riwayat", "Semua") \ No newline at end of file diff --git a/src/app_modules/home/component/ui_home.tsx b/src/app_modules/home/component/ui_home.tsx index 19faf8ed..4682d48a 100644 --- a/src/app_modules/home/component/ui_home.tsx +++ b/src/app_modules/home/component/ui_home.tsx @@ -153,7 +153,7 @@ export function Home_UiView({ e.icon )} - + {e.name} @@ -162,7 +162,6 @@ export function Home_UiView({ {/* Job View */} - - + {e?.Author.username} - + {e?.title} @@ -303,7 +307,11 @@ export function Home_UiFooter({ dataUser }: { dataUser: MODEL_USER }) { e.icon )} - + {e.name}
@@ -347,7 +355,7 @@ export function Home_UiFooter({ dataUser }: { dataUser: MODEL_USER }) { /> )} - + Profile
diff --git a/src/app_modules/notifikasi/component/card_view.tsx b/src/app_modules/notifikasi/component/card_view.tsx index ff0552fd..b3d64292 100644 --- a/src/app_modules/notifikasi/component/card_view.tsx +++ b/src/app_modules/notifikasi/component/card_view.tsx @@ -13,6 +13,7 @@ import { } from "@/app_modules/_global/color/color_pallet"; import notifikasi_getByUserId from "../fun/get/get_notifiaksi_by_id"; import { redirectVotingPage } from "./path/voting"; +import { redirectEventPage } from "./path/event"; export function ComponentNotifiaksi_CardView({ data, @@ -41,6 +42,18 @@ export function ComponentNotifiaksi_CardView({ }} my={"xs"} onClick={async () => { + + await notifikasi_funUpdateIsReadById({ + notifId: data?.id, + }); + + // if (updateIsRead.status === 200) { + // const loadData = await notifikasi_getByUserId({ + // page: activePage + 1, + // }); + // onLoadData(loadData); + // } + data?.kategoriApp === "JOB" && redirectJobPage({ data: data, @@ -65,16 +78,14 @@ export function ComponentNotifiaksi_CardView({ }, }); - const updateIsRead = await notifikasi_funUpdateIsReadById({ - notifId: data?.id, - }); - - if (updateIsRead.status === 200) { - // console.log(updateIsRead.status); - // const loadData = await notifikasi_getByUserId({ page: activePage }); - // onLoadData(loadData); - // console.log("berhasil load") - } + data?.kategoriApp === "EVENT" && + redirectEventPage({ + data: data, + router: router, + onSetPage(val) { + onSetMenu(val); + }, + }); }} > {/*
{JSON.stringify(e, null, 2)}
*/} diff --git a/src/app_modules/notifikasi/component/path/event.ts b/src/app_modules/notifikasi/component/path/event.ts new file mode 100644 index 00000000..5f83f9c2 --- /dev/null +++ b/src/app_modules/notifikasi/component/path/event.ts @@ -0,0 +1,36 @@ +import { RouterEvent } from "@/app/lib/router_hipmi/router_event"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; +import { MODEL_NOTIFIKASI } from "../../model/interface"; + +export function redirectEventPage({ + data, + router, + onSetPage, +}: { + data: MODEL_NOTIFIKASI; + router: AppRouterInstance; + onSetPage: (val: any) => void; +}) { + const path = RouterEvent.status_page; + + if (data.status === "Publish") { + onSetPage({ + menuId: 2, + status: data.status, + }); + router.push(path, { scroll: false }); + } + // console.log(data) + + if (data.status === "Reject") { + onSetPage({ + menuId: 2, + status: data.status, + }); + router.push(path, { scroll: false }); + } + + if (data.status === "Peserta event") { + router.push(RouterEvent.detail_main + data.appId, { scroll: false }); + } +} diff --git a/src/app_modules/notifikasi/component/ui_notifiaksi.tsx b/src/app_modules/notifikasi/component/ui_notifiaksi.tsx index 57db3e55..c283c33b 100644 --- a/src/app_modules/notifikasi/component/ui_notifiaksi.tsx +++ b/src/app_modules/notifikasi/component/ui_notifiaksi.tsx @@ -16,6 +16,10 @@ import { gs_vote_hotMenu, gs_vote_status, } from "@/app_modules/vote/global_state"; +import { + gs_event_hotMenu, + gs_event_status, +} from "@/app_modules/event/global_state"; export function Notifikasi_UiView({ listNotifikasi, @@ -29,20 +33,22 @@ export function Notifikasi_UiView({ const [jobMenuId, setJobMenuId] = useAtom(gs_job_hot_menu); const [jobStatus, setJobStatus] = useAtom(gs_job_status); const [voteMenu, setVoteMenu] = useAtom(gs_vote_hotMenu); - const [voeStatus, setVoteStatus] = useAtom(gs_vote_status); + const [voteStatus, setVoteStatus] = useAtom(gs_vote_status); + const [eventMenu, setEventMenu] = useAtom(gs_event_hotMenu); + const [eventStatus, setEventStatus] = useAtom(gs_event_status); - useShallowEffect(() => { - onLoadData({ - onLoad(val) { - setData(val); - }, - }); - }, []); + // useShallowEffect(() => { + // onLoadData({ + // onLoad(val) { + // setData(val); + // }, + // }); + // }, []); - async function onLoadData({ onLoad }: { onLoad: (val: any) => void }) { - const loadData = await notifikasi_getByUserId({ page: 1 }); - onLoad(loadData); - } + // async function onLoadData({ onLoad }: { onLoad: (val: any) => void }) { + // const loadData = await notifikasi_getByUserId({ page: 1 }); + // onLoad(loadData); + // } return ( <> @@ -71,17 +77,23 @@ export function Notifikasi_UiView({ {(item) => ( setData(val)} + onLoadData={setData} activePage={activePage} onSetMenu={(val) => { if (item?.kategoriApp === "JOB") { setJobMenuId(val.menuId); setJobStatus(val.status); } + if (item?.kategoriApp === "VOTING") { setVoteMenu(val.menuId); setVoteStatus(val.status); } + + if (item?.kategoriApp === "EVENT") { + setEventMenu(val.menuId); + setEventStatus(val.status); + } }} /> )} diff --git a/x.sh b/x.sh new file mode 100644 index 00000000..7eb36730 --- /dev/null +++ b/x.sh @@ -0,0 +1 @@ +# Test sh \ No newline at end of file From 810ce1c00d69af3b8ec835132aeb2737892e0a56 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 29 Jul 2024 10:07:52 +0800 Subject: [PATCH 5/6] # feat: - Deskripsi: - Notifikasi collaboration ## Issue: Scroll dari chat akan di ubah dengan package yang mas malik buat --- package.json | 1 + .../847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg | Bin 0 -> 7766 bytes .../6452c349-66fc-4db7-99ff-37a659f351bb.jpeg | Bin 0 -> 6403 bytes src/app/dev/colab/detail/group/[id]/page.tsx | 14 +- src/app/dev/investasi/detail/[id]/loading.tsx | 9 - src/app/dev/investasi/main/loading.tsx | 9 - .../button/button_update_beranda.tsx | 45 ++ .../detail/header_author_list_partisipan.tsx | 2 +- .../detail/list_partisipasi_user.tsx | 63 +- src/app_modules/colab/create/index.tsx | 54 +- src/app_modules/colab/detail/group/index.tsx | 31 - src/app_modules/colab/detail/grup/index.tsx | 659 ++++++++---------- src/app_modules/colab/detail/grup/layout.tsx | 125 ---- .../colab/detail/proyek/saya/index.tsx | 90 +-- src/app_modules/colab/edit/index.tsx | 26 +- .../fun_create_partisipan_by_user_id.ts | 19 +- .../colab/fun/create/fun_create_room_chat.ts | 14 + src/app_modules/colab/global_state/state.ts | 8 + src/app_modules/colab/index.ts | 2 - src/app_modules/colab/main/beranda.tsx | 34 +- src/app_modules/colab/main/grup/index.tsx | 28 +- src/app_modules/crowd/main/view.tsx | 28 +- .../create/create_cerita_penggalang.tsx | 2 +- .../donasi/create/create_donasi.tsx | 2 +- src/app_modules/donasi/main/layout.tsx | 11 +- .../event/detail/main_detail/index.tsx | 2 +- src/app_modules/forum/main/beranda.tsx | 30 +- src/app_modules/investasi/create/layout.tsx | 10 +- src/app_modules/investasi/detail/layout.tsx | 64 +- src/app_modules/investasi/detail/view.tsx | 28 +- src/app_modules/investasi/main/layout.tsx | 112 +-- src/app_modules/investasi/main/view.tsx | 56 +- .../investasi/portofolio/draft.tsx | 16 +- .../investasi/portofolio/publish.tsx | 46 +- src/app_modules/investasi/portofolio/view.tsx | 150 ++-- .../notifikasi/component/card_view.tsx | 9 +- .../component/path/collaboration.ts | 33 + .../notifikasi/component/path/event.ts | 2 +- .../create_notif_to_user_collaboration.ts | 32 + src/app_modules/notifikasi/model/interface.ts | 16 +- src/app_modules/vote/create/index.tsx | 2 +- yarn.lock | 5 + 42 files changed, 892 insertions(+), 997 deletions(-) create mode 100644 public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg create mode 100644 public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg delete mode 100644 src/app/dev/investasi/detail/[id]/loading.tsx delete mode 100644 src/app/dev/investasi/main/loading.tsx create mode 100644 src/app_modules/colab/component/button/button_update_beranda.tsx delete mode 100644 src/app_modules/colab/detail/grup/layout.tsx create mode 100644 src/app_modules/colab/global_state/state.ts create mode 100644 src/app_modules/notifikasi/component/path/collaboration.ts create mode 100644 src/app_modules/notifikasi/fun/create/create_notif_to_user_collaboration.ts diff --git a/package.json b/package.json index 772a7593..f02d79c5 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dependencies": { "@emotion/react": "^11.11.1", "@emotion/server": "^11.11.0", + "@hookstate/core": "^4.0.1", "@mantine/carousel": "^7.1.5", "@mantine/core": "^6.0.17", "@mantine/dates": "^6.0.17", diff --git a/public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg b/public/profile/background/847a4fa4-837d-4abd-aef2-435d8f259b4c.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..b43c0679833514aa571d181a3eb4157bf0537555 GIT binary patch literal 7766 zcmZX3bx<6@v*s@D78VHZ?(PJFyDToj2^QSloy9e{EG+IGY>{BW9fAddLxLpe<@f5{ z)xEo(s_FTvsO7Z|85C8!FTY%RMKqLSi1(kq+0E9?SLcvT;Ldrk}0@3i$FtM<4a&i(=@d@*B2r+YTvH>wLFmSMO zNb&GUIT)xJIsQN4`Y#LH|84&t;B^3ij|Qj$vLga%0SNd&M10^Y96Qs_*k zPNp@TTk~`)I-6;Aq;PFBply0Ntnm%8i9Pmx?5n4fkbhDbSL+GEFWmU`U|1tFKlbq~ z?~nIpo!rk3ChZRLky{Gcy{!!X&CMarG5SfFxgXZ6=IGzvr#|hoXnncbgd%fymC)Cy zRef2U2g%hg8{s3?4=VYOA1hH(BOABhT4k zu|`>WZxLio!?**$)HH#&QdROj`740lR1Pbj;2D|g?AdHP+OU=K9BE+`8ne4n zhF!5W^4~^-7fBr{gBOmECW9tR3;%CDgeFTvh|a8pRxXzknI`Lw4NqoH{PZ!$ET%EQ z+0-6`tH-P`I@4mChC;UHV!*E=e?2Gh7-8 z?>$y5^-pWGmY-_ezB_sL(bTEI@s=j0JQurH;sGEfAB_Z93$90F`;g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7b1?7gJN3hiG--w*$pDs4*Bb*YIrsGFz2Z4=x z#shz9j#2B$mIq3%o{Tgpgf#yfRlRWT$@j9CHJz&dxj)SqU}UY0$=!v8&ur~QWuFh@ti-;~N`Wi&1xuhnc866!NbIe#&~ zdvi=ON~~(1JIf|eF~JTZ@Mv!_Y-yB_1-Wr@FW!<(`qztSLu>pGL~`W=Gz{g>0XbTZ z!PSA@uYmZKfCqe5HhnwGsgc!_DJA+_Cd2Lmf6o}7HwU7J1?vK(WDrxQ)`If$_j`3} z(iPHNUCQ?oW+i`Tf`+O2a~HH_jL7D=>XqOXc`>?dz0pYUIFCz^jP|yOsQ#!~#SS)LzLw7{#WLtDBrcK=?|E8`B z%Otv|o%MCZ4O1=Z`|B@(3q~Im13AtKmK*Ht_fRglaLWIUeVBpj#o}w?ke>(-lf?5? zXpDlVKTH;Fq)`zMC5NU+)*M^geKkmh>s0?b)QvS|9M;WFwD2riSVXK4#&CD=r^KPl zftzU1{s$fQ|3Cv7G@bdN@5EI33$?L@qC@x)sScM+26`HFCC%8zf80v;KPoLHlAeYo zl7>M^mIjTW1fK>S&D20uOC?FS*=9%KXqgXR6*0^F5LYn;;^Lo+s+dgR_WOR!%iNlo T22GZ=^uHOJ|K>8eUf2E?OA(Jg literal 0 HcmV?d00001 diff --git a/public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg b/public/profile/foto/6452c349-66fc-4db7-99ff-37a659f351bb.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..4660498f65915bd8830b3fdf01d8a1b619ab80dc GIT binary patch literal 6403 zcmaJ_2Q*yY)}JwI)X{s1mW0uxmqFAJL86QrqfG`eM2kdp2?o)77l~emAV{=9bfRQ* zVTdk7i}FeSZ@u@v^{w^od)GR5opbNm=j^k8zrFXpoVr{9(CBLFXaayh004M(0WPNj zp#U;s5*j*M20B`5T1GGf6B7diEd%wR=1LgM&FIY~4nT1=0Rb2U2B-jz zlB4d2J@xZ&Wy~Wb!@xqh1x6mz1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`o5+m3Vks~jHTeo(Qi_rswg_Nn1%L575oxzx3Gb)N z_}#edd|IIde_=EIlZqUp#VGrE|Ja7>Bpb7^)?5E=((s0vlDEw73eLu}8iR=5OTg{1 zO00WF+l%85K^tEKbj2jlHG2aOyOyS~cz@i)6r;YmLLlCN=lz4GGUKB@c6cIc^~I5n zpwmSdlB}ixSsQ01P*CO{H3uvOc25yUIA9bKNIl%62V`nEC}7?_@3ZB^BaYO45VPgy z$>~B`>-)(zHakm@>|DT|dPya>5=X0v?OlHhAZp zL2AESjtYsA>goy!pE&8(S9QV#;@I3=q7@~yrVt$1s86q*>Xs4B91H8zuO2}4CgaNC zzszp&{rvf?JYjUkk+UgNy+iXj^BLCf_EA#H0K~eI=(lRHt9YtFLaxMT#OyNmCn>0L zd)G!h#^!nvzRo;gq~gJM5mx1a&{)vxF>5z2lk*97{9G#3XTxoZ2w*qU_2mYYY zj;@Fk6A@2#6|b;vKh|NzSfVr){i^D#UrL*2mw+8XU#`xH=;f0YHO3Udn^NDVpQvR= znk|3nx)`a(cU#cI17oS*aY`_iO+KCH^!big26xWyV(If9g?g>Wxc!Kcx&-W_IPX;k z+Z=STobO-7ZKg}WW17ro%<7ye@IL+Tf|N>Gd|&sAf$&ZS{2p`uljeB;-Z@L3hHM92 zdS$XUGi@V!9y^`&PYz=%I74cTOZ6$%X3y5A!{ zcsxxm#UJj9kdN;kAce{aEu2gIAj2+E1fM2T#KkstEqkISKTEl*G3jHBT{BZW5PXk# fNUe%V1*mx=6S=_()>j{|_lkCTsWEDYTz>l>8t4fz literal 0 HcmV?d00001 diff --git a/src/app/dev/colab/detail/group/[id]/page.tsx b/src/app/dev/colab/detail/group/[id]/page.tsx index 2fecdb0c..420aa361 100644 --- a/src/app/dev/colab/detail/group/[id]/page.tsx +++ b/src/app/dev/colab/detail/group/[id]/page.tsx @@ -1,5 +1,8 @@ import adminColab_getOneRoomChatById from "@/app_modules/admin/colab/fun/get/get_one_room_chat_by_id"; -import { Colab_GroupChatView } from "@/app_modules/colab"; +import { + Colab_DetailGrupDiskusi, + Colab_GroupChatView, +} from "@/app_modules/colab"; import colab_getMessageByRoomId from "@/app_modules/colab/fun/get/room_chat/get_message_by_room_id"; import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token"; import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id"; @@ -16,14 +19,15 @@ export default async function Page({ params }: { params: { id: string } }) { ]); let listMsg = await colab_getMessageByRoomId({ roomId: roomId, page: 1 }); const dataUserLogin = await user_getOneByUserId(userLoginId); - // console.log(dataUserLogin); return ( <> - {/* */} - - - ); -} diff --git a/src/app/dev/investasi/main/loading.tsx b/src/app/dev/investasi/main/loading.tsx deleted file mode 100644 index d8a1c040..00000000 --- a/src/app/dev/investasi/main/loading.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2"; - -export default async function Page() { - return ( - <> - - - ); -} diff --git a/src/app_modules/colab/component/button/button_update_beranda.tsx b/src/app_modules/colab/component/button/button_update_beranda.tsx new file mode 100644 index 00000000..05e00f56 --- /dev/null +++ b/src/app_modules/colab/component/button/button_update_beranda.tsx @@ -0,0 +1,45 @@ +import { AccentColor } from "@/app_modules/_global/color/color_pallet"; +import { Affix, rem, Center, Button } from "@mantine/core"; +import { useState } from "react"; +import colab_getListAllProyek from "../../fun/get/get_list_all_proyek"; + +export function ComponentColab_ButtonUpdateBeranda({ + onLoad, + setIsNewPost, +}: { + onLoad: (val: any) => void; + setIsNewPost: any; +}) { + const [isLoading, setIsLoading] = useState(false); + + async function onLoadData() { + const loadData = await colab_getListAllProyek({ page: 1 }); + onLoad(loadData); + setIsNewPost(false); + } + + return ( + <> + +
+ +
+
+ + ); +} diff --git a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx index e9577049..ca448347 100644 --- a/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx +++ b/src/app_modules/colab/component/detail/header_author_list_partisipan.tsx @@ -128,7 +128,7 @@ export default function ComponentColab_AuthorNameOnListPartisipan({ radius={"xl"} variant="transparent" > - + ) : ( "" diff --git a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx index 6f9f4153..aab5568a 100644 --- a/src/app_modules/colab/component/detail/list_partisipasi_user.tsx +++ b/src/app_modules/colab/component/detail/list_partisipasi_user.tsx @@ -19,18 +19,17 @@ import { Stack, Text, Textarea, - Title + Title, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { IconX } from "@tabler/icons-react"; import { useState } from "react"; import colab_funCreatePartisipan from "../../fun/create/fun_create_partisipan_by_user_id"; import colab_getListPartisipanByColabId from "../../fun/get/get_list_partisipan_by_id"; -import { - MODEL_COLLABORATION_PARTISIPASI -} from "../../model/interface"; +import { MODEL_COLLABORATION_PARTISIPASI } from "../../model/interface"; import ComponentColab_AuthorNameOnListPartisipan from "./header_author_list_partisipan"; - +import notifikasiToUser_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_user"; +import mqtt_client from "@/util/mqtt_client"; export default function ComponentColab_DetailListPartisipasiUser({ listPartisipan, userLoginId, @@ -50,22 +49,43 @@ export default function ComponentColab_DetailListPartisipasiUser({ const [deskripsi, setDeskripsi] = useState(""); async function onJoin() { - await colab_funCreatePartisipan( + const res = await colab_funCreatePartisipan( colabId as any, userLoginId as any, deskripsi - ).then(async (res) => { - if (res.status === 201) { - await colab_getListPartisipanByColabId(colabId as any).then((val) => { - setApply(true); - close(); - setData(val as any); - ComponentGlobal_NotifikasiBerhasil(res.message); - }); - } else { - ComponentGlobal_NotifikasiGagal(res.message); + ); + if (res.status === 201) { + const dataNotif = { + appId: res?.data?.ProjectCollaboration?.id, + userId: res?.data?.ProjectCollaboration?.userId, + pesan: res?.data?.ProjectCollaboration?.title, + status: "Partisipan Project", + kategoriApp: "COLLABORATION", + title: "Partisipan baru telah bergabung !", + }; + + const createNotifikasi = await notifikasiToUser_funCreate({ + data: dataNotif as any, + }); + + if (createNotifikasi.status === 201) { + mqtt_client.publish( + "USER", + JSON.stringify({ + userId: dataNotif.userId, + count: 1, + }) + ); } - }); + + const resList = await colab_getListPartisipanByColabId(colabId as any); + setApply(true); + close(); + setData(resList as any); + ComponentGlobal_NotifikasiBerhasil(res.message); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } } return ( @@ -104,7 +124,7 @@ export default function ComponentColab_DetailListPartisipasiUser({