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

update logic for when personal info call ismade #33028

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/applications/my-education-benefits/containers/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';

Check warning on line 3 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:3:1:Use date-fns or Native Date methods instead of moment.js
import PropTypes from 'prop-types';
import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
import { setData } from 'platform/forms-system/src/js/actions';
Expand Down Expand Up @@ -49,7 +49,7 @@
email,
duplicateEmail,
duplicatePhone,
benefitEffectiveDate,

Check warning on line 52 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:52:3:'benefitEffectiveDate' is missing in props validation
meb160630Automation,
}) => {
const [fetchedContactInfo, setFetchedContactInfo] = useState(false);
Expand Down Expand Up @@ -104,7 +104,9 @@
meb160630Automation &&
formData?.chosenBenefit) ||
(!fetchedContactInfo &&
(meb160630Automation && formData?.chosenBenefit))
(meb160630Automation && formData?.chosenBenefit)) ||
(meb160630Automation &&
formData?.chosenBenefit !== previousChosenBenefit.current)
) {
setFetchedPersonalInfo(true);
setFetchedContactInfo(true);
Expand All @@ -131,6 +133,7 @@
isLoggedIn,
setFormData,
meb160630Automation,
formData?.chosenBenefit,
],
);

Expand Down Expand Up @@ -178,7 +181,7 @@
});
}
},
[

Check warning on line 184 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:184:5:React Hook useEffect has a missing dependency: 'meb160630Automation'. Either include it or remove the dependency array.
eligibility,
featureTogglesLoaded,
fetchedEligibility,
Expand Down Expand Up @@ -232,7 +235,7 @@
setFormData(updatedFormData);
}
},
[

Check warning on line 238 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:238:5:React Hook useEffect has a missing dependency: 'meb160630Automation'. Either include it or remove the dependency array.
mebExclusionPeriodEnabled,
fetchedExclusionPeriods,
firstName,
Expand Down Expand Up @@ -426,12 +429,12 @@
};
fetchAndUpdateDirectDepositInfo();

const currentDate = moment();

Check warning on line 432 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:432:27:Consider using Native new Date().
const oneYearAgo = currentDate.subtract(1, 'y');
if (
!benefitEffectiveDate ||
(mebAutoPopulateRelinquishmentDate &&
moment(benefitEffectiveDate).isBefore(oneYearAgo))

Check warning on line 437 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:437:11:Consider using date-fns isBefore(date, dateToCompare) or dayjs().isBefore()

Check warning on line 437 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:437:11:Consider using Native new Date().
) {
setFormData({
...formData,
Expand All @@ -442,7 +445,7 @@
});
}
},
[

Check warning on line 448 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:448:5:React Hook useEffect has missing dependencies: 'formData', 'mebAutoPopulateRelinquishmentDate', and 'setFormData'. Either include them or remove the dependency array. If 'setFormData' changes too often, find the parent component that defines it and wrap that definition in useCallback.
isLoggedIn,
featureTogglesLoaded,
isLOA3,
Expand Down Expand Up @@ -516,8 +519,8 @@
showMebEnhancements08: PropTypes.bool,
showMebEnhancements09: PropTypes.bool,
showMebServiceHistoryCategorizeDisagreement: PropTypes.bool,
mebAutoPopulateRelinquishmentDate: PropTypes.bool,

Check warning on line 522 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:522:3:Prop types declarations should be sorted alphabetically
meb160630Automation: PropTypes.bool,

Check warning on line 523 in src/applications/my-education-benefits/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/my-education-benefits/containers/App.jsx:523:3:Prop types declarations should be sorted alphabetically
};

const mapStateToProps = state => {
Expand Down
3 changes: 2 additions & 1 deletion src/applications/my-education-benefits/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ export function prefillTransformerV4(pages, formData, metadata, state) {
const newData = {
...formData,
[formFields.formId]: state.data?.formData?.data?.id,
[formFields.claimantId]: claimant?.claimantId,
[formFields.claimantId]:
claimant?.claimantId === 0 ? 100 : claimant?.claimantId,
[formFields.viewUserFullName]: {
[formFields.userFullName]: {
first: firstName || undefined,
Expand Down
Loading