Skip to content
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

[PART 3] Remove overtime status of appeal if case is reassigned #14453

Conversation

hschallhorn
Copy link
Contributor

@hschallhorn hschallhorn commented Jun 2, 2020

Resolves #14366

PART 3 in stack to implement #14366
PART 1 #14448
PART 2 #14452

Description

If an appeal has been designated as "overtime approved" remove this status if the case is assigned to another judge or attorney.

Acceptance Criteria

  • OT status is removed when a judge or case movement user reassigns a case to another judge
    • Ama
    • Legacy
  • OT status is removed when a judge or case movement user reassigns an attorney task to another attorney
    • Ama

Testing Plan

AMA Judge

  1. Log in as bvaabshire
  2. Mark an ama case as overtime
  3. Reassign the case to another judge and go back to case details without refreshing
  4. Ensure the case is no longer marked as overtime

AMA Attorney

  1. Mark an ama case as overtime
  2. Assign it to an attorney
  3. Reassign the case to another attorney and go back to case details without refreshing
  4. Ensure the case is no longer marked as overtime

Legacy Judge

  1. Mark a legacy case as overtime
  2. Reassign the case to another judge and go back to case details without refreshing
  3. Ensure the case is no longer marked as overtime

User Facing Changes

  • NONE

@hschallhorn hschallhorn self-assigned this Jun 2, 2020
@hschallhorn hschallhorn changed the base branch from master to hschallhorn/14225-proper-reassign-of-attorney-tasks June 2, 2020 20:41
@codeclimate
Copy link

codeclimate bot commented Jun 2, 2020

Code Climate has analyzed commit 3cb011e and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 3

View more on Code Climate.

…to hschallhorn/14366-remove-ot-on-reassignment
@va-bot
Copy link
Collaborator

va-bot commented Jun 3, 2020

1 Warning
⚠️ This PR modifies React components — consider adding/updating corresponding Storybook file

Generated by 🚫 Danger

@hschallhorn hschallhorn requested a review from ajspotts June 4, 2020 13:49
@hschallhorn hschallhorn changed the title Remove overtime status of appeal if case is reassigned [PART 3] Remove overtime status of appeal if case is reassigned Jun 4, 2020
@@ -96,6 +96,9 @@ def assign_to_judge
# update the location to the assigned judge.
QueueRepository.update_location_to_judge(appeal.vacols_id, assigned_to)

# Remove overtime status of an appeal when reassigning to a judge
appeal.overtime = false if appeal.overtime?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not need a feature toggle check here as overtime? returns false if the feature toggle is not enabled

