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

End holds set with timed hold tasks #10687

Merged
merged 18 commits into from
May 10, 2019
Merged

End holds set with timed hold tasks #10687

merged 18 commits into from
May 10, 2019

Conversation

tomas-nava
Copy link
Contributor

@tomas-nava tomas-nava commented May 8, 2019

Connects #9207

Description

  • interface to allow users to end holds set with TimedHoldTasks
  • consolidates task action data functions in a new TaskActionRepository class
  • updating the parent task cancels the TimedHoldTask
  • a TimedHoldTask is invalid if it has more than one TaskTimer

lowellrex and others added 4 commits May 7, 2019 22:11
Freeing up space in models/task.rb which had gone over its line limit.
Also removed timeline_details method from models/task.rb which was no
longer being used.
Also, hide TimedHoldTasks from the queue table view.
@ghost ghost assigned tomas-nava May 8, 2019
@ghost ghost added the In-Progress label May 8, 2019
@tomas-nava tomas-nava requested a review from lowellrex May 8, 2019 09:28
@va-bot
Copy link
Collaborator

va-bot commented May 8, 2019

1 Warning
⚠️ This is a Big PR. Try to break this down if possible.

Generated by 🚫 Danger

@codeclimate
Copy link

codeclimate bot commented May 8, 2019

Code Climate has analyzed commit 71df9b7 and detected 0 issues on this pull request.

View more on Code Climate.

@tomas-nava tomas-nava changed the title [wip] End holds set with timed hold tasks End holds set with timed hold tasks May 8, 2019
Tomas Apodaca added 2 commits May 8, 2019 17:23
Not just when parent's status is updated, but when any parameter of the
parent (aside from placed_on_hold_at) is updated.
title: timeline_title,
date: closed_at
}
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed because this function was never called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it was defined and used in November '18, then the usage was removed in January but the definition never was.

@@ -0,0 +1,226 @@
# frozen_string_literal: true

class TaskActionRepository
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this! Such a clean way to separate this stuff out!

@@ -433,6 +433,10 @@
"NON_COMP_ADDRESS_MESSAGE": "The Veteran/appellant has filed a Notice of Disagreement at the Board of Veterans' Appeals. In order to decide that appeal, the Board will need the complete records from",
"INTAKE_EDIT_TITLE": "Edit contention title",

"END_HOLD_MODAL_TITLE": "End hold early",
"END_HOLD_MODAL_BODY": "Do you want to end the hold early?",
"END_HOLD_SUCCESS_MESSAGE_TITLE": "Success! The hold has been ended early.",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -22,6 +22,7 @@ class Task < ApplicationRecord
before_update :set_timestamps
after_update :update_parent_status, if: :task_just_closed_and_has_parent?
after_update :update_children_status_after_closed, if: :task_just_closed?
after_update :cancel_timed_hold, unless: :task_just_placed_on_hold?
Copy link
Contributor

Choose a reason for hiding this comment

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

If we create a child task for a task that is on a timed hold, will we cancel the existing timed hold? If not, I think it is fine to defer that work to a follow on PR since this looks good (and big!) as is and we aren't creating timed holds yet.

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 will; I added a test in this commit.

Copy link
Contributor

@lowellrex lowellrex left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks so much! One question, but I think it can be addressed in a later PR if need be.

Tomas Apodaca added 4 commits May 9, 2019 12:26
We may revisit this idea later, possibly as a validation on the
TaskTimer object instead of the TimedHoldTask, due to the way in
which TaskTimers are instantiated via the concern.
@tomas-nava tomas-nava added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label May 9, 2019
@ghost ghost assigned va-bot May 9, 2019
@va-bot va-bot merged commit dc71939 into master May 10, 2019
@va-bot va-bot deleted the lowell/9207_end_timed_hold branch May 10, 2019 08:15
@ghost ghost removed the In-Progress label May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants