Skip to content

improve user edit and list#258

Merged
mateodurante merged 7 commits into
developfrom
feature/improve_user_edit_and_list
May 26, 2026
Merged

improve user edit and list#258
mateodurante merged 7 commits into
developfrom
feature/improve_user_edit_and_list

Conversation

@mateodurante
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and new features to user management and UI components, focusing on enhanced password validation, improved user role handling, and better display of related information in tables. The most significant changes include the addition of stricter password validation logic, updates to user forms and API calls to handle new user roles, and UI enhancements for displaying user and contact information.

Password validation and feedback:

  • Added a new getPasswordErrors function in user.jsx to check for common password issues (too short, entirely numeric, or too similar to personal info), and integrated this into the user form to provide real-time feedback using localized error messages. Updated translation files in English and Spanish to include these new messages. [1] [2] [3] [4] [5] [6]

User role and status management:

  • Updated the user form (FormUser.jsx) and API layer (users.jsx) to support editing is_superuser and is_staff fields, including new switches in the UI for these roles. Corresponding changes were made to ensure these fields are sent to and from the backend. [1] [2] [3] [4]

Display of user and contact relationships:

  • Enhanced the user and contact tables to display related users and contacts using new badge components (BadgeUserLabel and BadgeNetworkLabelContact), replacing the previous yes/no field for network admin status with a more informative display of associated contacts. [1] [2] [3] [4]

UI and translation improvements:

  • Improved the clarity and consistency of translation strings for user roles and help tooltips in both English and Spanish, and updated table headers to better reflect their content. [1] [2] [3]

Backend serializer update:

  • Modified the Django UserSerializer to include a contacts field, exposing related contacts in the API response for users. [1] [2]

Copilot AI review requested due to automatic review settings May 26, 2026 15:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances user management by adding stricter client-side password feedback, expanding editable user role fields, and improving how user/contact relationships are displayed in tables (including backend support for exposing related contacts on users).

Changes:

  • Added password issue detection (getPasswordErrors) and inline validation feedback in the user form, plus new i18n strings (EN/ES).
  • Updated user edit flow/API payload to include is_superuser and is_staff, and added role switches to the shared user form.
  • Exposed contacts on the backend user serializer and updated UI tables to display related contacts/users via badge components.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ngen/serializers/auth.py Exposes related contacts on UserSerializer for UI consumption.
frontend/src/views/user/EditUser.jsx Sends is_superuser / is_staff through the update API call.
frontend/src/views/user/components/TableUsers.jsx Shows related contacts in the user table/modal via contact badges.
frontend/src/views/user/components/FormUser.jsx Adds role switches and password error rendering in the shared user form.
frontend/src/views/user/components/BadgeUserLabel.jsx New badge component to display a user label from a URL.
frontend/src/views/contact/components/TableContact.jsx Adds a “User” column displaying the related user as a badge.
frontend/src/utils/validators/user.jsx Introduces getPasswordErrors helper and exports it.
frontend/src/components/Field/YesNoField.jsx Simplifies Yes/No display to a Bootstrap badge.
frontend/src/api/services/users.jsx Extends putUser to include is_superuser / is_staff in payload.
frontend/public/locales/en/translation.json Adds/updates translation strings for password errors and tooltips.
frontend/public/locales/es/translation.json Adds/updates translation strings for password errors and tooltips.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ngen/serializers/auth.py
Comment thread frontend/src/views/user/components/TableUsers.jsx
Comment thread frontend/src/views/user/components/TableUsers.jsx
Comment thread frontend/src/views/user/components/BadgeUserLabel.jsx Outdated
Comment thread frontend/src/views/user/components/FormUser.jsx Outdated
Comment thread frontend/src/views/user/components/FormUser.jsx Outdated
mateodurante and others added 6 commits May 26, 2026 18:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mateodurante mateodurante merged commit 2e2bd28 into develop May 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants