app/repositories/task_action_repository.rb
# Cancel the underlying task, and cancels the hearing or hearing request.
#
# @note This task action can be called for either the AssignHearingDispositionTask or the ScheduleHearingTask.
#   The main difference between those contexts is that a hearing will exist for an AssignHearingDispositionTask,
#   but not for a ScheduleHearingTask.
Cancel the underlying task, and cancels the hearing or hearing request.
Cancel the underlying task and cancels the hearing or hearing request .
def withdraw_hearing_data(task, _user)
      copy = select_withdraw_hearing_copy(task.appeal)
      is_an_assign_hearing_disposition_task = task.is_a?(AssignHearingDispositionTask)
      {
        redirect_after: "/queue/appeals/#{task.appeal.external_id}",
        modal_title: COPY::WITHDRAW_HEARING_MODAL_TITLE,
        modal_body: copy["MODAL_BODY"],
        message_title: format(COPY::WITHDRAW_HEARING_SUCCESS_MESSAGE_TITLE, task.appeal.veteran_full_name),
        message_detail: format(copy["SUCCESS_MESSAGE"], task.appeal.veteran_full_name),
        business_payloads: if is_an_assign_hearing_disposition_task
                             {
                               values: {
                                 disposition: Constants.HEARING_DISPOSITION_TYPES.cancelled
                               }
                             }
                           end,
        back_to_hearing_schedule: is_an_assign_hearing_disposition_task ? false : true
      }
    end
def withdraw_hearing_data ( task , _user ) copy = select_withdraw_hearing_copy ( task . appeal ) is_an_assign_hearing_disposition_task = task . is_a? ( AssignHearingDispositionTask ) { redirect_after : "/queue/appeals/#{task.appeal.external_id}" , modal_title : COPY :: WITHDRAW_HEARING_MODAL_TITLE , modal_body : copy [ "MODAL_BODY" ] , message_title : format ( COPY :: WITHDRAW_HEARING_SUCCESS_MESSAGE_TITLE , task . appeal . veteran_full_name ) , message_detail : format ( copy [ "SUCCESS_MESSAGE" ] , task . appeal . veteran_full_name ) , business_payloads : if is_an_assign_hearing_disposition_task { values : { disposition : Constants . HEARING_DISPOSITION_TYPES . cancelled } } end , back_to_hearing_schedule : is_an_assign_hearing_disposition_task ? false : true } end
Cancel the underlying task, and cancels the hearing or hearing request.
Cancel the underlying task and cancels the hearing or hearing request .
# If a hearing has already been scheduled, the cancel task should also cancel the hearing. To do that # it will need to provide the cancelled disposition and action to the API. # If a hearing was already scheduled and is being withdrawn, it doesn't make sense to # return back to the hearing schedule, so don't show the link in that case.
task
_user
note
This task action can be called for either the AssignHearingDispositionTask or the ScheduleHearingTask. The main difference between those contexts is that a hearing will exist for an AssignHearingDispositionTask, but not for a ScheduleHearingTask.
This task action can be called for either the AssignHearingDispositionTask or the ScheduleHearingTask . The main difference between those contexts is that a hearing will exist for an AssignHearingDispositionTask but not for a ScheduleHearingTask .