From 75c6614e81ccef703d48e0351c04a39d2e4bd2d8 Mon Sep 17 00:00:00 2001 From: NPS Agent Date: Wed, 13 May 2026 10:54:34 +0930 Subject: [PATCH] Fix the ability for admins to be able to edit other users information AFTER the user already exists --- PROGRESS.md | 2 +- dashy.db | Bin 110592 -> 110592 bytes screens.jsx | 17 +++++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index 86e8a1b..2c1094e 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -71,7 +71,7 @@ - **`n`**: Open the "Add Task" modal from the main dashboard (disabled while typing in inputs). 24. **Drag-and-Drop Stability:** Fixed a bug where tasks would "disappear" if dropped in an invalid area. Tasks now remain visible at their original position if a drop is cancelled. 25. **User Deletion Safety:** Implemented a backend check to prevent deleting users who have assigned tasks or notes. Upgraded the frontend `ApiService` to correctly parse and display these descriptive error messages from the backend. -26. **Enhanced User Creation:** Added email and phone number fields to the "Add User" form in the workspace settings, ensuring full contact profiles are created for new team members. +26. **Enhanced User Management:** Admins can now manage full team profiles (Name, Role, Email, and Phone) during both user creation and inline editing in the Workspace settings. ### Phase 3: Advanced Features - **Real-time Notifications:** Explore WebSockets for task assignments. diff --git a/dashy.db b/dashy.db index d2bd065de7ac9ba2a3d9afb29a5bc099ab520e9d..784138b21200510cb23d6d18ace26ac929749c08 100644 GIT binary patch delta 471 zcmZp8z}E19ZGtpo*hCp;#;}bE3;DTu`x#hxelhUp^S;~6Bhbvt!uOpae&WPv?nYh~ zUU6}8Mt*D2$+Kj2nGKDMCtsBf-CQTvwvmsOub+W`KYt#-Jl}P`{>_RCwR~!>O;+rR z#=?q*f{F3Qh8C%&iN;Ar21aJO2Bx}(#tH_8Rz}8FM$-=lGAe4AxHehB6(^>cStMGd z7-K3npZxHz^z;vmjI0`#K1~)N9jf*WK;tb;%`KBsF?AT4OwSKt6c==?EXvPQC`c{J z%`7g?%+D*{oOgdp1M>!kMblXm7#sQ63YY_!4=`_Fo4~e!tzr6v1jZfPeG(Z}SQYr0 z6`2t3XS9Oyp%yY)Y@d+ESi;FXo$c6k_5#LQCbnbSTM8H**ro%;*|=a{VYJ+St&Gu7 zQjmo|iN}I(HE%Z05mrC$az3~15)&Bz@-muCoM<4B%*iL{%_}J^EGz2Bz`(#X-G3gV yB3n*kUZ%O(^zwO(I$X>z8jV@_1S?A=r*EFeSPGNVpU-H>%zlAkd(wQyc>)00eu1X| delta 296 zcmZp8z}E19ZGtpoz(g5m#(<3p3;DVEv=~@;elhUp^Y(A%5oqS+Zj@l*6&Dw0})YMeLz|dl{rd%is-*<+Pi4y}h*U7bQJ%moY!rn4q6HgYisFdtyvz&3$x!SpE!j5}D^8#olU`y?`|u(GgiU{ILoC^J1F zosn((v^2&%PUdNB*QT=Q0=fDU`*@C+N*9Ei5c6>d3&rz+PfG+3UYNdv<0~QKGrw^xAohIsy)j mQ-D$o42>o%e1esw($hE3V=RR$(VNd`$i!5*J!wAUJOKc9uT$j! diff --git a/screens.jsx b/screens.jsx index 6923b5a..86f17a0 100644 --- a/screens.jsx +++ b/screens.jsx @@ -1194,11 +1194,15 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, const [editingUserId, setEditingUserId] = React.useState(null); const [editName, setEditName] = React.useState(''); const [editRole, setEditRole] = React.useState(''); + const [editEmail, setEditEmail] = React.useState(''); + const [editPhone, setEditPhone] = React.useState(''); const startEditing = (u) => { setEditingUserId(u.id); setEditName(u.name); setEditRole(u.role); + setEditEmail(u.email || ''); + setEditPhone(u.phone || ''); }; const cancelEditing = () => { @@ -1206,7 +1210,7 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, }; const saveUserEdit = async (id) => { - await onUpdateUserRole(id, { name: editName, role: editRole }); + await onUpdateUserRole(id, { name: editName, role: editRole, email: editEmail, phone: editPhone }); setEditingUserId(null); }; @@ -1311,8 +1315,10 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser,
{editingUserId === u.id ? (
- setEditName(e.target.value)} autoFocus /> - setEditRole(e.target.value)} /> + setEditName(e.target.value)} placeholder="Name" /> + setEditRole(e.target.value)} placeholder="Role" /> + setEditEmail(e.target.value)} placeholder="Email" /> + setEditPhone(e.target.value)} placeholder="Phone" />
) : ( <> @@ -1324,7 +1330,10 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, )}
-
{u.role} · {u.email || (u.id + '@murchison-auto.co')}
+
+ {u.role} · {u.email || (u.id + '@murchison-auto.co')} + {u.phone && ` · ${u.phone}`} +
)}