Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-19548-orientation-of-map-controls-fl
Browse files Browse the repository at this point in the history
  • Loading branch information
eselkin committed Jan 6, 2025
2 parents 7c20e9c + 5e0dfcc commit 654ba3a
Show file tree
Hide file tree
Showing 157 changed files with 17,850 additions and 4,918 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ jobs:
cypress-tests:
name: Cypress E2E Tests
runs-on: ubuntu-16-cores-latest
timeout-minutes: 60
timeout-minutes: 120
needs: [build, tests-prep, fetch-ecr-credentials]
if: |
needs.build.result == 'success' &&
Expand Down
2 changes: 1 addition & 1 deletion src/applications/ask-va/components/RequireSignInModal.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { toggleLoginModal } from '@department-of-veterans-affairs/platform-site-wide/actions';
import { focusElement } from 'platform/utilities/ui';
import PropTypes from 'prop-types';
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { toggleLoginModal } from '~/platform/site-wide/user-nav/actions';

const RequireSignInModal = ({ onClose, show, restrictedItem, message }) => {
const dispatch = useDispatch();
Expand Down
78 changes: 68 additions & 10 deletions src/applications/ask-va/config/helpers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';
import {
CategoryEducation,
CategoryGuardianshipCustodianshipFiduciaryIssues,
CategoryHealthCare,
CategoryHousingAssistanceAndHomeLoans,
CategoryVeteranReadinessAndEmployment,
CHAPTER_3,
Expand Down Expand Up @@ -264,15 +265,14 @@ export const isLocationOfResidenceRequired = data => {
selectTopic,
whoIsYourQuestionAbout,
isQuestionAboutVeteranOrSomeoneElse,
yourHealthFacility,
} = data;

// Check if location is required based on contact preference
if (contactPreference === contactOptions.US_MAIL) {
return false;
}

// Guardianship and VR&E rules
// Guardianship, VR&E , and Health rules
const GuardianshipAndVRE =
(selectCategory === CategoryGuardianshipCustodianshipFiduciaryIssues ||
selectCategory === CategoryVeteranReadinessAndEmployment) &&
Expand Down Expand Up @@ -353,11 +353,6 @@ export const isLocationOfResidenceRequired = data => {
return true;
}

// Medical Facility was required
if (yourHealthFacility) {
return true;
}

// Default to false if none of the conditions are met
return false;
};
Expand All @@ -382,7 +377,7 @@ export const isPostalCodeRequired = data => {
return false;
}

// Guardianship and VR&E rules
// Guardianship, VR&E , and Health rules
const GuardianshipAndVRE =
(selectCategory === CategoryGuardianshipCustodianshipFiduciaryIssues ||
selectCategory === CategoryVeteranReadinessAndEmployment) &&
Expand All @@ -392,6 +387,10 @@ export const isPostalCodeRequired = data => {
selectCategory === CategoryEducation &&
selectTopic === TopicVeteranReadinessAndEmploymentChapter31;

const HealthCare = selectCategory === CategoryHealthCare;

const HealthFacilityNotSelected = !yourHealthFacility;

// About myself
// Flow 1.1
if (
Expand All @@ -402,6 +401,14 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.MYSELF &&
relationshipToVeteran === relationshipOptionsSomeoneElse.VETERAN &&
HealthFacilityNotSelected
) {
return true;
}

// Flow 1.2
if (
Expand All @@ -412,6 +419,14 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.MYSELF &&
relationshipToVeteran === relationshipOptionsSomeoneElse.FAMILY_MEMBER &&
HealthFacilityNotSelected
) {
return true;
}

// About someone else
// Flow 2.1
Expand All @@ -423,6 +438,14 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.SOMEONE_ELSE &&
relationshipToVeteran === relationshipOptionsSomeoneElse.VETERAN &&
HealthFacilityNotSelected
) {
return true;
}

// Flow 2.2.1
if (
Expand All @@ -435,6 +458,16 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.SOMEONE_ELSE &&
relationshipToVeteran === relationshipOptionsSomeoneElse.FAMILY_MEMBER &&
isQuestionAboutVeteranOrSomeoneElse ===
isQuestionAboutVeteranOrSomeoneElseLabels.VETERAN &&
HealthFacilityNotSelected
) {
return true;
}

// Flow 2.2.2
if (
Expand All @@ -447,6 +480,16 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.SOMEONE_ELSE &&
relationshipToVeteran === relationshipOptionsSomeoneElse.FAMILY_MEMBER &&
isQuestionAboutVeteranOrSomeoneElse ===
isQuestionAboutVeteranOrSomeoneElseLabels.SOMEONE_ELSE &&
HealthFacilityNotSelected
) {
return true;
}

// Flow 2.3
if (
Expand All @@ -459,17 +502,32 @@ export const isPostalCodeRequired = data => {
) {
return true;
}
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.SOMEONE_ELSE &&
relationshipToVeteran === relationshipOptionsSomeoneElse.WORK &&
isQuestionAboutVeteranOrSomeoneElse ===
isQuestionAboutVeteranOrSomeoneElseLabels.VETERAN &&
HealthFacilityNotSelected
) {
return true;
}

// Flow 3.1
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (
(GuardianshipAndVRE || EducationAndVRE) &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.GENERAL &&
statesRequiringPostalCode.includes(veteransLocationOfResidence)
) {
return true;
}

if (selectCategory === 'Health care' && !yourHealthFacility) {
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
if (
HealthCare &&
whoIsYourQuestionAbout === whoIsYourQuestionAboutLabels.GENERAL &&
HealthFacilityNotSelected
) {
return true;
}

Expand Down
16 changes: 8 additions & 8 deletions src/applications/ask-va/config/schema-helpers/formFlowHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ export const aboutMyselfRelationshipFamilyMemberPages = flowPages(
const aboutSomeoneElseRelationshipVeteran = [
'aboutYourRelationshipToFamilyMember',
'aboutYourFamilyMember',
'familyMembersLocationOfResidence',
'familyMembersPostalCode',
'yourVAHealthFacility',
'theirVREInformation',
'theirVRECounselor',
'familyMembersLocationOfResidence',
'familyMembersPostalCode',
'stateOfProperty',
'aboutYourself',
'yourBranchOfService',
Expand Down Expand Up @@ -551,11 +551,11 @@ const aboutSomeoneElseRelationshipFamilyMemberAboutVeteran = [
'moreAboutYourRelationshipToVeteran',
'aboutTheVeteran',
'dateOfDeath',
'veteransLocationOfResidence',
'veteransPostalCode',
'yourVAHealthFacility',
'theirVREInformation',
'theirVRECounselor',
'veteransLocationOfResidence',
'veteransPostalCode',
'stateOfProperty',
'aboutYourselfRelationshipFamilyMember',
'yourContactInformation',
Expand All @@ -571,11 +571,11 @@ export const aboutSomeoneElseRelationshipFamilyMemberAboutVeteranPages = flowPag
const aboutSomeoneElseRelationshipFamilyMemberAboutFamilyMember = [
'theirRelationshipToVeteran',
'aboutYourFamilyMember',
'familyMembersLocationOfResidence',
'familyMembersPostalCode',
'yourVAHealthFacility',
'theirVREInformation',
'theirVRECounselor',
'familyMembersLocationOfResidence',
'familyMembersPostalCode',
'stateOfProperty',
'aboutTheVeteran',
'dateOfDeath',
Expand Down Expand Up @@ -605,11 +605,11 @@ const aboutSomeoneElseRelationshipConnectedThroughWork = [
'yourRole',
'aboutTheVeteran',
'dateOfDeath',
'veteransLocationOfResidence',
'veteransPostalCode',
'yourVAHealthFacility',
'theirVREInformation',
'theirVRECounselor',
'veteransLocationOfResidence',
'veteransPostalCode',
'stateOfProperty',
'aboutYourself',
'yourContactInformation',
Expand Down
1 change: 1 addition & 0 deletions src/applications/ask-va/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const branchesOfService = [

// Categories
export const CategoryEducation = 'Education benefits and work study';
export const CategoryHealthCare = 'Health care';
export const CategoryVeteranReadinessAndEmployment =
'Veteran Readiness and Employment';
export const CategoryGuardianshipCustodianshipFiduciaryIssues =
Expand Down
6 changes: 6 additions & 0 deletions src/applications/ask-va/containers/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import RoutedSavableApp from 'platform/forms/save-in-progress/RoutedSavableApp';
import PropTypes from 'prop-types';
import React from 'react';
import BreadCrumbs from '../components/BreadCrumbs';
import ProgressBar from '../components/ProgressBar';
Expand All @@ -15,3 +16,8 @@ export default function App({ location, children }) {
</>
);
}

App.propTypes = {
children: PropTypes.node,
location: PropTypes.object,
};
2 changes: 1 addition & 1 deletion src/applications/ask-va/containers/ConfirmationPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ConfirmationPage = ({ location }) => {
</va-alert>
);

const actionLink = currentlyLoggedIn ?? (
const actionLink = currentlyLoggedIn && (
<div className="vads-u-margin-bottom--3 vads-u-margin-top--3">
<va-link-action
href="/contact-us/ask-va-too"
Expand Down
4 changes: 2 additions & 2 deletions src/applications/ask-va/containers/DashboardCards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getVAStatusFromCRM,
} from '../config/helpers';
import { URL, envUrl } from '../constants';
import { mockInquries } from './mockInquiryReplyData';
import { mockInquiries } from '../utils/mockData';

// Toggle this when testing locally to load dashboard cards
const mockTestingFlag = false;
Expand All @@ -40,7 +40,7 @@ const DashboardCards = () => {

const getApiData = url => {
if (mockTestingFlag) {
const res = mockInquries;
const res = mockInquiries;

const transformedInquiries = res.data.map(inquiry => ({
...inquiry,
Expand Down
Loading

0 comments on commit 654ba3a

Please sign in to comment.