Fix the ability for admins to be able to edit other users information AFTER the user already exists
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
- **`n`**: Open the "Add Task" modal from the main dashboard (disabled while typing in inputs).
|
- **`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.
|
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.
|
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
|
### Phase 3: Advanced Features
|
||||||
- **Real-time Notifications:** Explore WebSockets for task assignments.
|
- **Real-time Notifications:** Explore WebSockets for task assignments.
|
||||||
|
|||||||
+13
-4
@@ -1194,11 +1194,15 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser,
|
|||||||
const [editingUserId, setEditingUserId] = React.useState(null);
|
const [editingUserId, setEditingUserId] = React.useState(null);
|
||||||
const [editName, setEditName] = React.useState('');
|
const [editName, setEditName] = React.useState('');
|
||||||
const [editRole, setEditRole] = React.useState('');
|
const [editRole, setEditRole] = React.useState('');
|
||||||
|
const [editEmail, setEditEmail] = React.useState('');
|
||||||
|
const [editPhone, setEditPhone] = React.useState('');
|
||||||
|
|
||||||
const startEditing = (u) => {
|
const startEditing = (u) => {
|
||||||
setEditingUserId(u.id);
|
setEditingUserId(u.id);
|
||||||
setEditName(u.name);
|
setEditName(u.name);
|
||||||
setEditRole(u.role);
|
setEditRole(u.role);
|
||||||
|
setEditEmail(u.email || '');
|
||||||
|
setEditPhone(u.phone || '');
|
||||||
};
|
};
|
||||||
|
|
||||||
const cancelEditing = () => {
|
const cancelEditing = () => {
|
||||||
@@ -1206,7 +1210,7 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser,
|
|||||||
};
|
};
|
||||||
|
|
||||||
const saveUserEdit = async (id) => {
|
const saveUserEdit = async (id) => {
|
||||||
await onUpdateUserRole(id, { name: editName, role: editRole });
|
await onUpdateUserRole(id, { name: editName, role: editRole, email: editEmail, phone: editPhone });
|
||||||
setEditingUserId(null);
|
setEditingUserId(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1311,8 +1315,10 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser,
|
|||||||
<div className="member-row__meta" style={{ flex: 1 }}>
|
<div className="member-row__meta" style={{ flex: 1 }}>
|
||||||
{editingUserId === u.id ? (
|
{editingUserId === u.id ? (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.25rem' }}>
|
||||||
<input className="field__input field__input--sm" value={editName} onChange={e => setEditName(e.target.value)} autoFocus />
|
<input className="field__input field__input--sm" value={editName} onChange={e => setEditName(e.target.value)} placeholder="Name" />
|
||||||
<input className="field__input field__input--sm" value={editRole} onChange={e => setEditRole(e.target.value)} />
|
<input className="field__input field__input--sm" value={editRole} onChange={e => setEditRole(e.target.value)} placeholder="Role" />
|
||||||
|
<input className="field__input field__input--sm" value={editEmail} onChange={e => setEditEmail(e.target.value)} placeholder="Email" />
|
||||||
|
<input className="field__input field__input--sm" value={editPhone} onChange={e => setEditPhone(e.target.value)} placeholder="Phone" />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -1324,7 +1330,10 @@ function WorkspaceTab({ user, isAdmin, dbUsers = [], onSwitchUser, onCreateUser,
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="member-row__role mono">{u.role} · {u.email || (u.id + '@murchison-auto.co')}</div>
|
<div className="member-row__role mono">
|
||||||
|
{u.role} · {u.email || (u.id + '@murchison-auto.co')}
|
||||||
|
{u.phone && ` · ${u.phone}`}
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user