-
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.
* Updated routing logic to check for query params * Removed unnecessary useEffect handling postlogin * Using typographic apostrophe in copy * Reintroduce authorizeMedicalSelect * Refactored authorizeMedicalSelect * Removed unused method
- Loading branch information
Showing
6 changed files
with
89 additions
and
96 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
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
113 changes: 59 additions & 54 deletions
113
src/applications/representative-appoint/pages/authorizations/authorizeMedicalSelect.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 |
---|---|---|
@@ -1,56 +1,61 @@ | ||
// import React from 'react'; | ||
// import { checkboxGroupUI } from 'platform/forms-system/src/js/web-component-patterns'; | ||
// import { | ||
// checkboxGroupSchemaWithReviewLabels, | ||
// representativeTypeMap, | ||
// } from '../../utilities/helpers'; | ||
import React from 'react'; | ||
import { | ||
checkboxGroupSchema, | ||
checkboxGroupUI, | ||
} from '~/platform/forms-system/src/js/web-component-patterns'; | ||
import { authorizationNote } from '../../content/authorizeMedical'; | ||
import { representativeTypeMap } from '../../utilities/helpers'; | ||
|
||
// export const uiSchema = { | ||
// 'ui:description': ({ formData }) => { | ||
// return ( | ||
// <> | ||
// <h3>Authorization to access certain medical records</h3> | ||
// <p className="vads-u-margin-bottom--3 appoint-text"> | ||
// You’ve authorized this accredited{' '} | ||
// {representativeTypeMap[formData.repTypeRadio] || `representative`} to | ||
// access some of your medical records. | ||
// </p> | ||
// </> | ||
// ); | ||
// }, | ||
// 'view:authorizeRecordsCheckbox': { | ||
// ...checkboxGroupUI({ | ||
// title: 'Select the types of records they can access', | ||
// required: true, | ||
// labelHeaderLevel: '', | ||
// tile: false, | ||
// uswds: true, | ||
// labels: { | ||
// alcoholRecords: 'Alcoholism and alcohol abuse records', | ||
// drugAbuseRecords: 'Drug abuse records', | ||
// HIVRecords: 'HIV (human immunodeficiency virus) records', | ||
// sickleCellRecords: 'Sickle cell anemia records', | ||
// }, | ||
// errorMessages: { | ||
// required: 'Please select at least one option', | ||
// }, | ||
// }), | ||
// 'ui:options': { | ||
// classNames: 'vads-u-margin-top--0', | ||
// }, | ||
// }, | ||
// }; | ||
export const uiSchema = { | ||
'ui:description': ({ formData }) => { | ||
return ( | ||
<> | ||
<h3>Authorization to access certain medical records</h3> | ||
<p className="vads-u-margin-bottom--3 appoint-text"> | ||
You’ve authorized this accredited{' '} | ||
{representativeTypeMap[formData.repTypeRadio] || `representative`} to | ||
access some of your medical records. | ||
</p> | ||
</> | ||
); | ||
}, | ||
|
||
// export const schema = { | ||
// type: 'object', | ||
// properties: { | ||
// 'view:authorizeRecordsCheckbox': { | ||
// ...checkboxGroupSchemaWithReviewLabels([ | ||
// 'alcoholRecords', | ||
// 'drugAbuseRecords', | ||
// 'HIVRecords', | ||
// 'sickleCellRecords', | ||
// ]), | ||
// }, | ||
// }, | ||
// }; | ||
authorizeMedicalSelectCheckbox: checkboxGroupUI({ | ||
title: 'Select the types of records they can access', | ||
required: true, | ||
labelHeaderLevel: '', | ||
tile: false, | ||
uswds: true, | ||
labels: { | ||
alcoholRecords: 'Alcoholism and alcohol abuse records', | ||
drugAbuseRecords: 'Drug abuse records', | ||
HIVRecords: 'HIV (human immunodeficiency virus) records', | ||
sickleCellRecords: 'Sickle cell anemia records', | ||
}, | ||
errorMessages: { | ||
required: 'Please select at least one option', | ||
}, | ||
}), | ||
'view:authorizationNote4': { | ||
'ui:description': authorizationNote, | ||
}, | ||
}; | ||
|
||
export const schema = { | ||
type: 'object', | ||
required: ['authorizeMedicalSelectCheckbox'], | ||
properties: { | ||
'view:authorizeRecordsSelect': { | ||
type: 'object', | ||
properties: {}, | ||
}, | ||
authorizeMedicalSelectCheckbox: checkboxGroupSchema( | ||
Object.keys({ | ||
alcoholRecords: 'Alcoholism and alcohol abuse records', | ||
drugAbuseRecords: 'Drug abuse records', | ||
HIVRecords: 'HIV (human immunodeficiency virus) records', | ||
sickleCellRecords: 'Sickle cell anemia records', | ||
}), | ||
), | ||
}, | ||
}; |
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