From d1d9ecb4ec4da6f4ee99c842cae14ce789c7585a Mon Sep 17 00:00:00 2001 From: BaniHillabi Date: Thu, 11 Jul 2024 17:24:50 +0700 Subject: [PATCH 1/9] fix(frontend): fix ui bugs --- next.config.mjs | 8 +++++++- src/actions/registrationForm.ts | 2 +- .../dashboard/components/ProfileTim.tsx | 19 ++++++++++++------- .../components/parts/AnggotaCard.tsx | 2 +- .../dashboard/components/parts/Countdown.tsx | 2 +- src/app/(main)/dashboard/page.tsx | 2 ++ src/app/(main)/layout.tsx | 1 + src/app/components/global/Navbar.tsx | 2 +- src/app/components/global/SubmitButton.tsx | 4 ++-- 9 files changed, 28 insertions(+), 14 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 4678774..69dfa57 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,10 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + experimental:{ + serverActions:{ + bodySizeLimit:'5mb' + } + } +}; export default nextConfig; diff --git a/src/actions/registrationForm.ts b/src/actions/registrationForm.ts index 09c7d80..41bde04 100644 --- a/src/actions/registrationForm.ts +++ b/src/actions/registrationForm.ts @@ -19,7 +19,7 @@ export default async function submitFormRegistrasi( const tipe_pembayaran = data.get("tipe-pembayaran") as string; const no_pelatih = data.get("no-pelatih") as string; - const timCount = (await findTims({ jenjang: jenjang })).length; + const timCount = (await findTims({ jenjang: jenjang, confirmed: true })).length; if (timCount >= 30) return { success: false, message: `Kuota jenjang ${jenjang} telah penuh!` }; diff --git a/src/app/(main)/dashboard/components/ProfileTim.tsx b/src/app/(main)/dashboard/components/ProfileTim.tsx index 05739c1..9de3700 100644 --- a/src/app/(main)/dashboard/components/ProfileTim.tsx +++ b/src/app/(main)/dashboard/components/ProfileTim.tsx @@ -5,6 +5,7 @@ import SectionWrapper from "@/app/components/global/Wrapper"; import { TimWithRelations } from "@/types/entityRelations"; import { ReactNode, useState } from "react"; import { AnggotaCard } from "./parts/AnggotaCard"; +import cn from "@/lib/clsx"; const rowsMapNormal = [ ["b1s1", "b1s2", "b1s3"], @@ -24,9 +25,9 @@ const sizeMap = { NORMAL: 15, }; -function AnggotaCardsWrapper({ children }: Readonly<{ children: ReactNode }>) { +function AnggotaCardsWrapper({ children,className }: Readonly<{ children: ReactNode,className?:string }>) { return ( -
{children}
+
{children}
); } @@ -61,7 +62,7 @@ function TimLayout({ tim }: Readonly<{ tim: TimWithRelations }>) {
{tim.jenjang === "SMP" && ( - + ) { )}
- + ) { {tim.tipe_tim === "NORMAL" ? rowsMapNormal.map((row, i) => ( - + {row.map((pos, i) => { const anggotaInPos = anggotas.find( (value) => value.posisi === pos.toUpperCase() @@ -126,7 +127,7 @@ function TimLayout({ tim }: Readonly<{ tim: TimWithRelations }>) { )) : rowsMapSmall.map((row, i) => ( - + {row.map((pos, i) => { const anggotaInPos = anggotas.find( (value) => value.posisi === pos.toUpperCase() @@ -188,7 +189,11 @@ export default function ProfileTim({ {tim.confirmed ? "Sudah" : "Belum"}

- + {tim.confirmed ? : ( + +

Silahkan untuk menunggu konfirmasi pembayaran dari admin

+
+ )} ); diff --git a/src/app/(main)/dashboard/components/parts/AnggotaCard.tsx b/src/app/(main)/dashboard/components/parts/AnggotaCard.tsx index a749e1a..bef8e1e 100644 --- a/src/app/(main)/dashboard/components/parts/AnggotaCard.tsx +++ b/src/app/(main)/dashboard/components/parts/AnggotaCard.tsx @@ -19,7 +19,7 @@ export function AnggotaCard({ return (

Waktu Tersisa Sebelum Hari-H

-
+
diff --git a/src/app/(main)/dashboard/page.tsx b/src/app/(main)/dashboard/page.tsx index 8d35adb..c08cd4b 100644 --- a/src/app/(main)/dashboard/page.tsx +++ b/src/app/(main)/dashboard/page.tsx @@ -4,6 +4,8 @@ import { redirect } from "next/navigation"; import Heading from "./components/Heading"; import ProfileTim from "./components/ProfileTim"; import { TimWithRelations } from "@/types/entityRelations"; +import { H3 } from "@/app/components/global/Text"; +import SectionWrapper from "@/app/components/global/Wrapper"; export default async function TimDashboard() { const session = await getServerSession(); diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx index b7e8f87..fb2b3b2 100644 --- a/src/app/(main)/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -9,6 +9,7 @@ export default function MainLayout({ return ( <> + {/*
*/}
{children}
diff --git a/src/app/components/global/Navbar.tsx b/src/app/components/global/Navbar.tsx index a2759a7..7a4d8a7 100644 --- a/src/app/components/global/Navbar.tsx +++ b/src/app/components/global/Navbar.tsx @@ -36,7 +36,7 @@ export default function Navbar() { }, [pathname]); return ( -
Unduh buku panduan @@ -91,7 +91,7 @@ export default function Video() {

Unduh buku panduan diff --git a/src/app/(main)/dashboard/components/Heading.tsx b/src/app/(main)/dashboard/components/Heading.tsx index 86871be..bf677e0 100644 --- a/src/app/(main)/dashboard/components/Heading.tsx +++ b/src/app/(main)/dashboard/components/Heading.tsx @@ -22,7 +22,7 @@ export default async function Heading() {

Selamat Datang, {session?.user?.nama}👋

Unduh buku panduan From 8e29db92368ce4c9943b52c77589e2b7d5796724 Mon Sep 17 00:00:00 2001 From: BaniHillabi Date: Thu, 1 Aug 2024 10:37:36 +0700 Subject: [PATCH 3/9] feat(frontend) : change juklak drive link --- src/app/(main)/components/Video.tsx | 4 ++-- src/app/(main)/dashboard/components/Heading.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/(main)/components/Video.tsx b/src/app/(main)/components/Video.tsx index 3dbd8ff..1138e88 100644 --- a/src/app/(main)/components/Video.tsx +++ b/src/app/(main)/components/Video.tsx @@ -40,7 +40,7 @@ export default function Video() {

Unduh buku panduan @@ -91,7 +91,7 @@ export default function Video() {

Unduh buku panduan diff --git a/src/app/(main)/dashboard/components/Heading.tsx b/src/app/(main)/dashboard/components/Heading.tsx index bf677e0..4755393 100644 --- a/src/app/(main)/dashboard/components/Heading.tsx +++ b/src/app/(main)/dashboard/components/Heading.tsx @@ -22,7 +22,7 @@ export default async function Heading() {

Selamat Datang, {session?.user?.nama}👋

Unduh buku panduan From 0f74cf2aa7854bea1676e3ad51a178adf2c7b504 Mon Sep 17 00:00:00 2001 From: BaniHillabi Date: Fri, 30 Aug 2024 13:05:51 +0700 Subject: [PATCH 4/9] fix (frontend) : fix UI bugs --- src/app/(main)/components/Hero.tsx | 8 ++++++-- src/app/(main)/components/Juri.tsx | 4 ++-- src/app/(main)/components/Kategori.tsx | 4 ++-- src/app/(main)/components/Timeline.tsx | 8 ++++---- src/app/(main)/components/parts/Countdown.tsx | 2 +- src/app/layout.tsx | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/app/(main)/components/Hero.tsx b/src/app/(main)/components/Hero.tsx index 14021eb..bb65cd3 100644 --- a/src/app/(main)/components/Hero.tsx +++ b/src/app/(main)/components/Hero.tsx @@ -84,7 +84,11 @@ export default async function Hero() { BARISAN JAWARA @@ -99,7 +103,7 @@ export default async function Hero() { Antareja 2024

- Selamat datang di website official lomba keterampilan baris berbaris + Selamat datang di website official lomba peraturan keterampilan baris berbaris dari paskibra SMK Telkom Malang
diff --git a/src/app/(main)/components/Juri.tsx b/src/app/(main)/components/Juri.tsx index adccd60..3ecc429 100644 --- a/src/app/(main)/components/Juri.tsx +++ b/src/app/(main)/components/Juri.tsx @@ -68,10 +68,10 @@ export default function Juri() {

- Juri LKBB Antareja 2024 + Juri LPKBB Antareja 2024

- Yuk kenalan dulu dengan tim juri LKBB Antareja tahun 2024 + Yuk kenalan dulu dengan tim juri LPKBB Antareja tahun 2024

diff --git a/src/app/(main)/components/Kategori.tsx b/src/app/(main)/components/Kategori.tsx index e89e044..b766917 100644 --- a/src/app/(main)/components/Kategori.tsx +++ b/src/app/(main)/components/Kategori.tsx @@ -30,7 +30,7 @@ export default function Kategori() {
- *Pendaftaran 20 Mei 2024 - 7 September 2024* + *Pendaftaran 20 Mei 2024 - 5 Oktober 2024* @@ -50,7 +50,7 @@ export default function Kategori() { - *Pendaftaran 20 Mei 2024 - 7 September 2024* + *Pendaftaran 20 Mei 2024 - 5 Oktober 2024* diff --git a/src/app/(main)/components/Timeline.tsx b/src/app/(main)/components/Timeline.tsx index ef3c0b6..8c6d840 100644 --- a/src/app/(main)/components/Timeline.tsx +++ b/src/app/(main)/components/Timeline.tsx @@ -40,7 +40,7 @@ export default function Timeline() {
@@ -49,7 +49,7 @@ export default function Timeline() {
@@ -73,13 +73,13 @@ export default function Timeline() {
diff --git a/src/app/(main)/components/parts/Countdown.tsx b/src/app/(main)/components/parts/Countdown.tsx index d9e11da..3926595 100644 --- a/src/app/(main)/components/parts/Countdown.tsx +++ b/src/app/(main)/components/parts/Countdown.tsx @@ -3,7 +3,7 @@ import { H2, H5 } from "@/app/components/global/Text"; import { useCountdown } from "@/app/hooks/useCountdown"; -const endDate = new Date("09/07/2024"); +const endDate = new Date("10/05/2024"); function TimeFigure({ time, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 52b66d0..d845fc5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,7 +7,7 @@ import "./globals.css"; import basierFont from "./font"; export const metadata: Metadata = { - title: "LKBB Antareja", + title: "LPKBB Antareja", description: "Official Website of LKBB Antareja", authors: [ { name: "Ahsan Azizan", url: "https://ahsanzizan.xyz" }, From 65a11d6f47f603814ade9fb28c0cc6ae0d545344 Mon Sep 17 00:00:00 2001 From: BaniHillabi Date: Mon, 2 Sep 2024 09:09:55 +0700 Subject: [PATCH 5/9] fix(frontend) : change the date of timeline --- src/app/(main)/components/Timeline.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/(main)/components/Timeline.tsx b/src/app/(main)/components/Timeline.tsx index 8c6d840..7556aae 100644 --- a/src/app/(main)/components/Timeline.tsx +++ b/src/app/(main)/components/Timeline.tsx @@ -49,7 +49,7 @@ export default function Timeline() {
@@ -79,7 +79,7 @@ export default function Timeline() { From b5d599eed0b9e6a0f5c3d0678dc22f597100a223 Mon Sep 17 00:00:00 2001 From: BaniHillabi Date: Mon, 9 Sep 2024 00:29:54 +0700 Subject: [PATCH 6/9] feat(frontend) : add update verified user at admin dashboard --- src/actions/User.ts | 2 ++ .../admin/user/[id]/components/Form.tsx | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/actions/User.ts b/src/actions/User.ts index 8b36067..c61bdc5 100644 --- a/src/actions/User.ts +++ b/src/actions/User.ts @@ -33,6 +33,7 @@ export async function updateUserForm(data: FormData, id: string) { const email = data.get("email") as string; const password = (data.get("password") as string) || undefined; const role = data.get("role") as Role; + const verified = data.get("verified") === "true"; try { if (password) { @@ -55,6 +56,7 @@ export async function updateUserForm(data: FormData, id: string) { nama: name, email: email, role: role, + verified : verified, } ); revalidatePath("/", "layout"); diff --git a/src/app/(admin)/admin/user/[id]/components/Form.tsx b/src/app/(admin)/admin/user/[id]/components/Form.tsx index 31116b1..25c7396 100644 --- a/src/app/(admin)/admin/user/[id]/components/Form.tsx +++ b/src/app/(admin)/admin/user/[id]/components/Form.tsx @@ -22,6 +22,11 @@ export default function UserForm({ { label: "ADMIN", value: "ADMIN" }, ]; + const optionsVerified = [ + { label: "true", value: "true" }, + { label: "false", value: "false" }, + ]; + async function Create(data: FormData) { const toastId = toast.loading("Loading..."); const result = await createUserForm(data); @@ -102,6 +107,35 @@ export default function UserForm({ }} /> +
+ + + "rounded-[14px] border focus:bg-[#F1F6F9] border-neutral-400 px-[18px] active:border-black hover:border-black py-[14px] text-black placeholder-neutral-500 bg-white focus:outline-none transition-all duration-500 placeholder:text-[#C8C8C8]", + menu: () => + "bg-white rounded-lg px-[18px] py-[14px] border border-neutral-400", + multiValue: () => + "bg-primary-400 px-4 py-2 text-white rounded-2xl", + valueContainer: () => "flex gap-2", + menuList: () => "text-base flex flex-col gap-1", + option: () => + "hover:bg-neutral-300 hover:cursor-pointer transition-all duration-500 rounded-lg p-2", + input: () => "focus:bg-[#F1F6F9]", + }} + /> +
From e907dafe55090aeb2de7bd254f2e9606f0d61f00 Mon Sep 17 00:00:00 2001 From: teguhbayupratama Date: Mon, 9 Sep 2024 15:54:37 +0800 Subject: [PATCH 9/9] fix: Add deployment migrate to CD pipeline --- .github/workflows/CD.yml | 4 ++-- package.json | 1 + src/app/(main)/dashboard/anggota/[posisi]/page.tsx | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 4dec205..21cf153 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -34,8 +34,8 @@ jobs: echo 'GOOGLE_REDIRECT_URI=${{secrets.GOOGLE_REDIRECT_URI}}' >> /home/mokletdev/actions-runner/_work/antareja/antareja/.env.local - name: Install Modules run: npm ci - - name: Generate prisma - run: npm run prisma:generate + - name: Push prisma schema + run: npm run prisma:deploy - name: Build site run: npm run build --if-present - name: change dir diff --git a/package.json b/package.json index 817f066..4e01c44 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "prettier": "prettier --write .", "prisma": "dotenv -e .env.local prisma migrate dev", "prisma:generate": "dotenv -e .env.local prisma generate", + "prisma:deploy": "dotenv -e .env.local prisma migrate deploy", "prisma:push": "dotenv -e .env.local prisma db push", "prisma:studio": "dotenv -e .env.local prisma studio" }, diff --git a/src/app/(main)/dashboard/anggota/[posisi]/page.tsx b/src/app/(main)/dashboard/anggota/[posisi]/page.tsx index 997074c..79fa45c 100644 --- a/src/app/(main)/dashboard/anggota/[posisi]/page.tsx +++ b/src/app/(main)/dashboard/anggota/[posisi]/page.tsx @@ -32,6 +32,7 @@ export default async function EditAnggota({ timId: "", } as unknown as Anggota); + console.log(anggota) return (