Skip to content

Commit

Permalink
Merge pull request #1024 from CityOfBoston/DIG-4915
Browse files Browse the repository at this point in the history
DIG-4915: Data fixes for Marriage Intention form
  • Loading branch information
phillipbentonkelly authored Sep 5, 2024
2 parents eaf0d99 + e95185f commit 76f68f9
Show file tree
Hide file tree
Showing 7 changed files with 474 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,34 @@ export const handleUseSurnameChange$ = (data: {
val: string;
partnerFlag: string;
certObj: MarriageIntentionCertificateRequest;
requestInformation?: any;
}) => {
const { val, partnerFlag, certObj } = data;
const { val, partnerFlag, certObj, requestInformation } = data;
const {
[`partner${partnerFlag}_firstName`]: partner_FirstName,
[`partner${partnerFlag}_lastName`]: partner_LastName,
[`partner${partnerFlag}_middleName`]: partner_MiddleName,
} = requestInformation;
certObj.answerQuestion(
{
[`partner${partnerFlag}_useSurname`]: val,
},
''
);

let surNameDefault = '';

if (val === '0') {
const middleName =
partner_MiddleName.length < 1 ? '' : ` ${partner_MiddleName}`;

if (partner_FirstName.length > 0 && partner_LastName.length > 0) {
surNameDefault = `${partner_FirstName}${middleName} ${partner_LastName}`;
}

certObj.answerQuestion(
{
[`partner${partnerFlag}_surName`]: '',
[`partner${partnerFlag}_surName`]: surNameDefault,
},
''
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ export default class PartnerForm extends Component<Props> {
val: e.target.value,
partnerFlag: 'A',
certObj: this.props.marriageIntentionCertificateRequest,
requestInformation:
marriageIntentionCertificateRequest.requestInformation,
}),
formErrors: this.props.formErrors,
errorElemSrc: this.props.errorElemSrc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ export default class PartnerForm extends Component<Props> {
val: e.target.value,
partnerFlag: 'B',
certObj: this.props.marriageIntentionCertificateRequest,
requestInformation:
marriageIntentionCertificateRequest.requestInformation,
}),
formErrors: this.props.formErrors,
errorElemSrc: this.props.errorElemSrc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
PARTNERSHIP_TYPE2,
} from './inputData';

import { COUNTRIES, US_STATES } from '../../../utils/data';
import { COUNTRIES, US_STATES } from '../../../server/services/DBInputData';

import { ToolTip } from '@cityofboston/react-fleet';

Expand Down Expand Up @@ -1043,8 +1043,8 @@ export const parents = (data: {
parentsMarriedAtBirth,
handleChange,
handleAdditionalParentChange,
handleParentNameChange,
handleAddParentNameChange,
// handleParentNameChange,
// handleAddParentNameChange,
formErrors,
errorElemSrc,
refs,
Expand Down Expand Up @@ -1139,7 +1139,8 @@ export const parents = (data: {
label="Parent 1 - First Middle Last Name"
name={`partner${partnerFlag}_parentA_Name`}
value={parentA_Name}
onChange={handleParentNameChange}
// onChange={handleParentNameChange}
onChange={handleChange}
disableLabelNoWrap={true}
maxLength={38}
softRequired={true}
Expand All @@ -1150,7 +1151,8 @@ export const parents = (data: {
label="Parent 1 - Family Name/Last Name At the time of their birth or adoption"
name={`partner${partnerFlag}_parentA_Surname`}
value={parentA_Surname}
onChange={handleParentNameChange}
// onChange={handleParentNameChange}
onChange={handleChange}
disableLabelNoWrap={true}
maxLength={38}
optionalDescription={
Expand Down Expand Up @@ -1180,7 +1182,8 @@ export const parents = (data: {
parentB_Surname,
errorVal_parentB_Name,
errorVal_parentB_Surname,
handleChange: handleAddParentNameChange,
// handleChange: handleAddParentNameChange,
handleChange,
})}

{parentsMarried({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { COUNTRIES, US_STATES } from '../../../utils/data';
import { COUNTRIES, US_STATES } from '../../../server/services/DBInputData';
import { MARRIAGE_COUNT, PARTNERSHIP_TYPE } from '../forms/inputData';

/**
Expand Down
Loading

0 comments on commit 76f68f9

Please sign in to comment.