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
Related issues
Updated by Mizuki ISHIKAWA 7 months 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 7 months 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 7 months 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
projectsvariable set at the following line inRolesController#destroydoes 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.
Updated by Go MAEDA about 2 months ago
- Status changed from Closed to Reopened
The following issue was reported:
Defect #43164: Deleting role that used by many projects raises CookieOverflow error
Updated by Go MAEDA about 2 months ago
- Related to Defect #43164: Deleting role that used by many projects raises CookieOverflow error added
Updated by Go MAEDA about 2 months ago
- Status changed from Reopened to Closed
Go MAEDA wrote in #note-6:
The following issue was reported:
Defect #43164: Deleting role that used by many projects raises CookieOverflow error
Committed the fix in r23933.