-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not show inactive users as options for task assignee #13111
Conversation
client/COPY.json
Outdated
@@ -230,7 +230,7 @@ | |||
"ASSIGN_WIDGET_NO_TASK_DETAIL": "Please select a task.", | |||
"ASSIGN_WIDGET_SUCCESS": "%(verb)s %(numCases)s %(casePlural)s", | |||
"ASSIGN_WIDGET_ASSIGNMENT_ERROR_TITLE": "Error assigning tasks", | |||
"ASSIGN_WIDGET_ASSIGNMENT_ERROR_DETAIL": "One or more tasks couldn't be assigned. Reassign tasks to a judge on the case deatils screen", | |||
"ASSIGN_WIDGET_ASSIGNMENT_ERROR_DETAIL": "One or more tasks couldn't be assigned. Reassign tasks to a judge on the case details screen", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a typo I found.
Code Climate has analyzed commit cfa5a4d and detected 0 issues on this pull request. View more on Code Climate. |
…fairs/caseflow into 12949/inactive-users-task-assignee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more task assignment to inactive users!
|
||
def potential_task_assignees(task) | ||
if task.assigned_to.is_a?(Organization) | ||
task.assigned_to.users.reject(&:inactive?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enums come with scopes for free as well. This can be simplified to task.assigned_to.users.active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to go that route, but it doesn't work because task.assigned_to.users
is a Ruby array, not an Active Record object.
if task.assigned_to.is_a?(Organization) | ||
task.assigned_to.users.reject(&:inactive?) | ||
elsif task.parent&.assigned_to.is_a?(Organization) | ||
task.parent.assigned_to.users.reject do |check_user| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here, we can keep the original logic and just add .active
after users
Resolves #12949
Description
In "Assign to Person" task assignment modals, we were offering inactive users
Acceptance Criteria
Testing Plan
User.find_by_css_id("ORG_QUEUE_USER_5").inactive!
User Facing Changes
BEFORE:
AFTER: