Skip to content

Commit

Permalink
fix family flow, fix ssn requirement, fix inquiry api (#32894)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemeshvpatel authored Nov 5, 2024
1 parent 5109cde commit 7a5e813
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { ssnUI } from 'platform/forms-system/src/js/web-component-patterns';
import React from 'react';
import {
dateOfBirthSchema,
dateOfBirthUI,
fullNameSchema,
fullNameUI,
ssnSchema,
ssnUI,
titleUI,
} from 'platform/forms-system/src/js/web-component-patterns';
import { CHAPTER_3 } from '../../../constants';
import {
personalInformationFormSchemas,
Expand All @@ -20,23 +27,37 @@ delete aboutVetUiSchema.genderIdentity;
delete aboutVetUiSchema.socialOrServiceNum;
delete aboutVetUiSchema.isVeteranDeceased;

const aboutVetFormSchema = { ...personalInformationFormSchemas };
const aboutVetFormSchema = { ...personalInformationFormSchemas, ssnSchema };
delete aboutVetFormSchema.genderIdentity;
delete aboutVetFormSchema.socialOrServiceNum;
delete aboutVetFormSchema.isVeteranDeceased;

const aboutTheFamilyMemberPage = {
uiSchema: {
'ui:title': <h3>{CHAPTER_3.ABOUT_YOUR_FAM_MEM.TITLE}</h3>,
aboutTheFamilyMember: aboutVetUiSchema,
...titleUI(CHAPTER_3.ABOUT_YOUR_FAM_MEM.TITLE),
aboutTheFamilyMember: {
fullName: fullNameUI(),
socialOrServiceNum: { ssn: ssnUI() },
dateOfBirth: dateOfBirthUI(),
},
},
schema: {
type: 'object',
required: [],
properties: {
aboutTheFamilyMember: {
type: 'object',
properties: aboutVetFormSchema,
required: ['dateOfBirth'],
properties: {
fullName: fullNameSchema,
socialOrServiceNum: {
type: 'object',
required: ['ssn'],
properties: {
ssn: ssnSchema,
},
},
dateOfBirth: dateOfBirthSchema,
},
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/applications/ask-va/config/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ const formConfig = {
depends: formData =>
formData.whoIsYourQuestionAbout ===
whoIsYourQuestionAboutLabels.MYSELF &&
formData.relationshipToVeteran === relationshipOptionsMyself.VETERAN,
formData.relationshipToVeteran ===
relationshipOptionsMyself.FAMILY_MEMBER,
pages: {
...aboutSomeoneElseRelationshipFamilyMemberAboutFamilyMemberPages,
},
Expand Down
27 changes: 14 additions & 13 deletions src/applications/ask-va/containers/ReviewPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ import {
VaAccordionItem,
VaAlert,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { getViewedPages } from '@department-of-veterans-affairs/platform-forms-system/selectors';
import React, { useState } from 'react';
import { connect, useDispatch } from 'react-redux';
import Scroll from 'react-scroll';
import { isLoggedIn } from '@department-of-veterans-affairs/platform-user/selectors';
import {
getActiveExpandedPages,
getPageKeys,
} from '@department-of-veterans-affairs/platform-forms-system/helpers';
import {
setData,
setEditMode,
setViewedPages,
uploadFile,
} from '@department-of-veterans-affairs/platform-forms-system/actions';
import {
getActiveExpandedPages,
getPageKeys,
} from '@department-of-veterans-affairs/platform-forms-system/helpers';
import { getViewedPages } from '@department-of-veterans-affairs/platform-forms-system/selectors';
import { isLoggedIn } from '@department-of-veterans-affairs/platform-user/selectors';
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
import submitTransformer from '../config/submit-transformer';
import React, { useState } from 'react';
import { connect, useDispatch } from 'react-redux';
import Scroll from 'react-scroll';
import {
closeReviewChapter,
openReviewChapter,
setUpdatedInReview,
} from '../actions';
import ReviewCollapsibleChapter from '../components/ReviewCollapsibleChapter';
import formConfig from '../config/form';
import submitTransformer from '../config/submit-transformer';
import { URL, envUrl } from '../constants';
import {
createPageListByChapterAskVa,
getChapterFormConfigAskVa,
getPageKeysForReview,
} from '../utils/reviewPageHelper';
import { URL, envUrl } from '../constants';

const { scroller } = Scroll;

Expand Down Expand Up @@ -114,9 +114,10 @@ const ReviewPage = props => {
if (props.loggedIn) {
// auth call
postFormData(`${envUrl}${URL.AUTH_INQUIRIES}`, transformedData);
} else {
// no auth call
postFormData(`${envUrl}${URL.INQUIRIES}`, transformedData);
}
// no auth call
postFormData(`${envUrl}${URL.INQUIRIES}`, transformedData);
};

return (
Expand Down

0 comments on commit 7a5e813

Please sign in to comment.