Skip to content

Commit

Permalink
Feature/appeals 34320 to uat (#22032)
Browse files Browse the repository at this point in the history
* ClayS/APPEALS-39107 (#21458)

* add request issue modification button for non-admins

* add tests covering the request issue modification button

* appease rubocop overlord

* update feature tests

* change to inline style and absolute import

* update feature test

---------

Co-authored-by: Brandon Lee Dorner <[email protected]>

* JHoang/APPEALS-39445 (#21445)

* added new dropdown actions  for edit issues, restricted visibility to non vha admins

* fix failing tests

* update jest for new dropdown actions

* added placeholder modal for request additional issue button

* Replace relative import with absolute, rename variable to check for non vha admin

* render new dropdown actions and button only for in progress tasks

* revert previous changes, added new changes

* fix typo in issuelist

* typo again

* remove extra empty line

* fix jest tests and vha_hlr_sc rspec

* address styling issues

* more restrictions to dropdown/button visibility

* remove unused comments

---------

Co-authored-by: Jonathan Hoang <[email protected]>

* Pending Request Issues seeds, factories and query update (#21437)

* migration and initial commit of the factory

* changing approve status to status

* Added active record associations on models, added factory attributes, added pending tasks on queue tab

* adding AC-2 condition to get pending record response from pending_request_issue table

* factory and seed for pending_request_issues

* Added pending request issues count alias for sorting and serialization to Task query

* adding issue_type_Count and task_type_count for pending tab

* Added spec tests for vha business line and business line spec files, cleaned up the controller, modified issue_type_count query

* fixing the spec failures and code climate issues

* removed byebug

* Fixing code climate issue and adding seed data

* fixing the schema error

* Revert "fixing the schema error"

This reverts commit 73070fa.

* skip association so that test passes

* renaming the table to - issue_modification_request and corresponding changes to the model, factories

* fixing spec failures and linter

* fixing spec failures and linter

* making sure pending tasks doesnt show up in in progress tab and modified the factory so that Claimant name appears

* fixing the spec failure

* removing coalesce and removing null: true

* more PR feedbacks

* adding fix to the PR comments

* removing distinct

* fixing the error in the query

* Apply suggestions from code review

Co-authored-by: Tyler Broyles <[email protected]>

* removing limit as suggested in the pr

* Adding evaluator to the factory and adding it to the seeds

* Adding PaperTrail for change history stuff

* adding schema

* adding new column to the table

* changed decider_decision_text to decider_note

---------

Co-authored-by: almorbah <[email protected]>
Co-authored-by: Tyler Broyles <[email protected]>

* SeanC/APPEALS-40669 | Creation of ‘Pending admin review’ section on Edit Issues Page (#21604)

* Added fake data and rendering for it

* made the fake data better

* pending issues are being rendered

* passed up user admin of org from backend

* Added userIsOrgAdmin to the frontend

* created admin and non fake data

* determined fake data to use based on userIsOrgAdmin

* got the issues to render

* Created a new IssueModificationList component

* updated the issuemodification and row to work with the lists

* updated the fake data and the issues container

* removed some code for getting the user info

* updated IssueModificationRequest to make wireframe

* Updated row and list to work with the new request

* updated the fake data

* added propTypes to IssuesModificationList

* cleaned up some lint in addissues

* added Prop types to request

* added key to list

* improved row

* improved the row logic

* added some space to the list

* refactored the layout for the request

* added text to the COPY

* slight change to fake data

* refactored the row

* got sorting working

* added id to map of list

* updated formating functions for modificationIssueRequests

* updated the request to work with the formated data

* removed some console logs in row

* updated addIssues to format the fake data

* updated request to work with the serializer

* removed logs

* updated fake data and formatter

* removed unneed code

* removed unneed code

* removed unneed code

* Rename IssueModificationRow.jsx to issueModificationRow.jsx

* removed unneed code and renamed a couple things

* Slight change to request

* removed some comments

* added some data for the jest test

* got some of the jest tests working

* fixed a typo in request

* updated the prop for the tests

* fixed the broken test and added more for list

* Fixed the fake data and removed unneed code

* removed unneed coded

* changed the html in the request to better match the design

* added css rule for new class

* fixed an typo in COPY

* similified some logic in row

* added logic to not create the pending section if it is null

* cleaned up some lint in intake.scss

* updated the fake data to better match the wireframes

* added divider inbetween requests

* formatted the dates on the request

---------

Co-authored-by: Clay Sheppard <[email protected]>

* TYLERB/APPEALS-39106: Creation of Pending tab (#21455)

* Initial commit to add the pending tab to the vha business line decision review queue.

* Updated existing tests and added new ones for the pending tab.

* Added tab task counts to the decision review queue.

* Adjusted variable names to match up with the feature branch. Made a column change to the create_issue_modification_request migration file. Added in methods to serialize the issue_modification_requests. Added pending_issue_modification_requests to the decision review serializer.

* Updated schema.

* Added a serialzer and related javascript and redux methods to place issue modification requests into the frontend.

* Updated tests to work with new issue modification request factories.

* Added a couple more test scenarios for the decision review controller spec file and changed the FactoryBot.create methods to create().

* Removed extra copies of the pending tab mappings and if statements from the decision reviews controller that happened due to the feature merge.

* Updated ReviewPage jest test snapshots. Updated and added more tests to the NonCompTabs jest test for the new pending tasks tab. Fixed an issue where the TaskTableTab was added an empty hash to the columns as a placeholder for the pending requests column instead of not adding any additional columns.

* Added a few constant variables to copy.json and queue config and removed todo statements.

* Fixed serializer tests and Fixed a constant name.

* Renamed some javascript variables to match the serializer.

* Fixed more broken tests.

* Updated the pending tasks query to show the correct amount of pending issues instead of an incorrect count. Added the pendingRequests column to the SORT_COLUMN_MAPPINGS in the decision reviews controller so that the user can sort by the new pending requests column via the controller. Added tests to cover these scenarios.

* Made some layout and css adjustments to the search bar and tab description for the decision review queue.

* Added padding to the bottom of the new search box and description div to create some space between ui elements. Changed the tab titles in the decision review queue to be title case for all words instead of only the first word.

---------

Co-authored-by: Brandon Lee Dorner <[email protected]>

* Appeals-40989 - Inclusion of required Decision Date Banner on Add Issues (#21588)

* APPEALS-40989: Adding functionality to check if user is vhaAdmin and task is in progress then display Banner and make decision date required.

* Fixing spec failures, adding new model spec, new task factory to support spec

* fixing linter issues in spec

* Adding storybook and fixing codeclimate complain

* fixing PR comments and adding banner to unidendified modal

* removing local font sizing

* fixing linter issue

* APPEALS-39446 - Modal creation – modification, removal, withdrawal, request additional issue [Non-Admin] (#21681)

* WIP components

TODO: validation/errors, redux

* add some error messages and the error schema for the addition modal

* add missing data error messages for the rest of the modals

* add test coverage for issue modification request frontend errors

* disable submit button until form is dirty

* remove currentIssue from request additional issue modal

* DRY out these modals

* clean up imports and some formatting

* WIP stuck the issue modification requests into redux

* add requested additional issues to the pending review section

* get benefit type from redux

* add test covering modal submission

* remove unnecessary expectation

* move a line to read better

* linting fixes and remove unneeded code

* update test

* really fix this test

* try to fix the add isues page

* fix ambiguous click in spec

* add storybook for modals

* update snapshot

* update capitalization in reviews spec

* destructure modal props

* more destructuring

* use full name and css id for requestor

* import less lodash

* fix some more capitalization

* remove old comment

* Update client/app/intakeEdit/components/RequestCommonComponents/RequestIssueFormWrapper.jsx

Co-authored-by: Tyler Broyles <[email protected]>

* Update client/app/intake/components/IssueModificationRequest.jsx

Co-authored-by: Tyler Broyles <[email protected]>

* prevent future dates in issue modification requests

* format decision date in current issue section

* Prior decision date -> Decision date

---------

Co-authored-by: Prajwal Amatya <[email protected]>
Co-authored-by: Tyler Broyles <[email protected]>

* TYLERB/APPEALS-39447: Display of banner on Edit Issues page – issues with pending requests (#21695)

* Initial commit. Added the PendingIssueModificationRequestsBanner. Added the connection between the serialized pending issue modification requests to the ui in the front end EditAddIssues page. Refactored the issueModificationRow, IssueModificationList, and IssueModificationRequest components. Changed the request_type enumeration to be lowercased to match the key value and changed the database schema, migration, and factory to match up with the new enumeration value.

* Added withdrawal_date to the serializer and redux store for issue modifications. Renamed a constant variable from body to message. Swapped a groupBy function to the lodash version since it was causing capyabara to fail for the feature test. Added a feature test for the banner. Also added a some helper functions and feature test checks for the issue modification requests when pulling data from the actual database objects instead of mocked data.

* Updated jest test.

* Added a backup description to the request issue in the IssueModificationRequest.jsx file so it will work for request issues being moved to the section via the ui.

* Changed an rspec matcher to fix code climate issue.

* Removed two junk console output files that were erroneously created.

* Made changes to the issue modification ui to match the feature branch changes and renamed the redux key to always use pendingIssueModificationRequests.

* Added a new redux store key for the originalPendingRequests in order to move them around. Reworked how the issues were being removed from the issues section when they are associated to an existing or new pending request.

* Cleaned up old issue modification request redux code.

* Reverted a change to the intake redux store since the objects are added via reference instead of an object clone.

* Fixed an issue where having empty pendingIssueModificationRequ
ests was causing a javascript error. Removed some todo comments and commented code.

* Removed another todo comment.

* Removed the pending requests banner from the cancel edit issues page.

* Changed the issue modification seeds file to use the correct values for the request_type attribute based on the enumeration value change to always use lowercase values. Updated a variable name in javascript to be more descriptive.

* Updated the RequestIssueFormWrapper component so that withdrawal and removal requests would behave in the same way as modification of existing issue requests. Fixed a bug where the decision date was being set to undefined or null for removal or withdrawal issue modification requests instead of taking the decision date from the original issue.

* Removed n+1 bullet warnings from the decision_review serialization process for pending_issue_modification_requests.

* APPEALS-45242 (partial) (#21759)

* add a doubleArrow option to SearchableDropdown

* overriden -> replaced

* JHoang/APPEALS-40672 (#21756)

* Initial commit. Added the PendingIssueModificationRequestsBanner. Added the connection between the serialized pending issue modification requests to the ui in the front end EditAddIssues page. Refactored the issueModificationRow, IssueModificationList, and IssueModificationRequest components. Changed the request_type enumeration to be lowercased to match the key value and changed the database schema, migration, and factory to match up with the new enumeration value.

* Added withdrawal_date to the serializer and redux store for issue modifications. Renamed a constant variable from body to message. Swapped a groupBy function to the lodash version since it was causing capyabara to fail for the feature test. Added a feature test for the banner. Also added a some helper functions and feature test checks for the issue modification requests when pulling data from the actual database objects instead of mocked data.

* Updated jest test.

* Added a backup description to the request issue in the IssueModificationRequest.jsx file so it will work for request issues being moved to the section via the ui.

* Changed an rspec matcher to fix code climate issue.

* Removed two junk console output files that were erroneously created.

* Made changes to the issue modification ui to match the feature branch changes and renamed the redux key to always use pendingIssueModificationRequests.

* Added a new redux store key for the originalPendingRequests in order to move them around. Reworked how the issues were being removed from the issues section when they are associated to an existing or new pending request.

* Cleaned up old issue modification request redux code.

* Reverted a change to the intake redux store since the objects are added via reference instead of an object clone.

* Fixed an issue where having empty pendingIssueModificationRequ
ests was causing a javascript error. Removed some todo comments and commented code.

* Removed another todo comment.

* Removed the pending requests banner from the cancel edit issues page.

* Changed the issue modification seeds file to use the correct values for the request_type attribute based on the enumeration value change to always use lowercase values. Updated a variable name in javascript to be more descriptive.

* Added modal to request cancellation of an existing request modification

* fix lint and failing jest

* conditional rendering in cancelpendingrequestissue modal

* fix decision date and withdrawal dates not showing correctly when requesting modification

* fix mocked props for CancelPendingRequestIssueModal.test.js

* revert date changes, fix issue description display

* Updated the RequestIssueFormWrapper component so that withdrawal and removal requests would behave in the same way as modification of existing issue requests. Fixed a bug where the decision date was being set to undefined or null for removal or withdrawal issue modification requests instead of taking the decision date from the original issue.

* added space between current issue and pending issue request

* refactor cancelpendingrequestissuemodal structure

* remove temp dropdown button

---------

Co-authored-by: = <[email protected]>
Co-authored-by: Jonathan Hoang <[email protected]>

* Al/appeals 45834 (#21641)

* Added non admin issue modification request logic

* added finial touches on NON::AdminModificationRequestsUpdater class

* Added logic to make sure that the user is an admin or non-admin who belongs to Vha organization

* Added some Rspec tests for `NonAdmin::IssueModificationRequestsUpdater` and cleaned up Class

* Added controller spec tests for SupplementalClaimsController#update HigherLevelReviewsController#update

* Code clean up

* Fixing lining errors

* code clean up

* Added code to fix some failing rspec tests

* fixed linting errors

* Ensure backend validation – only one request per issue
If an issue already has a request and another is submitted, an error is thrown

* rebased off latest feature branch and downcased request_type and status  params

* Added request_issue_id param to account for existing request_issues in situations when request_type is other than addition. Adjusted process_modification? method

* Added changes based on PR feedback

* added a shared example block to dry up code

* more feedback

* changed name file structure

* Needed to re-handle validation errors

* Pamatya/appeals 40671- adding Select action dropdown to the Admin section (#21788)

* Adding props and searchable dropdown to meet ac

* fixing linter, and adding test

* added storybook for issue modification row and issue section row

* fixing the values in the popup

* fixing the Removal and withdrawal modal to behave similar to modification modal

* making changes to the code to fix the bug

* fixing spec, linter and jest failures

* missing schema file

* changing the Onclick to take object instead of the index or identifier

* removing unused code

* code cleanup

* J hoang/appeals 40987 (#21889)

* move issue modification request actions to new file, created new confirm issue modification change modal

* fixed some code climate issues

* some changes from review

* fix jest

* added new action to update pending issue request

* maybe fix tests?

* revert pending admin review display

* change pending admin review display to active pending issues only

* fix pending admin display

* consistent parameter placement and added an extra check for requested issues display

* fix all failing tests

* fix movetopendingreview action call breaking rspec

* fix cancel buttons on confirm modal modification

---------

Co-authored-by: Jonathan Hoang <[email protected]>

* APPEALS-46705: Addition of SearchableDropdown to IssueList (#21752)

* change issue action selector component and appearance

* fix padding

* fix linting error

* fix frontend tests

* fix list rendering bug

* wip fix one type of failure

* fix a couple more kinds of failure

* fix tests in ama_queue_workflow_spec

* fix a couple tests

* another one

* fix dropdown helpers to work if something was already selected

* fix test in edit_ep_claim_labels_spec

* fix issue modification request specs

* more tests

* update more tests

* whac a mole

* remove comment

* fix padding

* remove comment and whitespace

* make specs consistent

* SeanC/APPEALS-40670 | Update actions and pending request modal on Edit Issues Page – issues with pending requests [Non-Admin] (#21857)

* got the options actions working

* hooked up the cancel action

* added some styling for drop down

* changed the wording of the dropdown actions

* added new onClick action, added pending obj to state and cleared it

* passed the onClick to Row and List

* added onClick and useSelector to Request

* added new redux action

* removed comment

* added edit redux action

* fixed an issue from merge in addIssues

* updated the options to work with non admin actions and readOnly

* removed unneed styles

* removed comment

* changed modal title to change based on pendingIssueModificationRequests

* removed redundant code

* updated action and reducer to work with other code

* updated name of action on parent component

* updated form wrapper to work with new action

* fixed a failing spec test

* Added tests for action options for non and admin users

* refactored the props for the test for IssueModificationList

* slight change to the test

* add new test in issue_modification_request spec

* added logic in Request for the text to change slightly

* fixed a failing test

* fixed an error with the form wrapper

* fixed a few issues from the merge

* fixed failing test

* fixed an issue from the merge

* changed I back to i for issueModificationRow

* refactored options to a const in Request

* removed added comma in constants

* renamed const in FormWrapper

* removed no longer needed props in IssueModificationListProps

* removed setting the index when reviewing a modification request

* fixed a date formatting issue

* created const for pendingIssueModificationRequest

* Fixed issue with incorrectly changing admin modal title

* cleaned up some lint

* cleaned up more lint

* fixed an import issue

* removed conditional for the label text

* fixed a failing jest test

* fixed failing rspec

* removed comment in issue_modification_request_spec

* APPEALS-47866 (#21916)

* UX changes for modals

red buttons -> blue buttons
text wraps around icon
copy updates

* rspec updates

* update snapshots

* add a storybook for modals with icons

* refactor storybook

* remove class

* switch to constants

* remove unnecessary props

* fix the AddIssues storybook

* tinkering

* update snapshots again

* Pamatya/appeals 40997 v3 (#21926)

* move issue modification request actions to new file, created new confirm issue modification change modal

* fixed some code climate issues

* some changes from review

* fix jest

* added new action to update pending issue request

* maybe fix tests?

* revert pending admin review display

* change pending admin review display to active pending issues only

* fix pending admin display

* consistent parameter placement and added an extra check for requested issues display

* fix all failing tests

* fix movetopendingreview action call breaking rspec

* fix cancel buttons on confirm modal modification

* initial push

* renaming component and making the remove original issue button work

* fixing issues related with closing the modal and addissues page getting prerendered

* fixing spec failure

* fixing spec and linter issues

* adding spec test for approval and rejection

* new branch withdrawal date

* fixing bug and fixing the jest failure

* addressing comments

* fixing spec and linter failure

* code clean and consistency between two modals

* adding validation to the spec

* fixing the spec failure

* fixing spacing and spec

* fixing linter

---------

Co-authored-by: Jonathan Hoang <[email protected]>

* Update schema.rb

Fix error in previous merge conflict attempt.

* Update seeds.rb

Fix error in conflict resolution

* TYLERB/APPEALS-40985: Frontend Submission of Requested Issues/Pending Admin Review Section (#21912)

* Initial commit. Altered an existing model validation for issue modification requests and added a new validation. Added a formatter to prepare the issue modification requests for form submission and altered the button text for vha to be save instead of establish if there are pending issue modificaiton requests in the redux store.

* Added the redirection code for claim reviews that have active pending issue modification requests. Also added the non admin issue modification success banner and refactored the existing flash banner code for other claim review types to make them easier to modify in the future.

* Fixed code climate issue.

* Renamed a function parameter in RequestIssueFormWrapper to make it more clear on what it is actually using. Updated logic to use a property insted of the form data.

* Refactored how the claim review controller was building flash messaging to make it easier to customize it for vha claim reviews.

* Added a new selectors file with a selector to only get openPendingModification requests which are pending modification requests that are assigned. Changed the selector in the PendingIssueModificationRequestBanner to the new selector.

* Moved the open pending issue modification requests selector to the intake selector. Imported it and used it in the add issues page.

* Fixed an issue where the decision date was not added as the correct string format to the issue modification redux store which was causing it to fail to save later after form submission. Expanded the feature test for non admin to include submitting the form and verifying the success banner and issue modification request data.

* Added one more additional check to the feature test.

* Added the open issue modification requests selector the save btton text for the edit issues page.

* Made changes to the CancelPendingRequests modal to work with a new reducer. Added edited and cancelled pending requests to the formatIssueModificationRequestSubmissionData function.

* Added an edited boolean attribute to the form data for modification type modals for pending requests for an easy way to determine if a issue modification request has been edited without changing the status.

* Removed max width from non comp description text.

* Fixed admin messaging when there are pending issue modification requests remaining on the claim review.

* Added all the remaining frontend code and logic to make the issue modification form submission work. Fixed an issue where withdrawal date was not working correctly with the existing withdrawal process.

* Refactored the claim review controller logic to work with the non admin and admin updates to issue modification requests. Added methods into issue modification request for admin updates. Updated validations. Refactored the non_admin_updater to work for both admin and non admin workflows. Added some fallback error handling for issue modification updates.

* Removed unused import.

* Updated the RequestIssueStatus component option value from rejected to denied to matchup with the enum field on the issue_modification_request model.

* Fixed two code climate issues. Rewrote the issue modification request factories to fix the seed data.

* Removed some lines from RequestIssueFormWrapper that I don't think were neccessary. Removed some todos.

* Fixed a couple of failing specs.

* Added a new feature test spec file that Praj created.

* Added code to make the associations for request issues to issue modification requests through the UI work correctly in the request_issues_update model for additions and modifications since it is creating brand new request issues instead of using existing records in the database.

* Renamed non_admin_updater_spec file and fixed tests.

* Code climate fix.

* Updated the mocked data controller tests.

* Renamed the NonAdminUpdater and all related files to Updater.

* Fixed a bug where the confirm pending request issue modal was not properly setting up the request issue by using the old request issue id that the modification request was associated to. Fixed a console warning in the RequestIssueStatus component.

* Fixed spec failures due to changing banner text for editing vha claims.

* Fixed an issue where the openPendingModificationRequests selector was causing a console error for legacy appeals due to different initialization of the redux store. Removed the no decision date banner for legacy appeals since it was never intended although it shouldn't happen.

* Fixed jest test for CancelPendingRequestIssueModal where the property name had changed.

* Added admin process testing to the updater_spec.rb service class for issue modification requests. Added errors to caseflow error.rb and added a constant to copy.json.

* Removed todo statements.

* Updated a modal snapshot.

* Fixed merge conflicts that didn't get resolved.

* Added an addition check for the wording to be correct for the issues update banner in add issues to properly reflect the wording of the save button at the bottom of the page depending on pending issue modification requests. Changed the wording on a success banner from established to edited that was incorrect. Added a different success banner for a vha claim review when it still has pending issue modification requests after an admin has only actioned some of them.

* Updated the NonRatingIssueRequestModal decision date logic to prevent a non vha user from adding an issue without a decision date to a claim that was already in progress.

* Fixed spec failures related to the banner text changes.

* Added a banner and block the save of the page if the user is about to close a claim via a removal or withdrawal while the claim still has a pending addition issue modification request on it. Added feature test for this and uncommented some feature test code that shouldn't have been commented out. Added a way to make the content column span two columns in the add issues page table for styling the banner.

* Moved the new banner check into the edit page block to fix tests.

* CSS text change for the alert banner.

* text change and text title change

* Removed the established vha text variable in the claim review controller since it isn't being used anymore. Fixed a linting error.

* test fix for alert title change

---------

Co-authored-by: almorbah <[email protected]>
Co-authored-by: Prajwal Amatya <[email protected]>
Co-authored-by: Robert Travis Pierce <[email protected]>

* Fix COPY.json

* Fix merge conflict issues

---------

Co-authored-by: Clay Sheppard <[email protected]>
Co-authored-by: Brandon Lee Dorner <[email protected]>
Co-authored-by: jonathanh-va <[email protected]>
Co-authored-by: Jonathan Hoang <[email protected]>
Co-authored-by: Prajwal Amatya <[email protected]>
Co-authored-by: almorbah <[email protected]>
Co-authored-by: Tyler Broyles <[email protected]>
Co-authored-by: Brandon Dorner <[email protected]>
Co-authored-by: Sean Craig <[email protected]>
Co-authored-by: = <[email protected]>
Co-authored-by: almorbah <[email protected]>
Co-authored-by: Robert Travis Pierce <[email protected]>
Co-authored-by: Prajwal Amatya <[email protected]>
  • Loading branch information
14 people authored Jun 27, 2024
1 parent ab59772 commit 9cd2c7a
Show file tree
Hide file tree
Showing 133 changed files with 7,581 additions and 2,130 deletions.
98 changes: 85 additions & 13 deletions app/controllers/claim_review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def edit
end

def update
if request_issues_update.perform!
if issues_modification_request_updater.non_admin_actions?
process_and_render_issue_non_admin_issue_modification_requests
elsif issues_modification_request_updater.admin_actions?
process_and_render_issue_admin_issue_modification_requests
elsif request_issues_update.perform!
render_success
else
render json: { error_code: request_issues_update.error_code }, status: :unprocessable_entity
Expand Down Expand Up @@ -56,6 +60,14 @@ def source_type
fail "Must override source_type"
end

def issues_modification_request_updater
@issues_modification_request_updater ||= IssueModificationRequests::Updater.new(
user: current_user,
review: claim_review,
issue_modifications_data: params[:issue_modification_requests]
)
end

def request_issues_update
@request_issues_update ||= RequestIssuesUpdate.new(
user: current_user,
Expand Down Expand Up @@ -133,15 +145,23 @@ def removed_issues
end

def review_edited_message
"You have successfully " + [added_issues, removed_issues, withdrawn_issues].compact.to_sentence + "."
"You have successfully #{[added_issues, removed_issues, withdrawn_issues].compact.to_sentence}."
end

def vha_edited_decision_date_message
COPY::VHA_ADD_DECISION_DATE_TO_ISSUE_SUCCESS_MESSAGE
end

def vha_established_message
"You have successfully established #{claimant_name}'s #{claim_review.class.review_title}"
def vha_pending_reviews_message
"#{claimant_name}'s #{claim_review.class.review_title} was saved."
end

def vha_edited_title
"You have successfully edited #{claimant_name}'s #{claim_review.class.review_title}"
end

def vha_edited_message
"The claim has been modified."
end

def claimant_name
Expand All @@ -158,27 +178,53 @@ def vha_flash_message
request_issues_update.removed_or_withdrawn_issues)
.select { |issue| issue.decision_date.blank? && !issue.withdrawn? }

if issues_without_decision_date.empty?
vha_established_message
if claim_review.pending_issue_modification_requests.any?
vha_pending_reviews_message_hash
elsif issues_without_decision_date.empty?
{ title: vha_edited_title, message: vha_edited_message }
elsif request_issues_update.edited_issues.any?
vha_edited_decision_date_message
{ title: "Edit Completed", message: vha_edited_decision_date_message }
else
review_edited_message
decisions_message_hash_builder(vha_edited_message, review_edited_message)
end
end

def set_flash_success_message
flash[:edited] = if request_issues_update.after_issues.empty?
decisions_removed_message
flash[:custom] = if request_issues_update.after_issues.empty?
decisions_removed_hash
elsif (request_issues_update.after_issues - request_issues_update.withdrawn_issues).empty?
review_withdrawn_message
elsif claim_review.benefit_type == "vha"
decisions_withdrawn_hash
elsif claim_review.vha_claim?
vha_flash_message
else
review_edited_message
{ title: "Edit Completed", message: review_edited_message }
end
end

def decisions_message_hash_builder(vha_message, default_message)
if claim_review.vha_claim?
{ title: vha_edited_title, message: vha_message }
else
{ title: "Edit Completed", message: default_message }
end
end

def decisions_removed_hash
decisions_message_hash_builder("The claim has been removed.", decisions_removed_message)
end

def decisions_withdrawn_hash
decisions_message_hash_builder("The claim has been withdrawn.", review_withdrawn_message)
end

def vha_pending_reviews_message_hash
if current_user.vha_business_line_admin_user?
{ title: vha_edited_title, message: vha_edited_message }
else
{ title: "You have successfully submitted a request.", message: vha_pending_reviews_message }
end
end

def decisions_removed_message
"You have successfully removed #{claim_review.class.review_title} for #{claimant_name}
(ID: #{claim_review.veteran.ssn})."
Expand All @@ -203,4 +249,30 @@ def perform_ep_update!(epe)
ep_update.perform!
ep_update
end

def process_and_render_issue_non_admin_issue_modification_requests
issues_modification_request_updater.non_admin_process!
render_success
rescue StandardError => error
render_error(error)
end

def process_and_render_issue_admin_issue_modification_requests
if issues_modification_request_updater.admin_process!
# If there are no approvals, then we can just deny the requests. We do not need to process request_issues_updates
if issues_modification_request_updater.admin_approvals?
if request_issues_update.perform!
return render_success
else
return render json: { error_code: request_issues_update.error_code }, status: :unprocessable_entity
end
end

render_success
else
render json: { error_code: :default }, status: :unprocessable_entity
end
rescue StandardError => error
render_error(error)
end
end
10 changes: 9 additions & 1 deletion app/controllers/decision_reviews_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class DecisionReviewsController < ApplicationController
:in_progress_tasks,
:in_progress_tasks_type_counts,
:in_progress_tasks_issue_type_counts,
:pending_tasks,
:pending_tasks_type_counts,
:pending_tasks_issue_type_counts,
:completed_tasks,
:completed_tasks_type_counts,
:completed_tasks_issue_type_counts,
Expand All @@ -29,7 +32,8 @@ class DecisionReviewsController < ApplicationController
"issueCountColumn" => "issue_count",
"issueTypesColumn" => "issue_types_lower",
"daysWaitingColumn" => "tasks.assigned_at",
"completedDateColumn" => "tasks.closed_at"
"completedDateColumn" => "tasks.closed_at",
"pendingIssueModificationRequests" => "pending_issue_count"
}.freeze

def index
Expand Down Expand Up @@ -124,6 +128,9 @@ def task_filter_details
when :incomplete
task_filter_hash[:incomplete] = incomplete_tasks_type_counts
task_filter_hash[:incomplete_issue_types] = incomplete_tasks_issue_type_counts
when :pending
task_filter_hash[:pending] = pending_tasks_type_counts
task_filter_hash[:pending_issue_types] = pending_tasks_issue_type_counts
when :in_progress
task_filter_hash[:in_progress] = in_progress_tasks_type_counts
task_filter_hash[:in_progress_issue_types] = in_progress_tasks_issue_type_counts
Expand Down Expand Up @@ -180,6 +187,7 @@ def queue_tasks

tasks = case tab_name
when "incomplete" then incomplete_tasks(pagination_query_params(sort_by_column))
when "pending" then pending_tasks(pagination_query_params(sort_by_column))
when "in_progress" then in_progress_tasks(pagination_query_params(sort_by_column))
when "completed" then completed_tasks(pagination_query_params(sort_by_column))
when nil
Expand Down
1 change: 1 addition & 0 deletions app/controllers/intakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def index_props
userDisplayName: current_user.display_name,
userCanIntakeAppeals: current_user.can_intake_appeals?,
userCanEditIntakeIssues: current_user.can_edit_intake_issues?,
userIsVhaAdmin: current_user.vha_business_line_admin_user?,
serverIntake: intake_ui_hash,
dropdownUrls: dropdown_urls,
applicationUrls: application_urls,
Expand Down
4 changes: 4 additions & 0 deletions app/models/appeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ def create_business_line_tasks!
end
end

def task_in_progress?
nil
end

def stuck?
AppealsWithNoTasksOrAllTasksOnHoldQuery.new.ama_appeal_stuck?(self)
end
Expand Down
12 changes: 11 additions & 1 deletion app/models/claim_review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def create_business_line_tasks!
end

def redirect_url
if benefit_type == "vha" && request_issues_without_decision_dates?
if vha_claim? && request_issues_without_decision_dates?
"#{business_line.tasks_url}?tab=incomplete"
elsif vha_claim? && pending_issue_modification_requests.any?
"#{business_line.tasks_url}?tab=pending"
else
business_line.tasks_url
end
Expand Down Expand Up @@ -206,6 +208,10 @@ def active_status?
active?
end

def vha_claim?
benefit_type == "vha"
end

def search_table_ui_hash
{
caseflow_veteran_id: claim_veteran&.id,
Expand Down Expand Up @@ -311,6 +317,10 @@ def sct_appeal?
false
end

def task_in_progress?
tasks.any?(&:active?)
end

private

def cleared_end_products
Expand Down
5 changes: 5 additions & 0 deletions app/models/decision_review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class DecisionReview < CaseflowRecord
attr_reader :saving_review

has_many :request_issues, as: :decision_review, dependent: :destroy
has_many :issue_modification_requests, as: :decision_review, dependent: :destroy
has_many :claimants, as: :decision_review, dependent: :destroy
has_many :request_decision_issues, through: :request_issues
has_many :decision_issues, as: :decision_review, dependent: :destroy
Expand Down Expand Up @@ -263,6 +264,10 @@ def active_nonrating_request_issues
.where.not(id: request_issues.map(&:id))
end

def pending_issue_modification_requests
issue_modification_requests.includes(:request_issue, :requestor, :decider).select(&:assigned?)
end

# do not confuse ui_hash with serializer. ui_hash for intake and intakeEdit. serializer for work queue.
def serializer_class
::WorkQueue::DecisionReviewSerializer
Expand Down
Loading

0 comments on commit 9cd2c7a

Please sign in to comment.