Project

General

Profile

Actions

Feature #42441

closed

Improve error message on role deletion by listing projects using the role

Added by Mizuki ISHIKAWA about 1 month ago. Updated 9 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Administration
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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

Actions #2

Updated by Go MAEDA 26 days ago

  • Target version set to 6.1.0

Setting the target version to 6.1.0.

Actions #3

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
Actions #4

Updated by Mizuki ISHIKAWA 10 days ago

Go MAEDA wrote in #note-3:

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?

[...]

You're right. There was an issue with the patch, so I've re-attached the corrected version.

Actions #5

Updated by Go MAEDA 9 days ago

  • Status changed from New to Closed
  • Assignee changed from Mizuki ISHIKAWA to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r23619. Thank you.

Actions

Also available in: Atom PDF