Feature #42441
closedImprove error message on role deletion by listing projects using the role
0%
Description
Currently, when attempting to delete a role that is in use, the following message is displayed: This role is in use and cannot be deleted.
However, this message does not provide enough information to understand which projects are using the role and how to resolve the issue.
Proposal:
Enhance the error message to include a list of projects where this role is currently assigned to members.
For example:
Clicking on the project link will take you to the members tab of the settings for that project.
This way, the user can easily identify which project members they need to update before they can delete the role.
A similar improvement was made in #12521 to display detailed information in error messages for better guidance.
Files
Updated by Mizuki ISHIKAWA about 1 month ago
- File 0001-Improve-role-deletion-error-message-to-display-proje.patch 0001-Improve-role-deletion-error-message-to-display-proje.patch added
Attached is a patch that adds a project link to the error message
Updated by Go MAEDA 12 days ago
- Assignee set to Mizuki ISHIKAWA
In the suggested patch, the projects
variable set at the following line in RolesController#destroy
does not appear to be used.
Could you check the patch?
projects = Project.joins(:members).where(members: { role_id: @role.id }).distinct.sorted
Updated by Mizuki ISHIKAWA 10 days ago
- File 0001-Improve-role-deletion-error-message-to-display-proje.patch 0001-Improve-role-deletion-error-message-to-display-proje.patch added
Go MAEDA wrote in #note-3:
In the suggested patch, the
projects
variable set at the following line inRolesController#destroy
does not appear to be used.
Could you check the patch?[...]
You're right. There was an issue with the patch, so I've re-attached the corrected version.