From 2ae15e9f93ffd322b49b93ff5328174c7df59bf7 Mon Sep 17 00:00:00 2001 From: amel Date: Mon, 9 Dec 2024 14:47:35 +0800 Subject: [PATCH 1/5] upd: lainnya Deskripsi: - api get all forum (blm jadi) - loading on bussines map No Issues --- src/app/api/new/forum/route.ts | 67 +++++++++++++++++++++++++++ src/app_modules/map/ui/ui_map_new.tsx | 7 ++- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/app/api/new/forum/route.ts diff --git a/src/app/api/new/forum/route.ts b/src/app/api/new/forum/route.ts new file mode 100644 index 00000000..84d3523a --- /dev/null +++ b/src/app/api/new/forum/route.ts @@ -0,0 +1,67 @@ +import { prisma } from "@/app/lib" +import { NextResponse } from "next/server"; +export const dynamic = "force-dynamic"; + +// GET ALL DATA PORTOFOLIO BY PROFILE ID +export async function GET(request: Request) { + try { + const { searchParams } = new URL(request.url) + const page = searchParams.get("page") + const search = searchParams.get("search") + const dataSkip = Number(page) * 5 - 5; + + const data = await prisma.forum_Posting.findMany({ + take: 5, + skip: dataSkip, + orderBy: { + createdAt: "desc", + }, + where: { + isActive: true, + diskusi: { + mode: "insensitive", + contains: (search == undefined || search == "null") ? "" : search, + }, + }, + select: { + id: true, + diskusi: true, + createdAt: true, + isActive: true, + authorId: true, + Author: { + select: { + id: true, + username: true, + Profile: { + select: { + id: true, + name: true, + imageId: true, + }, + }, + }, + }, + Forum_Komentar: { + where: { + isActive: true, + }, + }, + ForumMaster_StatusPosting: { + select: { + id: true, + status: true, + }, + }, + forumMaster_StatusPostingId: true, + }, + }); + + return NextResponse.json({ success: true, message: "Berhasil mendapatkan data", data }, { status: 200 }); + + } + catch (error) { + console.error(error); + return NextResponse.json({ success: false, message: "Gagal mendapatkan data, coba lagi nanti ", reason: (error as Error).message, }, { status: 500 }); + } +} \ No newline at end of file diff --git a/src/app_modules/map/ui/ui_map_new.tsx b/src/app_modules/map/ui/ui_map_new.tsx index 6797cee0..2ce61efc 100644 --- a/src/app_modules/map/ui/ui_map_new.tsx +++ b/src/app_modules/map/ui/ui_map_new.tsx @@ -2,7 +2,7 @@ import { APIs } from "@/app/lib"; import { AccentColor } from "@/app_modules/_global/color/color_pallet"; import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data"; -import { Avatar, Stack } from "@mantine/core"; +import { Avatar, Loader, Stack } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; import "mapbox-gl/dist/mapbox-gl.css"; import { useState } from "react"; @@ -44,7 +44,10 @@ export function UiMap_MapBoxViewNew({ mapboxToken, }: { mapboxToken: string }) { { loading ? - <> : + + + + : Date: Mon, 9 Dec 2024 15:46:28 +0800 Subject: [PATCH 2/5] upd: katalog profile Deskripsi: - update bug button admin No Issues --- .../katalog/component/drawer_katalog_new.tsx | 2 +- src/app_modules/katalog/main/layout_new.tsx | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app_modules/katalog/component/drawer_katalog_new.tsx b/src/app_modules/katalog/component/drawer_katalog_new.tsx index c0ef291f..9e154560 100644 --- a/src/app_modules/katalog/component/drawer_katalog_new.tsx +++ b/src/app_modules/katalog/component/drawer_katalog_new.tsx @@ -89,7 +89,7 @@ export default function DrawerKatalogNew({ opened, close, userRoleId, userId }: ))} - {userRoleId != "1" && ( + {userRoleId != "1" && userRoleId != "" && ( - ) : ( - open()}> - - - ) + loading ? + : + authorId == userLoginId ? ( + open()}> + + + ) : ( + + ) } /> } From ead4913514c9da8388e6d841f20a01fc02f78756 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 9 Dec 2024 17:29:32 +0800 Subject: [PATCH 3/5] Fix event Deskripsi: - Fix konfirmasi event --- src/app_modules/event/_ui/konfirmasi.tsx | 67 ++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/src/app_modules/event/_ui/konfirmasi.tsx b/src/app_modules/event/_ui/konfirmasi.tsx index 2062d1b0..bc243cc1 100644 --- a/src/app_modules/event/_ui/konfirmasi.tsx +++ b/src/app_modules/event/_ui/konfirmasi.tsx @@ -20,6 +20,7 @@ import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm import { gs_event_hotMenu } from "../global_state"; import { MODEL_EVENT } from "../model/interface"; import { Event_funJoinEvent } from "../fun/create/fun_join_event"; +import "moment/locale/id"; export default function Ui_Konfirmasi({ userLoginId, @@ -88,7 +89,7 @@ export default function Ui_Konfirmasi({ ); } - // Jika tanggal acara lewat + // Jika tanggal acara sudah lewat if (moment(data?.tanggalSelesai).diff(moment(), "minute") < 0) { return ( <> @@ -97,6 +98,15 @@ export default function Ui_Konfirmasi({ ); } + // Jika join true + if (isJoin == true && moment(data?.tanggal).diff(moment(), "minute") > 0) { + return ( + <> + + + ); + } + // Jika belum join dan tanggal mulai acara belum lewat if (isJoin == false && moment(data?.tanggal).diff(moment(), "minute") > 0) { return ( @@ -125,8 +135,13 @@ export default function Ui_Konfirmasi({ ); } - // Jika sudah join, belum konfirm dan acara sudah mulai - if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0) { + // Jika sudah join, sudah konfirmasi dan tanggal mulai acara sudah lewat + // if (isPresent && moment(data?.tanggal).diff(moment(), "minute") < 0) + if ( + isPresent && + isJoin && + moment(data?.tanggal).diff(moment(), "minute") < 0 + ) { return ; } @@ -199,6 +214,52 @@ function SkeletonIsDataNull() { ); } +function UserJoinTrue({ title, tanggal }: { title: string; tanggal: Date }) { + const router = useRouter(); + const [isLoading, setLoading] = useState(false); + const [hotMenu, setHotMenu] = useAtom(gs_event_hotMenu); + + return ( + <> + + + + + + Terima kasih, Bapak/Ibu, Anda telah berhasil bergabung dalam + acara{" "} + + {title} + {" "} + . Mohon ditunggu hingga tanggal{" "} + + {moment(tanggal).format("DD-MM-YYYY")} + {" "} + untuk melakukan konfirmasi kehadiran melalui aplikasi HIPMI APP. + + + + + + + + + ); +} + function UserAllowToJoin({ title, tanggal, From a48a9ca99d05b91613db5d30dc4ae47d9a7740ed Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 9 Dec 2024 17:29:56 +0800 Subject: [PATCH 4/5] chore(release): 1.2.21 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbad195b..73e2314d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.2.21](https://github.com/bipproduction/hipmi/compare/v1.2.20...v1.2.21) (2024-12-09) + ## [1.2.20](https://github.com/bipproduction/hipmi/compare/v1.2.19...v1.2.20) (2024-12-09) ## [1.2.19](https://github.com/bipproduction/hipmi/compare/v1.2.18...v1.2.19) (2024-12-06) diff --git a/package.json b/package.json index b47b092a..7f57f862 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hipmi", - "version": "1.2.20", + "version": "1.2.21", "private": true, "prisma": { "seed": "npx tsx prisma/seed.ts --yes" From bfddf58caaaed1e5573a080c865e0614d9e433ad Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 9 Dec 2024 17:30:30 +0800 Subject: [PATCH 5/5] Fix version 1.2.21 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f57f862..ae8b1fa2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "prisma": { "seed": "npx tsx prisma/seed.ts --yes" - }, + }, "scripts": { "dev": "bun --bun run next dev --experimental-https", "build": "NODE_OPTIONS='--max-old-space-size=2048' bun --bun run next build",