Skip to content

Commit

Permalink
Display special issues for legacy cases (#7553)
Browse files Browse the repository at this point in the history
### Description
Allow attorneys and judges to select special issues for legacy cases

Once this PR is deployed, I will write a migration to update existing SpecialssueList records to have `Appeal` appeal_type as currently this is not being populated (due to missing `polymorphic: true`)
  • Loading branch information
Anya Roltsch authored and va-bot committed Jan 3, 2019
1 parent 017c19a commit 43e95c5
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/models/legacy_appeal.rb
Expand Up @@ -12,6 +12,7 @@ class LegacyAppeal < ApplicationRecord
has_many :appeal_views, as: :appeal
has_many :claims_folder_searches, as: :appeal
has_many :tasks, as: :appeal
has_one :special_issue_list, as: :appeal
accepts_nested_attributes_for :worksheet_issues, allow_destroy: true

class UnknownLocationError < StandardError; end
Expand Down
2 changes: 1 addition & 1 deletion app/models/legacy_tasks/attorney_legacy_task.rb
Expand Up @@ -10,7 +10,7 @@ def available_actions(role)
actions = [
{
label: COPY::ATTORNEY_CHECKOUT_DRAFT_DECISION_LABEL,
value: "draft_decision/dispositions"
value: "draft_decision/special_issues"
},
{
label: COPY::ATTORNEY_CHECKOUT_OMO_LABEL,
Expand Down
2 changes: 1 addition & 1 deletion app/models/legacy_tasks/judge_legacy_task.rb
Expand Up @@ -8,7 +8,7 @@ def review_action
else
{
label: COPY::JUDGE_CHECKOUT_DISPATCH_LABEL,
value: "dispatch_decision/dispositions"
value: "dispatch_decision/special_issues"
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/special_issue_list.rb
@@ -1,3 +1,3 @@
class SpecialIssueList < ApplicationRecord
belongs_to :appeal
belongs_to :appeal, polymorphic: true
end
3 changes: 2 additions & 1 deletion client/COPY.json
Expand Up @@ -247,7 +247,8 @@
"MODAL_CANCEL_ATTORNEY_CHECKOUT_PROMPT": "Are you sure you want to cancel?",
"MODAL_CANCEL_ATTORNEY_CHECKOUT": "All changes made to this page will be lost, except for the adding, editing, and deleting of issues.",

"SPECIAL_ISSUES_PAGE_TITLE": "Select special issue(s)",
"SPECIAL_ISSUES_PAGE_TITLE": "Select special issues (optional)",
"SPECIAL_ISSUES_PAGE_NOTE": "Select the special issues that pertain to this case. Cases with special issues are routed to specific groups who are in charge of adjusting the case.",

"ADVANCE_ON_DOCKET_MOTION_PAGE_TITLE": "Update Advanced on Docket (AOD) Status",
"ADVANCE_ON_DOCKET_MOTION_DISPOSITION_DROPDOWN": "AOD Motion Disposition",
Expand Down
7 changes: 6 additions & 1 deletion client/app/queue/SelectSpecialIssuesView.jsx
Expand Up @@ -15,6 +15,7 @@ import ApiUtil from '../util/ApiUtil';

class SelectSpecialIssuesView extends React.PureComponent {
getPageName = () => COPY.SPECIAL_ISSUES_PAGE_TITLE;
getPageNote = () => COPY.SPECIAL_ISSUES_PAGE_NOTE;

onChangeSpecialIssue = (issue) => (value) => {
this.props.setSpecialIssues({
Expand All @@ -36,11 +37,12 @@ class SelectSpecialIssuesView extends React.PureComponent {
render = () => {
const {
specialIssues,
appeal,
error
} = this.props;

const specialIssueCheckboxes = SPECIAL_ISSUES.map((issue) => {
if (issue.nonCompensation) {
if (issue.nonCompensation && !appeal.isLegacyAppeal) {
return null;
}

Expand All @@ -57,6 +59,9 @@ class SelectSpecialIssuesView extends React.PureComponent {
<h1>
{this.getPageName()}
</h1>
<p>
{this.getPageNote()}
</p>
{error && <Alert type="error" title={error.title} message={error.detail} />}
<div className="cf-multiple-columns">
{specialIssueCheckboxes}
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/ama_queue_spec.rb
Expand Up @@ -453,7 +453,7 @@
find(".Select-control", text: "Select an action").click
find("div", class: "Select-option", text: "Decision ready for review").click

expect(page).to have_content("Select special issue(s)")
expect(page).to have_content("Select special issues (optional)")

click_on "Continue"

Expand Down
31 changes: 31 additions & 0 deletions spec/feature/queue/attorney_checkout_flow_spec.rb
Expand Up @@ -360,6 +360,23 @@
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_label "vamc"

click_on "Continue"

# Ensure we can reload the flow and the special issue is saved
click_on "Cancel"
click_on "Yes, cancel"

click_dropdown(index: 0)

# Vamc should still be checked
expect(page).to have_field("vamc", checked: true, visible: false)

# Vamc should also be marked in the database
expect(appeal.special_issue_list.vamc).to eq(true)
click_on "Continue"

expect(page).to have_content "Select disposition"

cancel_button = page.find "#button-cancel-button"
Expand Down Expand Up @@ -404,6 +421,8 @@
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

expect(page).to have_content("Select disposition")

table_rows = page.find_all("tr[id^='table-row-']")
Expand Down Expand Up @@ -432,6 +451,8 @@
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

issue_dispositions = page.find_all(".Select-control", text: "Select disposition", count: appeal.issues.length)

# We want two issues to be a remand to make the remand reason screen show up.
Expand Down Expand Up @@ -492,6 +513,8 @@
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 1)

click_on "Continue"

expect(page).to have_content("Submit OMO for Review")

click_label("omo-type_OMO - VHA")
Expand Down Expand Up @@ -525,6 +548,8 @@
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

expect(page).to have_content("Select disposition")

issue_rows = page.find_all("tr[id^='table-row-']")
Expand Down Expand Up @@ -581,6 +606,8 @@ def select_issue_level_options(opts)
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

expect(page).to have_content("Select disposition")

first("a", text: "Edit Issue").click
Expand Down Expand Up @@ -611,6 +638,8 @@ def select_issue_level_options(opts)
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

expect(page).to have_content "Select disposition"

diag_code_no_l2 = %w[4 5 0 *]
Expand All @@ -633,6 +662,8 @@ def select_issue_level_options(opts)
click_on "#{appeal.veteran_full_name} (#{appeal.sanitized_vbms_id})"
click_dropdown(index: 0)

click_on "Continue"

expect(page).to have_content "Select disposition"

click_on "Add Issue"
Expand Down
19 changes: 19 additions & 0 deletions spec/feature/queue/judge_checkout_flow_spec.rb
Expand Up @@ -123,8 +123,27 @@
expect(visible_options.first.text).to eq COPY::JUDGE_CHECKOUT_DISPATCH_LABEL
end

click_label "vamc"

click_on "Continue"

# Ensure we can reload the flow and the special issue is saved
click_on "Cancel"
click_on "Yes, cancel"

click_dropdown(index: 0)

# Vamc should still be checked
expect(page).to have_field("vamc", checked: true, visible: false)

# Vamc should also be marked in the database
expect(appeal.special_issue_list.vamc).to eq(true)
click_on "Continue"

# one issue is decided, excluded from checkout flow
expect(appeal.issues.length).to eq 2

expect(page).to have_content("Review Dispositions")
expect(page.find_all(".issue-disposition-dropdown").length).to eq 1

click_on "Continue"
Expand Down

0 comments on commit 43e95c5

Please sign in to comment.