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

APPPEALS-29699 | Remove AddDecisionDate action for withdrawn issues #19375

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

brandondorner
Copy link
Contributor

@brandondorner brandondorner commented Sep 6, 2023

Closes Jira: https://jira.devops.va.gov/browse/APPEALS-29699

Description

We do not want the ability to add a decision date to a withdrawn issue. So we need to update the conditional to exclude withdrawn issues from having the AddDecisionDate action.

We also will remove the showNoDecisionDateModal for withdrawn issues.

Acceptance Criteria

  • Code compiles correctly
  • Pending withdrawal issues do not show the noDecisionDateBanner and do not have the ability to add/edit a decision date
  • Fully saved withdrawal issues do not show the noDecisionDateBanner and do not have the ability to add/edit a decision date

Frontend

Screen.Recording.2023-09-06.at.12.09.11.PM.mov

We do not want the ability to add a decision date to a withdrawn
issue. So we need to update the conditional to exclude withdrawn
issues from having the AddDecisionDate action.

We also will remove the showNoDecisionDateModal for withdrawn issues.
@brandondorner brandondorner force-pushed the dorner/no-decision-date-fix branch from b952aed to 6b35f7b Compare September 6, 2023 18:28
@pamatyatake2
Copy link
Contributor

LGTM

@brandondorner brandondorner changed the title Remove AddDecisionDate action for withdrawn issues APPPEALS-29699 | Remove AddDecisionDate action for withdrawn issues Sep 7, 2023
@ajspotts ajspotts added the Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests label Sep 7, 2023
@ajspotts ajspotts merged commit d9be7e3 into feature/APPEALS-15376 Sep 8, 2023
12 of 14 checks passed
HunJerBAH added a commit that referenced this pull request Sep 27, 2023
* Remove `disable_claim_establishment` FeatureToggle (#19017)

The disable_claim_establishment FeatureToggle is a defunct feature
flag that resides in our codebase. It is currently enabled by default
by enable_features_dev.rb in local and demo environments, and this
causes an error to display whenever attempting to edit issues on claim
reviews.

We would like to remove this FeatureToggle entirely in order to reduce
code complexity, as well as to prevent this error from occurring.

Co-authored-by: Craig Reese <[email protected]>

* APPEALS-19547 Optional Decision Date field for VHA HLR/SC (#19053)

* Got the modal to allow the form to be submitted without a decision_date for vha benifit type

* Got optional label to appear next to the Decision date label for vha benifit type

* cleaned up some lint

* Cleaned up the logic of the submit button

* Updated the storebook file for the modal to inculde an example for the vha benefit type

* Got first new test working

* Added a new condition to a test for non vha benefit type to check that the optional label is not visible

* added some testing for the submit button logic

* extracted shared logic to describe block

* Cleaned up the repeated code and logic

* fixed the code climate issue of repeated code

* made the first recommended change

* Made the rest of the recommended changes

---------

Co-authored-by: Alec Spottswood <[email protected]>

* Add `Alert` banner for issues with no decision date - APPEALS/19548 (#19063)

* Remove rerouting for VHA issues w/o decision dates

Prior to this change there would be a reroute when trying to edit a
VHA issue that did not have a decision date.

We no longer want to reroute when a VHA issue has a missing decision
date.

* Add NoDecisionBanner to IssueList component

From the jira Epic:
Value Statement: As a VHA Intake user, I need the ability to bypass
the required Decision Date entry for a HLR/SC if the information is
not provided, so that I may proceed with the intake of the claim.

As a result of allowing the user to save issues with no decision date,
we want to alert the user to the outcome of saving without a decision
date.

* Extract issueSectionRow to its own file

In an attempt to make the codebase more maintainable and testable we
are extracting this logic that can go in its own file.

The purpose of this is to better follow Separations of Concerns
principles. The `issueSectionRow` logic is distinct enough that it
justifies being in its own section.

Now when working on this section in the future a developer can focus
on just `issueSectionRow.jsx` instead of the whole `addIssues` file.

The main reason I did this however was to more easily test this
functionality in storybook.

* Create `issueSectionRow` stories

The stories are testing:
- The basic issueSectionRow functionality
- issueSectionRow when the issue has no decision date

* Move `addIssues.jsx` into the `addIssues` folder

There were several new files created related to `addIssues` and it
felt like time to make a new directory to house these files.

One thing that could be done in the future is to use more absolute
paths instead of relative paths so that in the future when files and
folders get moved around we don't have to edit file paths.

* Add messageStyling to` IssueList` and `Alert`

We want to override the existing css of the `Alert` component's
message body. To do this we are adding a new prop called
`messageStyling` which will contain any additional css.

This is used in the `IssueList` component for the NoDecisionDate
banner. We want the font size and color to match the mockups provided
to us.

I don't love using the `!important` tag here but I think for now it is
fine and can be potentially improved in the future.

* Minor lint fix

* Add margin to No Decision Date Banner

Adjusted the spacing on the no decision date banner so it does not
cover up the dividing line between issues.

* Add tests for NoDecisionDateBanner in `IssueList`

---------

Co-authored-by: Alec Spottswood <[email protected]>

* TYLERB/APPEALS-19718: Creation of Incomplete Tasks tab in Decision Review Queue (#19048)

* Initial commit with the incomplete tab for the vha business line.

* Updated the issue type count query logic to work for the new incomplete tab. Added the new appeal unique id alias i.e. the external id to the select statements. Added tabname to the TaskTableTab state in order to account for different behavior for different types of tabs.

* Removed some debugging code.

* Added new constant for the incomplete tab description. Updated a lot of instances of BusinessLine.find_by(url: vha) to use the new VhaBusinessLine.singleton method to hopefully avoid module/class preloading issues.

* Refactored business line querybuilder to work with subtypes of businessline. Added a None tag to the list of filter options if there is not a issue category present on a request issue and fixed the method of counting to work with null issue category column values. Refactored union query joins into an array to reduce code complexity.

* Updated decision review task serializer spec and it's inherited specs for the new fields.

* Refactored the task_filter_details to only include the filter counts for the tabs that the businessline can query for.

* Updated the decision reviews controller in progress method for
 generic non comp buisiness line org to verify that it also includes on hold tasks. Added new tests for the incompe vha businessline for the incomplete tasks method and tab. Also added an in progress tasks test for vha since it should no longer include tasks that have the on_hold status.

* Added tests for generic non comp business line to the business line spec. Also added incomplete_tasks to the vha businessline spec tests.

* Fixed a typo in the controller for the in progress issue types key in the filtering hash.

* Updated reviews spec test and added a test for a non vha business line to make sure on_hold tasks still appear in the in progress tab and that the incomplete tab is not present.

* Storybook file updates for Noncomp.

* Updated the NonCompTabs jest test file.

* Updated NonCompTabs jest test for both vha and generic businesslines.

* Removed unused import.

* Added more expect statements to the reviews spec feature test to check the incomplete tab description and a check to make sure that it is using the correct filter information from the backend for each tab.

* Removed some commented out code. Removed some todos. Fixed some code climate issues.

* Fixed a lot of tests that were failing because the swap to VhaBusinessLine instead of using BusinessLine.create or similar factory bot methods in test setup. Fixed a bug where the completed tab index is now 2 instead of 1 for vha since there are 3 tabs now. It still guesses that it is the last tab or 1. Added a couple of todos related to possibly overriding methods in business line to make sure VhaBusinessLine is created correctly. Added businessline config to show.html.erb for determining the tab and preventing a possible error.

* More testing changes for VhaBusinessLine.

* Made some small updates to the veterans_health_administration seed file to attepmt to fix test setup failures and some other small code climate fixes.

* Changed VhaBusinessLine singleton a to more closely resemble what happens in the has_business_line concern.

* Updated sanitized json file so that the VhaBusinessLine has the correct type on it.

* Altered the wrong json block to the VhaBusinessLine type and fixed it.

* Changed sanitize to sanitize_sql and updated a jest test to use the renamed constant.

* More spec test updates to deal with the VhaBusinessLine subclass and decision review task serializer changes.

* Removed import and todo.

* Another attempt at fixing the brakeman warning.

* Yet more attempts to fix brakeman warning.

* Brakeman really doesn't like string interpolation.

* Fixed a bug where the assigned_to field was set to business_line_id instead of parent in the business line model class.

* Fixed a rare css bug where the user dropdown menu could be blocked by the search bar div in the decision review queue.

* Rewrote some of the issue type count to use arel to avoid brakeman warnings.

* Refactored some repeated code into the issue count helper method.

* Removed a couple of todo statements. Rewrote the issue type count method to use active record instead of an SQL string block.

* Removed another todo block.

* Added a VhaBusinessLine migration.

* Made a couple of small code refactors and moved the require_dependency to the bottom of the business_line.rb file instead of in the decision_reviews_controller.

* Removed commented out code in user.rb model.

* TYLERB/19549-19550: Combined branches of 19549 and 19550 (#19175)

* Initial commit that attempts to set the first decision review task of associated claim review that has an issue without a decision date to on_hold. It also attempts to set it back to in_progress if all the request issues have a decision date.

* Fixed an issue where the newly created business line task would not be a part of the claim review tasks during intake. Added a new redirect url method for claim reviews and changed the intake controller and claim review controller to use it.

* Attempt at the new success message for claim reviews with issues without a decision date.

* Attempt at the messaging from successful intake of a claim that has a request issue without a decision date that matches the designs.

* Added a message after editing decision reviews without issues without a decision date.

* Added a check for vha and either SC or HLR form type to NonRating issues modalfor the no decision date exemption.

* Changed the text on the establish button on the add issues page during intake for VHA HLRs and SCs based on if all the issues have a decision date or not.

* Added the 'No date entered' row to an issue's summary descrpiton if a decision date was not given.

* Added a feature test for vha hlr/sc intakes with issues with no decision date.

* Added an additional expect to the IssueList test for the No date entered text.

* Added a todo comment and added a intakes_controller_spec test for no vha issue without a decision date.

* Added one more expect statement to the intakes controller spec.

* Removed some TODO comments and added a guard clause to scope the decision review task update to vha only. Added a test to the claim review spec to cover the task status changing behavior based on the request issues' decision date.

* Reworded some comments. Removed some todos. Added another test to the claim_review_spec.rb file.

* Moved the save_edited_decision_date! method to a new spot in the code. Added a spec test for the method.

* Added new spec tests to request_issues_update for updating the decision date.

* Attempting to fix code climate issues.

* Added a util function for the skip button to fix a code climate issue and to make some of the modals more dry. Refactored request_issues_update for code climate.

* Removed mismatched end statement.

* Added a fallback if the review doesn't have the method. Removed some todo statements.

* Changed the method call to .try since it doesn't exist for appeals and only claim reviews for now.

* Fixed a typo when refactoring the edit contention and edit decision date methods for a code climate fix.

* Removed a comment and added another todo.

* Altered the messaging for vha benefit types for the claim review controller.

* Refactored several things. Removed some todo statements. Added the :handle_issues_with_no_decision_date! to the request issue close! block to catch both withdrawls and removals. Altered the messaging for the claim reviews controller to match designs for vha.

* Altered Edit Issues button text for vha benefit types.

* Create addDecisionDateModalVisible value & toggle

The newly created value and toggle are added to the reducer to be
used in toggling the visibility of `AddDecisionDateModal`.

* Create `addDecisionDate` action

This action is used to send the updated decision date to the backend.

* Create `AddDecisionDateModal` component

This component will be used for editing the decision_dates of issues
that currently do not have a decision_date.

There is validation that a user cannot submit a empty date value and
cannot submit a date in the future.

* Add the `add_decision_date` issue action option

This option will trigger an action to open the `AddDecisionDateModal`
and is only visible when the issue is missing a decision date.

* Add `AddDecisionDateModal` to `addIssues`

Now that the reducers and actions are set up we can now display
`AddDecisionDateModal` when `intakeData.addDecisionDateModalVisible`
has been activated.

* Add Decision Date modal toggle functionality tests

These tests make sure the modal opens when it is supposed to.

* Added more tests for claim review and request issues spec files. Changed the task factory to use VhaBusinessLine.singleton instead of BusinessLine.find_by for a couple of factory methods.

* Add backend ability to update issue=>decision_date

We now can update the decision_date of an issue if the
`edited_decision_date` was sent with our edit action.

* Add further decision date validation

Add validation that the new decision date is not in the future.

Although there are two instances of this validation on the front end
I thought we should also have it on the backend.

* Add rspec tests for editing issues' decision_dates

* Add minor lint fixes

I was working on this file and noticed some lint changes that needed
to be done. Although these changes do not affect the current PR I
am trying to fix these lint issues where appropriate.

* Refactored method to avoid potential multiple database fetches when editing an issue. Renamed some methods to match APPEALS-19550.

* Fixing code climate issues.

* Hopefully circumvent master merge conflicts.

* Trigger code climate

* Fix code climate issue in `issueListProps.js`

* Add nonRatingIssueDescription to issue serializer

This is used in the AddDecisionDateModal to correctly display the
issue description.

Before the issue description would be {issue type} - {description}
when we want just {description}. This allows for that without causing
breaking issues in other areas of the app that rely on this behavior.

* Update text casing in AddDecisionDateModal

This casing is more in line with the figma mockup.

* Moved strings to copy.json file. Removed some commented out code and a todo statement.

* Removed last todo statement.

* Remove unnecessary `addDecisionDateModalVisible`

These values aren't needed as originally thought.

* Fix minor spelling issue

* Add snapshot test to AddDecisionDateModal

* Trying to fix flaky test for appeal_notifications_page_spec.

* Fixed a jest test snapshot bug because the date field max attribute will never match without a faked date since it will be different every day

* Fixed a typo where the parameter name changed and wasn't updated in the merge.

* Updated subject in a test after the merge.

* Added more to the complete feature test for vha add no decision date to also include editing and adding a decision date to the review after intake.

* Fixed a bug that was using a method that didn't exist.

* Added one additional check to the large feature test.

* Expanded the feature tests for vha hlr/sc no decision date.

---------

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

* APPEALS/19551 - Edit Decision Date (#19206)

* Add ability to EditDecisionDate after initial add

We want the user to be able to change the decision date if they
selected the wrong decision date.
This can only happen before the user saves the issue claim. Once they
have saved the claim they can no longer edit the issue decision date.

https://jira.devops.va.gov/browse/APPEALS-19551

* Add test for adding decision date to new issue

This is for testing the functionality of adding a decision date to a
new issue that was created without a decision date and then receives
a decision date all within the Edit Issues page.

* Add tests for removing issue without decision date

We are testing the functionality of removing an issue that does not
have a decision date and expecting that when we remove that issue we
should be able to establish the claim.

* Add editedDecisionDate to `issues.test.js.snap`

This resolves failing snapshot in test.

* Update AddDecisionDateModal snapshot

Update the snapshot to match the test code.

* Cleaned up feature tests for no_decision_date

* Ensure better check for no decision date test

* APPEALS-29591 Removed Sentry Alert when a record is inserted into the caseflow_stuck_records table.  Updated RSPEC.

* APPEALS-29591 Updated SQL query used in PopulateEndProductSyncQueueJob to be more performant.

* APPEALS-29591 Further optimized SQL query with CTEs.

* APPEALS-29591 Updated insert_into_priority_sync_queue method to do a single SQL insert statement.

* functionality to destroy SYNCED pepsq records

* updated spec to account for the synced pepsq record deletion

* add destroy synced records functionality and associated tests

* switch to reload

* adjust to only delete pepsq records in batch

* add check for non deleted pepsq record

* updated method name to be more verbose

* Remove AddDecisionDate action for withdrawn issues (#19375)

We do not want the ability to add a decision date to a withdrawn
issue. So we need to update the conditional to exclude withdrawn
issues from having the AddDecisionDate action.

We also will remove the showNoDecisionDateModal for withdrawn issues.

* [APPEALS- 29700] Update banner language after issue update (#19377)

* Added a change to the banner to make the text say Establish instead of Save

* Changed the banner to also change to establish which withdrawn issues

* Changed the button text to establish with withdrawn issues

* Altered the vha flash success message for the claim review controller to more accurately reflect how the user altered the claim's issues. Updated the no decision date feature spec file to reflect these changes. Also added in a withdraw issue to the existing test for more edge case code coverage. Fixed a line length lint issue in addIssues.jsx. Renamed the no decision date feature spec file.

* Added one more expectation to verify that the add decision date action is removed from withdrawn issues.

* Updated a json seed file to the correct subclass type for the new VhaBusinessLine.

---------

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

* code climate fix, moved logic to PEPSQ class

* potential code climate fix, passing in self

* fixed rspec, added rspec for pepsq class, added comment

* updated with synced constant

* APPEALS-29591 Updated find_priority_end_product_establishments_to_sync sql query to include 930s, 682s, and 683s.

* Merge test fixes.

* Updated reviews_spec.rb file to work with new factory changes.

* fix dropdown menu proptypes

* resolved code conflicts with VHA work in master

---------

Co-authored-by: Brandon Lee Dorner <[email protected]>
Co-authored-by: Craig Reese <[email protected]>
Co-authored-by: Alec Spottswood <[email protected]>
Co-authored-by: Sean Craig <[email protected]>
Co-authored-by: Tyler Broyles <[email protected]>
Co-authored-by: Jeffrey Aaron Willis <[email protected]>
Co-authored-by: Eli Brown <[email protected]>
Co-authored-by: nkirby-va <[email protected]>
Co-authored-by: = <[email protected]>
Co-authored-by: Craig Reese <[email protected]>
Co-authored-by: (Jeffrey) Aaron Willis <[email protected]>
@ThorntonMatthew ThorntonMatthew deleted the dorner/no-decision-date-fix branch August 20, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: VHA Enter No Decision Date Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests Team: Saturn 🪐 A development team for the VHA business line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants