From 35927291972061c80d62270502dd0a7d33f8264e Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 12:27:08 -0400 Subject: [PATCH 01/64] 5512: remove petition redaction acknowledgement from Electronic petition since it doesnt save to the DB and its validated on the frontend (keep legacy pattern); --- shared/src/business/entities/cases/ElectronicPetition.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/shared/src/business/entities/cases/ElectronicPetition.ts b/shared/src/business/entities/cases/ElectronicPetition.ts index 6164dc4de11..5714d2f342c 100644 --- a/shared/src/business/entities/cases/ElectronicPetition.ts +++ b/shared/src/business/entities/cases/ElectronicPetition.ts @@ -34,7 +34,6 @@ export class ElectronicPetition extends JoiValidationEntity { public petitionFile?: object; public petitionFileSize?: number; public petitionFileId?: string; - public petitionRedactionAcknowledgement?: boolean; public preferredTrialCity: string; public procedureType: string; public stinFile?: object; @@ -63,8 +62,6 @@ export class ElectronicPetition extends JoiValidationEntity { this.petitionFile = rawCase.petitionFile; this.petitionFileSize = rawCase.petitionFileSize; this.petitionFileId = rawCase.petitionFileId; - this.petitionRedactionAcknowledgement = - rawCase.petitionRedactionAcknowledgement; this.petitionType = rawCase.petitionType || PETITION_TYPES.userUploaded; this.corporateDisclosureFile = rawCase.corporateDisclosureFile; @@ -178,11 +175,6 @@ export class ElectronicPetition extends JoiValidationEntity { '*': 'Your Petition file size is empty', 'number.max': `Your Petition file size is too big. The maximum file size is ${MAX_FILE_SIZE_MB}MB.`, }), - petitionRedactionAcknowledgement: joi.boolean().when('petitionType', { - is: JoiValidationConstants.STRING.valid(PETITION_TYPES.userUploaded), - otherwise: joi.optional(), - then: joi.boolean().optional().invalid(false), - }), petitionType: JoiValidationConstants.STRING.required().valid( ...Object.values(PETITION_TYPES), ), From 013f0e28a48c052993e8ada4ac5415876db7be39 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 12:32:05 -0400 Subject: [PATCH 02/64] 5512: Extracted the 'N/A' constant to Entity Constant file; --- shared/src/business/entities/EntityConstants.ts | 3 ++- shared/src/business/entities/cases/ElectronicPetition.ts | 3 ++- shared/src/business/entities/cases/PaperPetition.ts | 3 ++- .../utilities/pdfGenerator/documentTemplates/Petition.tsx | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/shared/src/business/entities/EntityConstants.ts b/shared/src/business/entities/EntityConstants.ts index ba6456e230a..c7554d59b7a 100644 --- a/shared/src/business/entities/EntityConstants.ts +++ b/shared/src/business/entities/EntityConstants.ts @@ -1144,7 +1144,8 @@ export type AbbrevatedStates = | keyof typeof US_STATES | keyof typeof US_STATES_OTHER; -export const STATE_NOT_AVAILABLE = 'N/A'; +export const NOT_AVAILABLE_OPTION = 'N/A'; +export const STATE_NOT_AVAILABLE = NOT_AVAILABLE_OPTION; export const PARTY_TYPES = { conservator: 'Conservator', diff --git a/shared/src/business/entities/cases/ElectronicPetition.ts b/shared/src/business/entities/cases/ElectronicPetition.ts index 5714d2f342c..4af0929e0df 100644 --- a/shared/src/business/entities/cases/ElectronicPetition.ts +++ b/shared/src/business/entities/cases/ElectronicPetition.ts @@ -4,6 +4,7 @@ import { LEGACY_TRIAL_CITY_STRINGS, MAX_FILE_SIZE_BYTES, MAX_FILE_SIZE_MB, + NOT_AVAILABLE_OPTION, PARTY_TYPES, PROCEDURE_TYPES, ROLES, @@ -80,7 +81,7 @@ export class ElectronicPetition extends JoiValidationEntity { if (contacts.secondary) { if (!contacts.secondary.phone) { - contacts.secondary.phone = 'N/A'; + contacts.secondary.phone = NOT_AVAILABLE_OPTION; } this.petitioners.push(contacts.secondary); } diff --git a/shared/src/business/entities/cases/PaperPetition.ts b/shared/src/business/entities/cases/PaperPetition.ts index 63b282e99e8..23099d49b38 100644 --- a/shared/src/business/entities/cases/PaperPetition.ts +++ b/shared/src/business/entities/cases/PaperPetition.ts @@ -2,6 +2,7 @@ import { CASE_TYPES, FILING_TYPES, MAX_FILE_SIZE_MB, + NOT_AVAILABLE_OPTION, PARTY_TYPES, PAYMENT_STATUS, PROCEDURE_TYPES, @@ -146,7 +147,7 @@ export class PaperPetition extends JoiValidationEntity { this.petitioners = [contacts.primary]; if (contacts.secondary) { if (!contacts.secondary.phone) { - contacts.secondary.phone = 'N/A'; + contacts.secondary.phone = NOT_AVAILABLE_OPTION; } this.petitioners.push(contacts.secondary); } diff --git a/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx b/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx index b6da2b5426b..a48d515e6bf 100644 --- a/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx +++ b/shared/src/business/utilities/pdfGenerator/documentTemplates/Petition.tsx @@ -3,6 +3,7 @@ import { ALL_STATE_OPTIONS, BUSINESS_TYPES, COUNTRY_TYPES, + NOT_AVAILABLE_OPTION, PARTY_TYPES, PROCEDURE_TYPES_MAP, } from '@shared/business/entities/EntityConstants'; @@ -98,12 +99,12 @@ export const Petition = ({
    {irsNotices.map(irsNotice => (
  1. - {irsNotice.taxYear || 'N/A'} + {irsNotice.taxYear || NOT_AVAILABLE_OPTION}
  2. ))}
) : ( -

{taxYear || 'N/A'}

+

{taxYear || NOT_AVAILABLE_OPTION}

)}
  • @@ -274,7 +275,7 @@ const renderIrsNotice = irsNotice => { } else { return ( - {`${irsNotice.noticeIssuedDateFormatted || 'N/A'} - ${irsNotice.cityAndStateIssuingOffice || 'N/A'}`} + {`${irsNotice.noticeIssuedDateFormatted || NOT_AVAILABLE_OPTION} - ${irsNotice.cityAndStateIssuingOffice || NOT_AVAILABLE_OPTION}`} ); } From 0ebe5571dbe3b1511e6f0538e9580451ddadfc28 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 12:37:09 -0400 Subject: [PATCH 03/64] 5512: use useEffect instead of local variable; --- web-client/src/views/StepIndicator.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/web-client/src/views/StepIndicator.tsx b/web-client/src/views/StepIndicator.tsx index cc0c67186a5..f88e0404227 100644 --- a/web-client/src/views/StepIndicator.tsx +++ b/web-client/src/views/StepIndicator.tsx @@ -1,11 +1,9 @@ import { Button } from '@web-client/ustc-ui/Button/Button'; import { connect } from '@web-client/presenter/shared.cerebral'; import { sequences, state } from '@web-client/presenter/app.cerebral'; -import React from 'react'; +import React, { useEffect } from 'react'; import classNames from 'classnames'; -let PREVIOUS_STEP = 0; - export const StepIndicator = connect( { stepIndicatorInfo: state.stepIndicatorInfo, @@ -14,10 +12,9 @@ export const StepIndicator = connect( function StepIndicator({ stepIndicatorInfo, updateStepIndicatorSequence }) { const { currentStep, steps } = stepIndicatorInfo; - if (PREVIOUS_STEP !== currentStep) { - PREVIOUS_STEP = currentStep; + useEffect(() => { window.scrollTo(0, 0); - } + }, [currentStep]); return ( <> From ca932fa1f11dcebbc72fadc6ded753a08d288dea Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 12:54:11 -0400 Subject: [PATCH 04/64] 5512: Extracted React components from Step 6 to own files; --- .../src/views/StartCaseUpdated/CardHeader.tsx | 40 ++ .../StartCaseUpdated/CaseInformation.tsx | 28 ++ .../StartCaseUpdated/IRSNoticeInformation.tsx | 76 ++++ .../StartCaseUpdated/PetitionInformation.tsx | 62 +++ .../PetitionerInformation.tsx | 153 +++++++ .../StartCaseUpdated/STINInformation.tsx | 28 ++ .../UpdatedFilePetitionStep6.tsx | 380 +----------------- 7 files changed, 395 insertions(+), 372 deletions(-) create mode 100644 web-client/src/views/StartCaseUpdated/CardHeader.tsx create mode 100644 web-client/src/views/StartCaseUpdated/CaseInformation.tsx create mode 100644 web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx create mode 100644 web-client/src/views/StartCaseUpdated/PetitionInformation.tsx create mode 100644 web-client/src/views/StartCaseUpdated/PetitionerInformation.tsx create mode 100644 web-client/src/views/StartCaseUpdated/STINInformation.tsx diff --git a/web-client/src/views/StartCaseUpdated/CardHeader.tsx b/web-client/src/views/StartCaseUpdated/CardHeader.tsx new file mode 100644 index 00000000000..0f645903cd2 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/CardHeader.tsx @@ -0,0 +1,40 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { props as cerebralProps } from 'cerebral'; +import { connect } from '@web-client/presenter/shared.cerebral'; +import { sequences } from '@web-client/presenter/app.cerebral'; +import React from 'react'; + +const props = cerebralProps as unknown as { + step: number; + title: string; +}; + +export const CardHeader = connect( + { + step: props.step, + title: props.title, + updateStepIndicatorSequence: sequences.updateStepIndicatorSequence, + }, + function CardHeader({ step, title, updateStepIndicatorSequence }) { + return ( +

    +
    + {step}. {title} +
    +
    + +
    +

    + ); + }, +); diff --git a/web-client/src/views/StartCaseUpdated/CaseInformation.tsx b/web-client/src/views/StartCaseUpdated/CaseInformation.tsx new file mode 100644 index 00000000000..f935c33889d --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/CaseInformation.tsx @@ -0,0 +1,28 @@ +import { CardHeader } from './CardHeader'; +import React from 'react'; + +export function CaseInformation({ petitionFormatted }) { + return ( +
    +
    + +
    +
    +
    Case procedure
    +
    + {petitionFormatted.procedureType} +
    +
    +
    +
    + Requested trial location +
    +
    + {petitionFormatted.preferredTrialCity} +
    +
    +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx b/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx new file mode 100644 index 00000000000..d231f4eab24 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx @@ -0,0 +1,76 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { CardHeader } from './CardHeader'; +import { formatCaseType } from './UpdatedFilePetitionStep6'; +import React from 'react'; +import classNames from 'classnames'; + +export function IRSNoticeInformation({ petitionFormatted }) { + return ( +
    +
    + +
    + {!petitionFormatted.hasIrsNotice && ( +
    +
    +
    + Type of notice/case +
    +
    + {petitionFormatted.caseType} +
    +
    +
    + )} + + {petitionFormatted.hasIrsNotice && + petitionFormatted.irsNotices.map((irsNotice, index) => { + const isFirstNotice = index === 0; + return ( +
    +
    + IRS notice {index + 1} +
    +
    + {formatCaseType(irsNotice.caseType)} +
    + {irsNotice.taxYear && ( +
    {irsNotice.taxYear}
    + )} + {irsNotice.noticeIssuedDate && ( +
    + {irsNotice.noticeIssuedDateFormatted} +
    + )} + {irsNotice.cityAndStateIssuingOffice && ( +
    + {irsNotice.cityAndStateIssuingOffice} +
    + )} + {irsNotice.irsNoticeFileUrl && ( + + )} +
    + ); + })} +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/PetitionInformation.tsx b/web-client/src/views/StartCaseUpdated/PetitionInformation.tsx new file mode 100644 index 00000000000..092751e9897 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/PetitionInformation.tsx @@ -0,0 +1,62 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { CardHeader } from './CardHeader'; +import React from 'react'; + +export function PetitionInformation({ isAutoGenerated, petitionFormatted }) { + return ( +
    +
    + + {!isAutoGenerated ? ( +
    + +
    + ) : ( + <> +
    + Reason(s) why you disagree with the IRS action(s) in this case +
    +
    +
      + {petitionFormatted.petitionReasons.map(reason => ( +
    1. + {reason} +
    2. + ))} +
    +
    +
    +
    Fact(s) upon which you rely
    +
    +
      + {petitionFormatted.petitionFacts.map(fact => ( +
    1. + {fact} +
    2. + ))} +
    +
    +
    + + )} +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/PetitionerInformation.tsx b/web-client/src/views/StartCaseUpdated/PetitionerInformation.tsx new file mode 100644 index 00000000000..3ac6eba2077 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/PetitionerInformation.tsx @@ -0,0 +1,153 @@ +import { + ALL_STATE_OPTIONS, + BUSINESS_TYPES, +} from '@shared/business/entities/EntityConstants'; +import { AddressDisplay } from '../CaseDetail/AddressDisplay'; +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { CardHeader } from './CardHeader'; +import React from 'react'; + +export function PetitionerInformation({ petitionFormatted }) { + return ( +
    +
    + +
    +
    + Party type +
    {petitionFormatted.partyType}
    + {petitionFormatted.corporateDisclosureFile && ( +
    + + Corporate Disclosure Statement + +
    +
    +
    + +
    +
    +
    +
    + )} +
    +
    +
    + + Petitioner contact information + + {petitionFormatted.contactPrimary && ( +
    + + {petitionFormatted.contactPrimary.placeOfLegalResidence && ( +
    + + {Object.values(BUSINESS_TYPES).includes( + petitionFormatted.partyType, + ) + ? 'Place of business:' + : 'Place of legal residence:'} + + + { + ALL_STATE_OPTIONS[ + petitionFormatted.contactPrimary + .placeOfLegalResidence + ] + } + +
    + )} + +
    + + Service email + + + {petitionFormatted.contactPrimary.email} + +
    +
    + )} +
    +
    + {petitionFormatted.contactSecondary && ( +
    +
    + + {"Spouse's contact information"} + +
    + +
    +
    + + Register for eService/filing: + + + {petitionFormatted.contactSecondary.hasConsentedToEService + ? 'Yes' + : 'No'} + +
    + {petitionFormatted.contactSecondary.placeOfLegalResidence && ( +
    + + Place of legal residence: + + + { + ALL_STATE_OPTIONS[ + petitionFormatted.contactSecondary + .placeOfLegalResidence + ] + } + +
    + )} +
    +
    + )} +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/STINInformation.tsx b/web-client/src/views/StartCaseUpdated/STINInformation.tsx new file mode 100644 index 00000000000..1e2dc3d0c19 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/STINInformation.tsx @@ -0,0 +1,28 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { CardHeader } from './CardHeader'; +import React from 'react'; + +export function STINInformation({ petitionFormatted }) { + return ( +
    +
    + +
    + +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx index 61d82b4d667..5b2d4ef2475 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx @@ -1,22 +1,19 @@ -import { - ALL_STATE_OPTIONS, - BUSINESS_TYPES, - CASE_TYPES_MAP, -} from '@shared/business/entities/EntityConstants'; -import { AddressDisplay } from '../CaseDetail/AddressDisplay'; -import { Button } from '@web-client/ustc-ui/Button/Button'; +import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants'; +import { CaseInformation } from './CaseInformation'; import { ErrorNotification } from '@web-client/views/ErrorNotification'; import { FileUploadErrorModal } from '@web-client/views/FileUploadErrorModal'; import { FileUploadStatusModal } from '@web-client/views/FileUploadStatusModal'; +import { IRSNoticeInformation } from './IRSNoticeInformation'; import { InfoNotificationComponent } from '@web-client/views/InfoNotification'; import { PETITION_TYPES } from '@web-client/presenter/actions/setupPetitionStateAction'; +import { PetitionInformation } from './PetitionInformation'; +import { PetitionerInformation } from './PetitionerInformation'; +import { STINInformation } from './STINInformation'; import { UpdatedFilePetitionButtons } from '@web-client/views/StartCaseUpdated/UpdatedFilePetitionButtons'; import { WarningNotificationComponent } from '@web-client/views/WarningNotification'; -import { props as cerebralProps } from 'cerebral'; import { connect } from '@web-client/presenter/shared.cerebral'; -import { sequences, state } from '@web-client/presenter/app.cerebral'; +import { state } from '@web-client/presenter/app.cerebral'; import React from 'react'; -import classNames from 'classnames'; export const UpdatedFilePetitionStep6 = connect( { @@ -129,368 +126,7 @@ export const UpdatedFilePetitionStep6 = connect( }, ); -function PetitionerInformation({ petitionFormatted }) { - return ( -
    -
    - -
    -
    - Party type -
    {petitionFormatted.partyType}
    - {petitionFormatted.corporateDisclosureFile && ( -
    - - Corporate Disclosure Statement - -
    -
    -
    - -
    -
    -
    -
    - )} -
    -
    -
    - - Petitioner contact information - - {petitionFormatted.contactPrimary && ( -
    - - {petitionFormatted.contactPrimary.placeOfLegalResidence && ( -
    - - {Object.values(BUSINESS_TYPES).includes( - petitionFormatted.partyType, - ) - ? 'Place of business:' - : 'Place of legal residence:'} - - - { - ALL_STATE_OPTIONS[ - petitionFormatted.contactPrimary - .placeOfLegalResidence - ] - } - -
    - )} - -
    - - Service email - - - {petitionFormatted.contactPrimary.email} - -
    -
    - )} -
    -
    - {petitionFormatted.contactSecondary && ( -
    -
    - - {"Spouse's contact information"} - -
    - -
    -
    - - Register for eService/filing: - - - {petitionFormatted.contactSecondary.hasConsentedToEService - ? 'Yes' - : 'No'} - -
    - {petitionFormatted.contactSecondary.placeOfLegalResidence && ( -
    - - Place of legal residence: - - - { - ALL_STATE_OPTIONS[ - petitionFormatted.contactSecondary - .placeOfLegalResidence - ] - } - -
    - )} -
    -
    - )} -
    -
    -
    - ); -} - -function PetitionInformation({ isAutoGenerated, petitionFormatted }) { - return ( -
    -
    - - {!isAutoGenerated ? ( -
    - -
    - ) : ( - <> -
    - Reason(s) why you disagree with the IRS action(s) in this case -
    -
    -
      - {petitionFormatted.petitionReasons.map(reason => ( -
    1. - {reason} -
    2. - ))} -
    -
    -
    -
    Fact(s) upon which you rely
    -
    -
      - {petitionFormatted.petitionFacts.map(fact => ( -
    1. - {fact} -
    2. - ))} -
    -
    -
    - - )} -
    -
    - ); -} - -function IRSNoticeInformation({ petitionFormatted }) { - return ( -
    -
    - -
    - {!petitionFormatted.hasIrsNotice && ( -
    -
    -
    - Type of notice/case -
    -
    - {petitionFormatted.caseType} -
    -
    -
    - )} - - {petitionFormatted.hasIrsNotice && - petitionFormatted.irsNotices.map((irsNotice, index) => { - const isFirstNotice = index === 0; - return ( -
    -
    - IRS notice {index + 1} -
    -
    - {formatCaseType(irsNotice.caseType)} -
    - {irsNotice.taxYear && ( -
    {irsNotice.taxYear}
    - )} - {irsNotice.noticeIssuedDate && ( -
    - {irsNotice.noticeIssuedDateFormatted} -
    - )} - {irsNotice.cityAndStateIssuingOffice && ( -
    - {irsNotice.cityAndStateIssuingOffice} -
    - )} - {irsNotice.irsNoticeFileUrl && ( - - )} -
    - ); - })} -
    -
    -
    - ); -} - -function CaseInformation({ petitionFormatted }) { - return ( -
    -
    - -
    -
    -
    Case procedure
    -
    - {petitionFormatted.procedureType} -
    -
    -
    -
    - Requested trial location -
    -
    - {petitionFormatted.preferredTrialCity} -
    -
    -
    -
    -
    - ); -} - -function STINInformation({ petitionFormatted }) { - return ( -
    -
    - -
    - -
    -
    -
    - ); -} - -const props = cerebralProps as unknown as { - step: number; - title: string; -}; - -const CardHeader = connect( - { - step: props.step, - title: props.title, - updateStepIndicatorSequence: sequences.updateStepIndicatorSequence, - }, - function CardHeader({ step, title, updateStepIndicatorSequence }) { - return ( -

    -
    - {step}. {title} -
    -
    - -
    -

    - ); - }, -); - -function formatCaseType(caseType: string) { +export function formatCaseType(caseType: string) { if (caseType === 'Disclosure1' || caseType === 'Disclosure2') { return CASE_TYPES_MAP.disclosure; } From 8375cc79e33bdafcddd5779a61eaf57033ba1f18 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 13:11:49 -0400 Subject: [PATCH 05/64] 5512: Extracted React components from Step 1 to own files; --- .../views/StartCaseUpdated/BusinessInfo.tsx | 85 +++ .../CorporateDisclosureUpload.tsx | 73 +++ .../OtherContactInformation.tsx | 27 + .../src/views/StartCaseUpdated/OtherInfo.tsx | 97 +++ .../PetitionerAndSpouseInfo.tsx | 105 ++++ .../SecondaryEstateOptions.tsx | 55 ++ .../SecondaryMinorIncompetentOptions.tsx | 61 ++ .../src/views/StartCaseUpdated/Spouse.tsx | 76 +++ .../UpdatedFilePetitionStep1.tsx | 560 +----------------- 9 files changed, 582 insertions(+), 557 deletions(-) create mode 100644 web-client/src/views/StartCaseUpdated/BusinessInfo.tsx create mode 100644 web-client/src/views/StartCaseUpdated/CorporateDisclosureUpload.tsx create mode 100644 web-client/src/views/StartCaseUpdated/OtherContactInformation.tsx create mode 100644 web-client/src/views/StartCaseUpdated/OtherInfo.tsx create mode 100644 web-client/src/views/StartCaseUpdated/PetitionerAndSpouseInfo.tsx create mode 100644 web-client/src/views/StartCaseUpdated/SecondaryEstateOptions.tsx create mode 100644 web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx create mode 100644 web-client/src/views/StartCaseUpdated/Spouse.tsx diff --git a/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx b/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx new file mode 100644 index 00000000000..3f0f526cddc --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/BusinessInfo.tsx @@ -0,0 +1,85 @@ +import { BUSINESS_TYPES } from '@shared/business/entities/EntityConstants'; +import { ContactPrimaryUpdated } from '@web-client/views/StartCase/ContactPrimaryUpdated'; +import { CorporateDisclosureUpload } from './CorporateDisclosureUpload'; +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import React from 'react'; + +export function BusinessInfo({ + businessFieldNames, + form, + petitionGenerationLiveValidationSequence, + registerRef, + updateFilingTypeSequence, + updateFormValueCountryTypeSequence, + updateFormValueUpdatedSequence, + validationErrors, +}) { + const selectedBusinessType = form.businessType; + return ( +
    + +
    + + What type of business are you filing for? + + {[ + BUSINESS_TYPES.corporation, + BUSINESS_TYPES.partnershipAsTaxMattersPartner, + BUSINESS_TYPES.partnershipOtherThanTaxMatters, + BUSINESS_TYPES.partnershipBBA, + ].map((businessType, idx) => ( +
    + { + updateFilingTypeSequence({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + +
    + ))} +
    +
    + + {selectedBusinessType && ( +
    + + +
    + )} +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/CorporateDisclosureUpload.tsx b/web-client/src/views/StartCaseUpdated/CorporateDisclosureUpload.tsx new file mode 100644 index 00000000000..f268a3966c3 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/CorporateDisclosureUpload.tsx @@ -0,0 +1,73 @@ +import { Button } from '@web-client/ustc-ui/Button/Button'; +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import { InfoNotificationComponent } from '@web-client/views/InfoNotification'; +import { MAX_FILE_SIZE_MB } from '@shared/business/entities/EntityConstants'; +import { StateDrivenFileInput } from '@web-client/views/FileDocument/StateDrivenFileInput'; +import React from 'react'; +import classNames from 'classnames'; + +export function CorporateDisclosureUpload({ + hasCorporateDisclosureFile, + validationErrors, +}) { + return ( + <> +

    Corporate Disclosure Statement

    + +
    + {"Download and fill out the form if you haven't already done so:"} +
    + +
    + + + + Make sure file is not encrypted or password protected. Max file size{' '} + {MAX_FILE_SIZE_MB}MB. + + + +
    + + ); +} diff --git a/web-client/src/views/StartCaseUpdated/OtherContactInformation.tsx b/web-client/src/views/StartCaseUpdated/OtherContactInformation.tsx new file mode 100644 index 00000000000..718e40187b8 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/OtherContactInformation.tsx @@ -0,0 +1,27 @@ +import { ContactPrimaryUpdated } from '@web-client/views/StartCase/ContactPrimaryUpdated'; +import React from 'react'; + +export function OtherContactInformation({ + form, + otherContactNameLabel, + petitionGenerationLiveValidationSequence, + registerRef, + updateFormValueCountryTypeSequence, + updateFormValueUpdatedSequence, +}) { + return ( + + ); +} diff --git a/web-client/src/views/StartCaseUpdated/OtherInfo.tsx b/web-client/src/views/StartCaseUpdated/OtherInfo.tsx new file mode 100644 index 00000000000..ccbc1f45abf --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/OtherInfo.tsx @@ -0,0 +1,97 @@ +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import { OtherContactInformation } from './OtherContactInformation'; +import { SecondaryEstateOptions } from './SecondaryEstateOptions'; +import { SecondaryMinorIncompetentOptions } from './SecondaryMinorIncompetentOptions'; +import React from 'react'; + +export function OtherInfo({ + form, + otherContactNameLabel, + petitionGenerationLiveValidationSequence, + registerRef, + showContactInformationForOtherPartyType, + updateFilingTypeSequence, + updateFormValueCountryTypeSequence, + updateFormValueUpdatedSequence, + validationErrors, +}) { + const selectedEstateType = form.estateType; + const selectedMinorIncompetentType = form.minorIncompetentType; + const selectedOtherType = form.otherType; + + return ( +
    + +
    + + What other type of taxpayer are you filing for? + + {[ + 'An estate or trust', + 'A minor or legally incompetent person', + 'Donor', + 'Transferee', + 'Deceased Spouse', + ].map((otherType, idx) => ( +
    + { + updateFilingTypeSequence({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + +
    + ))} +
    +
    + {selectedOtherType === 'An estate or trust' && ( + + )} + {selectedOtherType === 'A minor or legally incompetent person' && ( + + )} + {showContactInformationForOtherPartyType && ( + + )} +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/PetitionerAndSpouseInfo.tsx b/web-client/src/views/StartCaseUpdated/PetitionerAndSpouseInfo.tsx new file mode 100644 index 00000000000..0f8f51d954a --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/PetitionerAndSpouseInfo.tsx @@ -0,0 +1,105 @@ +import { ContactSecondaryUpdated } from '@web-client/views/StartCase/ContactSecondaryUpdated'; +import { Spouse } from './Spouse'; +import React from 'react'; +import classNames from 'classnames'; + +export function PetitionerAndSpouseInfo({ + form, + petitionGenerationLiveValidationSequence, + registerRef, + resetSecondaryAddressSequence, + updateFilingTypeSequence, + updateFormValueCountryTypeSequence, + updateFormValueSequence, + updateFormValueUpdatedSequence, + validationErrors, +}) { + const { + contactSecondary, + hasSpouseConsent, + isSpouseDeceased: isSpouseDeceasedSelected, + useSameAsPrimary, + } = form; + + return ( +
    +

    Your spouse's information

    +
    + Is your spouse deceased? + {['Yes', 'No'].map((isSpouseDeceased, idx) => ( +
    + { + updateFilingTypeSequence({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + +
    + ))} + + {validationErrors.isSpouseDeceased && ( + + {validationErrors.isSpouseDeceased} + + )} +
    + {isSpouseDeceasedSelected === 'Yes' && ( + + )} + {isSpouseDeceasedSelected === 'No' && ( + + )} +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/SecondaryEstateOptions.tsx b/web-client/src/views/StartCaseUpdated/SecondaryEstateOptions.tsx new file mode 100644 index 00000000000..87fc7094f40 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/SecondaryEstateOptions.tsx @@ -0,0 +1,55 @@ +import { ESTATE_TYPES } from '@shared/business/entities/EntityConstants'; +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import React from 'react'; + +export function SecondaryEstateOptions({ + selectedEstateType, + updateFilingTypeSequence, + validationErrors, +}) { + return ( +
    + +
    + + What type of estate or trust are you filing for? + + {[ + ESTATE_TYPES.estate, + ESTATE_TYPES.estateWithoutExecutor, + ESTATE_TYPES.trust, + ].map((estateType, idx) => ( +
    + { + updateFilingTypeSequence({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + +
    + ))} +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx b/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx new file mode 100644 index 00000000000..51387116fad --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/SecondaryMinorIncompetentOptions.tsx @@ -0,0 +1,61 @@ +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import { OTHER_TYPES } from '@shared/business/entities/EntityConstants'; +import React from 'react'; + +export function SecondaryMinorIncompetentOptions({ + selectedMinorIncompetentType, + updateFilingTypeSequence, + validationErrors, +}) { + return ( +
    + +
    + + What is your role in filing for this minor or legally incompetent + person? + + {[ + OTHER_TYPES.conservator, + OTHER_TYPES.guardian, + OTHER_TYPES.custodian, + OTHER_TYPES.nextFriendForMinor, + OTHER_TYPES.nextFriendForIncompetentPerson, + ].map((minorIncompetentType, idx) => ( +
    + { + updateFilingTypeSequence({ + key: e.target.name, + value: e.target.value, + }); + }} + /> + +
    + ))} +
    +
    +
    + ); +} diff --git a/web-client/src/views/StartCaseUpdated/Spouse.tsx b/web-client/src/views/StartCaseUpdated/Spouse.tsx new file mode 100644 index 00000000000..6984bcf3889 --- /dev/null +++ b/web-client/src/views/StartCaseUpdated/Spouse.tsx @@ -0,0 +1,76 @@ +import { ContactSecondaryUpdated } from '@web-client/views/StartCase/ContactSecondaryUpdated'; +import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; +import { WarningNotificationComponent } from '@web-client/views/WarningNotification'; +import React from 'react'; +import classNames from 'classnames'; + +export function Spouse({ + contactSecondary, + hasSpouseConsent, + petitionGenerationLiveValidationSequence, + registerRef, + resetSecondaryAddressSequence, + updateFormValueCountryTypeSequence, + updateFormValueSequence, + updateFormValueUpdatedSequence, + useSameAsPrimary, + validationErrors, +}) { + return ( + <> + + + { + updateFormValueSequence({ + key: e.target.name, + value: e.target.checked, + }); + resetSecondaryAddressSequence({ + key: e.target.name, + value: e.target.checked, + }); + }} + /> + + + {hasSpouseConsent && ( + + )} + + ); +} diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx index b5b04f84047..e4d29ab6b84 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx @@ -1,22 +1,13 @@ -import { - BUSINESS_TYPES, - ESTATE_TYPES, - MAX_FILE_SIZE_MB, - OTHER_TYPES, -} from '@shared/business/entities/EntityConstants'; -import { Button } from '@web-client/ustc-ui/Button/Button'; +import { BusinessInfo } from './BusinessInfo'; import { ContactPrimaryUpdated } from '@web-client/views/StartCase/ContactPrimaryUpdated'; -import { ContactSecondaryUpdated } from '@web-client/views/StartCase/ContactSecondaryUpdated'; import { FormGroup } from '@web-client/ustc-ui/FormGroup/FormGroup'; -import { InfoNotificationComponent } from '@web-client/views/InfoNotification'; -import { StateDrivenFileInput } from '@web-client/views/FileDocument/StateDrivenFileInput'; +import { OtherInfo } from './OtherInfo'; +import { PetitionerAndSpouseInfo } from './PetitionerAndSpouseInfo'; import { UpdatedFilePetitionButtons } from '@web-client/views/StartCaseUpdated/UpdatedFilePetitionButtons'; -import { WarningNotificationComponent } from '@web-client/views/WarningNotification'; import { connect } from '@web-client/presenter/shared.cerebral'; import { sequences, state } from '@web-client/presenter/app.cerebral'; import { useValidationFocus } from '@web-client/views/UseValidationFocus'; import React from 'react'; -import classNames from 'classnames'; /* eslint-disable max-lines */ export const UpdatedFilePetitionStep1 = connect( @@ -174,548 +165,3 @@ export const UpdatedFilePetitionStep1 = connect( ); }, ); - -function PetitionerAndSpouseInfo({ - form, - petitionGenerationLiveValidationSequence, - registerRef, - resetSecondaryAddressSequence, - updateFilingTypeSequence, - updateFormValueCountryTypeSequence, - updateFormValueSequence, - updateFormValueUpdatedSequence, - validationErrors, -}) { - const { - contactSecondary, - hasSpouseConsent, - isSpouseDeceased: isSpouseDeceasedSelected, - useSameAsPrimary, - } = form; - - return ( -
    -

    Your spouse's information

    -
    - Is your spouse deceased? - {['Yes', 'No'].map((isSpouseDeceased, idx) => ( -
    - { - updateFilingTypeSequence({ - key: e.target.name, - value: e.target.value, - }); - }} - /> - -
    - ))} - - {validationErrors.isSpouseDeceased && ( - - {validationErrors.isSpouseDeceased} - - )} -
    - {isSpouseDeceasedSelected === 'Yes' && ( - - )} - {isSpouseDeceasedSelected === 'No' && ( - - )} -
    - ); -} - -function Spouse({ - contactSecondary, - hasSpouseConsent, - petitionGenerationLiveValidationSequence, - registerRef, - resetSecondaryAddressSequence, - updateFormValueCountryTypeSequence, - updateFormValueSequence, - updateFormValueUpdatedSequence, - useSameAsPrimary, - validationErrors, -}) { - return ( - <> - - - { - updateFormValueSequence({ - key: e.target.name, - value: e.target.checked, - }); - resetSecondaryAddressSequence({ - key: e.target.name, - value: e.target.checked, - }); - }} - /> - - - {hasSpouseConsent && ( - - )} - - ); -} - -function BusinessInfo({ - businessFieldNames, - form, - petitionGenerationLiveValidationSequence, - registerRef, - updateFilingTypeSequence, - updateFormValueCountryTypeSequence, - updateFormValueUpdatedSequence, - validationErrors, -}) { - const selectedBusinessType = form.businessType; - return ( -
    - -
    - - What type of business are you filing for? - - {[ - BUSINESS_TYPES.corporation, - BUSINESS_TYPES.partnershipAsTaxMattersPartner, - BUSINESS_TYPES.partnershipOtherThanTaxMatters, - BUSINESS_TYPES.partnershipBBA, - ].map((businessType, idx) => ( -
    - { - updateFilingTypeSequence({ - key: e.target.name, - value: e.target.value, - }); - }} - /> - -
    - ))} -
    -
    - - {selectedBusinessType && ( -
    - - -
    - )} -
    - ); -} - -function CorporateDisclosureUpload({ - hasCorporateDisclosureFile, - validationErrors, -}) { - return ( - <> -

    Corporate Disclosure Statement

    - -
    - {"Download and fill out the form if you haven't already done so:"} -
    - -
    - - - - Make sure file is not encrypted or password protected. Max file size{' '} - {MAX_FILE_SIZE_MB}MB. - - - -
    - - ); -} - -function OtherInfo({ - form, - otherContactNameLabel, - petitionGenerationLiveValidationSequence, - registerRef, - showContactInformationForOtherPartyType, - updateFilingTypeSequence, - updateFormValueCountryTypeSequence, - updateFormValueUpdatedSequence, - validationErrors, -}) { - const selectedEstateType = form.estateType; - const selectedMinorIncompetentType = form.minorIncompetentType; - const selectedOtherType = form.otherType; - - return ( -
    - -
    - - What other type of taxpayer are you filing for? - - {[ - 'An estate or trust', - 'A minor or legally incompetent person', - 'Donor', - 'Transferee', - 'Deceased Spouse', - ].map((otherType, idx) => ( -
    - { - updateFilingTypeSequence({ - key: e.target.name, - value: e.target.value, - }); - }} - /> - -
    - ))} -
    -
    - {selectedOtherType === 'An estate or trust' && ( - - )} - {selectedOtherType === 'A minor or legally incompetent person' && ( - - )} - {showContactInformationForOtherPartyType && ( - - )} -
    - ); -} - -function OtherContactInformation({ - form, - otherContactNameLabel, - petitionGenerationLiveValidationSequence, - registerRef, - updateFormValueCountryTypeSequence, - updateFormValueUpdatedSequence, -}) { - return ( - - ); -} - -function SecondaryEstateOptions({ - selectedEstateType, - updateFilingTypeSequence, - validationErrors, -}) { - return ( -
    - -
    - - What type of estate or trust are you filing for? - - {[ - ESTATE_TYPES.estate, - ESTATE_TYPES.estateWithoutExecutor, - ESTATE_TYPES.trust, - ].map((estateType, idx) => ( -
    - { - updateFilingTypeSequence({ - key: e.target.name, - value: e.target.value, - }); - }} - /> - -
    - ))} -
    -
    -
    - ); -} - -function SecondaryMinorIncompetentOptions({ - selectedMinorIncompetentType, - updateFilingTypeSequence, - validationErrors, -}) { - return ( -
    - -
    - - What is your role in filing for this minor or legally incompetent - person? - - {[ - OTHER_TYPES.conservator, - OTHER_TYPES.guardian, - OTHER_TYPES.custodian, - OTHER_TYPES.nextFriendForMinor, - OTHER_TYPES.nextFriendForIncompetentPerson, - ].map((minorIncompetentType, idx) => ( -
    - { - updateFilingTypeSequence({ - key: e.target.name, - value: e.target.value, - }); - }} - /> - -
    - ))} -
    -
    -
    - ); -} From 6c5eb784a27d3b003e2661565945c43e9387e07f Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 13:14:27 -0400 Subject: [PATCH 06/64] 5512: Remove Comment; --- .../src/views/StartCaseUpdated/UpdatedFilePetitionStep3.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep3.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep3.tsx index 944d3135cde..6fe87bf6f09 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep3.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep3.tsx @@ -41,7 +41,6 @@ export const UpdatedFilePetitionStep3 = connect( updateFormValueSequence, validationErrors, }) { - // move... somewhere else const handleIrsNoticeErrors = (errors, refs, elementsToFocus, prefix) => { if (!Array.isArray(errors)) { return; From ee9bf906c94d030e984183e7a54712d0a4492a69 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 15:42:17 -0400 Subject: [PATCH 07/64] 5512: move logic to generate case description based off of original case type; updated unit tests; --- .../generatePetitionPdfInteractor.test.ts | 51 ++++++++++++++++++- .../useCases/generatePetitionPdfInteractor.ts | 17 +++++-- .../src/proxies/generatePetitionPdfProxy.ts | 6 +-- .../actions/formatPetitionAction.test.ts | 15 ++++-- .../presenter/actions/formatPetitionAction.ts | 34 +++++++------ .../StartCaseUpdated/IRSNoticeInformation.tsx | 5 +- .../UpdatedFilePetitionStep1.tsx | 1 - .../UpdatedFilePetitionStep6.tsx | 8 --- 8 files changed, 98 insertions(+), 39 deletions(-) diff --git a/shared/src/business/useCases/generatePetitionPdfInteractor.test.ts b/shared/src/business/useCases/generatePetitionPdfInteractor.test.ts index d1eb74e1304..eb0f19ebda4 100644 --- a/shared/src/business/useCases/generatePetitionPdfInteractor.test.ts +++ b/shared/src/business/useCases/generatePetitionPdfInteractor.test.ts @@ -1,4 +1,7 @@ -import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants'; +import { + CASE_TYPES_MAP, + CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE, +} from '@shared/business/entities/EntityConstants'; import { applicationContext } from '../test/createTestApplicationContext'; import { generatePetitionPdfInteractor } from '@shared/business/useCases/generatePetitionPdfInteractor'; import { petitionerUser } from '@shared/test/mockUsers'; @@ -46,6 +49,7 @@ describe('generatePetitionPdfInteractor', () => { hasIrsNotice: false, hasUploadedIrsNotice: 'TEST_hasUploadedIrsNotice', irsNotices: [], + originalCaseType: CASE_TYPES_MAP.deficiency, partyType: 'TEST_partyType', petitionFacts: 'TEST_petitionFacts', petitionReasons: 'TEST_petitionReasons', @@ -90,6 +94,7 @@ describe('generatePetitionPdfInteractor', () => { caseType: CASE_TYPES_MAP.deficiency, key: 'TEST_KEY', noticeIssuedDate: '2024-05-02T00:00:00.000-04:00', + originalCaseType: 'Deficiency', taxYear: 'TEST_TAX_YEAR', }, ]; @@ -103,6 +108,7 @@ describe('generatePetitionPdfInteractor', () => { hasIrsNotice: true, hasUploadedIrsNotice: 'TEST_hasUploadedIrsNotice', irsNotices, + originalCaseType: CASE_TYPES_MAP.deficiency, partyType: 'TEST_partyType', petitionFacts: 'TEST_petitionFacts', petitionReasons: 'TEST_petitionReasons', @@ -128,4 +134,47 @@ describe('generatePetitionPdfInteractor', () => { }); expect(results.fileId).toEqual(mockFileId); }); + + it('should generate petition with correct case description when case type is disclosure', async () => { + const irsNotices: any[] = [ + { + caseType: CASE_TYPES_MAP.disclosure, + key: 'TEST_KEY', + noticeIssuedDate: '2024-05-02T00:00:00.000-04:00', + originalCaseType: 'Disclosure1', + taxYear: 'TEST_TAX_YEAR', + }, + ]; + + const results = await generatePetitionPdfInteractor(applicationContext, { + caseCaptionExtension: 'TEST_caseCaptionExtension', + caseTitle: 'TEST_caseTitle', + caseType: CASE_TYPES_MAP.disclosure, + contactPrimary: 'TEST_contactPrimary', + contactSecondary: 'TEST_contactSecondary', + hasIrsNotice: true, + hasUploadedIrsNotice: 'TEST_hasUploadedIrsNotice', + irsNotices, + originalCaseType: 'Disclosure1', + partyType: 'TEST_partyType', + petitionFacts: 'TEST_petitionFacts', + petitionReasons: 'TEST_petitionReasons', + preferredTrialCity: 'TEST_preferredTrialCity', + procedureType: 'TEST_procedureType', + taxYear: 'TEST_taxYear', + }); + + const petitionCalls = + applicationContext.getDocumentGenerators().petition.mock.calls; + expect(petitionCalls.length).toEqual(1); + expect(petitionCalls[0][0].data).toMatchObject({ + caseDescription: CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE.Disclosure1, + irsNotices: [ + { + caseDescription: CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE.Disclosure1, + }, + ], + }); + expect(results.fileId).toEqual(mockFileId); + }); }); diff --git a/shared/src/business/useCases/generatePetitionPdfInteractor.ts b/shared/src/business/useCases/generatePetitionPdfInteractor.ts index 3fd6e679584..21e54eb3783 100644 --- a/shared/src/business/useCases/generatePetitionPdfInteractor.ts +++ b/shared/src/business/useCases/generatePetitionPdfInteractor.ts @@ -16,13 +16,13 @@ export const generatePetitionPdfInteractor = async ( applicationContext: ServerApplicationContext, { caseCaptionExtension, - caseDescription, caseTitle, contactPrimary, contactSecondary, hasIrsNotice, hasUploadedIrsNotice, irsNotices, + originalCaseType, partyType, petitionFacts, petitionReasons, @@ -36,6 +36,7 @@ export const generatePetitionPdfInteractor = async ( if (!isAuthorized(user, ROLE_PERMISSIONS.PETITION)) { throw new UnauthorizedError('Unauthorized'); } + const caseDescription = getCaseDescription(hasIrsNotice, originalCaseType); let pdfFile = await applicationContext.getDocumentGenerators().petition({ applicationContext, @@ -48,9 +49,10 @@ export const generatePetitionPdfInteractor = async ( hasUploadedIrsNotice, irsNotices: irsNotices.map(irsNotice => ({ ...irsNotice, - caseDescription: hasIrsNotice - ? CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE[irsNotice.caseType] - : CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE[irsNotice.caseType], + caseDescription: getCaseDescription( + hasIrsNotice, + irsNotice.originalCaseType, + ), noticeIssuedDateFormatted: applicationContext .getUtilities() .formatDateString(irsNotice.noticeIssuedDate || '', FORMATS.MMDDYY), @@ -74,3 +76,10 @@ export const generatePetitionPdfInteractor = async ( return { fileId }; }; + +function getCaseDescription(hasIrsNotice: boolean, caseType: string) { + if (hasIrsNotice) { + return CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE[caseType]; + } + return CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE[caseType]; +} diff --git a/shared/src/proxies/generatePetitionPdfProxy.ts b/shared/src/proxies/generatePetitionPdfProxy.ts index b5514287e6d..a85cf4390fd 100644 --- a/shared/src/proxies/generatePetitionPdfProxy.ts +++ b/shared/src/proxies/generatePetitionPdfProxy.ts @@ -4,13 +4,13 @@ export const generatePetitionPdfInteractor = ( applicationContext: IApplicationContext, { caseCaptionExtension, - caseDescription, caseTitle, contactPrimary, contactSecondary, hasIrsNotice, hasUploadedIrsNotice, irsNotices, + originalCaseType, partyType, petitionFacts, petitionReasons, @@ -20,9 +20,9 @@ export const generatePetitionPdfInteractor = ( }: { //TODO: Type remaining properties [key: string]: any; - caseDescription: string; hasIrsNotice: boolean; hasUploadedIrsNotice: boolean; + originalCaseType: string; }, ): Promise<{ fileId: string; @@ -31,13 +31,13 @@ export const generatePetitionPdfInteractor = ( applicationContext, body: { caseCaptionExtension, - caseDescription, caseTitle, contactPrimary, contactSecondary, hasIrsNotice, hasUploadedIrsNotice, irsNotices, + originalCaseType, partyType, petitionFacts, petitionReasons, diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 26491da04bf..6636ae3f3f0 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -14,6 +14,7 @@ describe('formatPetitionAction', () => { caseType: CASE_TYPES_MAP.cdp, irsNotices: [ { + caseType: CASE_TYPES_MAP.cdp, noticeIssuedDate: 'TEST_noticeIssuedDate', taxYear: 'TEST_taxYear', }, @@ -52,7 +53,6 @@ describe('formatPetitionAction', () => { expect(results.state.petitionFormatted).toEqual({ caseCaption: 'TEST_CASE_CAPTION', caseCaptionExtension: '', - caseDescription: 'Collection (Lien/Levy)', caseTitle: 'TEST_CASE_CAPTION', caseType: CASE_TYPES_MAP.cdp, contactPrimary: { @@ -60,11 +60,14 @@ describe('formatPetitionAction', () => { }, irsNotices: [ { + caseType: CASE_TYPES_MAP.cdp, noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: CASE_TYPES_MAP.cdp, taxYear: 'TEST_taxYear', }, ], noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: CASE_TYPES_MAP.cdp, taxYear: 'TEST_taxYear', }); }); @@ -87,7 +90,6 @@ describe('formatPetitionAction', () => { expect(results.state.petitionFormatted).toEqual({ caseCaption: '', caseCaptionExtension: '', - caseDescription: 'Collection (Lien/Levy)', caseTitle: '', caseType: CASE_TYPES_MAP.cdp, contactPrimary: { @@ -95,11 +97,14 @@ describe('formatPetitionAction', () => { }, irsNotices: [ { + caseType: CASE_TYPES_MAP.cdp, noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: CASE_TYPES_MAP.cdp, taxYear: 'TEST_taxYear', }, ], noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: CASE_TYPES_MAP.cdp, taxYear: 'TEST_taxYear', }); }); @@ -111,6 +116,7 @@ describe('formatPetitionAction', () => { caseType: 'Disclosure1', irsNotices: [ { + caseType: 'Disclosure1', noticeIssuedDate: 'TEST_noticeIssuedDate', taxYear: 'TEST_taxYear', }, @@ -137,11 +143,14 @@ describe('formatPetitionAction', () => { }, irsNotices: [ { + caseType: CASE_TYPES_MAP.disclosure, noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: 'Disclosure1', taxYear: 'TEST_taxYear', }, ], noticeIssuedDate: 'TEST_noticeIssuedDate', + originalCaseType: 'Disclosure1', taxYear: 'TEST_taxYear', }); }); @@ -167,7 +176,6 @@ describe('formatPetitionAction', () => { expect(results.state.petitionFormatted).toEqual({ caseCaption: 'TEST_CASE_CAPTION', caseCaptionExtension: '', - caseDescription: 'Deficiency', caseTitle: 'TEST_CASE_CAPTION', caseType: CASE_TYPES_MAP.deficiency, contactPrimary: { @@ -175,6 +183,7 @@ describe('formatPetitionAction', () => { }, irsNotices: [], noticeIssuedDate: undefined, + originalCaseType: CASE_TYPES_MAP.deficiency, taxYear: undefined, }); }); diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index 6da456f301b..e08592eefee 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -1,7 +1,4 @@ -import { - CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE, - CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE, -} from '@shared/business/entities/EntityConstants'; +import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants'; import { getCaseCaptionMeta } from '@shared/business/utilities/getCaseCaptionMeta'; import { state } from '@web-client/presenter/app.cerebral'; @@ -27,16 +24,8 @@ export const formatPetitionAction = ({ caseCaption, }); - const caseDescription = petitionInfo.hasIrsNotice - ? CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE[petitionInfo.caseType] - : CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE[petitionInfo.caseType]; - - const { CASE_TYPES_MAP } = applicationContext.getConstants(); - const disclosureCaseTypes = ['Disclosure1', 'Disclosure2']; - - if (disclosureCaseTypes.includes(petitionInfo.caseType)) { - petitionInfo.caseType = CASE_TYPES_MAP.disclosure; - } + petitionInfo.originalCaseType = petitionInfo.caseType; + petitionInfo.caseType = formatCaseType(petitionInfo.caseType); const { contactPrimary, irsNotices } = petitionInfo; @@ -50,14 +39,29 @@ export const formatPetitionAction = ({ ({ noticeIssuedDate, taxYear } = irsNotices[0]); } + const irsNoticesWithCaseTypes = irsNotices.map(irsNotice => { + return { + ...irsNotice, + caseType: formatCaseType(irsNotice.caseType), + originalCaseType: irsNotice.caseType, + }; + }); + store.set(state.petitionFormatted, { ...petitionInfo, caseCaption, caseCaptionExtension, - caseDescription, caseTitle, contactPrimary, + irsNotices: irsNoticesWithCaseTypes, noticeIssuedDate, taxYear, }); }; + +function formatCaseType(caseType: string) { + if (caseType === 'Disclosure1' || caseType === 'Disclosure2') { + return CASE_TYPES_MAP.disclosure; + } + return caseType; +} diff --git a/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx b/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx index d231f4eab24..d2bcbc1be46 100644 --- a/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx +++ b/web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx @@ -1,6 +1,5 @@ import { Button } from '@web-client/ustc-ui/Button/Button'; import { CardHeader } from './CardHeader'; -import { formatCaseType } from './UpdatedFilePetitionStep6'; import React from 'react'; import classNames from 'classnames'; @@ -38,9 +37,7 @@ export function IRSNoticeInformation({ petitionFormatted }) {
    IRS notice {index + 1}
    -
    - {formatCaseType(irsNotice.caseType)} -
    +
    {irsNotice.caseType}
    {irsNotice.taxYear && (
    {irsNotice.taxYear}
    )} diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx index e4d29ab6b84..6d6365e8dce 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep1.tsx @@ -9,7 +9,6 @@ import { sequences, state } from '@web-client/presenter/app.cerebral'; import { useValidationFocus } from '@web-client/views/UseValidationFocus'; import React from 'react'; -/* eslint-disable max-lines */ export const UpdatedFilePetitionStep1 = connect( { form: state.form, diff --git a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx index 5b2d4ef2475..2e46b929de1 100644 --- a/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx +++ b/web-client/src/views/StartCaseUpdated/UpdatedFilePetitionStep6.tsx @@ -1,4 +1,3 @@ -import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants'; import { CaseInformation } from './CaseInformation'; import { ErrorNotification } from '@web-client/views/ErrorNotification'; import { FileUploadErrorModal } from '@web-client/views/FileUploadErrorModal'; @@ -125,10 +124,3 @@ export const UpdatedFilePetitionStep6 = connect( ); }, ); - -export function formatCaseType(caseType: string) { - if (caseType === 'Disclosure1' || caseType === 'Disclosure2') { - return CASE_TYPES_MAP.disclosure; - } - return caseType; -} From 69d94f9949a59700fbfc35ee656c8c69bb718856 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 15:46:43 -0400 Subject: [PATCH 08/64] 5512: Use empty HTML tags instead of React.Fragment tags; --- web-client/src/views/StartCase/CountryUpdated.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-client/src/views/StartCase/CountryUpdated.tsx b/web-client/src/views/StartCase/CountryUpdated.tsx index 1f63eb115e5..ca50eb4656d 100644 --- a/web-client/src/views/StartCase/CountryUpdated.tsx +++ b/web-client/src/views/StartCase/CountryUpdated.tsx @@ -32,7 +32,7 @@ export const CountryUpdated = connect( validationErrors, }) { return ( - + <> - + ); }, ); From 959f587aecaed326e54e868ec4b3e5fa970e1b2e Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 15:55:30 -0400 Subject: [PATCH 09/64] 5512: rename get data actions; --- ... getCreatePetitionStep1DataAction.test.ts} | 12 +++++------ ...ts => getCreatePetitionStep1DataAction.ts} | 2 +- ... getCreatePetitionStep2DataAction.test.ts} | 6 +++--- ...ts => getCreatePetitionStep2DataAction.ts} | 2 +- ... getCreatePetitionStep3DataAction.test.ts} | 8 ++++---- ...ts => getCreatePetitionStep3DataAction.ts} | 2 +- ... getCreatePetitionStep4DataAction.test.ts} | 6 +++--- ...ts => getCreatePetitionStep4DataAction.ts} | 2 +- ... getCreatePetitionStep5DataAction.test.ts} | 6 +++--- ...ts => getCreatePetitionStep5DataAction.ts} | 2 +- ...etitionGenerationLiveValidationSequence.ts | 16 +++++++-------- ...pdatedFilePetitionCompleteStep1Sequence.ts | 4 ++-- ...pdatedFilePetitionCompleteStep2Sequence.ts | 4 ++-- ...pdatedFilePetitionCompleteStep3Sequence.ts | 4 ++-- ...pdatedFilePetitionCompleteStep4Sequence.ts | 4 ++-- ...pdatedFilePetitionCompleteStep5Sequence.ts | 20 +++++++++---------- ...alidateUpdatedFilePetitionStep2Sequence.ts | 4 ++-- ...alidateUpdatedFilePetitionStep5Sequence.ts | 4 ++-- 18 files changed, 54 insertions(+), 54 deletions(-) rename web-client/src/presenter/actions/{getStep1DataAction.test.ts => getCreatePetitionStep1DataAction.test.ts} (93%) rename web-client/src/presenter/actions/{getStep1DataAction.ts => getCreatePetitionStep1DataAction.ts} (95%) rename web-client/src/presenter/actions/{getStep2DataAction.test.ts => getCreatePetitionStep2DataAction.test.ts} (81%) rename web-client/src/presenter/actions/{getStep2DataAction.ts => getCreatePetitionStep2DataAction.ts} (84%) rename web-client/src/presenter/actions/{getStep3DataAction.test.ts => getCreatePetitionStep3DataAction.test.ts} (86%) rename web-client/src/presenter/actions/{getStep3DataAction.ts => getCreatePetitionStep3DataAction.ts} (94%) rename web-client/src/presenter/actions/{getStep4DataAction.test.ts => getCreatePetitionStep4DataAction.test.ts} (68%) rename web-client/src/presenter/actions/{getStep4DataAction.ts => getCreatePetitionStep4DataAction.ts} (84%) rename web-client/src/presenter/actions/{getStep5DataAction.test.ts => getCreatePetitionStep5DataAction.test.ts} (64%) rename web-client/src/presenter/actions/{getStep5DataAction.ts => getCreatePetitionStep5DataAction.ts} (83%) diff --git a/web-client/src/presenter/actions/getStep1DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts similarity index 93% rename from web-client/src/presenter/actions/getStep1DataAction.test.ts rename to web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts index 7b6d4728e8f..b88df878c7e 100644 --- a/web-client/src/presenter/actions/getStep1DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts @@ -1,8 +1,8 @@ import { CONTACT_TYPES } from '@shared/business/entities/EntityConstants'; -import { getStep1DataAction } from '@web-client/presenter/actions/getStep1DataAction'; +import { getCreatePetitionStep1DataAction } from '@web-client/presenter/actions/getCreatePetitionStep1DataAction'; import { runAction } from '@web-client/presenter/test.cerebral'; -describe('getStep1DataAction', () => { +describe('getCreatePetitionStep1DataAction', () => { const STATE_FORM = { businessType: 'TEST_businessType', corporateDisclosureFile: 'TEST_corporateDisclosureFile', @@ -19,7 +19,7 @@ describe('getStep1DataAction', () => { }; it('should fetch step 2 related data from state.form when useSameAsPrimary is true', async () => { - const results = await runAction(getStep1DataAction, { + const results = await runAction(getCreatePetitionStep1DataAction, { state: { form: { ...STATE_FORM, @@ -87,7 +87,7 @@ describe('getStep1DataAction', () => { }); it('should fetch step 2 related data from state.form when useSameAsPrimary is false', async () => { - const results = await runAction(getStep1DataAction, { + const results = await runAction(getCreatePetitionStep1DataAction, { state: { form: { ...STATE_FORM, @@ -145,7 +145,7 @@ describe('getStep1DataAction', () => { }); it('should set contact type for secondary contact when a secondary contact is present', async () => { - const results = await runAction(getStep1DataAction, { + const results = await runAction(getCreatePetitionStep1DataAction, { state: { form: { ...STATE_FORM, @@ -174,7 +174,7 @@ describe('getStep1DataAction', () => { }); it('should not set contact type for secondary contact when a secondary contact is not present', async () => { - const results = await runAction(getStep1DataAction, { + const results = await runAction(getCreatePetitionStep1DataAction, { state: { form: { ...STATE_FORM, diff --git a/web-client/src/presenter/actions/getStep1DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts similarity index 95% rename from web-client/src/presenter/actions/getStep1DataAction.ts rename to web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts index e11775eedd8..73bd3af93d5 100644 --- a/web-client/src/presenter/actions/getStep1DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts @@ -2,7 +2,7 @@ import { CONTACT_TYPES } from '@shared/business/entities/EntityConstants'; import { pick } from 'lodash'; import { state } from '@web-client/presenter/app.cerebral'; -export const getStep1DataAction = ({ get }: ActionProps) => { +export const getCreatePetitionStep1DataAction = ({ get }: ActionProps) => { const { businessType, contactPrimary, diff --git a/web-client/src/presenter/actions/getStep2DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts similarity index 81% rename from web-client/src/presenter/actions/getStep2DataAction.test.ts rename to web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts index 774e7101030..fa4bf6968b1 100644 --- a/web-client/src/presenter/actions/getStep2DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts @@ -1,9 +1,9 @@ -import { getStep2DataAction } from '@web-client/presenter/actions/getStep2DataAction'; +import { getCreatePetitionStep2DataAction } from '@web-client/presenter/actions/getCreatePetitionStep2DataAction'; import { runAction } from '@web-client/presenter/test.cerebral'; -describe('getStep2DataAction', () => { +describe('getCreatePetitionStep2DataAction', () => { it('should fetch Petition Information related data from state.form', async () => { - const results = await runAction(getStep2DataAction, { + const results = await runAction(getCreatePetitionStep2DataAction, { state: { form: { petitionFacts: 'TEST_petitionFacts', diff --git a/web-client/src/presenter/actions/getStep2DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts similarity index 84% rename from web-client/src/presenter/actions/getStep2DataAction.ts rename to web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts index 2cf71534917..0edaa495980 100644 --- a/web-client/src/presenter/actions/getStep2DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts @@ -1,6 +1,6 @@ import { state } from '@web-client/presenter/app.cerebral'; -export const getStep2DataAction = ({ get }: ActionProps) => { +export const getCreatePetitionStep2DataAction = ({ get }: ActionProps) => { const { petitionFacts, petitionFile, diff --git a/web-client/src/presenter/actions/getStep3DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts similarity index 86% rename from web-client/src/presenter/actions/getStep3DataAction.test.ts rename to web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts index d1b957000e5..98c953ee133 100644 --- a/web-client/src/presenter/actions/getStep3DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts @@ -1,9 +1,9 @@ -import { getStep3DataAction } from '@web-client/presenter/actions/getStep3DataAction'; +import { getCreatePetitionStep3DataAction } from '@web-client/presenter/actions/getCreatePetitionStep3DataAction'; import { runAction } from '@web-client/presenter/test.cerebral'; -describe('getStep3DataAction', () => { +describe('getCreatePetitionStep3DataAction', () => { it('should fetch step 3 related data from state.form when user has IRS notice', async () => { - const results = await runAction(getStep3DataAction, { + const results = await runAction(getCreatePetitionStep3DataAction, { state: { form: { caseType: 'ROOT_LEVEL_CASE_TYPE', @@ -45,7 +45,7 @@ describe('getStep3DataAction', () => { }); it('should fetch step 3 related data from state.form when user does not have IRS notice', async () => { - const results = await runAction(getStep3DataAction, { + const results = await runAction(getCreatePetitionStep3DataAction, { state: { form: { caseType: 'ROOT_LEVEL_CASE_TYPE', diff --git a/web-client/src/presenter/actions/getStep3DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts similarity index 94% rename from web-client/src/presenter/actions/getStep3DataAction.ts rename to web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts index 2b919f2acdb..a00387780b3 100644 --- a/web-client/src/presenter/actions/getStep3DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts @@ -4,7 +4,7 @@ import { } from '@shared/business/utilities/DateHandler'; import { state } from '@web-client/presenter/app.cerebral'; -export const getStep3DataAction = ({ +export const getCreatePetitionStep3DataAction = ({ get, }: ActionProps<{ selectedPage: number }>) => { const { caseType, hasIrsNotice, irsNoticesRedactionAcknowledgement } = get( diff --git a/web-client/src/presenter/actions/getStep4DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts similarity index 68% rename from web-client/src/presenter/actions/getStep4DataAction.test.ts rename to web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts index 6c136cd19f2..15e30c72cab 100644 --- a/web-client/src/presenter/actions/getStep4DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts @@ -1,9 +1,9 @@ -import { getStep4DataAction } from '@web-client/presenter/actions/getStep4DataAction'; +import { getCreatePetitionStep4DataAction } from '@web-client/presenter/actions/getCreatePetitionStep4DataAction'; import { runAction } from '@web-client/presenter/test.cerebral'; -describe('getStep4DataAction', () => { +describe('getCreatePetitionStep4DataAction', () => { it('should fetch step 4 related data from state.form', async () => { - const results = await runAction(getStep4DataAction, { + const results = await runAction(getCreatePetitionStep4DataAction, { state: { form: { preferredTrialCity: 'TEST_preferredTrialCity', diff --git a/web-client/src/presenter/actions/getStep4DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts similarity index 84% rename from web-client/src/presenter/actions/getStep4DataAction.ts rename to web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts index 27a5051f588..baa1f7765ef 100644 --- a/web-client/src/presenter/actions/getStep4DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts @@ -1,6 +1,6 @@ import { state } from '@web-client/presenter/app.cerebral'; -export const getStep4DataAction = ({ +export const getCreatePetitionStep4DataAction = ({ get, }: ActionProps<{ selectedPage: number }>) => { const { preferredTrialCity, procedureType } = get(state.form); diff --git a/web-client/src/presenter/actions/getStep5DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts similarity index 64% rename from web-client/src/presenter/actions/getStep5DataAction.test.ts rename to web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts index f8e0339d0d2..51d1ab89042 100644 --- a/web-client/src/presenter/actions/getStep5DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts @@ -1,9 +1,9 @@ -import { getStep5DataAction } from '@web-client/presenter/actions/getStep5DataAction'; +import { getCreatePetitionStep5DataAction } from '@web-client/presenter/actions/getCreatePetitionStep5DataAction'; import { runAction } from '@web-client/presenter/test.cerebral'; -describe('getStep5DataAction', () => { +describe('getCreatePetitionStep5DataAction', () => { it('should fetch step 5 related data from state.form', async () => { - const results = await runAction(getStep5DataAction, { + const results = await runAction(getCreatePetitionStep5DataAction, { state: { form: { stinFile: 'TEST_stinFile', diff --git a/web-client/src/presenter/actions/getStep5DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts similarity index 83% rename from web-client/src/presenter/actions/getStep5DataAction.ts rename to web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts index e2af6eebc4a..f95a1e1d089 100644 --- a/web-client/src/presenter/actions/getStep5DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts @@ -1,6 +1,6 @@ import { state } from '@web-client/presenter/app.cerebral'; -export const getStep5DataAction = ({ +export const getCreatePetitionStep5DataAction = ({ get, }: ActionProps<{ selectedPage: number }>) => { const { stinFile, stinFileSize } = get(state.form); diff --git a/web-client/src/presenter/sequences/petitionGenerationLiveValidationSequence.ts b/web-client/src/presenter/sequences/petitionGenerationLiveValidationSequence.ts index 89f0cd86115..bc0c55bc425 100644 --- a/web-client/src/presenter/sequences/petitionGenerationLiveValidationSequence.ts +++ b/web-client/src/presenter/sequences/petitionGenerationLiveValidationSequence.ts @@ -1,8 +1,8 @@ import { determineStepPathAction } from '@web-client/presenter/actions/determineStepPathAction'; -import { getStep1DataAction } from '@web-client/presenter/actions/getStep1DataAction'; -import { getStep2DataAction } from '@web-client/presenter/actions/getStep2DataAction'; -import { getStep3DataAction } from '@web-client/presenter/actions/getStep3DataAction'; -import { getStep4DataAction } from '@web-client/presenter/actions/getStep4DataAction'; +import { getCreatePetitionStep1DataAction } from '@web-client/presenter/actions/getCreatePetitionStep1DataAction'; +import { getCreatePetitionStep2DataAction } from '@web-client/presenter/actions/getCreatePetitionStep2DataAction'; +import { getCreatePetitionStep3DataAction } from '@web-client/presenter/actions/getCreatePetitionStep3DataAction'; +import { getCreatePetitionStep4DataAction } from '@web-client/presenter/actions/getCreatePetitionStep4DataAction'; import { setSingleValidationErrorAction } from '@web-client/presenter/actions/setSingleValidationErrorAction'; import { startShowValidationAction } from '@web-client/presenter/actions/startShowValidationAction'; import { validateUploadPetitionStep1Action } from '@web-client/presenter/actions/validateUploadPetitionStep1Action'; @@ -25,22 +25,22 @@ export const petitionGenerationLiveValidationSequence = [ determineStepPathAction, { step1: [ - getStep1DataAction, + getCreatePetitionStep1DataAction, validateUploadPetitionStep1Action, handleValidationErrorsRoute, ], step2: [ - getStep2DataAction, + getCreatePetitionStep2DataAction, validateUploadPetitionStep2Action, handleValidationErrorsRoute, ], step3: [ - getStep3DataAction, + getCreatePetitionStep3DataAction, validateUploadPetitionStep3Action, handleValidationErrorsRoute, ], step4: [ - getStep4DataAction, + getCreatePetitionStep4DataAction, validateUploadPetitionStep4Action, handleValidationErrorsRoute, ], diff --git a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep1Sequence.ts b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep1Sequence.ts index 991f9bcb656..85e12a7d661 100644 --- a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep1Sequence.ts +++ b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep1Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep1DataAction } from '@web-client/presenter/actions/getStep1DataAction'; +import { getCreatePetitionStep1DataAction } from '@web-client/presenter/actions/getCreatePetitionStep1DataAction'; import { incrementCurrentStepIndicatorAction } from '@web-client/presenter/actions/incrementCurrentStepIndicatorAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep1Action } from '@web-client/presenter/actions export const updatedFilePetitionCompleteStep1Sequence = [ startShowValidationAction, - getStep1DataAction, + getCreatePetitionStep1DataAction, validateUploadPetitionStep1Action, { error: [setValidationErrorsAction], diff --git a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep2Sequence.ts b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep2Sequence.ts index 2ef645650d2..4550d1a4537 100644 --- a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep2Sequence.ts +++ b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep2Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep2DataAction } from '@web-client/presenter/actions/getStep2DataAction'; +import { getCreatePetitionStep2DataAction } from '@web-client/presenter/actions/getCreatePetitionStep2DataAction'; import { incrementCurrentStepIndicatorAction } from '@web-client/presenter/actions/incrementCurrentStepIndicatorAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep2Action } from '@web-client/presenter/actions export const updatedFilePetitionCompleteStep2Sequence = [ startShowValidationAction, - getStep2DataAction, + getCreatePetitionStep2DataAction, validateUploadPetitionStep2Action, { error: [setValidationErrorsAction], diff --git a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep3Sequence.ts b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep3Sequence.ts index a3433f739c0..462d9992077 100644 --- a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep3Sequence.ts +++ b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep3Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep3DataAction } from '@web-client/presenter/actions/getStep3DataAction'; +import { getCreatePetitionStep3DataAction } from '@web-client/presenter/actions/getCreatePetitionStep3DataAction'; import { incrementCurrentStepIndicatorAction } from '@web-client/presenter/actions/incrementCurrentStepIndicatorAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep3Action } from '@web-client/presenter/actions export const updatedFilePetitionCompleteStep3Sequence = [ startShowValidationAction, - getStep3DataAction, + getCreatePetitionStep3DataAction, validateUploadPetitionStep3Action, { error: [setValidationErrorsAction], diff --git a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep4Sequence.ts b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep4Sequence.ts index 8a386733f04..a2b71e96d92 100644 --- a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep4Sequence.ts +++ b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep4Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep4DataAction } from '@web-client/presenter/actions/getStep4DataAction'; +import { getCreatePetitionStep4DataAction } from '@web-client/presenter/actions/getCreatePetitionStep4DataAction'; import { incrementCurrentStepIndicatorAction } from '@web-client/presenter/actions/incrementCurrentStepIndicatorAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep4Action } from '@web-client/presenter/actions export const updatedFilePetitionCompleteStep4Sequence = [ startShowValidationAction, - getStep4DataAction, + getCreatePetitionStep4DataAction, validateUploadPetitionStep4Action, { error: [setValidationErrorsAction], diff --git a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep5Sequence.ts b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep5Sequence.ts index 36527c96476..27f64297c62 100644 --- a/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep5Sequence.ts +++ b/web-client/src/presenter/sequences/updatedFilePetitionCompleteStep5Sequence.ts @@ -1,11 +1,11 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; import { formatPetitionAction } from '@web-client/presenter/actions/formatPetitionAction'; import { generatePetitionPreviewPdfUrlAction } from '@web-client/presenter/actions/generatePetitionPreviewPdfUrlAction'; -import { getStep1DataAction } from '@web-client/presenter/actions/getStep1DataAction'; -import { getStep2DataAction } from '@web-client/presenter/actions/getStep2DataAction'; -import { getStep3DataAction } from '@web-client/presenter/actions/getStep3DataAction'; -import { getStep4DataAction } from '@web-client/presenter/actions/getStep4DataAction'; -import { getStep5DataAction } from '@web-client/presenter/actions/getStep5DataAction'; +import { getCreatePetitionStep1DataAction } from '@web-client/presenter/actions/getCreatePetitionStep1DataAction'; +import { getCreatePetitionStep2DataAction } from '@web-client/presenter/actions/getCreatePetitionStep2DataAction'; +import { getCreatePetitionStep3DataAction } from '@web-client/presenter/actions/getCreatePetitionStep3DataAction'; +import { getCreatePetitionStep4DataAction } from '@web-client/presenter/actions/getCreatePetitionStep4DataAction'; +import { getCreatePetitionStep5DataAction } from '@web-client/presenter/actions/getCreatePetitionStep5DataAction'; import { incrementCurrentStepIndicatorAction } from '@web-client/presenter/actions/incrementCurrentStepIndicatorAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { showProgressSequenceDecorator } from '@web-client/presenter/utilities/showProgressSequenceDecorator'; @@ -15,17 +15,17 @@ import { validateUploadPetitionStep5Action } from '@web-client/presenter/actions export const updatedFilePetitionCompleteStep5Sequence = [ startShowValidationAction, - getStep5DataAction, + getCreatePetitionStep5DataAction, validateUploadPetitionStep5Action, { error: [setValidationErrorsAction], success: showProgressSequenceDecorator([ clearAlertsAction, stopShowValidationAction, - getStep1DataAction, - getStep2DataAction, - getStep3DataAction, - getStep4DataAction, + getCreatePetitionStep1DataAction, + getCreatePetitionStep2DataAction, + getCreatePetitionStep3DataAction, + getCreatePetitionStep4DataAction, formatPetitionAction, generatePetitionPreviewPdfUrlAction, incrementCurrentStepIndicatorAction, diff --git a/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep2Sequence.ts b/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep2Sequence.ts index 073bcfaa497..5bbf5d2d861 100644 --- a/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep2Sequence.ts +++ b/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep2Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep2DataAction } from '@web-client/presenter/actions/getStep2DataAction'; +import { getCreatePetitionStep2DataAction } from '@web-client/presenter/actions/getCreatePetitionStep2DataAction'; import { setValidationAlertErrorsAction } from '../actions/setValidationAlertErrorsAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep2Action } from '@web-client/presenter/actions export const validateUpdatedFilePetitionStep2Sequence = [ startShowValidationAction, - getStep2DataAction, + getCreatePetitionStep2DataAction, validateUploadPetitionStep2Action, { error: [setValidationErrorsAction, setValidationAlertErrorsAction], diff --git a/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep5Sequence.ts b/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep5Sequence.ts index 7601acaf5ba..a8f04ffef2f 100644 --- a/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep5Sequence.ts +++ b/web-client/src/presenter/sequences/validateUpdatedFilePetitionStep5Sequence.ts @@ -1,5 +1,5 @@ import { clearAlertsAction } from '../actions/clearAlertsAction'; -import { getStep5DataAction } from '@web-client/presenter/actions/getStep5DataAction'; +import { getCreatePetitionStep5DataAction } from '@web-client/presenter/actions/getCreatePetitionStep5DataAction'; import { setValidationAlertErrorsAction } from '../actions/setValidationAlertErrorsAction'; import { setValidationErrorsAction } from '../actions/setValidationErrorsAction'; import { startShowValidationAction } from '../actions/startShowValidationAction'; @@ -8,7 +8,7 @@ import { validateUploadPetitionStep5Action } from '@web-client/presenter/actions export const validateUpdatedFilePetitionStep5Sequence = [ startShowValidationAction, - getStep5DataAction, + getCreatePetitionStep5DataAction, validateUploadPetitionStep5Action, { error: [setValidationErrorsAction, setValidationAlertErrorsAction], From 0ed4ceb9b9f9ab915752597d2e23a7de19e64410 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 15:58:26 -0400 Subject: [PATCH 10/64] 5512: rename state property where we store data for create a petition step #1; --- .../actions/formatPetitionAction.test.ts | 2 +- .../presenter/actions/formatPetitionAction.ts | 2 +- .../getCreatePetitionStep1DataAction.test.ts | 16 ++++++++-------- .../actions/getCreatePetitionStep1DataAction.ts | 4 ++-- .../validateUploadPetitionStep1Action.test.ts | 4 ++-- .../actions/validateUploadPetitionStep1Action.ts | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 6636ae3f3f0..60519ab4a36 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -6,7 +6,7 @@ import { runAction } from '@web-client/presenter/test.cerebral'; describe('formatPetitionAction', () => { const PROPS = { - step1Data: { + createPetitionStep1Data: { contactPrimary: {}, }, step2Data: {}, diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index e08592eefee..59aacd8baac 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -8,7 +8,7 @@ export const formatPetitionAction = ({ store, }: ActionProps) => { const petitionInfo = { - ...props.step1Data, + ...props.createPetitionStep1Data, ...props.step2Data, ...props.step3Data, ...props.step4Data, diff --git a/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts index b88df878c7e..82663538546 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.test.ts @@ -43,8 +43,8 @@ describe('getCreatePetitionStep1DataAction', () => { }, }); - const { step1Data } = results.output; - expect(step1Data).toEqual({ + const { createPetitionStep1Data } = results.output; + expect(createPetitionStep1Data).toEqual({ businessType: 'TEST_businessType', contactPrimary: { address1: 'TEST_PRIMARY_address1', @@ -110,8 +110,8 @@ describe('getCreatePetitionStep1DataAction', () => { }, }); - const { step1Data } = results.output; - expect(step1Data).toEqual({ + const { createPetitionStep1Data } = results.output; + expect(createPetitionStep1Data).toEqual({ businessType: 'TEST_businessType', contactPrimary: { address2: 'TEST_PRIMARY_address2', @@ -167,8 +167,8 @@ describe('getCreatePetitionStep1DataAction', () => { }, }, }); - const { step1Data } = results.output; - expect(step1Data.contactSecondary.contactType).toEqual( + const { createPetitionStep1Data } = results.output; + expect(createPetitionStep1Data.contactSecondary.contactType).toEqual( CONTACT_TYPES.secondary, ); }); @@ -186,7 +186,7 @@ describe('getCreatePetitionStep1DataAction', () => { }, }, }); - const { step1Data } = results.output; - expect(step1Data.contactSecondary).toBeUndefined(); + const { createPetitionStep1Data } = results.output; + expect(createPetitionStep1Data.contactSecondary).toBeUndefined(); }); }); diff --git a/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts index 73bd3af93d5..9e9af25988d 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep1DataAction.ts @@ -28,7 +28,7 @@ export const getCreatePetitionStep1DataAction = ({ get }: ActionProps) => { } : contactSecondary; - const step1Data = { + const createPetitionStep1Data = { businessType, contactPrimary: { ...contactPrimary, @@ -64,6 +64,6 @@ export const getCreatePetitionStep1DataAction = ({ get }: ActionProps) => { }; return { - step1Data, + createPetitionStep1Data, }; }; diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep1Action.test.ts b/web-client/src/presenter/actions/validateUploadPetitionStep1Action.test.ts index 514812415fb..12f40ae75f4 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep1Action.test.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep1Action.test.ts @@ -28,7 +28,7 @@ describe('validateUploadPetitionStep1Action', () => { presenter, }, props: { - step1Data: { + createPetitionStep1Data: { countryType: COUNTRY_TYPES.DOMESTIC, filingType: FILING_TYPES[ROLES.petitioner][0], partyType: PARTY_TYPES.petitioner, @@ -46,7 +46,7 @@ describe('validateUploadPetitionStep1Action', () => { presenter, }, props: { - step1Data: {}, + createPetitionStep1Data: {}, }, }); diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep1Action.ts b/web-client/src/presenter/actions/validateUploadPetitionStep1Action.ts index 6f2d0ac0bf4..6252b48288e 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep1Action.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep1Action.ts @@ -3,11 +3,11 @@ import { UploadPetitionStep1 } from '@shared/business/entities/startCase/UploadP export const validateUploadPetitionStep1Action = ({ path, props, -}: ActionProps<{ step1Data: any }>) => { - const { step1Data } = props; +}: ActionProps<{ createPetitionStep1Data: any }>) => { + const { createPetitionStep1Data } = props; const errors = new UploadPetitionStep1( - step1Data, + createPetitionStep1Data, ).getFormattedValidationErrors(); if (!errors) { From ea4d90d0966e084620ea57dffc60b8fd7c05f0e8 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 15:59:25 -0400 Subject: [PATCH 11/64] 5512: rename state property where we store data for create a petition step #2; --- .../actions/formatPetitionAction.test.ts | 2 +- .../presenter/actions/formatPetitionAction.ts | 2 +- .../getCreatePetitionStep2DataAction.test.ts | 4 ++-- .../getCreatePetitionStep2DataAction.ts | 4 ++-- .../validateUploadPetitionStep2Action.test.ts | 8 +++---- .../validateUploadPetitionStep2Action.ts | 23 +++++++++++-------- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 60519ab4a36..fb82197f739 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -9,7 +9,7 @@ describe('formatPetitionAction', () => { createPetitionStep1Data: { contactPrimary: {}, }, - step2Data: {}, + createPetitionStep2Data: {}, step3Data: { caseType: CASE_TYPES_MAP.cdp, irsNotices: [ diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index 59aacd8baac..ee77c229f1c 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -9,7 +9,7 @@ export const formatPetitionAction = ({ }: ActionProps) => { const petitionInfo = { ...props.createPetitionStep1Data, - ...props.step2Data, + ...props.createPetitionStep2Data, ...props.step3Data, ...props.step4Data, ...props.step5Data, diff --git a/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts index fa4bf6968b1..52f51abd9ee 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.test.ts @@ -20,8 +20,8 @@ describe('getCreatePetitionStep2DataAction', () => { }, }); - const { step2Data } = results.output; - expect(step2Data).toEqual({ + const { createPetitionStep2Data } = results.output; + expect(createPetitionStep2Data).toEqual({ petitionFacts: 'TEST_petitionFacts', petitionFile: 'TEST_petitionFile', petitionFileSize: 'TEST_petitionFileSize', diff --git a/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts index 0edaa495980..df7622ce0d5 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep2DataAction.ts @@ -10,7 +10,7 @@ export const getCreatePetitionStep2DataAction = ({ get }: ActionProps) => { petitionType, } = get(state.form); - const step2Data = { + const createPetitionStep2Data = { petitionFacts, petitionFile, petitionFileSize, @@ -20,6 +20,6 @@ export const getCreatePetitionStep2DataAction = ({ get }: ActionProps) => { }; return { - step2Data, + createPetitionStep2Data, }; }; diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep2Action.test.ts b/web-client/src/presenter/actions/validateUploadPetitionStep2Action.test.ts index eb565732433..7dd34d11c9a 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep2Action.test.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep2Action.test.ts @@ -23,7 +23,7 @@ describe('validateUploadPetitionStep2Action', () => { presenter, }, props: { - step2Data: { + createPetitionStep2Data: { petitionFacts: ['Fact goes here'], petitionReasons: ['Reason goes here'], petitionType: PETITION_TYPES.autoGenerated, @@ -48,7 +48,7 @@ describe('validateUploadPetitionStep2Action', () => { presenter, }, props: { - step2Data: { + createPetitionStep2Data: { petitionFacts: [''], petitionFile: {}, petitionFileSize: 1, @@ -79,7 +79,7 @@ describe('validateUploadPetitionStep2Action', () => { presenter, }, props: { - step2Data: { + createPetitionStep2Data: { petitionFacts: [''], petitionReasons: [''], petitionType: PETITION_TYPES.autoGenerated, @@ -104,7 +104,7 @@ describe('validateUploadPetitionStep2Action', () => { presenter, }, props: { - step2Data: { + createPetitionStep2Data: { petitionFacts: ['Fact goes here', '', 'Second fact here'], petitionReasons: [ 'Reason goes here', diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep2Action.ts b/web-client/src/presenter/actions/validateUploadPetitionStep2Action.ts index 47acd95e921..8dda84c45ee 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep2Action.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep2Action.ts @@ -5,23 +5,28 @@ export const validateUploadPetitionStep2Action = ({ path, props, store, -}: ActionProps<{ step2Data: any }>) => { - const { step2Data } = props; +}: ActionProps<{ createPetitionStep2Data: any }>) => { + const { createPetitionStep2Data } = props; // move this logic to new action? - step2Data.petitionReasons = (arr => (arr.length > 0 ? arr : ['']))( - step2Data.petitionReasons.filter(r => r.length >= 1), + createPetitionStep2Data.petitionReasons = (arr => + arr.length > 0 ? arr : [''])( + createPetitionStep2Data.petitionReasons.filter(r => r.length >= 1), ); - step2Data.petitionFacts = (arr => (arr.length > 0 ? arr : ['']))( - step2Data.petitionFacts.filter(r => r.length >= 1), + createPetitionStep2Data.petitionFacts = (arr => + arr.length > 0 ? arr : [''])( + createPetitionStep2Data.petitionFacts.filter(r => r.length >= 1), ); - store.set(state.form.petitionReasons, step2Data.petitionReasons); - store.set(state.form.petitionFacts, step2Data.petitionFacts); + store.set( + state.form.petitionReasons, + createPetitionStep2Data.petitionReasons, + ); + store.set(state.form.petitionFacts, createPetitionStep2Data.petitionFacts); let errors = new UploadPetitionStep2( - step2Data, + createPetitionStep2Data, ).getFormattedValidationErrors(); if (errors) { return path.error({ From ee5a028e7af6d576319f901d4c44f728c60d1181 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 16:00:00 -0400 Subject: [PATCH 12/64] 5512: rename state property where we store data for create a petition step #3; --- .../src/presenter/actions/formatPetitionAction.test.ts | 6 +++--- web-client/src/presenter/actions/formatPetitionAction.ts | 2 +- .../actions/getCreatePetitionStep3DataAction.test.ts | 8 ++++---- .../presenter/actions/getCreatePetitionStep3DataAction.ts | 4 ++-- .../actions/validateUploadPetitionStep3Action.test.ts | 4 ++-- .../actions/validateUploadPetitionStep3Action.ts | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index fb82197f739..1cd6ac40840 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -10,7 +10,7 @@ describe('formatPetitionAction', () => { contactPrimary: {}, }, createPetitionStep2Data: {}, - step3Data: { + createPetitionStep3Data: { caseType: CASE_TYPES_MAP.cdp, irsNotices: [ { @@ -112,7 +112,7 @@ describe('formatPetitionAction', () => { it('should update caseType if caseType is a disclosure', async () => { const propsWithDisclosure = { ...PROPS, - step3Data: { + createPetitionStep3Data: { caseType: 'Disclosure1', irsNotices: [ { @@ -158,7 +158,7 @@ describe('formatPetitionAction', () => { it('should set noticeIssuedDate and taxYear as undefined if there is no irsNotice', async () => { const propsWithoutIrsNotice = { ...PROPS, - step3Data: { + createPetitionStep3Data: { caseType: CASE_TYPES_MAP.deficiency, irsNotices: [], }, diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index ee77c229f1c..2fcbdbca0db 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -10,7 +10,7 @@ export const formatPetitionAction = ({ const petitionInfo = { ...props.createPetitionStep1Data, ...props.createPetitionStep2Data, - ...props.step3Data, + ...props.createPetitionStep3Data, ...props.step4Data, ...props.step5Data, }; diff --git a/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts index 98c953ee133..165dc6abd4b 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.test.ts @@ -24,8 +24,8 @@ describe('getCreatePetitionStep3DataAction', () => { }, }); - const { step3Data } = results.output; - expect(step3Data).toEqual({ + const { createPetitionStep3Data } = results.output; + expect(createPetitionStep3Data).toEqual({ caseType: 'IRS_NOTICE_CASE_TYPE', hasIrsNotice: 'TEST_hasIrsNotice', hasUploadedIrsNotice: true, @@ -58,8 +58,8 @@ describe('getCreatePetitionStep3DataAction', () => { }, }); - const { step3Data } = results.output; - expect(step3Data).toEqual({ + const { createPetitionStep3Data } = results.output; + expect(createPetitionStep3Data).toEqual({ caseType: 'ROOT_LEVEL_CASE_TYPE', hasIrsNotice: false, hasUploadedIrsNotice: false, diff --git a/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts index a00387780b3..0a20664d222 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep3DataAction.ts @@ -21,7 +21,7 @@ export const getCreatePetitionStep3DataAction = ({ }; }); - const step3Data = { + const createPetitionStep3Data = { caseType: hasIrsNotice ? irsNotices[0].caseType : caseType, hasIrsNotice, hasUploadedIrsNotice, @@ -30,6 +30,6 @@ export const getCreatePetitionStep3DataAction = ({ }; return { - step3Data, + createPetitionStep3Data, }; }; diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep3Action.test.ts b/web-client/src/presenter/actions/validateUploadPetitionStep3Action.test.ts index 1d155b07d70..641856331ff 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep3Action.test.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep3Action.test.ts @@ -23,7 +23,7 @@ describe('validateUploadPetitionStep3Action', () => { presenter, }, props: { - step3Data: { + createPetitionStep3Data: { caseType: CASE_TYPES_MAP.cdp, hasIrsNotice: false, hasUploadedIrsNotice: false, @@ -41,7 +41,7 @@ describe('validateUploadPetitionStep3Action', () => { presenter, }, props: { - step3Data: {}, + createPetitionStep3Data: {}, }, }); diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep3Action.ts b/web-client/src/presenter/actions/validateUploadPetitionStep3Action.ts index 718852bf10b..d9d477856b4 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep3Action.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep3Action.ts @@ -3,11 +3,11 @@ import { UploadPetitionStep3 } from '@shared/business/entities/startCase/UploadP export const validateUploadPetitionStep3Action = ({ path, props, -}: ActionProps<{ step3Data: any }>) => { - const { step3Data } = props; +}: ActionProps<{ createPetitionStep3Data: any }>) => { + const { createPetitionStep3Data } = props; const errors = new UploadPetitionStep3( - step3Data, + createPetitionStep3Data, ).getFormattedValidationErrors(); return errors From 0badc94a49b9dd70fd294365658314e0f7046de2 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 16:00:56 -0400 Subject: [PATCH 13/64] 5512: rename state property where we store data for create a petition step #4; --- .../src/presenter/actions/formatPetitionAction.test.ts | 2 +- web-client/src/presenter/actions/formatPetitionAction.ts | 2 +- .../actions/getCreatePetitionStep4DataAction.test.ts | 4 ++-- .../presenter/actions/getCreatePetitionStep4DataAction.ts | 4 ++-- .../actions/validateUploadPetitionStep4Action.test.ts | 4 ++-- .../presenter/actions/validateUploadPetitionStep4Action.ts | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 1cd6ac40840..98307b10024 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -20,7 +20,7 @@ describe('formatPetitionAction', () => { }, ], }, - step4Data: {}, + createPetitionStep4Data: {}, step5Data: {}, }; diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index 2fcbdbca0db..3b5d8021e3f 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -11,7 +11,7 @@ export const formatPetitionAction = ({ ...props.createPetitionStep1Data, ...props.createPetitionStep2Data, ...props.createPetitionStep3Data, - ...props.step4Data, + ...props.createPetitionStep4Data, ...props.step5Data, }; diff --git a/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts index 15e30c72cab..17c358e0cff 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.test.ts @@ -13,8 +13,8 @@ describe('getCreatePetitionStep4DataAction', () => { }, }); - const { step4Data } = results.output; - expect(step4Data).toEqual({ + const { createPetitionStep4Data } = results.output; + expect(createPetitionStep4Data).toEqual({ preferredTrialCity: 'TEST_preferredTrialCity', procedureType: 'TEST_procedureType', }); diff --git a/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts index baa1f7765ef..5b9fea35e98 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep4DataAction.ts @@ -5,12 +5,12 @@ export const getCreatePetitionStep4DataAction = ({ }: ActionProps<{ selectedPage: number }>) => { const { preferredTrialCity, procedureType } = get(state.form); - const step4Data = { + const createPetitionStep4Data = { preferredTrialCity, procedureType, }; return { - step4Data, + createPetitionStep4Data, }; }; diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep4Action.test.ts b/web-client/src/presenter/actions/validateUploadPetitionStep4Action.test.ts index 8d07a07ad5a..52fa70d7bca 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep4Action.test.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep4Action.test.ts @@ -26,7 +26,7 @@ describe('validateUploadPetitionStep4Action', () => { presenter, }, props: { - step4Data: { + createPetitionStep4Data: { preferredTrialCity: TRIAL_CITY_STRINGS[0], procedureType: PROCEDURE_TYPES_MAP.regular, }, @@ -43,7 +43,7 @@ describe('validateUploadPetitionStep4Action', () => { presenter, }, props: { - step4Data: {}, + createPetitionStep4Data: {}, }, }); diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep4Action.ts b/web-client/src/presenter/actions/validateUploadPetitionStep4Action.ts index d2d16ab4896..0ed9003a302 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep4Action.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep4Action.ts @@ -3,11 +3,11 @@ import { UploadPetitionStep4 } from '@shared/business/entities/startCase/UploadP export const validateUploadPetitionStep4Action = ({ path, props, -}: ActionProps<{ step4Data: any }>) => { - const { step4Data } = props; +}: ActionProps<{ createPetitionStep4Data: any }>) => { + const { createPetitionStep4Data } = props; const errors = new UploadPetitionStep4( - step4Data, + createPetitionStep4Data, ).getFormattedValidationErrors(); return errors From 1177bfdec46eb0687323c48f204979cbd092a9eb Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 16:02:11 -0400 Subject: [PATCH 14/64] 5512: rename state property where we store data for create a petition step #5; --- .../src/presenter/actions/formatPetitionAction.test.ts | 2 +- web-client/src/presenter/actions/formatPetitionAction.ts | 2 +- .../actions/getCreatePetitionStep5DataAction.test.ts | 4 ++-- .../presenter/actions/getCreatePetitionStep5DataAction.ts | 4 ++-- .../actions/validateUploadPetitionStep5Action.test.ts | 4 ++-- .../presenter/actions/validateUploadPetitionStep5Action.ts | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web-client/src/presenter/actions/formatPetitionAction.test.ts b/web-client/src/presenter/actions/formatPetitionAction.test.ts index 98307b10024..0d0678b6a81 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.test.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.test.ts @@ -21,7 +21,7 @@ describe('formatPetitionAction', () => { ], }, createPetitionStep4Data: {}, - step5Data: {}, + createPetitionStep5Data: {}, }; const TEST_CASE_CAPTION = 'TEST_CASE_CAPTION'; diff --git a/web-client/src/presenter/actions/formatPetitionAction.ts b/web-client/src/presenter/actions/formatPetitionAction.ts index 3b5d8021e3f..352493a448e 100644 --- a/web-client/src/presenter/actions/formatPetitionAction.ts +++ b/web-client/src/presenter/actions/formatPetitionAction.ts @@ -12,7 +12,7 @@ export const formatPetitionAction = ({ ...props.createPetitionStep2Data, ...props.createPetitionStep3Data, ...props.createPetitionStep4Data, - ...props.step5Data, + ...props.createPetitionStep5Data, }; const caseCaption = diff --git a/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts index 51d1ab89042..e1f03f2b806 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.test.ts @@ -12,8 +12,8 @@ describe('getCreatePetitionStep5DataAction', () => { }, }); - const { step5Data } = results.output; - expect(step5Data).toEqual({ + const { createPetitionStep5Data } = results.output; + expect(createPetitionStep5Data).toEqual({ stinFile: 'TEST_stinFile', stinFileSize: 'TEST_stinFileSize', }); diff --git a/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts index f95a1e1d089..4b207a1fea7 100644 --- a/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts +++ b/web-client/src/presenter/actions/getCreatePetitionStep5DataAction.ts @@ -5,12 +5,12 @@ export const getCreatePetitionStep5DataAction = ({ }: ActionProps<{ selectedPage: number }>) => { const { stinFile, stinFileSize } = get(state.form); - const step5Data = { + const createPetitionStep5Data = { stinFile, stinFileSize, }; return { - step5Data, + createPetitionStep5Data, }; }; diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep5Action.test.ts b/web-client/src/presenter/actions/validateUploadPetitionStep5Action.test.ts index 1fc8dbb5307..e4371f4ba0f 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep5Action.test.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep5Action.test.ts @@ -22,7 +22,7 @@ describe('validateUploadPetitionStep5Action', () => { presenter, }, props: { - step5Data: { + createPetitionStep5Data: { stinFile: {}, stinFileSize: 1, }, @@ -39,7 +39,7 @@ describe('validateUploadPetitionStep5Action', () => { presenter, }, props: { - step5Data: {}, + createPetitionStep5Data: {}, }, }); diff --git a/web-client/src/presenter/actions/validateUploadPetitionStep5Action.ts b/web-client/src/presenter/actions/validateUploadPetitionStep5Action.ts index 31848696b59..92d6a45c799 100644 --- a/web-client/src/presenter/actions/validateUploadPetitionStep5Action.ts +++ b/web-client/src/presenter/actions/validateUploadPetitionStep5Action.ts @@ -3,11 +3,11 @@ import { UploadPetitionStep5 } from '@shared/business/entities/startCase/UploadP export const validateUploadPetitionStep5Action = ({ path, props, -}: ActionProps<{ step5Data: any }>) => { - const { step5Data } = props; +}: ActionProps<{ createPetitionStep5Data: any }>) => { + const { createPetitionStep5Data } = props; const errors = new UploadPetitionStep5( - step5Data, + createPetitionStep5Data, ).getFormattedValidationErrors(); return errors From cbc134402e873ead5d177df3d386b5a70a3f0a0e Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 16:10:47 -0400 Subject: [PATCH 15/64] 5512: Refactor out a nested if condition when assigning phone number for secondary contact; --- shared/src/business/entities/cases/ElectronicPetition.ts | 6 ++---- shared/src/business/entities/cases/PaperPetition.ts | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/shared/src/business/entities/cases/ElectronicPetition.ts b/shared/src/business/entities/cases/ElectronicPetition.ts index 4af0929e0df..2cebdc3b80e 100644 --- a/shared/src/business/entities/cases/ElectronicPetition.ts +++ b/shared/src/business/entities/cases/ElectronicPetition.ts @@ -78,11 +78,9 @@ export class ElectronicPetition extends JoiValidationEntity { }); this.petitioners = [contacts.primary]; - if (contacts.secondary) { - if (!contacts.secondary.phone) { - contacts.secondary.phone = NOT_AVAILABLE_OPTION; - } + contacts.secondary.phone = + contacts.secondary.phone || NOT_AVAILABLE_OPTION; this.petitioners.push(contacts.secondary); } } diff --git a/shared/src/business/entities/cases/PaperPetition.ts b/shared/src/business/entities/cases/PaperPetition.ts index 23099d49b38..17e3ec0ccc1 100644 --- a/shared/src/business/entities/cases/PaperPetition.ts +++ b/shared/src/business/entities/cases/PaperPetition.ts @@ -146,9 +146,8 @@ export class PaperPetition extends JoiValidationEntity { }); this.petitioners = [contacts.primary]; if (contacts.secondary) { - if (!contacts.secondary.phone) { - contacts.secondary.phone = NOT_AVAILABLE_OPTION; - } + contacts.secondary.phone = + contacts.secondary.phone || NOT_AVAILABLE_OPTION; this.petitioners.push(contacts.secondary); } } From 75905dd3216975304af61f753632b872c2709ee4 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Thu, 25 Jul 2024 16:19:06 -0400 Subject: [PATCH 16/64] 5512: add types to updatePetitionFormValueSequence; --- web-client/src/presenter/presenter.ts | 3 +-- .../presenter/sequences/updatePetitionFormValueSequence.ts | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web-client/src/presenter/presenter.ts b/web-client/src/presenter/presenter.ts index 077e688ac9e..df957465746 100644 --- a/web-client/src/presenter/presenter.ts +++ b/web-client/src/presenter/presenter.ts @@ -1482,8 +1482,7 @@ export const presenterSequences = { updatePaperServiceProgressSequence: updatePaperServiceProgressSequence as unknown as Function, updatePartyViewTabSequence: updatePartyViewTabSequence as unknown as Function, - updatePetitionFormValueSequence: - updatePetitionFormValueSequence as unknown as Function, + updatePetitionFormValueSequence, updatePetitionPaymentFormValueSequence: updatePetitionPaymentFormValueSequence as unknown as Function, updateQcCompleteForTrialSequence: diff --git a/web-client/src/presenter/sequences/updatePetitionFormValueSequence.ts b/web-client/src/presenter/sequences/updatePetitionFormValueSequence.ts index e7b46f2fc1b..b04c8b3ef15 100644 --- a/web-client/src/presenter/sequences/updatePetitionFormValueSequence.ts +++ b/web-client/src/presenter/sequences/updatePetitionFormValueSequence.ts @@ -1,3 +1,5 @@ import { setPetitionFormValueAction } from '@web-client/presenter/actions/setPetitionFormValueAction'; -//TODO: type here instead of presenter.ts -export const updatePetitionFormValueSequence = [setPetitionFormValueAction]; + +export const updatePetitionFormValueSequence = [ + setPetitionFormValueAction, +] as unknown as (props: { index: number; key: string; value: any }) => void; From 6bc8e9a51d0c1b711c21736b39e007b37d5ae516 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Fri, 26 Jul 2024 10:23:54 -0400 Subject: [PATCH 17/64] 5512: separate place of legal residence ids with hyphen instead of periods; --- .../petitioner-creates-electronic-case-updated.ts | 4 ++-- .../file-a-petition-step-1-myself.cy.ts | 2 +- ...le-a-petition-step-6-petitioner-info-business.cy.ts | 8 ++++---- .../file-a-petition-step-6-petitioner-info-other.cy.ts | 10 +++++----- .../fileAPetitionUpdated/petition-helper.ts | 8 ++++---- .../views/StartCase/PlaceOfLegalResidenceDropdown.tsx | 8 ++++---- .../views/StartCase/PlaceOfLegalResidenceSelect.tsx | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cypress/helpers/fileAPetition/petitioner-creates-electronic-case-updated.ts b/cypress/helpers/fileAPetition/petitioner-creates-electronic-case-updated.ts index 903e18e7e55..5530ccbf537 100644 --- a/cypress/helpers/fileAPetition/petitioner-creates-electronic-case-updated.ts +++ b/cypress/helpers/fileAPetition/petitioner-creates-electronic-case-updated.ts @@ -12,7 +12,7 @@ export function petitionerCreatesElectronicCaseUpdated( cy.get('[data-testid="contactPrimary.city"]').type('Orlando'); cy.get('[data-testid="contactPrimary.state"]').select('AL'); cy.get('[data-testid="contactPrimary.postalCode"]').type('12345'); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select('AL'); + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select('AL'); cy.get('[data-testid="contact-primary-phone"]').type('1111111111'); cy.get('[data-testid="step-1-next-button"]').click(); @@ -105,7 +105,7 @@ export function petitionerAttemptsToUploadCorruptPdfUpdated() { cy.get('[data-testid="contactPrimary.city"]').type('Orlando'); cy.get('[data-testid="contactPrimary.state"]').select('AL'); cy.get('[data-testid="contactPrimary.postalCode"]').type('12345'); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select('AL'); + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select('AL'); cy.get('[data-testid="contact-primary-phone"]').type('1111111111'); cy.get('[data-testid="step-1-next-button"]').click(); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts index ec749ca4048..eef6ec182b7 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-1-myself.cy.ts @@ -39,7 +39,7 @@ describe('File a petition', () => { }); it('should display an input for "place of legal residence"', () => { - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').should( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').should( 'exist', ); }); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-business.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-business.cy.ts index e333cfa826c..1b67b32c9cf 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-business.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-business.cy.ts @@ -24,7 +24,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillInCareOf: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); @@ -64,7 +64,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillSecondaryName: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); @@ -118,7 +118,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillSecondaryName: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); @@ -172,7 +172,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillSecondaryName: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-other.cy.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-other.cy.ts index 1f9fb54521a..ac4b0bb9869 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-other.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/file-a-petition-step-6-petitioner-info-other.cy.ts @@ -28,7 +28,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillSecondaryName: true, fillTitle: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( 'AK', ); cy.get('[data-testid="contact-primary-phone"]').type('3232323232'); @@ -70,7 +70,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillInCareOf: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( 'AK', ); cy.get('[data-testid="contact-primary-phone"]').type('3232323232'); @@ -112,7 +112,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillBusinessandOtherContact({ fillSecondaryName: true, }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( 'AK', ); cy.get('[data-testid="contact-primary-phone"]').type('3232323232'); @@ -174,7 +174,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { fillSecondaryName: true, }); cy.get( - '[data-testid="contactPrimary.placeOfLegalResidence"]', + '[data-testid="contactPrimary-placeOfLegalResidence"]', ).select(contactInfo.placeOfLegalResidence); cy.get('[data-testid="contact-primary-phone"]').type( contactInfo.phone, @@ -269,7 +269,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => { cy.get('[data-testid="filing-type-3"]').click(); cy.get('[data-testid="other-type-radio-option-4"]').click(); fillBusinessandOtherContact({ fillSecondaryName: true }); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); diff --git a/cypress/local-only/tests/integration/fileAPetitionUpdated/petition-helper.ts b/cypress/local-only/tests/integration/fileAPetitionUpdated/petition-helper.ts index 769a03f5f07..b7b4dae79e2 100644 --- a/cypress/local-only/tests/integration/fileAPetitionUpdated/petition-helper.ts +++ b/cypress/local-only/tests/integration/fileAPetitionUpdated/petition-helper.ts @@ -83,7 +83,7 @@ export function fillPetitionerAndSpouseInformation(addPhone: boolean = false) { cy.get('[data-testid="contactPrimary.city"]').type('Orlando'); cy.get('[data-testid="contactPrimary.state"]').select('AL'); cy.get('[data-testid="contactPrimary.postalCode"]').type('33233'); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select('AL'); + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select('AL'); cy.get('[data-testid="contact-primary-phone"]').type('3232323232'); cy.get('[data-testid="is-spouse-deceased-0"]').click(); cy.get('[data-testid="contact-secondary-name"]').type('John Spouse'); @@ -91,7 +91,7 @@ export function fillPetitionerAndSpouseInformation(addPhone: boolean = false) { if (addPhone) { cy.get('[data-testid="contact-secondary-phone"]').type('1232323232'); } - cy.get('[data-testid="contactSecondary.placeOfLegalResidence"]').select('AK'); + cy.get('[data-testid="contactSecondary-placeOfLegalResidence"]').select('AK'); cy.get('[data-testid="step-1-next-button"]').click(); } @@ -255,7 +255,7 @@ export function fillPrimaryContact() { cy.get('[data-testid="contactPrimary.postalCode"]').type( contactInfo.postalCode, ); - cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactPrimary-placeOfLegalResidence"]').select( contactInfo.placeOfLegalResidence, ); cy.get('[data-testid="contact-primary-phone"]').type(contactInfo.phone); @@ -314,7 +314,7 @@ export function fillSecondaryContact(useSameAddress = true) { secondaryContactInfo.postalCode, ); } - cy.get('[data-testid="contactSecondary.placeOfLegalResidence"]').select( + cy.get('[data-testid="contactSecondary-placeOfLegalResidence"]').select( secondaryContactInfo.placeOfLegalResidence, ); diff --git a/web-client/src/views/StartCase/PlaceOfLegalResidenceDropdown.tsx b/web-client/src/views/StartCase/PlaceOfLegalResidenceDropdown.tsx index 8b3cd6dfd9a..5508a8edf4e 100644 --- a/web-client/src/views/StartCase/PlaceOfLegalResidenceDropdown.tsx +++ b/web-client/src/views/StartCase/PlaceOfLegalResidenceDropdown.tsx @@ -47,7 +47,7 @@ export const PlaceOfLegalResidenceDropdown = connect<