From 66545db31253c65d6cb3b0133e2af8efbe79e006 Mon Sep 17 00:00:00 2001 From: NPS Agent Date: Wed, 13 May 2026 10:47:44 +0930 Subject: [PATCH] When creating a new user it asks for all information (Phone number, email address, name and role) instead of just name and role --- PROGRESS.md | 1 + app.jsx | 2 ++ dashy.db | Bin 110592 -> 110592 bytes screens.jsx | 20 ++++++++++++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index 72ac627..86e8a1b 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -71,6 +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. ### Phase 3: Advanced Features - **Real-time Notifications:** Explore WebSockets for task assignments. diff --git a/app.jsx b/app.jsx index 0784ad0..531c407 100644 --- a/app.jsx +++ b/app.jsx @@ -374,6 +374,8 @@ function App() { id, name: u.name, role: u.role, + email: u.email, + phone: u.phone, hue: Math.floor(Math.random() * 360), initials: u.name.split(' ').map(s=>s[0]).join('').slice(0,2).toUpperCase(), account_type: u.account_type, diff --git a/dashy.db b/dashy.db index e2a6cabbc9a249c634ff197980d29faa3f94dfcb..d2bd065de7ac9ba2a3d9afb29a5bc099ab520e9d 100644 GIT binary patch delta 2024 zcmZvcTWr&27>4~hiCs6YowSsyDqWM((iVE~*>N>N%0z(yJy3+;Dz)Rd1iB=oWnFJd z>uqco6D$hU6KKGW(gvEg<)V{zF-@B`P3%x{!7h*xNC-__Ohp^86-~@ZoU)Qda-=W+ z`~3eGzwiIe-o$2aVsAE74Iv29U_Z3|K&D-Wq0dG?puOZWL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> zY!8KI4>8w`)BeFZy1_bd2429A&JOmUlIPkI-Hj-+?$6JF4S9NO`nCcZjwUuOlEXp>KvR$p(~T= zs6I?k{#{iKH8qX3efg~>mF)A6n^sQWc@8=o!gHtdn;~<8oAOT|YpAaY7R2bJU{N?o W*3x+pR*;Shz@q5U1?>Wy_x%fe1qikP delta 791 zcmXw%Ur1AN6vywmfA`z&e!s0@Hq_ioqX%{OUfVQ@n1o=dO~|aL@~&F{Os~^6jIfPD zdFX=-?^iWr;1Lr&(K3~q4b53ebOwEaz z5~s>AOo^4mO4eLo2kPyvtHj|PV@R)a4FAAGd6#QmHm9@WV`Ue4i|R1V_VJvEIITKshwfmgwk? zsJl1zw+0t2aFuwIjlfJV*nmEwcKcM&Q*W>#&MGI9c!D_YEr>G6e zhK8V)#^CgLy!k|V%EhUgkpCHQ_*Mwyqh*Bgl3(OISs?S|W8U5MisV1<^%{9^<})#; zeF9hn&bu>TiP^B`_;(|OQ%;ImN zi<=e{R$+Y{BY&|s@eC{wmGU~&tU=G&S==a(;p-54bfo2rnzakU5LdXhg@f+1S35mi{!mDOkR^mbfp14 zjOXz?{0!g2Gx#zdrOgIxrXvQF+U2k`A*-@qcGEisRM9yDv{mQ|8b_y5KiX&OL>;IJ z1yQB+39T$BeQ-@Mr|7f)A7e!O}Z7J3YC|xZPcO*@`bXOLRiGRO=KFfl}O0)EL7KTfg zKIMPxS%Lj(x!1a5QLWWu>7@y%{IA+J0p(&{L$IFvQdpdTVUCqC9h`(oR}^7)i?i6{ zDJyDRmPK;l7xck+Zx2o8po*>8S4duj91B^~G~MZX9=ivR7kfSaWnQB9bI|>d4@`k- Q3qNgtu;i%_or0X}4@cnNJpcdz diff --git a/screens.jsx b/screens.jsx index 2c5583e..6923b5a 100644 --- a/screens.jsx +++ b/screens.jsx @@ -1183,6 +1183,8 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, const [adding, setAdding] = React.useState(false); const [newName, setNewName] = React.useState(''); const [newRole, setNewRole] = React.useState(''); + const [newEmail, setNewEmail] = React.useState(''); + const [newPhone, setNewPhone] = React.useState(''); const [newType, setNewType] = React.useState('standard'); const [wsName, setWsName] = React.useState(workspace ? workspace.name : ''); const [wsTz, setWsTz] = React.useState(workspace ? workspace.timezone : ''); @@ -1217,8 +1219,14 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, const submit = () => { if (!newName.trim()) return; - onCreateUser({ name: newName.trim(), role: newRole.trim() || 'Team member', account_type: newType }); - setNewName(''); setNewRole(''); setNewType('standard'); setAdding(false); + onCreateUser({ + name: newName.trim(), + role: newRole.trim() || 'Team member', + account_type: newType, + email: newEmail.trim(), + phone: newPhone.trim() + }); + setNewName(''); setNewRole(''); setNewEmail(''); setNewPhone(''); setNewType('standard'); setAdding(false); }; const handleUpdateWorkspace = async () => { @@ -1268,6 +1276,14 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser, Role / title setNewRole(e.target.value)} placeholder="Apprentice" /> + +
Account type