From 20188025d64ab22cb277d5a272491abb8839336d Mon Sep 17 00:00:00 2001 From: ferdiansyah666 Date: Mon, 19 Aug 2024 16:53:38 +0700 Subject: [PATCH 01/37] add: route for assessmentRequestManagement --- apps/backend/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/backend/src/index.ts b/apps/backend/src/index.ts index 9076b79..88a66d5 100644 --- a/apps/backend/src/index.ts +++ b/apps/backend/src/index.ts @@ -16,6 +16,7 @@ import HonoEnv from "./types/HonoEnv"; import devRoutes from "./routes/dev/route"; import appEnv from "./appEnv"; import questionsRoute from "./routes/questions/route"; +import assessmentsRequestManagementRoutes from "./routes/assessmentRequestManagement/route"; configDotenv(); @@ -80,6 +81,7 @@ const routes = app .route("/roles", rolesRoute) .route("/dev", devRoutes) .route("/questions", questionsRoute) + .route("/assessmentRequestManagement",assessmentsRequestManagementRoutes) .onError((err, c) => { if (err instanceof DashboardError) { return c.json( From 0948b9e117f95753741682c63a6d4e279aded315 Mon Sep 17 00:00:00 2001 From: ferdiansyah666 Date: Mon, 19 Aug 2024 16:54:21 +0700 Subject: [PATCH 02/37] add: premission for assessmentRequestManagement --- apps/backend/src/data/permissions.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/backend/src/data/permissions.ts b/apps/backend/src/data/permissions.ts index e4d458c..6314f8c 100644 --- a/apps/backend/src/data/permissions.ts +++ b/apps/backend/src/data/permissions.ts @@ -47,6 +47,16 @@ const permissionsData = [ { code: "questions.restore", }, + { + code :"assessmentRequestManagement.readAll", + }, + { + code: "assessmentRequestManagement.update", + }, + { + code :"assessmentRequestManagement.read", + }, + ] as const; export type SpecificPermissionCode = (typeof permissionsData)[number]["code"]; From eaf8c8a027fffcaf2764b9a618dae14202772d3a Mon Sep 17 00:00:00 2001 From: ferdiansyah666 Date: Mon, 19 Aug 2024 16:55:13 +0700 Subject: [PATCH 03/37] create: develop API assessmentRequestManagement --- .../assessmentRequestManagement/route.ts | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 apps/backend/src/routes/assessmentRequestManagement/route.ts diff --git a/apps/backend/src/routes/assessmentRequestManagement/route.ts b/apps/backend/src/routes/assessmentRequestManagement/route.ts new file mode 100644 index 0000000..e05e3bd --- /dev/null +++ b/apps/backend/src/routes/assessmentRequestManagement/route.ts @@ -0,0 +1,173 @@ + import { and, eq, ilike, or, sql } from "drizzle-orm"; + import { Hono } from "hono"; + import checkPermission from "../../middlewares/checkPermission"; + import { z } from "zod"; + import { HTTPException } from "hono/http-exception"; + import db from "../../drizzle"; + import { assessments } from "../../drizzle/schema/assessments"; + import { respondents } from "../../drizzle/schema/respondents"; + import { users } from "../../drizzle/schema/users"; + import HonoEnv from "../../types/HonoEnv"; + import requestValidator from "../../utils/requestValidator"; + import authInfo from "../../middlewares/authInfo"; + + export const assessmentFormSchema = z.object({ + respondentId: z.string().min(1), + status: z.enum(["tertunda", "disetujui", "ditolak", "selesai"]), + reviewedBy: z.string().min(1), + validatedBy: z.string().min(1), + validatedAt: z.string().optional(), + }); + + export const assessmentUpdateSchema = assessmentFormSchema.extend({ + validatedAt: z.string().optional().or(z.literal("")), + }); + + const assessmentsRequestManagementRoutes = new Hono() + .use(authInfo) + /** + * Get All Assessments (With Metadata) + * + * Query params: + * - withMetadata: boolean + */ + .get( + "/", + checkPermission("assessmentRequestManagement.readAll"), + requestValidator( + "query", + z.object({ + withMetadata: z + .string() + .optional() + .transform((v) => v?.toLowerCase() === "true"), + page: z.coerce.number().int().min(0).default(0), + limit: z.coerce.number().int().min(1).max(1000).default(10), + q: z.string().default(""), + }) + ), + async (c) => { + const { page, limit, q } = c.req.valid("query"); + + const totalCountQuery = sql`(SELECT count(*) FROM ${assessments})`; + + const result = await db + .select({ + idPermohonan: assessments.id, + namaResponden: users.name, + namaPerusahaan: respondents.companyName, + status: assessments.status, + tanggal: assessments.createdAt, + fullCount: totalCountQuery, + }) + .from(assessments) + .leftJoin(respondents, eq(assessments.respondentId, respondents.id)) + .leftJoin(users, eq(respondents.userId, users.id)) + .where( + q + ? or( + ilike(users.name, `%${q}%`), + ilike(respondents.companyName, `%${q}%`), + eq(assessments.id, q) + ) + : undefined + ) + .offset(page * limit) + .limit(limit); + + return c.json({ + data: result.map((d) => ({ + idPermohonan: d.idPermohonan, + namaResponden: d.namaResponden, + namaPerusahaan: d.namaPerusahaan, + status: d.status, + tanggal: d.tanggal, + })), + _metadata: { + currentPage: page, + totalPages: Math.ceil( + (Number(result[0]?.fullCount) ?? 0) / limit + ), + totalItems: Number(result[0]?.fullCount) ?? 0, + perPage: limit, + }, + }); + } + ) + + // Get assessment by id + .get( + "/:id", + checkPermission("assessmentRequestManagement.read"), + async (c) => { + const assessmentId = c.req.param("id"); + + const queryResult = await db + .select({ + // id: assessments.id, + tanggal: assessments.createdAt, + nama: users.name, + posisi: respondents.position, + pengalamanKerja: respondents.workExperience, + email: users.email, + namaPerusahaan: respondents.companyName, + alamat: respondents.address, + nomorTelepon: respondents.phoneNumber, + username: users.username, + status: assessments.status, + }) + .from(assessments) + .leftJoin(respondents, eq(assessments.respondentId, respondents.id)) + .leftJoin(users, eq(respondents.userId, users.id)) + .where(eq(assessments.id, assessmentId)); + + if (!queryResult.length) + throw new HTTPException(404, { + message: "The assessment does not exist", + }); + + const assessmentData = queryResult[0]; + + return c.json(assessmentData); + } + ) + + .patch( + "/:id", + checkPermission("assessmentRequestManagement.update"), + requestValidator( + "json", + z.object({ + status: z.enum(["tertunda", "disetujui", "ditolak", "selesai"]), + }) + ), + async (c) => { + const assessmentId = c.req.param("id"); + const { status } = c.req.valid("json"); + + const assessment = await db + .select() + .from(assessments) + .where(and(eq(assessments.id, assessmentId),)); + + if (!assessment[0]) throw new HTTPException(404, { + message: "Assessment tidak ditemukan.", + }); + + await db + .update(assessments) + .set({ + status, + }) + .where(eq(assessments.id, assessmentId)); + + return c.json({ + message: "Status assessment berhasil diperbarui.", + }); + } + ) + + + + + export default assessmentsRequestManagementRoutes; From 95aec9faf37f26450a4dad1cc250e296bcb8324a Mon Sep 17 00:00:00 2001 From: falendikategar Date: Wed, 4 Sep 2024 10:06:03 +0700 Subject: [PATCH 04/37] update: Revision for Slicing Login Page --- apps/frontend/package.json | 3 + apps/frontend/src/routes/login/index.lazy.tsx | 34 ++-- pnpm-lock.yaml | 153 +++++++++++++----- 3 files changed, 140 insertions(+), 50 deletions(-) diff --git a/apps/frontend/package.json b/apps/frontend/package.json index b89c51a..0068476 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -10,11 +10,13 @@ }, "dependencies": { "@emotion/react": "^11.11.4", + "@hookform/resolvers": "^3.9.0", "@mantine/core": "^7.10.2", "@mantine/dates": "^7.10.2", "@mantine/form": "^7.10.2", "@mantine/hooks": "^7.10.2", "@mantine/notifications": "^7.10.2", + "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", "@tanstack/react-query": "^5.45.0", "@tanstack/react-router": "^1.38.1", @@ -28,6 +30,7 @@ "mantine-form-zod-resolver": "^1.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-hook-form": "^7.52.2", "react-icons": "^5.2.1", "tailwind-merge": "^2.4.0", "tailwindcss-animate": "^1.0.7", diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index 58c16ef..66b0275 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -97,18 +97,24 @@ export default function LoginPage() { }; return ( -
-
+
+
Amati
-
- -

Sign In

-

+

+
+
+
+
+
+
+
+
+
+
+ +

Sign In

+

New to this app?{' '} ( - Email/Username + Email/Username ( - Password + Password Forgot Password? @@ -177,7 +183,7 @@ export default function LoginPage() { className="w-full flex items-center justify-center space-x-[13.125rem] sm:space-x-[20rem] lg:space-x-[23.125rem] bg-[#2555FF] text-white hover:bg-[#1e4ae0]" > - Sign In + Sign In

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16570cb..ec1b9dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,6 +87,9 @@ importers: '@emotion/react': specifier: ^11.11.4 version: 11.11.4(@types/react@18.3.3)(react@18.3.1) + '@hookform/resolvers': + specifier: ^3.9.0 + version: 3.9.0(react-hook-form@7.52.2(react@18.3.1)) '@mantine/core': specifier: ^7.10.2 version: 7.10.2(@mantine/hooks@7.10.2(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -102,6 +105,9 @@ importers: '@mantine/notifications': specifier: ^7.10.2 version: 7.10.2(@mantine/core@7.10.2(@mantine/hooks@7.10.2(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mantine/hooks@7.10.2(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-label': + specifier: ^2.1.0 + version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-slot': specifier: ^1.1.0 version: 1.1.0(@types/react@18.3.3)(react@18.3.1) @@ -141,6 +147,9 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + react-hook-form: + specifier: ^7.52.2 + version: 7.52.2(react@18.3.1) react-icons: specifier: ^5.2.1 version: 5.2.1(react@18.3.1) @@ -149,7 +158,7 @@ importers: version: 2.4.0 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5))) + version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))) zod: specifier: ^3.23.8 version: 3.23.8 @@ -204,7 +213,7 @@ importers: version: 7.0.1(postcss@8.4.38) tailwindcss: specifier: ^3.4.4 - version: 3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) + version: 3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -222,7 +231,7 @@ importers: version: 7.10.0(eslint@9.5.0)(typescript@5.4.5) '@vercel/style-guide': specifier: ^5.2.0 - version: 5.2.0(eslint@9.5.0)(jest@29.7.0)(prettier@3.3.2)(typescript@5.4.5) + version: 5.2.0(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(prettier@3.3.2)(typescript@5.4.5) eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.5.0) @@ -1121,9 +1130,15 @@ packages: hono: '>=3.9.0' zod: ^3.19.1 + '@hookform/resolvers@3.9.0': + resolution: {integrity: sha512-bU0Gr4EepJ/EQsH/IwEzYLsT/PEj5C0ynLQ4m+GSHS+xKH4TfSelhluTgOaoc4kA5s7eCsQbM4wvZLzELmWzUg==} + peerDependencies: + react-hook-form: ^7.0.0 + '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1131,6 +1146,7 @@ packages: '@humanwhocodes/object-schema@2.0.2': resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + deprecated: Use @eslint/object-schema instead '@humanwhocodes/retry@0.3.0': resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} @@ -1440,6 +1456,32 @@ packages: '@types/react': optional: true + '@radix-ui/react-label@2.1.0': + resolution: {integrity: sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-primitive@2.0.0': + resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-slot@1.1.0': resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} peerDependencies: @@ -3226,6 +3268,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -3377,6 +3420,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -4398,6 +4442,12 @@ packages: peerDependencies: react: ^18.3.1 + react-hook-form@7.52.2: + resolution: {integrity: sha512-pqfPEbERnxxiNMPd0bzmt1tuaPcVccywFDpyk2uV5xCIBphHV5T8SVnX9/o3kplPE1zzKt77+YIoq+EMwJp56A==} + engines: {node: '>=18.0.0'} + peerDependencies: + react: ^16.8.0 || ^17 || ^18 || ^19 + react-icons@5.2.1: resolution: {integrity: sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==} peerDependencies: @@ -4561,6 +4611,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup@4.18.0: @@ -6064,6 +6115,10 @@ snapshots: hono: 4.4.6 zod: 3.23.8 + '@hookform/resolvers@3.9.0(react-hook-form@7.52.2(react@18.3.1))': + dependencies: + react-hook-form: 7.52.2(react@18.3.1) + '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.2 @@ -6184,7 +6239,7 @@ snapshots: slash: 3.0.0 optional: true - '@jest/core@29.7.0': + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -6198,7 +6253,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.2) + jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -6477,6 +6532,24 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 + '@radix-ui/react-label@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + + '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 + '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) @@ -7182,7 +7255,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vercel/style-guide@5.2.0(eslint@9.5.0)(jest@29.7.0)(prettier@3.3.2)(typescript@5.4.5)': + '@vercel/style-guide@5.2.0(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(prettier@3.3.2)(typescript@5.4.5)': dependencies: '@babel/core': 7.24.6 '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@9.5.0) @@ -7194,9 +7267,9 @@ snapshots: eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0) eslint-plugin-eslint-comments: 3.2.0(eslint@9.5.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5) eslint-plugin-jsx-a11y: 6.8.0(eslint@9.5.0) - eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5))(eslint@9.5.0) + eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5))(eslint@9.5.0) eslint-plugin-react: 7.34.1(eslint@9.5.0) eslint-plugin-react-hooks: 4.6.2(eslint@9.5.0) eslint-plugin-testing-library: 6.2.2(eslint@9.5.0)(typescript@5.4.5) @@ -7726,13 +7799,13 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - create-jest@29.7.0: + create-jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.14.2) + jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -7796,7 +7869,9 @@ snapshots: dependencies: ms: 2.1.2 - dedent@1.5.3: + dedent@1.5.3(babel-plugin-macros@3.1.0): + optionalDependencies: + babel-plugin-macros: 3.1.0 optional: true deep-extend@0.6.0: {} @@ -8146,7 +8221,7 @@ snapshots: debug: 4.3.5 enhanced-resolve: 5.16.1 eslint: 9.5.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 @@ -8158,13 +8233,12 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 6.21.0(eslint@9.5.0)(typescript@5.4.5) eslint: 9.5.0 - eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0) transitivePeerDependencies: - supports-color @@ -8212,13 +8286,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@9.5.0)(typescript@5.4.5) eslint: 9.5.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5) - jest: 29.7.0 + jest: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) transitivePeerDependencies: - supports-color - typescript @@ -8245,11 +8319,11 @@ snapshots: eslint-plugin-only-warn@1.1.0: {} - eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5))(eslint@9.5.0): + eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5))(eslint@9.5.0): dependencies: eslint: 9.5.0 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5) eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): dependencies: @@ -9098,7 +9172,7 @@ snapshots: p-limit: 3.1.0 optional: true - jest-circus@29.7.0: + jest-circus@29.7.0(babel-plugin-macros@3.1.0): dependencies: '@jest/environment': 29.7.0 '@jest/expect': 29.7.0 @@ -9107,7 +9181,7 @@ snapshots: '@types/node': 20.14.2 chalk: 4.1.2 co: 4.6.0 - dedent: 1.5.3 + dedent: 1.5.3(babel-plugin-macros@3.1.0) is-generator-fn: 2.1.0 jest-each: 29.7.0 jest-matcher-utils: 29.7.0 @@ -9125,16 +9199,16 @@ snapshots: - supports-color optional: true - jest-cli@29.7.0: + jest-cli@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0 + create-jest: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.14.2) + jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -9145,7 +9219,7 @@ snapshots: - ts-node optional: true - jest-config@29.7.0(@types/node@20.14.2): + jest-config@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: '@babel/core': 7.24.7 '@jest/test-sequencer': 29.7.0 @@ -9156,7 +9230,7 @@ snapshots: deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-circus: 29.7.0 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) jest-environment-node: 29.7.0 jest-get-type: 29.6.3 jest-regex-util: 29.6.3 @@ -9171,6 +9245,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.14.2 + ts-node: 10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -9412,12 +9487,12 @@ snapshots: supports-color: 8.1.1 optional: true - jest@29.7.0: + jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0 + jest-cli: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -9975,13 +10050,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: lilconfig: 3.1.2 yaml: 2.4.5 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.1(@types/node@20.14.2)(typescript@5.4.5) + ts-node: 10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) postcss-mixins@9.0.4(postcss@8.4.38): dependencies: @@ -10096,6 +10171,10 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 + react-hook-form@7.52.2(react@18.3.1): + dependencies: + react: 18.3.1 + react-icons@5.2.1(react@18.3.1): dependencies: react: 18.3.1 @@ -10617,11 +10696,11 @@ snapshots: tailwind-merge@2.4.0: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))): dependencies: - tailwindcss: 3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) - tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)): + tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -10640,7 +10719,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -10735,7 +10814,7 @@ snapshots: optionalDependencies: '@swc/core': 1.6.1 - ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5): + ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -10752,6 +10831,8 @@ snapshots: typescript: 5.4.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.6.1 optional: true tsconfig-paths@3.15.0: From ac5fcc62f1a2e1408d54bd5cec3f780fdb80b330 Mon Sep 17 00:00:00 2001 From: falendikategar Date: Wed, 4 Sep 2024 10:20:06 +0700 Subject: [PATCH 05/37] Revert "update: Revision for Slicing Login Page" This reverts commit 95aec9faf37f26450a4dad1cc250e296bcb8324a. --- apps/frontend/package.json | 3 - apps/frontend/src/routes/login/index.lazy.tsx | 34 ++-- pnpm-lock.yaml | 153 +++++------------- 3 files changed, 50 insertions(+), 140 deletions(-) diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 0068476..b89c51a 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -10,13 +10,11 @@ }, "dependencies": { "@emotion/react": "^11.11.4", - "@hookform/resolvers": "^3.9.0", "@mantine/core": "^7.10.2", "@mantine/dates": "^7.10.2", "@mantine/form": "^7.10.2", "@mantine/hooks": "^7.10.2", "@mantine/notifications": "^7.10.2", - "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", "@tanstack/react-query": "^5.45.0", "@tanstack/react-router": "^1.38.1", @@ -30,7 +28,6 @@ "mantine-form-zod-resolver": "^1.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-hook-form": "^7.52.2", "react-icons": "^5.2.1", "tailwind-merge": "^2.4.0", "tailwindcss-animate": "^1.0.7", diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index 66b0275..58c16ef 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -97,24 +97,18 @@ export default function LoginPage() { }; return ( -
-
+
+
Amati
-
-
-
-
-
-
-
-
-
-
-
- -

Sign In

-

+

+ +

Sign In

+

New to this app?{' '} ( - Email/Username + Email/Username ( - Password + Password Forgot Password? @@ -183,7 +177,7 @@ export default function LoginPage() { className="w-full flex items-center justify-center space-x-[13.125rem] sm:space-x-[20rem] lg:space-x-[23.125rem] bg-[#2555FF] text-white hover:bg-[#1e4ae0]" > - Sign In + Sign In

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec1b9dd..16570cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,9 +87,6 @@ importers: '@emotion/react': specifier: ^11.11.4 version: 11.11.4(@types/react@18.3.3)(react@18.3.1) - '@hookform/resolvers': - specifier: ^3.9.0 - version: 3.9.0(react-hook-form@7.52.2(react@18.3.1)) '@mantine/core': specifier: ^7.10.2 version: 7.10.2(@mantine/hooks@7.10.2(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -105,9 +102,6 @@ importers: '@mantine/notifications': specifier: ^7.10.2 version: 7.10.2(@mantine/core@7.10.2(@mantine/hooks@7.10.2(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mantine/hooks@7.10.2(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-label': - specifier: ^2.1.0 - version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-slot': specifier: ^1.1.0 version: 1.1.0(@types/react@18.3.3)(react@18.3.1) @@ -147,9 +141,6 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - react-hook-form: - specifier: ^7.52.2 - version: 7.52.2(react@18.3.1) react-icons: specifier: ^5.2.1 version: 5.2.1(react@18.3.1) @@ -158,7 +149,7 @@ importers: version: 2.4.0 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))) + version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5))) zod: specifier: ^3.23.8 version: 3.23.8 @@ -213,7 +204,7 @@ importers: version: 7.0.1(postcss@8.4.38) tailwindcss: specifier: ^3.4.4 - version: 3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + version: 3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -231,7 +222,7 @@ importers: version: 7.10.0(eslint@9.5.0)(typescript@5.4.5) '@vercel/style-guide': specifier: ^5.2.0 - version: 5.2.0(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(prettier@3.3.2)(typescript@5.4.5) + version: 5.2.0(eslint@9.5.0)(jest@29.7.0)(prettier@3.3.2)(typescript@5.4.5) eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.5.0) @@ -1130,15 +1121,9 @@ packages: hono: '>=3.9.0' zod: ^3.19.1 - '@hookform/resolvers@3.9.0': - resolution: {integrity: sha512-bU0Gr4EepJ/EQsH/IwEzYLsT/PEj5C0ynLQ4m+GSHS+xKH4TfSelhluTgOaoc4kA5s7eCsQbM4wvZLzELmWzUg==} - peerDependencies: - react-hook-form: ^7.0.0 - '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1146,7 +1131,6 @@ packages: '@humanwhocodes/object-schema@2.0.2': resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} - deprecated: Use @eslint/object-schema instead '@humanwhocodes/retry@0.3.0': resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} @@ -1456,32 +1440,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-label@2.1.0': - resolution: {integrity: sha512-peLblDlFw/ngk3UWq0VnYaOLy6agTZZ+MUO/WhVfm14vJGML+xH4FAl2XQGLqdefjNb7ApRg6Yn7U42ZhmYXdw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-primitive@2.0.0': - resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-slot@1.1.0': resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} peerDependencies: @@ -3268,7 +3226,6 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -3420,7 +3377,6 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -4442,12 +4398,6 @@ packages: peerDependencies: react: ^18.3.1 - react-hook-form@7.52.2: - resolution: {integrity: sha512-pqfPEbERnxxiNMPd0bzmt1tuaPcVccywFDpyk2uV5xCIBphHV5T8SVnX9/o3kplPE1zzKt77+YIoq+EMwJp56A==} - engines: {node: '>=18.0.0'} - peerDependencies: - react: ^16.8.0 || ^17 || ^18 || ^19 - react-icons@5.2.1: resolution: {integrity: sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==} peerDependencies: @@ -4611,7 +4561,6 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup@4.18.0: @@ -6115,10 +6064,6 @@ snapshots: hono: 4.4.6 zod: 3.23.8 - '@hookform/resolvers@3.9.0(react-hook-form@7.52.2(react@18.3.1))': - dependencies: - react-hook-form: 7.52.2(react@18.3.1) - '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.2 @@ -6239,7 +6184,7 @@ snapshots: slash: 3.0.0 optional: true - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))': + '@jest/core@29.7.0': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -6253,7 +6198,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.14.2) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -6532,24 +6477,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@radix-ui/react-label@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - - '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 - '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) @@ -7255,7 +7182,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vercel/style-guide@5.2.0(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(prettier@3.3.2)(typescript@5.4.5)': + '@vercel/style-guide@5.2.0(eslint@9.5.0)(jest@29.7.0)(prettier@3.3.2)(typescript@5.4.5)': dependencies: '@babel/core': 7.24.6 '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@9.5.0) @@ -7267,9 +7194,9 @@ snapshots: eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0) eslint-plugin-eslint-comments: 3.2.0(eslint@9.5.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5) eslint-plugin-jsx-a11y: 6.8.0(eslint@9.5.0) - eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5))(eslint@9.5.0) + eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5))(eslint@9.5.0) eslint-plugin-react: 7.34.1(eslint@9.5.0) eslint-plugin-react-hooks: 4.6.2(eslint@9.5.0) eslint-plugin-testing-library: 6.2.2(eslint@9.5.0)(typescript@5.4.5) @@ -7799,13 +7726,13 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - create-jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + create-jest@29.7.0: dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.14.2) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -7869,9 +7796,7 @@ snapshots: dependencies: ms: 2.1.2 - dedent@1.5.3(babel-plugin-macros@3.1.0): - optionalDependencies: - babel-plugin-macros: 3.1.0 + dedent@1.5.3: optional: true deep-extend@0.6.0: {} @@ -8221,7 +8146,7 @@ snapshots: debug: 4.3.5 enhanced-resolve: 5.16.1 eslint: 9.5.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 @@ -8233,12 +8158,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 6.21.0(eslint@9.5.0)(typescript@5.4.5) eslint: 9.5.0 + eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@9.5.0) transitivePeerDependencies: - supports-color @@ -8286,13 +8212,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@9.5.0)(typescript@5.4.5) eslint: 9.5.0 optionalDependencies: '@typescript-eslint/eslint-plugin': 7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5) - jest: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + jest: 29.7.0 transitivePeerDependencies: - supports-color - typescript @@ -8319,11 +8245,11 @@ snapshots: eslint-plugin-only-warn@1.1.0: {} - eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5))(eslint@9.5.0): + eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5))(eslint@9.5.0): dependencies: eslint: 9.5.0 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)))(typescript@5.4.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(typescript@5.4.5))(eslint@9.5.0)(jest@29.7.0)(typescript@5.4.5) eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): dependencies: @@ -9172,7 +9098,7 @@ snapshots: p-limit: 3.1.0 optional: true - jest-circus@29.7.0(babel-plugin-macros@3.1.0): + jest-circus@29.7.0: dependencies: '@jest/environment': 29.7.0 '@jest/expect': 29.7.0 @@ -9181,7 +9107,7 @@ snapshots: '@types/node': 20.14.2 chalk: 4.1.2 co: 4.6.0 - dedent: 1.5.3(babel-plugin-macros@3.1.0) + dedent: 1.5.3 is-generator-fn: 2.1.0 jest-each: 29.7.0 jest-matcher-utils: 29.7.0 @@ -9199,16 +9125,16 @@ snapshots: - supports-color optional: true - jest-cli@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + jest-cli@29.7.0: dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + '@jest/core': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + create-jest: 29.7.0 exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@20.14.2) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -9219,7 +9145,7 @@ snapshots: - ts-node optional: true - jest-config@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + jest-config@29.7.0(@types/node@20.14.2): dependencies: '@babel/core': 7.24.7 '@jest/test-sequencer': 29.7.0 @@ -9230,7 +9156,7 @@ snapshots: deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-circus: 29.7.0 jest-environment-node: 29.7.0 jest-get-type: 29.6.3 jest-regex-util: 29.6.3 @@ -9245,7 +9171,6 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.14.2 - ts-node: 10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -9487,12 +9412,12 @@ snapshots: supports-color: 8.1.1 optional: true - jest@29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + jest@29.7.0: dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + '@jest/core': 29.7.0 '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.14.2)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + jest-cli: 29.7.0 transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -10050,13 +9975,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)): dependencies: lilconfig: 3.1.2 yaml: 2.4.5 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5) + ts-node: 10.9.1(@types/node@20.14.2)(typescript@5.4.5) postcss-mixins@9.0.4(postcss@8.4.38): dependencies: @@ -10171,10 +10096,6 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-hook-form@7.52.2(react@18.3.1): - dependencies: - react: 18.3.1 - react-icons@5.2.1(react@18.3.1): dependencies: react: 18.3.1 @@ -10696,11 +10617,11 @@ snapshots: tailwind-merge@2.4.0: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5))): dependencies: - tailwindcss: 3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) - tailwindcss@3.4.4(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)): + tailwindcss@3.4.4(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -10719,7 +10640,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -10814,7 +10735,7 @@ snapshots: optionalDependencies: '@swc/core': 1.6.1 - ts-node@10.9.1(@swc/core@1.6.1)(@types/node@20.14.2)(typescript@5.4.5): + ts-node@10.9.1(@types/node@20.14.2)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -10831,8 +10752,6 @@ snapshots: typescript: 5.4.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - optionalDependencies: - '@swc/core': 1.6.1 optional: true tsconfig-paths@3.15.0: From ebaa6f2d8a5758eb8abff0e0d931db126734bd4f Mon Sep 17 00:00:00 2001 From: falendikategar Date: Wed, 4 Sep 2024 10:24:52 +0700 Subject: [PATCH 06/37] update: Slicing For Login Page --- apps/frontend/src/routes/login/index.lazy.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index 58c16ef..2477ae9 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -188,3 +188,4 @@ export default function LoginPage() {
); } + From f4e98fd8138e9e18152310f1139c2a91473fb703 Mon Sep 17 00:00:00 2001 From: Sukma Gladys Date: Wed, 4 Sep 2024 16:12:22 +0700 Subject: [PATCH 07/37] fix: text color --- apps/frontend/src/routes/forgot-password/index.lazy.tsx | 2 +- apps/frontend/src/routes/forgot-password/verify.lazy.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/routes/forgot-password/index.lazy.tsx b/apps/frontend/src/routes/forgot-password/index.lazy.tsx index 8f0a73e..2844bac 100644 --- a/apps/frontend/src/routes/forgot-password/index.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/index.lazy.tsx @@ -185,7 +185,7 @@ export function ForgotPasswordForm() { > Forgot Password -

+

No worries, we'll send you reset instructions

diff --git a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx index 23d5b94..7180c97 100644 --- a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx @@ -221,7 +221,7 @@ export function ResetPasswordForm() { > Change Password -

Enter your new password

+

Enter your new password

Date: Wed, 4 Sep 2024 16:15:05 +0700 Subject: [PATCH 08/37] update: Revision on Login Page --- apps/frontend/src/routes/login/index.lazy.tsx | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index 2477ae9..bb4ba08 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -97,18 +97,24 @@ export default function LoginPage() { }; return ( -
-
+
+
Amati
-
- -

Sign In

-

+

+
+
+
+
+
+
+
+
+
+
+ +

Sign In

+

New to this app?{' '} ( - Email/Username + Email/Username ( - Password + Password Forgot Password? @@ -177,7 +183,7 @@ export default function LoginPage() { className="w-full flex items-center justify-center space-x-[13.125rem] sm:space-x-[20rem] lg:space-x-[23.125rem] bg-[#2555FF] text-white hover:bg-[#1e4ae0]" > - Sign In + Sign In

@@ -187,5 +193,4 @@ export default function LoginPage() {
); -} - +} \ No newline at end of file From c828812cf3fa849ec14d6df13cbee58a620352b5 Mon Sep 17 00:00:00 2001 From: falendikategar Date: Wed, 4 Sep 2024 17:24:54 +0700 Subject: [PATCH 09/37] fix: background div className --- apps/frontend/src/routes/login/index.lazy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index bb4ba08..17cc30b 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -101,7 +101,7 @@ export default function LoginPage() {
Amati
-
+
From cca21096dd83a8437c349442f9ef91cc2ab1b115 Mon Sep 17 00:00:00 2001 From: Sukma Gladys Date: Wed, 4 Sep 2024 18:05:35 +0700 Subject: [PATCH 10/37] fix: background div className --- apps/frontend/src/routes/forgot-password/index.lazy.tsx | 2 +- apps/frontend/src/routes/forgot-password/verify.lazy.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/routes/forgot-password/index.lazy.tsx b/apps/frontend/src/routes/forgot-password/index.lazy.tsx index 2844bac..6a3e361 100644 --- a/apps/frontend/src/routes/forgot-password/index.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/index.lazy.tsx @@ -160,7 +160,7 @@ export function ForgotPasswordForm() { return (
diff --git a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx index 7180c97..44e9bdb 100644 --- a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx @@ -196,7 +196,7 @@ export function ResetPasswordForm() { return (
From e73c99c0a5263361e7d2c45f1bdea207f017ad41 Mon Sep 17 00:00:00 2001 From: Sukma Gladys Date: Thu, 5 Sep 2024 09:38:11 +0700 Subject: [PATCH 11/37] fix: back to login page link --- apps/frontend/src/routes/forgot-password/index.lazy.tsx | 2 +- apps/frontend/src/routes/forgot-password/verify.lazy.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/routes/forgot-password/index.lazy.tsx b/apps/frontend/src/routes/forgot-password/index.lazy.tsx index 6a3e361..58608f1 100644 --- a/apps/frontend/src/routes/forgot-password/index.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/index.lazy.tsx @@ -219,7 +219,7 @@ export function ForgotPasswordForm() { Back to login diff --git a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx index 44e9bdb..5294140 100644 --- a/apps/frontend/src/routes/forgot-password/verify.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/verify.lazy.tsx @@ -261,7 +261,7 @@ export function ResetPasswordForm() { Back to login From 964e9f4eb745083662e6ee9afbc16e0400ea3d94 Mon Sep 17 00:00:00 2001 From: percyfikri Date: Thu, 5 Sep 2024 14:06:16 +0700 Subject: [PATCH 12/37] Update : API for management-aspect --- .../src/routes/managementAspect/route.ts | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/apps/backend/src/routes/managementAspect/route.ts b/apps/backend/src/routes/managementAspect/route.ts index da8a140..772aed5 100644 --- a/apps/backend/src/routes/managementAspect/route.ts +++ b/apps/backend/src/routes/managementAspect/route.ts @@ -40,7 +40,7 @@ export const aspectUpdateSchema = aspectFormSchema.extend({ // Schema for creating and updating subAspects export const subAspectFormSchema = z.object({ name: z.string().min(1).max(50), - aspectId: z.string().uuid(), + aspectId: z.string() }); export const subAspectUpdateSchema = subAspectFormSchema.extend({}); @@ -89,9 +89,12 @@ const managementAspectRoute = new Hono() createdAt: aspects.createdAt, updatedAt: aspects.updatedAt, ...(includeTrashed ? { deletedAt: aspects.deletedAt } : {}), + subAspectId : subAspects.id, + subAspectName : subAspects.name, fullCount: totalCountQuery, }) .from(aspects) + .leftJoin(subAspects, eq(subAspects.aspectId, aspects.id)) .where( and( includeTrashed ? undefined : isNull(aspects.deletedAt), @@ -261,22 +264,6 @@ const managementAspectRoute = new Hono() }) .where(eq(aspects.id, aspectId)); - //Update for Sub-Aspects - // if (aspectData.subAspects) { - // const subAspectsArray = JSON.parse(aspectData.subAspects) as string[]; - - // await db.delete(subAspects).where(eq(subAspects.aspectId, aspectId)); - - // if (subAspectsArray.length) { - // await db.insert(subAspects).values( - // subAspectsArray.map((subAspect) => ({ - // aspectId: aspectId, - // name: subAspect, - // })) - // ); - // } - // } - return c.json({ message: "Aspect updated successfully", }); @@ -394,7 +381,7 @@ const managementAspectRoute = new Hono() eq(subAspects.aspectId, subAspectData.aspectId))); if (existingSubAspect.length > 0) { - throw forbidden({ message: "Nama Sub Aspek sudah tersedia!" }); + throw forbidden({ message: "Sub aspect name already exists!" }); } const [aspect] = await db @@ -423,28 +410,39 @@ const managementAspectRoute = new Hono() // Update sub aspect .patch( - "/subAspect/:id", checkPermission("managementAspect.update"), + "/subAspect/:id", + checkPermission("managementAspect.update"), requestValidator("json", subAspectUpdateSchema), async (c) => { const subAspectId = c.req.param("id"); const subAspectData = c.req.valid("json"); - - // Validation to check if the new sub aspect name already exists + + // Validate if the new sub aspect name already exists for the given aspect const existingSubAspect = await db .select() .from(subAspects) .where( - eq(subAspects.aspectId, subAspectData.aspectId)); - + and( + eq(subAspects.name, subAspectData.name), + eq(subAspects.aspectId, subAspectData.aspectId), + ) + ); + if (existingSubAspect.length > 0) { - throw forbidden({ message: "Name Sub Aspect already exists" }); + throw forbidden({ message: "Sub Aspect name already exists" }); } - - if (!existingSubAspect[0]) + + const [currentSubAspect] = await db + .select() + .from(subAspects) + .where(eq(subAspects.id, subAspectId)); + + if (!currentSubAspect) throw notFound({ message: "The sub aspect is not found", }); - + + // Update the sub aspect await db .update(subAspects) .set({ @@ -452,11 +450,12 @@ const managementAspectRoute = new Hono() updatedAt: new Date(), }) .where(eq(subAspects.id, subAspectId)); - + return c.json({ - message: "Sub aspect updated successfully", + message: "Sub Aspect updated successfully", }); - }) + } + ) // Delete sub aspect .delete( From 041781c5b3074233c43d7f2cfb54321e163a4769 Mon Sep 17 00:00:00 2001 From: Sukma Gladys Date: Thu, 5 Sep 2024 15:56:12 +0700 Subject: [PATCH 13/37] fix: form and bg position --- apps/frontend/src/routes/forgot-password/index.lazy.tsx | 4 ++-- apps/frontend/src/routes/forgot-password/verify.lazy.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/routes/forgot-password/index.lazy.tsx b/apps/frontend/src/routes/forgot-password/index.lazy.tsx index 58608f1..bc29d01 100644 --- a/apps/frontend/src/routes/forgot-password/index.lazy.tsx +++ b/apps/frontend/src/routes/forgot-password/index.lazy.tsx @@ -162,7 +162,7 @@ export function ForgotPasswordForm() {
-
+
@@ -177,7 +177,7 @@ export function ForgotPasswordForm() {
Amati
{/* Center */} -
+

-
+
@@ -213,7 +213,7 @@ export function ResetPasswordForm() {
Amati
{/* Center */} -
+

Date: Fri, 6 Sep 2024 09:27:51 +0700 Subject: [PATCH 14/37] fix: Responsive Design for wide viewing --- apps/frontend/src/routes/login/index.lazy.tsx | 4 ++-- apps/frontend/tailwind.config.js | 17 ++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/frontend/src/routes/login/index.lazy.tsx b/apps/frontend/src/routes/login/index.lazy.tsx index 17cc30b..5439e1e 100644 --- a/apps/frontend/src/routes/login/index.lazy.tsx +++ b/apps/frontend/src/routes/login/index.lazy.tsx @@ -111,9 +111,9 @@ export default function LoginPage() {

-
+
-

Sign In

+

Sign In

New to this app?{' '} Date: Fri, 6 Sep 2024 09:54:31 +0700 Subject: [PATCH 15/37] update: Add role permission for Endpoint to Calculate Average Score By Sub Aspect and Aspect --- apps/backend/src/data/permissions.ts | 12 ++++++++++++ apps/backend/src/routes/assessments/route.ts | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/backend/src/data/permissions.ts b/apps/backend/src/data/permissions.ts index d0a7c76..75d2495 100644 --- a/apps/backend/src/data/permissions.ts +++ b/apps/backend/src/data/permissions.ts @@ -104,6 +104,18 @@ const permissionsData = [ { code: "assessments.updateAnswer", }, + { + code: "assessments.readAverageSubAspect", + }, + { + code: "assessments.readAverageAllSubAspects", + }, + { + code: "assessments.readAverageAspect", + }, + { + code: "assessments.readAverageAllAspects", + }, ] as const; export type SpecificPermissionCode = (typeof permissionsData)[number]["code"]; diff --git a/apps/backend/src/routes/assessments/route.ts b/apps/backend/src/routes/assessments/route.ts index 604c903..462fd09 100644 --- a/apps/backend/src/routes/assessments/route.ts +++ b/apps/backend/src/routes/assessments/route.ts @@ -409,7 +409,7 @@ const assessmentsRoute = new Hono() // Get data for One Sub Aspect average score By Sub Aspect Id and Assessment Id .get( '/average-score/sub-aspects/:subAspectId/assessments/:assessmentId', - // checkPermission("assessments.readAssessmentScore"), + checkPermission("assessments.readAverageSubAspect"), async (c) => { const { subAspectId, assessmentId } = c.req.param(); @@ -440,7 +440,7 @@ const assessmentsRoute = new Hono() // Get data for All Sub Aspects average score By Assessment Id .get( '/average-score/sub-aspects/assessments/:assessmentId', - // checkPermission("assessments.readAssessmentScore"), + checkPermission("assessments.readAverageAllSubAspects"), async (c) => { const { assessmentId } = c.req.param(); @@ -472,6 +472,7 @@ const assessmentsRoute = new Hono() // Get data for One Aspect average score By Aspect Id and Assessment Id .get( "/average-score/aspects/:aspectId/assessments/:assessmentId", + checkPermission("assessments.readAverageAspect"), async (c) => { const { aspectId, assessmentId } = c.req.param(); @@ -503,7 +504,7 @@ const assessmentsRoute = new Hono() // Get data for All Aspects average score By Assessment Id .get( '/average-score/aspects/assessments/:assessmentId', - // checkPermission("assessments.readAssessmentScore"), + checkPermission("assessments.readAverageAllAspects"), async (c) => { const { assessmentId } = c.req.param(); From ddbce9d65e386e377d240a73d9041b6bc6b255b4 Mon Sep 17 00:00:00 2001 From: ferdiansyah666 Date: Fri, 6 Sep 2024 15:06:59 +0700 Subject: [PATCH 16/37] create API for assessmentRequestManagement --- apps/backend/src/data/permissions.ts | 9 +++++++++ apps/backend/src/index.ts | 2 ++ .../src/routes/assessmentRequestManagement/route.ts | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/data/permissions.ts b/apps/backend/src/data/permissions.ts index d0a7c76..2396260 100644 --- a/apps/backend/src/data/permissions.ts +++ b/apps/backend/src/data/permissions.ts @@ -47,6 +47,15 @@ const permissionsData = [ { code: "questions.restore", }, + { + code :"assessmentRequestManagement.readAll", + }, + { + code: "assessmentRequestManagement.update", + }, + { + code :"assessmentRequestManagement.read", + }, { code: "managementAspect.readAll", }, diff --git a/apps/backend/src/index.ts b/apps/backend/src/index.ts index 925b235..820fe77 100644 --- a/apps/backend/src/index.ts +++ b/apps/backend/src/index.ts @@ -93,11 +93,13 @@ const routes = app .route("/assessmentRequest", assessmentRequestRoute) .route("/forgot-password", forgotPasswordRoutes) .route("/assessments", assessmentsRoute) + .route("/assessmentRequestManagement",assessmentsRequestManagementRoutes) .onError((err, c) => { if (err instanceof DashboardError) { return c.json( { message: err.message, + errorCode: err.errorCode, formErrors: err.formErrors, }, diff --git a/apps/backend/src/routes/assessmentRequestManagement/route.ts b/apps/backend/src/routes/assessmentRequestManagement/route.ts index e05e3bd..c8e7fca 100644 --- a/apps/backend/src/routes/assessmentRequestManagement/route.ts +++ b/apps/backend/src/routes/assessmentRequestManagement/route.ts @@ -13,7 +13,7 @@ export const assessmentFormSchema = z.object({ respondentId: z.string().min(1), - status: z.enum(["tertunda", "disetujui", "ditolak", "selesai"]), + status: z.enum(["menunggu konfirmasi", "disetujui", "ditolak", "selesai"]), reviewedBy: z.string().min(1), validatedBy: z.string().min(1), validatedAt: z.string().optional(), @@ -138,7 +138,7 @@ requestValidator( "json", z.object({ - status: z.enum(["tertunda", "disetujui", "ditolak", "selesai"]), + status: z.enum(["menunggu konfirmasi", "disetujui", "ditolak", "selesai"]), }) ), async (c) => { From 79c1e4a353ff9fc9be2fd8e85d40be5bf43a43e7 Mon Sep 17 00:00:00 2001 From: Sukma Gladys Date: Tue, 10 Sep 2024 08:04:01 +0700 Subject: [PATCH 17/37] feat: update template to shadcn component --- apps/frontend/package.json | 5 + apps/frontend/src/assets/logos/amati-logo.png | Bin 0 -> 1991 bytes apps/frontend/src/components/AppHeader.tsx | 120 +++++---- apps/frontend/src/components/AppNavbar.tsx | 94 +++++-- .../src/components/DashboardTable.tsx | 119 +++++---- .../src/components/NavbarChildMenu.tsx | 11 +- .../src/components/NavbarMenuItem.tsx | 85 ++++--- apps/frontend/src/components/PageTemplate.tsx | 231 +++++++++++++----- .../usersManagement/tables/columns.tsx | 30 ++- apps/frontend/src/routes/_dashboardLayout.tsx | 88 ++++--- .../src/shadcn/components/ui/avatar.tsx | 50 ++++ .../src/shadcn/components/ui/badge.tsx | 36 +++ .../src/shadcn/components/ui/breadcrumb.tsx | 115 +++++++++ .../src/shadcn/components/ui/dialog.tsx | 122 +++++++++ .../shadcn/components/ui/dropdown-menu.tsx | 2 - .../src/shadcn/components/ui/pagination.tsx | 117 +++++++++ .../src/shadcn/components/ui/radio-group.tsx | 44 ++++ .../src/shadcn/components/ui/scroll-area.tsx | 48 ++++ .../src/shadcn/components/ui/select.tsx | 160 ++++++++++++ .../src/shadcn/components/ui/table.tsx | 117 +++++++++ .../src/shadcn/components/ui/textarea.tsx | 24 ++ pnpm-lock.yaml | 214 +++++++++++++++- 22 files changed, 1508 insertions(+), 324 deletions(-) create mode 100644 apps/frontend/src/assets/logos/amati-logo.png create mode 100644 apps/frontend/src/shadcn/components/ui/avatar.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/badge.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/breadcrumb.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/dialog.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/pagination.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/radio-group.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/scroll-area.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/select.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/table.tsx create mode 100644 apps/frontend/src/shadcn/components/ui/textarea.tsx diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 37d7123..6fd0053 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -16,9 +16,14 @@ "@mantine/form": "^7.10.2", "@mantine/hooks": "^7.10.2", "@mantine/notifications": "^7.10.2", + "@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-checkbox": "^1.1.1", + "@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-label": "^2.1.0", + "@radix-ui/react-radio-group": "^1.2.0", + "@radix-ui/react-scroll-area": "^1.1.0", + "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-slot": "^1.1.0", "@tanstack/react-query": "^5.45.0", "@tanstack/react-router": "^1.38.1", diff --git a/apps/frontend/src/assets/logos/amati-logo.png b/apps/frontend/src/assets/logos/amati-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..bf15f563d4770d3700595058fdc9d3632219b803 GIT binary patch literal 1991 zcmV;&2RQhNP)@~0drDELIAGL9O(c600d`2O+f$vv5yPoW{?%E@-}mD>6?I1YtHb zUN=-4QXFs{)F*j4CJ4d|kdX8>#7~HS{=z^+Mi8Rp7H*C49&wX_FE9lJL71Eq+#6-g z-i!ucWD*F1FexM&Yig8taKD!nf*?$e0#9U8#19Ss3iQ8Gy0aI54?z$F9*<`uvC+7^ ziZ`X@=fC}DFBXvz1i=?8HobfYK@fxq5s?uDVNyh71VNY-nUe{NLNy7t!)2MfIooH{ zCc`}0HNInaPSc!!<`9I)2qiMA@iP|c4R9(ns#*3uh6AZcX#Otk;hZlQD9xm_-*6F^ zKJwDuqcOw3AiIXe!kD^Y??pLW>vBzm2=+!(mmNlSvN-s@T#d1-%vpVl{MRPVrP zUx~hV7e%gdMi7cOUSzB2=Fg{;kfJ1;x z##)iM9A?bl)K*};N3+MYd0f)kJl)4g^E$O9EoG50KL6a-y5eLGSnmo-ZUb9eStwLP zGGFLTT88z~CNe)@n~d#@opz_8z`Ryrn`8*ot6vcr0^M^x;x~bu z_*RG00PC32KBDRcsMn`4{vKhWs9_t?OW#5BBsbur&z28dr?BlIG?nx3*p4S>P(|$q zr$C%D+*8;Pt{Xo$tt-w#Ax!*Bf$kyB&~9a2cET{3N4nQ)3A$0J1o@iohigZS55%k6 zizlPu=f%`})TPh}?O#(qtqD%2@&+q|M21_DWFl=lNZkkn zXYJFESQ#WTTU}u)2y?*^-=DBDNM!y6k1d2%3w}u5XvZ+FRan{b9-niUq#_AjCIACb>==Ivxl%140upln{Q`b)?japWD`loPw^7|y9eLNxv=U5*hW|azWpq|j-w-WhruR*p40n5gxk(`> zDJ(^XxVKCoulj`e=LvJfzlhZCmt_6}Q;uRY1s__`%>@O0V z=a9p1GxWJIjsJ7YZ?5t-=s)5n2F7ke_FR^ItFTkVDKuHj?+n~ABmdsS$L%$YYkftP z(^$Cokd^ie;%gvT%kK<$7|e%3+(Oe9f5fR*&LX7{&*_qRM;>V`{^Xd(5yQB~4CU}c z!~LEU`0>E_4&S#33h|sSS)hA9=EO*238?%z&ub1#JMyX-X(V8hVA&%&>AU+H!<|DK z1>7bEwPT(X{5d(KU%(#)H{ne&9*t$ira=F*(2nT@iw*Hap(;nZpDznqI*`xIA&tUb Z{1tmmBwwEC<=_AS002ovPDHLkV1i_Wi7NmA literal 0 HcmV?d00001 diff --git a/apps/frontend/src/components/AppHeader.tsx b/apps/frontend/src/components/AppHeader.tsx index 836b93d..3b351e7 100644 --- a/apps/frontend/src/components/AppHeader.tsx +++ b/apps/frontend/src/components/AppHeader.tsx @@ -1,20 +1,13 @@ import { useState } from "react"; -import { - AppShell, - Avatar, - Burger, - Group, - Menu, - UnstyledButton, - Text, - rem, -} from "@mantine/core"; -import logo from "@/assets/logos/logo.png"; +import logo from "@/assets/logos/amati-logo.png"; import cx from "clsx"; import classNames from "./styles/appHeader.module.css"; -import { TbChevronDown } from "react-icons/tb"; +import { IoMdMenu } from "react-icons/io"; import { Link } from "@tanstack/react-router"; import useAuth from "@/hooks/useAuth"; +import { Avatar, AvatarFallback, AvatarImage } from "@/shadcn/components/ui/avatar"; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/shadcn/components/ui/dropdown-menu"; +import { Button } from "@/shadcn/components/ui/button"; // import getUserMenus from "../actions/getUserMenus"; // import { useAuth } from "@/modules/auth/contexts/AuthContext"; // import UserMenuItem from "./UserMenuItem"; @@ -24,73 +17,74 @@ interface Props { toggle: () => void; } +interface User { + id: string; + name: string; + permissions: string[]; + photoProfile?: string; +} + // const mockUserData = { // name: "Fulan bin Fulanah", // email: "janspoon@fighter.dev", // image: "https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/avatars/avatar-5.png", // }; -export default function AppHeader(props: Props) { +export default function AppHeader({toggle}: Props) { const [userMenuOpened, setUserMenuOpened] = useState(false); - const { user } = useAuth(); + const { user }: { user: User | null } = useAuth(); // const userMenus = getUserMenus().map((item, i) => ( // // )); return ( - - - - -

setUserMenuOpened(true)} - onClose={() => setUserMenuOpened(false)} - withinPortal +
+
+ - - - Logout - + - {/* {userMenus} */} - -
- - + + + + + + + + Logout + + + +
+ ); } diff --git a/apps/frontend/src/components/AppNavbar.tsx b/apps/frontend/src/components/AppNavbar.tsx index d44397c..824d092 100644 --- a/apps/frontend/src/components/AppNavbar.tsx +++ b/apps/frontend/src/components/AppNavbar.tsx @@ -1,7 +1,10 @@ -import { AppShell, ScrollArea } from "@mantine/core"; import { useQuery } from "@tanstack/react-query"; import client from "../honoClient"; import MenuItem from "./NavbarMenuItem"; +import { useState, useEffect } from "react"; +import { useLocation } from "@tanstack/react-router"; +import { ScrollArea } from "@/shadcn/components/ui/scroll-area"; +import AppHeader from "./AppHeader"; // import MenuItem from "./SidebarMenuItem"; // import { useAuth } from "@/modules/auth/contexts/AuthContext"; @@ -12,33 +15,84 @@ import MenuItem from "./NavbarMenuItem"; * * @returns A React element representing the application's navigation bar. */ -export default function AppNavbar() { +export default function AppNavbar(){ // const {user} = useAuth(); + const { pathname } = useLocation(); + + const [isSidebarOpen, setSidebarOpen] = useState(true); + const toggleSidebar = () => { + setSidebarOpen(!isSidebarOpen); + }; + const { data } = useQuery({ queryKey: ["sidebarData"], queryFn: async () => { - const res = await client.dashboard.getSidebarItems.$get(); - if (res.ok) { - const data = await res.json(); - - return data; - } - console.error("Error:", res.status, res.statusText); - - //TODO: Handle error properly - throw new Error("Error fetching sidebar data"); + const res = await client.dashboard.getSidebarItems.$get(); + if (res.ok) { + const data = await res.json(); + return data; + } + console.error("Error:", res.status, res.statusText); + throw new Error("Error fetching sidebar data"); }, }); + useEffect(() => { + const handleResize = () => { + if (window.innerWidth < 768) { // Ganti 768 dengan breakpoint mobile Anda + setSidebarOpen(false); + } else { + setSidebarOpen(true); + } + }; + + window.addEventListener('resize', handleResize); + handleResize(); // Initial check + + return () => window.removeEventListener('resize', handleResize); + }, []); + + const [activeMenuId, setActiveMenuId] = useState(''); + + const handleMenuItemClick = (id: string) => { + setActiveMenuId(id); + if (window.innerWidth < 768) { + setSidebarOpen(false); + } + }; + return ( - - - {data?.map((menu, i) => )} - {/* {user?.sidebarMenus.map((menu, i) => ( - - )) ?? null} */} - - + <> +
+ {/* Header */} + + + {/* Sidebar */} +
+ + {data?.map((menu, i) => ( + + ))} + +
+ + {/* Overlay to close sidebar on mobile */} + {isSidebarOpen && ( +
+ )} +
+ ); } diff --git a/apps/frontend/src/components/DashboardTable.tsx b/apps/frontend/src/components/DashboardTable.tsx index 1b03a27..5301c59 100644 --- a/apps/frontend/src/components/DashboardTable.tsx +++ b/apps/frontend/src/components/DashboardTable.tsx @@ -1,5 +1,13 @@ -import { Table, Center, ScrollArea } from "@mantine/core"; -import { Table as ReactTable, flexRender } from "@tanstack/react-table"; +import { ScrollArea } from "@/shadcn/components/ui/scroll-area"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow +} from "@/shadcn/components/ui/table"; +import { flexRender, Table as ReactTable } from "@tanstack/react-table"; interface Props { table: ReactTable; @@ -7,68 +15,55 @@ interface Props { export default function DashboardTable({ table }: Props) { return ( - - - {/* Thead */} - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - + +
+ + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender(header.column.columnDef.header, header.getContext())} + ))} - + + ))} + - {/* Tbody */} - - {table.getRowModel().rows.length > 0 ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - )) - ) : ( - - -
- No Data -
-
-
- )} -
+ + {table.getRowModel().rows.length > 0 ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + )) + ) : ( + + + - No Data - + + + )} +
-
+ ); } diff --git a/apps/frontend/src/components/NavbarChildMenu.tsx b/apps/frontend/src/components/NavbarChildMenu.tsx index 3f09f2f..5ed22ef 100644 --- a/apps/frontend/src/components/NavbarChildMenu.tsx +++ b/apps/frontend/src/components/NavbarChildMenu.tsx @@ -1,5 +1,3 @@ -import { Text } from "@mantine/core"; - import classNames from "./styles/navbarChildMenu.module.css"; import { SidebarMenu } from "backend/types"; @@ -22,13 +20,10 @@ export default function ChildMenu(props: Props) { : `/${props.item.link}`; return ( - - component="a" - className={classNames.link} - href={`${linkPath}`} - fw={props.active ? "bold" : "normal"} +
{props.item.label} - + ); } diff --git a/apps/frontend/src/components/NavbarMenuItem.tsx b/apps/frontend/src/components/NavbarMenuItem.tsx index fc0e202..d1e114b 100644 --- a/apps/frontend/src/components/NavbarMenuItem.tsx +++ b/apps/frontend/src/components/NavbarMenuItem.tsx @@ -1,16 +1,5 @@ import { useState } from "react"; - -import { - Box, - Collapse, - Group, - ThemeIcon, - UnstyledButton, - rem, -} from "@mantine/core"; -import { TbChevronRight } from "react-icons/tb"; import * as TbIcons from "react-icons/tb"; - import classNames from "./styles/navbarMenuItem.module.css"; // import dashboardConfig from "../dashboard.config"; // import { usePathname } from "next/navigation"; @@ -19,9 +8,14 @@ import classNames from "./styles/navbarMenuItem.module.css"; import { SidebarMenu } from "backend/types"; import ChildMenu from "./NavbarChildMenu"; import { Link } from "@tanstack/react-router"; +import { Button } from "@/shadcn/components/ui/button"; +import { ChevronRightIcon} from "lucide-react"; +import { cn } from "@/lib/utils"; interface Props { menu: SidebarMenu; + isActive: boolean; + onClick: (link: string) => void; } //TODO: Make bold and collapsed when the item is active @@ -34,7 +28,7 @@ interface Props { * @param props.menu - The menu item data to display. * @returns A React element representing an individual menu item. */ -export default function MenuItem({ menu }: Props) { +export default function MenuItem({ menu, isActive, onClick }: Props) { const hasChildren = Array.isArray(menu.children); // const pathname = usePathname(); @@ -50,6 +44,13 @@ export default function MenuItem({ menu }: Props) { setOpened((prev) => !prev); }; + const handleClick = () => { + onClick(menu.link ?? ""); // Notify parent of the active menu item + if (!hasChildren) { + toggleOpenMenu(); // Collapse if no children + } + }; + // Mapping children menu items if available const subItems = (hasChildren ? menu.children! : []).map((child, index) => ( @@ -69,43 +70,41 @@ export default function MenuItem({ menu }: Props) { return ( <> {/* Main Menu Item */} - - onClick={toggleOpenMenu} - className={`${classNames.control} py-2`} - to={menu.link} - component={menu.link ? Link : "button"} + {/* Collapsible Sub-Menu */} - {hasChildren && {subItems}} + {hasChildren && ( +
+ {subItems} +
+ )} ); } diff --git a/apps/frontend/src/components/PageTemplate.tsx b/apps/frontend/src/components/PageTemplate.tsx index 3107229..c26a673 100644 --- a/apps/frontend/src/components/PageTemplate.tsx +++ b/apps/frontend/src/components/PageTemplate.tsx @@ -1,16 +1,4 @@ /* eslint-disable no-mixed-spaces-and-tabs */ -import { - Button, - Card, - Flex, - Pagination, - Select, - Stack, - Text, - TextInput, - Title, -} from "@mantine/core"; -import { Link } from "@tanstack/react-router"; import React, { ReactNode, useState } from "react"; import { TbPlus, TbSearch } from "react-icons/tb"; import DashboardTable from "./DashboardTable"; @@ -26,6 +14,26 @@ import { useQuery, } from "@tanstack/react-query"; import { useDebouncedCallback } from "@mantine/hooks"; +import { Button } from "@/shadcn/components/ui/button"; +import { useNavigate } from "@tanstack/react-router"; +import { Card } from "@/shadcn/components/ui/card"; +import { Input } from "@/shadcn/components/ui/input"; +import { + Pagination, + PaginationContent, + PaginationEllipsis, + PaginationItem, + PaginationLink, + PaginationNext, + PaginationPrevious, + } from "@/shadcn/components/ui/pagination" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/shadcn/components/ui/select" type PaginatedResponse> = { data: Array; @@ -71,30 +79,108 @@ const createCreateButton = ( property: Props["createButton"] = true ) => { if (property === true) { + const navigate = useNavigate(); return ( ); } else if (typeof property === "string") { + const navigate = useNavigate(); return ( + + + ); } else { return property; } }; +/** + * Pagination component for handling page navigation. + * + * @param props - The properties object. + * @returns The rendered Pagination component. + */ +const CustomPagination = ({ + currentPage, + totalPages, + onPageChange, + hasNextPage, + }: { + currentPage: number; + totalPages: number; + onPageChange: (page: number) => void; + hasNextPage: boolean; + }) => { + return ( + + + + onPageChange(currentPage - 1)} + className={`${ + currentPage === 1 + ? 'bg-white text-muted-foreground cursor-not-allowed' + : 'bg-white text-black hover:bg-muted hover:text-black' + }`} + aria-disabled={currentPage === 1} + > + Previous + + + + {Array.from({ length: totalPages }, (_, index) => index + 1).map((page) => ( + + onPageChange(page)} + className={page === currentPage ? 'border text-black' : ''} + > + {page} + + + ))} + + {totalPages > 1 && currentPage < totalPages && ( + + + + )} + + + onPageChange(currentPage + 1)} + className={`${ + !hasNextPage || currentPage === totalPages + ? 'bg-white text-muted-foreground cursor-not-allowed' + : 'bg-white text-black hover:bg-muted hover:text-black' + }`} + aria-disabled={!hasNextPage || currentPage === totalPages} + > + Next + + + + + ); + }; + /** * PageTemplate component for displaying a paginated table with search and filter functionality. @@ -131,7 +217,11 @@ export default function PageTemplate< columns: props.columnDefs, getCoreRowModel: getCoreRowModel(), defaultColumn: { - cell: (props) => {props.getValue() as ReactNode}, + cell: (props) => ( + + {props.getValue() as ReactNode} + + ), }, }); @@ -154,34 +244,50 @@ export default function PageTemplate< * @param page - The new page number. */ const handlePageChange = (page: number) => { - setFilterOptions((prev) => ({ - page: page - 1, + if (page >= 1 && page <= (query.data?._metadata.totalPages ?? 1)) { + setFilterOptions((prev) => ({ + page: page - 1, // Adjust for zero-based index limit: prev.limit, q: prev.q, - })); - }; + })); + } + }; + + // Default values when query.data is undefined + const totalPages = query.data?._metadata.totalPages ?? 1; + const hasNextPage = query.data + ? filterOptions.page < totalPages - 1 + : false; return ( - - {props.title} - +
+

{props.title}

+ {/* Top Section */} - - {createCreateButton(props.createButton)} - + {/* Table Functionality */}
- {/* Search */} -
- } + {/* Search and Create Button */} +
+
+ + handleSearchQueryChange(e.target.value) } placeholder="Search..." /> + +
+
+ {createCreateButton(props.createButton)} +
{/* Table */} @@ -189,32 +295,43 @@ export default function PageTemplate< {/* Pagination */} {query.data && ( -
- setFilterOptions((prev) => ({ page: prev.page, limit: parseInt(value ?? "10"), q: prev.q, })) - } - checkIconPosition="right" - className="w-20" + } + defaultValue="10" + > + + + + + 5 + 10 + 50 + 100 + 500 + 1000 + + +
+ - - - Showing {query.data.data.length} of{" "} - {query.data._metadata.totalItems} - +
+ + Showing {query.data.data.length} of {query.data._metadata.totalItems} + +
)}
@@ -224,6 +341,6 @@ export default function PageTemplate< {modal} ))}
- +
); } diff --git a/apps/frontend/src/modules/usersManagement/tables/columns.tsx b/apps/frontend/src/modules/usersManagement/tables/columns.tsx index d29d65c..134f191 100644 --- a/apps/frontend/src/modules/usersManagement/tables/columns.tsx +++ b/apps/frontend/src/modules/usersManagement/tables/columns.tsx @@ -1,5 +1,4 @@ import { createColumnHelper } from "@tanstack/react-table"; -import { Badge, Flex, Group, Avatar, Text, Anchor } from "@mantine/core"; import { TbEye, TbPencil, TbTrash } from "react-icons/tb"; import { CrudPermission } from "@/types"; import stringToColorHex from "@/utils/stringToColorHex"; @@ -7,6 +6,8 @@ import createActionButtons from "@/utils/createActionButton"; import client from "@/honoClient"; import { InferResponseType } from "hono"; import { Link } from "@tanstack/react-router"; +import { Badge } from "@/shadcn/components/ui/badge"; +import { Avatar } from "@/shadcn/components/ui/avatar"; interface ColumnOptions { permissions: Partial; @@ -29,31 +30,28 @@ const createColumns = (options: ColumnOptions) => { columnHelper.accessor("name", { header: "Name", cell: (props) => ( - +
{props.getValue()?.[0].toUpperCase()} - + {props.getValue()} - - + +
), }), columnHelper.accessor("email", { header: "Email", cell: (props) => ( - + {props.getValue()} - + ), }), @@ -66,7 +64,7 @@ const createColumns = (options: ColumnOptions) => { id: "status", header: "Status", cell: (props) => ( - + {props.row.original.isEnabled ? "Active" : "Inactive"} ), @@ -80,7 +78,7 @@ const createColumns = (options: ColumnOptions) => { className: "w-fit", }, cell: (props) => ( - +
{createActionButtons([ { label: "Detail", @@ -104,7 +102,7 @@ const createColumns = (options: ColumnOptions) => { icon: , }, ])} - +
), }), ]; diff --git a/apps/frontend/src/routes/_dashboardLayout.tsx b/apps/frontend/src/routes/_dashboardLayout.tsx index e5d8517..49c8037 100644 --- a/apps/frontend/src/routes/_dashboardLayout.tsx +++ b/apps/frontend/src/routes/_dashboardLayout.tsx @@ -1,4 +1,3 @@ -import { AppShell } from "@mantine/core"; import { Navigate, Outlet, createFileRoute } from "@tanstack/react-router"; import { useDisclosure } from "@mantine/hooks"; import AppHeader from "../components/AppHeader"; @@ -9,60 +8,57 @@ import fetchRPC from "@/utils/fetchRPC"; import client from "@/honoClient"; export const Route = createFileRoute("/_dashboardLayout")({ - component: DashboardLayout, + component: DashboardLayout, - // beforeLoad: ({ location }) => { - // if (true) { - // throw redirect({ - // to: "/login", - // }); - // } - // }, + // beforeLoad: ({ location }) => { + // if (true) { + // throw redirect({ + // to: "/login", + // }); + // } + // }, }); function DashboardLayout() { - const { isAuthenticated, saveAuthData } = useAuth(); + const { isAuthenticated, saveAuthData } = useAuth(); - useQuery({ - queryKey: ["my-profile"], - queryFn: async () => { - const response = await fetchRPC(client.auth["my-profile"].$get()); + useQuery({ + queryKey: ["my-profile"], + queryFn: async () => { + const response = await fetchRPC(client.auth["my-profile"].$get()); - saveAuthData({ - id: response.id, - name: response.name, - permissions: response.permissions, - }); + saveAuthData({ + id: response.id, + name: response.name, + permissions: response.permissions, + }); - return response; - }, - enabled: isAuthenticated, - }); + return response; + }, + enabled: isAuthenticated, + }); - const [openNavbar, { toggle }] = useDisclosure(false); + const [openNavbar, { toggle }] = useDisclosure(false); - return isAuthenticated ? ( - - + return isAuthenticated ? ( +
+ {/* Header */} + - + {/* Main Content Area */} +
+ {/* Sidebar */} + - - - - - ) : ( - - ); + {/* Main Content */} +
+ +
+
+
+ ) : ( + + ); } diff --git a/apps/frontend/src/shadcn/components/ui/avatar.tsx b/apps/frontend/src/shadcn/components/ui/avatar.tsx new file mode 100644 index 0000000..51e507b --- /dev/null +++ b/apps/frontend/src/shadcn/components/ui/avatar.tsx @@ -0,0 +1,50 @@ +"use client" + +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Avatar.displayName = AvatarPrimitive.Root.displayName + +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName + +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName + +export { Avatar, AvatarImage, AvatarFallback } diff --git a/apps/frontend/src/shadcn/components/ui/badge.tsx b/apps/frontend/src/shadcn/components/ui/badge.tsx new file mode 100644 index 0000000..f000e3e --- /dev/null +++ b/apps/frontend/src/shadcn/components/ui/badge.tsx @@ -0,0 +1,36 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return ( +
+ ) +} + +export { Badge, badgeVariants } diff --git a/apps/frontend/src/shadcn/components/ui/breadcrumb.tsx b/apps/frontend/src/shadcn/components/ui/breadcrumb.tsx new file mode 100644 index 0000000..71a5c32 --- /dev/null +++ b/apps/frontend/src/shadcn/components/ui/breadcrumb.tsx @@ -0,0 +1,115 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { ChevronRight, MoreHorizontal } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Breadcrumb = React.forwardRef< + HTMLElement, + React.ComponentPropsWithoutRef<"nav"> & { + separator?: React.ReactNode + } +>(({ ...props }, ref) =>