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

Remove AddDecisionDate action for withdrawn issues #19372

Closed
wants to merge 13 commits into from

Conversation

brandondorner
Copy link
Contributor

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

brandondorner and others added 13 commits July 20, 2023 14:08
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 <109101548+craigrva@users.noreply.github.com>
* 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 <ajspottswood@gmail.com>
…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 <ajspottswood@gmail.com>
…view 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.
* 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 <brandonleedorner@gmail.com>
* 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
@brandondorner brandondorner added Team: Saturn 🪐 A development team for the VHA business line Feature: VHA Enter No Decision Date labels Sep 6, 2023
@brandondorner
Copy link
Contributor Author

Closing in favor of #19375

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 Team: Saturn 🪐 A development team for the VHA business line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants