From 8b91265d8c0336fb0824d837620ab5f5bb22d29d Mon Sep 17 00:00:00 2001 From: User Date: Fri, 21 Feb 2025 20:22:23 +0000 Subject: [PATCH 1/2] Tweaks --- frontend/src/components/Common/UserMenu.tsx | 7 +----- .../src/components/Pending/PendingItems.tsx | 19 ++++++++------- .../src/components/Pending/PendingUsers.tsx | 23 +++++++++--------- .../UserSettings/ChangePassword.tsx | 5 +--- frontend/src/main.tsx | 7 +++++- frontend/src/routes/_layout/admin.tsx | 24 +++++++++---------- frontend/src/routes/_layout/items.tsx | 14 +++++------ frontend/tests/login.spec.ts | 2 +- playwright/.auth/user.json | 14 +++++++++++ 9 files changed, 64 insertions(+), 51 deletions(-) create mode 100644 playwright/.auth/user.json diff --git a/frontend/src/components/Common/UserMenu.tsx b/frontend/src/components/Common/UserMenu.tsx index c6aa1a9855..5f2b26ad44 100644 --- a/frontend/src/components/Common/UserMenu.tsx +++ b/frontend/src/components/Common/UserMenu.tsx @@ -19,12 +19,7 @@ const UserMenu = () => { - diff --git a/frontend/src/components/Pending/PendingItems.tsx b/frontend/src/components/Pending/PendingItems.tsx index 688ba3ab88..0afc50477d 100644 --- a/frontend/src/components/Pending/PendingItems.tsx +++ b/frontend/src/components/Pending/PendingItems.tsx @@ -1,29 +1,30 @@ -import { Skeleton, Table } from "@chakra-ui/react" +import { Table } from "@chakra-ui/react" +import { SkeletonText } from "../ui/skeleton" const PendingItems = () => ( - ID - Title - Description - Actions + ID + Title + Description + Actions {[...Array(5)].map((_, index) => ( - + - + - + - + ))} diff --git a/frontend/src/components/Pending/PendingUsers.tsx b/frontend/src/components/Pending/PendingUsers.tsx index 013ea5fcf8..c7ac1c73ec 100644 --- a/frontend/src/components/Pending/PendingUsers.tsx +++ b/frontend/src/components/Pending/PendingUsers.tsx @@ -1,33 +1,34 @@ -import { Skeleton, Table } from "@chakra-ui/react" +import { Table } from "@chakra-ui/react" +import { SkeletonText } from "../ui/skeleton" const PendingUsers = () => ( - Full name - Email - Role - Status - Actions + Full name + Email + Role + Status + Actions {[...Array(5)].map((_, index) => ( - + - + - + - + - + ))} diff --git a/frontend/src/components/UserSettings/ChangePassword.tsx b/frontend/src/components/UserSettings/ChangePassword.tsx index c94f970df1..55e6167a49 100644 --- a/frontend/src/components/UserSettings/ChangePassword.tsx +++ b/frontend/src/components/UserSettings/ChangePassword.tsx @@ -47,10 +47,7 @@ const ChangePassword = () => { Change Password - + - Full name - Email - Role - Status - Actions + Full name + Email + Role + Status + Actions {users?.map((user) => ( - + {user.full_name || "N/A"} {currentUser?.id === user.id && ( @@ -79,14 +79,14 @@ function UsersTable() { )} - {user.email} - - {user.is_superuser ? "Superuser" : "User"} + + {user.email} - - {user.is_active ? "Active" : "Inactive"} + + {user.is_superuser ? "Superuser" : "User"} - + {user.is_active ? "Active" : "Inactive"} + - ID - Title - Description - Actions + ID + Title + Description + Actions {items?.map((item) => ( - + {item.id} - + {item.title} {item.description || "N/A"} - + diff --git a/frontend/tests/login.spec.ts b/frontend/tests/login.spec.ts index c1bccf3bc8..e482934916 100644 --- a/frontend/tests/login.spec.ts +++ b/frontend/tests/login.spec.ts @@ -124,4 +124,4 @@ test("Redirects to /login when token is wrong", async ({ page }) => { await page.goto("/settings") await page.waitForURL("/login") await expect(page).toHaveURL("/login") -}) \ No newline at end of file +}) diff --git a/playwright/.auth/user.json b/playwright/.auth/user.json new file mode 100644 index 0000000000..4235dc49bc --- /dev/null +++ b/playwright/.auth/user.json @@ -0,0 +1,14 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:5173", + "localStorage": [ + { + "name": "access_token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDA1OTgzMDQsInN1YiI6ImFhZjQ3N2MwLTQ0NTAtNDEyYy04MzQwLTk4NGFiOWE0NmMyMyJ9.c4W2TmVisI-y4qdFZG02etE-9thN9bPcghyxPcMD8EE" + } + ] + } + ] +} \ No newline at end of file From c1970ecfc2bb40548dac99e7f0fdc24ccd08c70d Mon Sep 17 00:00:00 2001 From: Alejandra <90076947+alejsdev@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:23:52 +0000 Subject: [PATCH 2/2] Delete playwright/.auth/user.json --- playwright/.auth/user.json | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 playwright/.auth/user.json diff --git a/playwright/.auth/user.json b/playwright/.auth/user.json deleted file mode 100644 index 4235dc49bc..0000000000 --- a/playwright/.auth/user.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "cookies": [], - "origins": [ - { - "origin": "http://localhost:5173", - "localStorage": [ - { - "name": "access_token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDA1OTgzMDQsInN1YiI6ImFhZjQ3N2MwLTQ0NTAtNDEyYy04MzQwLTk4NGFiOWE0NmMyMyJ9.c4W2TmVisI-y4qdFZG02etE-9thN9bPcghyxPcMD8EE" - } - ] - } - ] -} \ No newline at end of file