@@ -145,6 +145,9 @@ class AssignToView extends React.Component {

return this.props.requestPatch(`/tasks/${task.taskId}`, payload, successMsg).then((resp) => {
this.props.onReceiveAmaTasks(resp.body.tasks.data);
if (task.type === 'JudgeAssignTask') {
this.props.setOvertime(task.externalAppealId, false);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On reassign of a judge assign task: Ensure we update the redux store to reflect that this appeal's overtime status is now false

@@ -557,6 +559,8 @@ export const legacyReassignToJudge = ({
dispatch(onReceiveTasks(_.pick(allTasks, ['tasks', 'amaTasks'])));

dispatch(showSuccessMessage(successMessage));

dispatch(setOvertime(oldTask.externalAppealId, false));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On reassign of a legacy judge assign task: Ensure we update the redux store to reflect that this appeal's overtime status is now false

@@ -534,6 +534,8 @@ export const reassignTasksToUser = ({
dispatch(decrementTaskCountForAttorney({
id: previousAssigneeId
}));

dispatch(setOvertime(oldTask.externalAppealId, false));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On reassign of an attorney assign task: Ensure we update the redux store to reflect that this appeal's overtime status is now false

@@ -59,6 +59,8 @@ class AssignToView extends React.Component {
};
}

componentDidMount = () => this.props.resetSuccessMessages();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes the below!
Screen Shot 2020-06-04 at 3 03 25 PM

@@ -47,6 +47,8 @@ class AssignToAttorneyWidget extends React.PureComponent {
};
}

componentDidMount = () => this.props.resetSuccessMessages();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes the below!
Screen Shot 2020-06-04 at 3 03 25 PM

Copy link
Contributor

@ajspotts ajspotts left a comment

Choose a reason for hiding this comment

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

🚀

@hschallhorn hschallhorn merged commit 06bcb47 into hschallhorn/14225-proper-reassign-of-attorney-tasks Jun 9, 2020
@hschallhorn hschallhorn deleted the hschallhorn/14366-remove-ot-on-reassignment branch June 9, 2020 16:18
hschallhorn added a commit that referenced this pull request Jun 9, 2020
* User proper reassign params when reassigning an attorney task

* Remove changes

* [PART 3] Remove overtime status of appeal if case is reassigned (#14453)

* Remove overtime status on judge or attorney reassignment

* Wip

* Properly set overtime to false when reassigning

* Undo changes

* lint

* Clear suvccess messages
va-bot pushed a commit that referenced this pull request Jun 9, 2020
# FULL STACK

PART 1: Remove attorney task cancellation hook #14448
PART 2: Perform "caseflow" reassign of attorney tasks #14452
PART 3: Remove overtime status of appeal if case is reassigned #14453

# THIS PR

Resolves #14181

PART 1 in stack to implement #14366
PART 2 #14452
PART 3 #14453

### Description
Calls send_back_to_judge_assign! directly when cancelling an attorney task rather than relying on a callback.

### Acceptance Criteria
- [x] Hook for sending a case back to judge reassign on attorney task cancellation is removed.

### Testing Plan
1. Log in as BVACASPER
1. Go to any ama attorney task
1. Select "Cancel Task & return to judge"
1. Ensure the attorney and judge decision review task are cancelled and a judge assign task was opened
```ruby
uuid = ""
Appeal.find_by_uuid(uuid).treee
                                  ┌────────────────────────────────────────────────────────────────────────┐
Appeal 682 (evidence_submission)  │ ID   │ STATUS    │ ASGN_BY     │ ASGN_TO     │ UPDATED_AT              │
└── RootTask                      │ 2027 │ on_hold   │             │ Bva         │ 2020-05-22 14:50:19 UTC │
    ├── JudgeDecisionReviewTask   │ 2028 │ cancelled │             │ BVAAABSHIRE │ 2020-06-02 18:19:56 UTC │
    │   └── AttorneyTask          │ 2029 │ cancelled │ BVAAABSHIRE │ BVAEERDMAN  │ 2020-06-02 18:19:55 UTC │
    └── JudgeAssignTask           │ 2532 │ assigned  │             │ BVAAABSHIRE │ 2020-06-02 18:19:56 UTC │
                                  └────────────────────────────────────────────────────────────────────────┘
```
1. Cancel any attorney task by hand
```ruby
task = AttorneyTask.open.last
task.appeal.treee
Appeal 545 (direct_review) ──── │ ID   │ STATUS    │ ASGN_BY     │ ASGN_TO     │ UPDATED_AT              │
└── RootTask                    │ 1458 │ on_hold   │             │ Bva         │ 2020-05-22 14:47:39 UTC │
    ├── DistributionTask        │ 1459 │ completed │             │ Bva         │ 2020-05-22 14:47:39 UTC │
    ├── JudgeAssignTask         │ 1460 │ completed │             │ BVAAABSHIRE │ 2020-06-01 14:34:38 UTC │
    ├── JudgeDecisionReviewTask │ 2493 │ cancelled │ BVAAABSHIRE │ BVAAABSHIRE │ 2020-06-01 14:52:39 UTC │
    │   └── AttorneyTask        │ 2494 │ cancelled │ BVAAABSHIRE │ BVAEERDMAN  │ 2020-06-01 14:52:39 UTC │
    ├── JudgeAssignTask         │ 2495 │ cancelled │             │ BVAAABSHIRE │ 2020-06-01 14:53:15 UTC │
    ├── JudgeAssignTask         │ 2496 │ completed │ BVAAABSHIRE │ BVAAABSHIRE │ 2020-06-01 18:17:36 UTC │
    └── JudgeDecisionReviewTask │ 2523 │ on_hold   │ BVARDUNKLE  │ BVAAABSHIRE │ 2020-06-01 18:17:36 UTC │
        └── AttorneyTask        │ 2524 │ assigned  │ BVARDUNKLE  │ BVAEERDMAN  │ 2020-06-01 18:17:36 UTC │

=> nil
task.cancelled!
```
1. Ensure this does not close the judge review task and does not open a judge assign task
```ruby
task.appeal.reload.treee
Appeal 545 (direct_review)       ID   STATUS    ASGN_BY     ASGN_TO     UPDATED_AT
└── RootTask                     1458 on_hold               Bva         2020-05-22 14:47:39 UTC
    ├── DistributionTask         1459 completed             Bva         2020-05-22 14:47:39 UTC
    ├── JudgeAssignTask          1460 completed             BVAAABSHIRE 2020-06-01 14:34:38 UTC
    ├── JudgeDecisionReviewTask  2493 cancelled BVAAABSHIRE BVAAABSHIRE 2020-06-01 14:52:39 UTC
    │   └── AttorneyTask         2494 cancelled BVAAABSHIRE BVAEERDMAN  2020-06-01 14:52:39 UTC
    ├── JudgeAssignTask          2495 cancelled             BVAAABSHIRE 2020-06-01 14:53:15 UTC
    ├── JudgeAssignTask          2496 completed BVAAABSHIRE BVAAABSHIRE 2020-06-01 18:17:36 UTC
    └── JudgeDecisionReviewTask  2523 assigned  BVARDUNKLE  BVAAABSHIRE 2020-06-02 19:45:16 UTC
        └── AttorneyTask         2524 cancelled BVARDUNKLE  BVAEERDMAN  2020-06-02 19:45:16 UTC
```

### User Facing Changes
 - [ ] None
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.

Remove OT status for cases that are reassigned
3 participants