From 7777703aa1390873b4c87895e36911ae1e10ff06 Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Sun, 16 Jun 2024 08:12:15 +0700 Subject: [PATCH 1/8] fix --- apps/web/src/app/(auth)/layout.tsx | 2 +- .../web/src/app/_components/admin/all-registered-user/index.tsx | 2 +- apps/web/src/app/_components/auth/login-page.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/app/(auth)/layout.tsx b/apps/web/src/app/(auth)/layout.tsx index b4e07f5c..91936200 100644 --- a/apps/web/src/app/(auth)/layout.tsx +++ b/apps/web/src/app/(auth)/layout.tsx @@ -85,7 +85,7 @@ export default async function RootLayout(props: { children: React.ReactNode }) { name={isLoggedIn.user.name ?? ""} email={isLoggedIn.user.email ?? ""} nameFallback={isLoggedIn.user.name?.slice(0, 2) ?? ""} - role={isLoggedIn.user.role} + role={isLoggedIn.user.role!} > {props.children} diff --git a/apps/web/src/app/_components/admin/all-registered-user/index.tsx b/apps/web/src/app/_components/admin/all-registered-user/index.tsx index 8fb0fb8b..84d0577c 100644 --- a/apps/web/src/app/_components/admin/all-registered-user/index.tsx +++ b/apps/web/src/app/_components/admin/all-registered-user/index.tsx @@ -133,7 +133,7 @@ export const columns: ColumnDef[] = [ diff --git a/apps/web/src/app/_components/auth/login-page.tsx b/apps/web/src/app/_components/auth/login-page.tsx index 3290b2f2..3e7a8f98 100644 --- a/apps/web/src/app/_components/auth/login-page.tsx +++ b/apps/web/src/app/_components/auth/login-page.tsx @@ -48,7 +48,7 @@ export function LoginComponent() { ...values, }); - if (loginResult.error) { + if (loginResult?.error) { console.log(loginResult); toast.error("Gagal login", { description: "Email atau password salah!" }); From f42fa91a45a15dddade827cd6a4a45f4923606d1 Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Sun, 16 Jun 2024 09:04:36 +0700 Subject: [PATCH 2/8] fix: sedikit edit --- packages/api/src/router/settings.ts | 4 +--- tooling/typescript/internal-package.json | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/api/src/router/settings.ts b/packages/api/src/router/settings.ts index 181db782..52fe3943 100644 --- a/packages/api/src/router/settings.ts +++ b/packages/api/src/router/settings.ts @@ -16,9 +16,7 @@ export const settingsRouter = { updateCanLogin: adminProcedure .input(settingsSchema.SharedCanLogin) - .mutation(async ({ input }) => - settings.updateSettings.canLogin(input.canLogin), - ), + .mutation(({ input }) => settings.updateSettings.canLogin(input.canLogin)), changeVotingBehaviour: adminProcedure .input(settingsSchema.SharedBehaviour) diff --git a/tooling/typescript/internal-package.json b/tooling/typescript/internal-package.json index 1ac41efd..7730ced8 100644 --- a/tooling/typescript/internal-package.json +++ b/tooling/typescript/internal-package.json @@ -3,9 +3,9 @@ "extends": "./base.json", "compilerOptions": { /** Emit types for internal packages to speed up editor performance. */ - "declaration": true, - "declarationMap": true, - "noEmit": false, - "emitDeclarationOnly": true + // "declaration": true, + // "declarationMap": true, + // "noEmit": false, + // "emitDeclarationOnly": true } } From ac6d6e7fe93abd597311d8a6f99168f78e8f203f Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Sun, 16 Jun 2024 09:52:59 +0700 Subject: [PATCH 3/8] =?UTF-8?q?fix:=20ternyata=20harus=20di=20pre=20build?= =?UTF-8?q?=20dulu=20=E2=98=A0=EF=B8=8F=E2=98=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/_components/candidate/candidate-action.tsx | 2 -- package.json | 1 + packages/settings/package.json | 9 +++++++-- packages/settings/tsconfig.json | 5 +++-- tooling/typescript/internal-package.json | 8 ++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/apps/web/src/app/_components/candidate/candidate-action.tsx b/apps/web/src/app/_components/candidate/candidate-action.tsx index 9515aabc..15236759 100644 --- a/apps/web/src/app/_components/candidate/candidate-action.tsx +++ b/apps/web/src/app/_components/candidate/candidate-action.tsx @@ -2,9 +2,7 @@ import { useMemo, useState } from "react"; import { zodResolver } from "@hookform/resolvers/zod"; -import { FileText, UserPlus } from "lucide-react"; import { useForm, useWatch } from "react-hook-form"; -import { z } from "zod"; import { Button } from "@sora-vp/ui/button"; import { DialogClose, DialogDescription } from "@sora-vp/ui/dialog"; diff --git a/package.json b/package.json index e0f54a7b..d9327b9e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "node": ">=20.12.0" }, "scripts": { + "pre-build": "turbo build --filter @sora-vp/db --filter @sora-vp/settings", "build": "turbo build", "clean": "git clean -xdf node_modules", "clean:workspaces": "turbo clean", diff --git a/packages/settings/package.json b/packages/settings/package.json index 90641e23..733c086d 100644 --- a/packages/settings/package.json +++ b/packages/settings/package.json @@ -4,14 +4,19 @@ "version": "0.1.0", "type": "module", "exports": { - ".": "./src/index.ts" + ".": { + "types": "./dist/index.d.ts", + "default": "./src/index.ts" + } }, "license": "MIT", "scripts": { + "build": "tsc", + "dev": "tsc --watch", "clean": "rm -rf .turbo node_modules", "format": "prettier --check . --ignore-path ../../.gitignore", "lint": "eslint", - "typecheck": "tsc --noEmit" + "typecheck": "tsc --noEmit --emitDeclarationOnly false" }, "devDependencies": { "@sora-vp/eslint-config": "*", diff --git a/packages/settings/tsconfig.json b/packages/settings/tsconfig.json index 1d9d3935..aeb37cba 100644 --- a/packages/settings/tsconfig.json +++ b/packages/settings/tsconfig.json @@ -1,8 +1,9 @@ { - "extends": "@sora-vp/tsconfig/base.json", + "extends": "@sora-vp/tsconfig/internal-package.json", "compilerOptions": { + "outDir": "dist", "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, - "include": ["*.ts", "src"], + "include": ["src"], "exclude": ["node_modules"] } diff --git a/tooling/typescript/internal-package.json b/tooling/typescript/internal-package.json index 7730ced8..1ac41efd 100644 --- a/tooling/typescript/internal-package.json +++ b/tooling/typescript/internal-package.json @@ -3,9 +3,9 @@ "extends": "./base.json", "compilerOptions": { /** Emit types for internal packages to speed up editor performance. */ - // "declaration": true, - // "declarationMap": true, - // "noEmit": false, - // "emitDeclarationOnly": true + "declaration": true, + "declarationMap": true, + "noEmit": false, + "emitDeclarationOnly": true } } From c9a68ea87ae33f637433ad1db08d8734c094e6cd Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Sun, 16 Jun 2024 09:54:23 +0700 Subject: [PATCH 4/8] fix: actionnya --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a76a4cfe..4bbfe143 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: run: cp .env.example .env - name: Lint - run: yarn lint && yarn lint:ws + run: yarn pre-build && yarn lint && yarn lint:ws format: runs-on: ubuntu-latest @@ -47,4 +47,4 @@ jobs: uses: ./.github/actions/yarn-nm-install - name: Typecheck - run: yarn typecheck + run: yarn pre-build && yarn typecheck From e146274634f5d2179ce7413616075c1bfb558a7a Mon Sep 17 00:00:00 2001 From: Ezra Khairan Permana Date: Sun, 16 Jun 2024 21:52:37 +0700 Subject: [PATCH 5/8] fix: besar-besaran --- .../candidate/candidate-action.tsx | 4 +- .../app/_components/candidate/data-table.tsx | 36 ++++++----------- .../_components/candidate/new-candidate.tsx | 13 ++++-- .../app/_components/nav/resizeable-nav.tsx | 2 +- .../_components/participant/data-table.tsx | 40 ++++++++----------- .../app/_components/participant/export.tsx | 4 +- .../participant/new-participant.tsx | 14 ++++--- .../participant/participant-action.tsx | 6 +-- .../src/app/_components/settings/duration.tsx | 17 +++++--- .../app/_components/statistic/essential.tsx | 21 ++++------ .../src/app/_components/statistic/graphic.tsx | 6 +-- .../src/app/api/uploads/[filename]/route.ts | 4 +- packages/api/src/router/candidate.ts | 2 +- packages/api/src/router/statistic.ts | 2 +- 14 files changed, 83 insertions(+), 88 deletions(-) diff --git a/apps/web/src/app/_components/candidate/candidate-action.tsx b/apps/web/src/app/_components/candidate/candidate-action.tsx index 15236759..e5c9c834 100644 --- a/apps/web/src/app/_components/candidate/candidate-action.tsx +++ b/apps/web/src/app/_components/candidate/candidate-action.tsx @@ -28,7 +28,7 @@ interface IProps { dialogOpen: boolean; openSetter: React.Dispatch>; name: string; - id: string; + id: number; } export function EditCandidate(props: IProps) { @@ -80,6 +80,7 @@ export function EditCandidate(props: IProps) { return; } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const file = values.image.item(0)!; const image = await toBase64(file); @@ -170,6 +171,7 @@ export function EditCandidate(props: IProps) {