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 e2a6cab..d2bd065 100644 Binary files a/dashy.db and b/dashy.db differ 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" /> + +