feat: add merchant user edit page with editable profile fields
All checks were successful
All checks were successful
- Add /admin/merchant-users/{id}/edit page route and template
- Replace toggle-status button with edit button on merchant-users list
- Editable fields: username, email, first name, last name
- Quick actions: toggle status, delete (with double confirm)
- Move RBAC two-phase plan to docs/proposals/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,10 +16,8 @@ function merchantUsersPage() {
|
||||
merchantUsers: [],
|
||||
loading: false,
|
||||
error: null,
|
||||
showToggleStatusModal: false,
|
||||
showDeleteModal: false,
|
||||
showDeleteFinalModal: false,
|
||||
userToToggle: null,
|
||||
userToDelete: null,
|
||||
filters: {
|
||||
search: '',
|
||||
@@ -230,30 +228,6 @@ function merchantUsersPage() {
|
||||
}
|
||||
},
|
||||
|
||||
// Toggle user active status
|
||||
async toggleUserStatus(user) {
|
||||
const action = user.is_active ? 'deactivate' : 'activate';
|
||||
merchantUsersLog.info(`Toggle status: ${action} for user`, user.username);
|
||||
|
||||
try {
|
||||
const url = `/admin/users/${user.id}/status`;
|
||||
window.LogConfig.logApiCall('PUT', url, null, 'request');
|
||||
|
||||
const response = await apiClient.put(url);
|
||||
|
||||
window.LogConfig.logApiCall('PUT', url, response, 'response');
|
||||
|
||||
user.is_active = response.is_active;
|
||||
Utils.showToast(`User ${action}d successfully`, 'success');
|
||||
merchantUsersLog.info(`User ${action}d successfully`);
|
||||
|
||||
await this.loadStats();
|
||||
} catch (error) {
|
||||
window.LogConfig.logError(error, `Toggle Status (${action})`);
|
||||
Utils.showToast(error.message || `Failed to ${action} user`, 'error');
|
||||
}
|
||||
},
|
||||
|
||||
// Intermediate step for double-confirm delete
|
||||
confirmDeleteStep() {
|
||||
merchantUsersLog.info('First delete confirmation accepted, showing final confirmation');
|
||||
|
||||
Reference in New Issue
Block a user