-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DBX-97063] 0781 Paper Sync boilerplate (#33210)
* [DBX-97062/97063] Add flipper protected entrypoint for modern 0781 sync * general save * general save * general save * general save * general save * general save * general save
- Loading branch information
1 parent
0307061
commit d1e2169
Showing
10 changed files
with
115 additions
and
0 deletions.
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
16 changes: 16 additions & 0 deletions
16
src/applications/disability-benefits/all-claims/config/form0781/index.js
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,16 @@ | ||
import * as workflowChoicePage from '../../pages/form0781/workflowChoicePage'; | ||
import { showForm0781Pages } from '../../utils/form0781'; | ||
|
||
/** | ||
* Configuration for our modern 0781 paper sync (2024/2025) | ||
* | ||
* @returns Object | ||
*/ | ||
export const form0781PagesConfig = { | ||
workflowChoicePage: { | ||
path: 'additional-forms/mental-health-statement', | ||
depends: formData => showForm0781Pages(formData), | ||
uiSchema: workflowChoicePage.uiSchema, | ||
schema: workflowChoicePage.schema, | ||
}, | ||
}; |
1 change: 1 addition & 0 deletions
1
src/applications/disability-benefits/all-claims/content/form0781.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 @@ | ||
export const additionalFormsTitle = 'Additional Forms'; |
9 changes: 9 additions & 0 deletions
9
src/applications/disability-benefits/all-claims/pages/additionalFormsChapterWrapper.js
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,9 @@ | ||
// TODO: this is a placeholder. Structure will be added to this page in this ticket #97065 | ||
export const uiSchema = { | ||
'ui:description': 'Placeholder Text for Start Page', | ||
}; | ||
|
||
export const schema = { | ||
type: 'object', | ||
properties: {}, | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/applications/disability-benefits/all-claims/pages/form0781/workflowChoicePage.js
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,9 @@ | ||
// TODO: this is a placeholder. Structure will be added to this page in this ticket #97067 | ||
export const uiSchema = { | ||
'ui:description': 'Placeholder Text for workflow choice page', | ||
}; | ||
|
||
export const schema = { | ||
type: 'object', | ||
properties: {}, | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/applications/disability-benefits/all-claims/tests/config/form0781.unit.spec.js
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,9 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { form0781PagesConfig } from '../../config/form0781/index'; | ||
|
||
describe('the form0781PagesConfig entry point object', () => { | ||
it('should return a config object', () => { | ||
expect(form0781PagesConfig).to.be.an('object'); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
...ons/disability-benefits/all-claims/tests/pages/additionalFormsChapterWrapper.unit.spec.js
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,12 @@ | ||
import { expect } from 'chai'; | ||
import * as additionalFormsChapterWrapper from '../../pages/additionalFormsChapterWrapper'; | ||
|
||
describe('Additional Forms chapter wrapper page', () => { | ||
it('should define a uiSchema object', () => { | ||
expect(additionalFormsChapterWrapper.uiSchema).to.be.an('object'); | ||
}); | ||
|
||
it('should define a schema object', () => { | ||
expect(additionalFormsChapterWrapper.schema).to.be.an('object'); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
...tions/disability-benefits/all-claims/tests/pages/form0781/workflowChoicePage.unit.spec.js
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,12 @@ | ||
import { expect } from 'chai'; | ||
import * as workflowChoicePage from '../../../pages/form0781/workflowChoicePage'; | ||
|
||
describe('Form 0781 workflow choice page', () => { | ||
it('should define a uiSchema object', () => { | ||
expect(workflowChoicePage.uiSchema).to.be.an('object'); | ||
}); | ||
|
||
it('should define a schema object', () => { | ||
expect(workflowChoicePage.schema).to.be.an('object'); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
src/applications/disability-benefits/all-claims/utils/form0781.js
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,25 @@ | ||
// All flippers for the 0781 Papersync should be added to this file | ||
import { isClaimingNew } from '.'; | ||
|
||
/** | ||
* Checks if the modern 0781 flow should be shown if the flipper is active for this veteran | ||
* All 0781 page-specific flippers should include a check against this top level flipper | ||
* | ||
* @returns | ||
* TRUE if | ||
* - is set on form via the backend | ||
* - Veteran is claiming a new disability | ||
* - Veteran has selected connected condition choices on 'screener page' | ||
* else | ||
* - returns false | ||
*/ | ||
export function showForm0781Pages(formData) { | ||
const conditions = formData?.mentalHealth?.conditions || {}; | ||
return ( | ||
formData?.syncModern0781Flow === true && | ||
isClaimingNew(formData) && | ||
Object.entries(conditions).some( | ||
([key, value]) => key !== 'none' && value === true, | ||
) | ||
); | ||
} |
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