-
Notifications
You must be signed in to change notification settings - Fork 128
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
All claims 23 mg #8705
Merged
Merged
All claims 23 mg #8705
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e6b5826
Filter out PTSD disabilities
markgreenburg 716be5e
Working ui:title with modal
markgreenburg 1d3eae2
Content updates, add PREEXISTING type
markgreenburg 2ee7cb8
Added questions for secondary new disabilities
markgreenburg 224a607
Working 2.3 page
markgreenburg 070ed8e
Merge commit
markgreenburg 1787f8f
Missed apostrophes
markgreenburg 406b898
Add disabilities summary page
markgreenburg 2de5057
Replace apostrophe
markgreenburg 6d89512
Add tests
markgreenburg 5651f3a
Terser conditional
markgreenburg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,12 @@ import { | |
evidenceTypes, | ||
claimExamsInfo, | ||
homelessOrAtRisk, | ||
newPTSDFollowUp, | ||
} from '../pages'; | ||
|
||
import fullSchema from './schema'; | ||
import { PTSD } from '../constants'; | ||
|
||
const ptsdDisabilityIds = new Set([5420, 7290, 9010, 9011]); | ||
import fullSchema from './schema'; | ||
|
||
const formConfig = { | ||
urlPrefix: '/', | ||
|
@@ -182,11 +183,40 @@ const formConfig = { | |
title: formData => getDisabilityName(formData.condition), | ||
path: 'new-disabilities/follow-up/:index', | ||
showPagePerItem: true, | ||
itemFilter: item => !ptsdDisabilityIds.has(item.diagnosticCode), | ||
itemFilter: item => | ||
item.condition | ||
? !item.condition.toLowerCase().includes(PTSD) | ||
: false, | ||
arrayPath: 'newDisabilities', | ||
uiSchema: newDisabilityFollowUp.uiSchema, | ||
schema: newDisabilityFollowUp.schema, | ||
}, | ||
// Consecutive `showPagePerItem` pages that have the same arrayPath | ||
// will force each item in the array to be evaluated by both pages | ||
// before the next item is evaluated (e.g., if PTSD was entered first, | ||
// it would still show first even though the first page was skipped). | ||
// This break between the two `showPagePerItem`s ensures PTSD is sorted | ||
// behind non-PTSD conditions in the form flow. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great comment! |
||
// TODO: forms system PR to make showPagePerItem behavior configurable | ||
followUpPageBreak: { | ||
title: '', | ||
depends: () => false, | ||
path: 'new-disabilities/page-break', | ||
uiSchema: {}, | ||
schema: { type: 'object', properties: {} }, | ||
}, | ||
newPTSDFollowUp: { | ||
title: formData => getDisabilityName(formData.condition), | ||
path: 'new-disabilities/follow-up/ptsd/:index', | ||
showPagePerItem: true, | ||
itemFilter: item => | ||
item.condition | ||
? item.condition.toLowerCase().includes(PTSD) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively: |
||
: false, | ||
arrayPath: 'newDisabilities', | ||
uiSchema: newPTSDFollowUp.uiSchema, | ||
schema: newPTSDFollowUp.schema, | ||
}, | ||
}, | ||
}, | ||
supportingEvidence: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/applications/disability-benefits/all-claims/content/newDisabilityFollowUp.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from 'react'; | ||
import Modal from '@department-of-veterans-affairs/formation/Modal'; | ||
import { getDisabilityName } from '../utils'; | ||
|
||
export class CauseTitle extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { modalVisible: false }; | ||
} | ||
|
||
openModal = () => this.setState({ modalVisible: true }); | ||
|
||
closeModal = () => this.setState({ modalVisible: false }); | ||
|
||
render() { | ||
return ( | ||
<div> | ||
What caused this{' '} | ||
<button | ||
type="button" | ||
className="va-button-link" | ||
onClick={this.openModal} | ||
> | ||
service-connected | ||
</button>{' '} | ||
disability? | ||
<Modal | ||
title="Service-connected disability" | ||
onClose={this.closeModal} | ||
visible={this.state.modalVisible} | ||
id="service-connected-modal" | ||
> | ||
<p> | ||
To be eligible for disability benefits, you’ll need to show that | ||
your condition was caused by an illness or injury connected to your | ||
military service. You’ll need to show your condition is linked to | ||
your service by submitting evidence, such as medical reports or lay | ||
statements, with your claim. We may ask you to have a claim exam if | ||
you don’t submit evidence or if we need more information to decide | ||
your claim. | ||
</p> | ||
</Modal> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export const disabilityNameTitle = ({ formData }) => ( | ||
<legend className="schemaform-block-title schemaform-title-underline"> | ||
{getDisabilityName(formData.condition)} | ||
</legend> | ||
); |
17 changes: 17 additions & 0 deletions
17
src/applications/disability-benefits/all-claims/content/newPTSDFollowUp.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
export const newPTSDFollowUpDescription = ( | ||
<div> | ||
<p> | ||
If you’re filing a claim for PTSD, you’ll need to provide additional | ||
documents and details about the traumatic (or “stressor”) event that | ||
caused your PTSD. You may also need to provide treatment records and | ||
contact information for any relevant supporting statements. | ||
</p> | ||
<p> | ||
If you need more time to prepare your evidence for your PTSD claim, you | ||
can save your application and return to it later when you have your | ||
evidence ready to upload. | ||
</p> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
itemFilter: item => item.condition && !item.condition.toLowerCase().includes(PTSD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, good call