From ef04961c9f6a31c0478ca6732870671199820326 Mon Sep 17 00:00:00 2001 From: cesnimda Date: Sun, 22 Mar 2026 14:29:23 +0100 Subject: [PATCH] feat: expand user profiles and google account linking ux --- .../src/components/UserManagementCard.tsx | 2 +- job-tracker-ui/src/pages/AdminUsersPage.tsx | 22 ++++++++++++++++ job-tracker-ui/src/pages/ProfilePage.tsx | 25 +++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/job-tracker-ui/src/components/UserManagementCard.tsx b/job-tracker-ui/src/components/UserManagementCard.tsx index 673eb38..aa8a4fb 100644 --- a/job-tracker-ui/src/components/UserManagementCard.tsx +++ b/job-tracker-ui/src/components/UserManagementCard.tsx @@ -5,7 +5,7 @@ import { Box, Button, Paper, TextField, Typography } from "@mui/material"; import { api } from "../api"; import { getAuthToken } from "../auth"; import { useToast } from "../toast"; -import { confirmAction } from "../dialogs"; +import { useDialogActions } from "../dialogs"; type UserDto = { id: string; diff --git a/job-tracker-ui/src/pages/AdminUsersPage.tsx b/job-tracker-ui/src/pages/AdminUsersPage.tsx index eabcca7..21148e2 100644 --- a/job-tracker-ui/src/pages/AdminUsersPage.tsx +++ b/job-tracker-ui/src/pages/AdminUsersPage.tsx @@ -212,6 +212,28 @@ export default function AdminUsersPage() { ); })} + {!loading && users.length === 0 ? ( + + + No users. + + + ) : null} + + + + + ); +} + + + + + ); + })} + {!loading && users.length === 0 ? ( diff --git a/job-tracker-ui/src/pages/ProfilePage.tsx b/job-tracker-ui/src/pages/ProfilePage.tsx index ee4fa50..85bd525 100644 --- a/job-tracker-ui/src/pages/ProfilePage.tsx +++ b/job-tracker-ui/src/pages/ProfilePage.tsx @@ -88,6 +88,8 @@ export default function ProfilePage() { + + Account @@ -186,4 +188,27 @@ export default function ProfilePage() { ); +} + try { + await api.post("/auth/change-password", { + currentPassword, + newPassword, + }); + setCurrentPassword(""); + setNewPassword(""); + toast("Password updated.", "success"); + } catch (e: any) { + const msg = e?.response?.data || e?.message || "Failed to change password."; + toast(String(msg), "error"); + } finally { + setLoading(false); + } + }} + > + Update password + + + + + ); }