+ {$ReviewControlHeader({
+ title: `Person ${this.props.partnerLabel}`,
+ btnStr: `Edit This Page`,
+ routeStep: `${stepStr}`,
+ backTrackingDisclaimer: this.props.backTrackingDisclaimer,
+ toggleDisclaimerModal: this.props.toggleDisclaimerModal,
+ })}
+
+
+
+
Personal Information
+
+ {$ReviewFieldValuePair({
+ field: `Legal Name`,
+ value: `${firstName} ${lastNameStr}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Full Name to be Used After Marriage`,
+ value: `${surName}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Occupation`,
+ value: `${occupation}`,
+ })}
-
-
-
- {lastName}
-
+
+
Date and Place of Birth
-
-
- {this.props.surName}
-
-
+ {$ReviewFieldValuePair({
+ field: `Date of Birth`,
+ value: `${dob}`,
+ })}
-
-
-
- {this.props.dob}
-
-
-
-
- {this.props.age}
-
-
- {/*
-
- {genderLabel}
-
*/}
-
-
-
- {this.props.occupation}
-
-
-
-
- {this.props.address}
-
+ {$ReviewFieldValuePair({
+ field: `BirthPlace`,
+ value: `${birthCity}, ${birthCountry}`,
+ })}
-
-
Birthplace
-
-
-
- {this.props.birthCity}
-
-
- {this.props.birthState.length > 0 &&
- this.props.birthState !== '--' && (
-
-
- {this.props.birthState}
-
- )}
-
-
-
- {this.props.birthCountry}
-
+
+
Residence
+
+ {$ReviewFieldValuePair({
+ field: `Address`,
+ value: `${address}`,
+ })}
-
-
Parents
-
-
-
- {this.props.parentA}
-
-
-
-
- {this.props.parentB}
-
-
-
-
- {` ${this.props.parentsMarriedAtBirth}`}
-
+
+
Marriage
+
+ {$ReviewFieldValuePair({
+ field: `If Applicable, Blood Relation To Current Partner`,
+ value: `${bloodRelation}`,
+ })}
+
+ {bloodRelation === 'Yes' &&
+ $ReviewFieldValuePair({
+ field: `Blood Relation Description`,
+ value: `${bloodRelationDesc}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Marriage Number`,
+ value: `${marriageNumb}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `If Applicable, Status of Last Marriage`,
+ value: `${lastMarriageStatus}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `If Applicable, Status of Civil Union or Domestic Partnership`,
+ value: `${partnerShipDissolve}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `If Applicable, State of Civil Union or Domestic Partnership`,
+ value: `${partnerShipType}`,
+ })}
-
-
Marriage
-
-
-
- {this.props.marriageNumb}
-
-
- {this.props.marriageNumb !== '1st' && (
-
-
- {lastMarriageStatus}
-
- )}
-
- {this.props.marriageNumb !== '1st' && (
-
-
- {this.props.partnerShipDissolve}
-
- )}
-
-
-
- {partnerShipType}
-
-
- {this.props.partnerShipType !== 'N/A' && (
-
-
- {this.props.partnerShipDissolve}
-
- )}
-
- {this.props.partnerShipType !== 'N/A' && (
-
-
- {this.props.partnershipState}
-
- )}
-
-
-
- {this.props.bloodRelation}
-
-
- {this.props.bloodRelation === 'Yes' && (
-
-
- {this.props.bloodRelationDesc}
-
- )}
+
+
Parents
+
+ {$ReviewFieldValuePair({
+ field: `Parent 1`,
+ value: `${parentA}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Parent 2`,
+ value: `${parentB}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Status of Marriage at Time of Birth`,
+ value: `${parentsMarriedAtBirth}`,
+ })}
diff --git a/services-js/registry-certs/client/marriageintention/forms/reviewForms.tsx b/services-js/registry-certs/client/marriageintention/forms/reviewForms.tsx
index 6af929257..279f869ab 100644
--- a/services-js/registry-certs/client/marriageintention/forms/reviewForms.tsx
+++ b/services-js/registry-certs/client/marriageintention/forms/reviewForms.tsx
@@ -8,29 +8,29 @@ import { observer } from 'mobx-react';
import MarriageIntentionCertificateRequest from '../../store/MarriageIntentionCertificateRequest';
import QuestionComponent from '../../common/question-components/QuestionComponent';
-import { COUNTRIES, US_STATES } from './inputData';
-
+import { MI_REVIEW_STYLING } from './styling';
import {
- SECTION_HEADING_STYLING,
- SECTION_WRAPPER_STYLING,
MARRIAGE_INTENTION_FORM_STYLING,
MARRIAGE_INTENTION_INTRO_STYLING,
- NAME_FIELDS_BASIC_CONTAINER_STYLING,
} from '../../common/question-components/styling';
import {
- MAIN_HEADING_STYLING,
- MI_REVIEW_STYLING,
- PAIRED_COLUMNS_STYLING,
- COLUMNS_STYLING,
-} from './styling';
+ formatDate,
+ getStateFullName,
+ getCountryFullName,
+ yesNoAnswer,
+} from '../helpers/formUtils';
import PartnerView from './partnerView';
+import ContactUX from './reviewUI/contact';
+import HeaderUX from './reviewUI/header';
interface Props {
handleProceed: (ev: MouseEvent) => void;
- handleStepBack: (ev: MouseEvent) => void;
+ handleStepBack: (ev: MouseEvent | TouchEvent) => void;
marriageIntentionCertificateRequest: MarriageIntentionCertificateRequest;
+ toggleDisclaimerModal: (val: boolean) => void;
+ backTrackingDisclaimer: boolean;
}
@observer
@@ -44,75 +44,45 @@ export default class ReviewForms extends Component
{
};
}
- private adjustForTimezone(date: Date): Date {
- var timeOffsetInMS: number = date.getTimezoneOffset() * 60000;
- date.setTime(date.getTime() + timeOffsetInMS);
- return date;
- }
+ private handleStepBack = (ev: MouseEvent | TouchEvent) => {
+ const { toggleDisclaimerModal, backTrackingDisclaimer } = this.props;
- private formatDate(_dateObj): any {
- const dateObj = new Date(this.adjustForTimezone(_dateObj));
- const year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(
- dateObj
- );
- const month = new Intl.DateTimeFormat('en', { month: 'short' }).format(
- dateObj
- );
- const day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(
- dateObj
- );
-
- return `${month} ${day}, ${year}`;
- }
+ if (backTrackingDisclaimer === false && toggleDisclaimerModal) {
+ toggleDisclaimerModal(true);
+ } else {
+ this.props.handleStepBack(ev);
+ }
+ };
public render() {
const {
requestInformation,
} = this.props.marriageIntentionCertificateRequest;
- const appointmentDateTime = `${this.formatDate(
+ const appointmentDateTime = `${formatDate(
requestInformation.appointmentDate
)}`;
- const YesNoAnswer = (val: any) => {
- return parseInt(val) === 1 ? 'Yes' : 'No';
- };
-
const partnerA_parentA = `${requestInformation.partnerA_parentA_Name}/${
requestInformation.partnerA_parentA_Surname
}`;
+
const partnerA_parentB = `${requestInformation.partnerA_parentB_Name}/${
requestInformation.partnerA_parentB_Surname
}`;
+
const partnerB_parentA = `${requestInformation.partnerB_parentA_Name}/${
requestInformation.partnerB_parentA_Surname
}`;
+
const partnerB_parentB = `${requestInformation.partnerB_parentB_Name}/${
requestInformation.partnerB_parentB_Surname
}`;
- const getCountryFullName = (Name: string) => {
- const countryObj = COUNTRIES.find(entry => entry.value === Name);
- let retVal = '';
-
- if (countryObj && countryObj.label) {
- retVal = ` ${countryObj.label.toLocaleUpperCase()}`;
- if (countryObj.shortLabel)
- retVal = ` ${countryObj.shortLabel.toLocaleUpperCase()}`;
- }
-
- return retVal;
- };
- const getStateFullName = (Name: string) => {
- const countryObj = US_STATES.find(entry => entry.value === Name);
- return countryObj && countryObj.label && countryObj.label !== '--'
- ? countryObj.label
- : '';
- };
return (
@@ -123,28 +93,20 @@ export default class ReviewForms extends Component {
MI_REVIEW_STYLING,
]}
>
-
- Please review the details below. If you notice any errors, click the
- "back" button at the bottom of your screen and correct your
- information before submitting this application.
-
-
-
- Review Information
-
+
{/* PARTY A */}
{
`}
parentA={partnerA_parentA}
parentB={partnerA_parentB}
- parentsMarriedAtBirth={YesNoAnswer(
+ parentsMarriedAtBirth={yesNoAnswer(
requestInformation.partnerA_parentsMarriedAtBirth
)}
- bloodRelation={YesNoAnswer(
+ bloodRelation={yesNoAnswer(
requestInformation.partnerA_bloodRelation
)}
bloodRelationDesc={`
${requestInformation.partnerA_bloodRelationDesc}
`}
partnershipState={requestInformation.partnerA_partnershipState}
+ stepStr={`partnerFormA`}
+ toggleDisclaimerModal={this.props.toggleDisclaimerModal}
+ backTrackingDisclaimer={this.props.backTrackingDisclaimer}
/>
{/* PARTY B */}
@@ -191,13 +156,13 @@ export default class ReviewForms extends Component {
marriageIntentionCertificateRequest={
this.props.marriageIntentionCertificateRequest
}
- partyLabel={'B'}
+ partnerLabel={'2'}
firstName={requestInformation.partnerB_firstName}
lastName={requestInformation.partnerB_lastName}
suffix={requestInformation.partnerB_suffix}
middleName={requestInformation.partnerB_middleName}
surName={requestInformation.partnerB_surName}
- dob={this.formatDate(requestInformation.partnerB_dob)}
+ dob={formatDate(requestInformation.partnerB_dob)}
age={requestInformation.partnerB_age}
occupation={requestInformation.partnerB_occupation}
// sex={requestInformation.partnerB_sex}
@@ -227,40 +192,30 @@ export default class ReviewForms extends Component {
`}
parentA={partnerB_parentA}
parentB={partnerB_parentB}
- parentsMarriedAtBirth={YesNoAnswer(
+ parentsMarriedAtBirth={yesNoAnswer(
requestInformation.partnerB_parentsMarriedAtBirth
)}
- bloodRelation={YesNoAnswer(
+ bloodRelation={yesNoAnswer(
requestInformation.partnerB_bloodRelation
)}
bloodRelationDesc={`
${requestInformation.partnerB_bloodRelationDesc}
`}
partnershipState={requestInformation.partnerB_partnershipState}
+ stepStr={`partnerFormB`}
+ toggleDisclaimerModal={this.props.toggleDisclaimerModal}
+ backTrackingDisclaimer={this.props.backTrackingDisclaimer}
/>
-
- Contact Information
-
-
-
-
-
-
- {requestInformation.email}
-
-
-
-
- {requestInformation.dayPhone}
-
-
-
-
-
- {appointmentDateTime}
-
-
+
);
diff --git a/services-js/registry-certs/client/marriageintention/forms/reviewUI/components.tsx b/services-js/registry-certs/client/marriageintention/forms/reviewUI/components.tsx
new file mode 100644
index 000000000..88a52c772
--- /dev/null
+++ b/services-js/registry-certs/client/marriageintention/forms/reviewUI/components.tsx
@@ -0,0 +1,67 @@
+/** @jsx jsx */
+
+import { jsx } from '@emotion/core';
+import Router from 'next/router';
+
+import { REVIEW_CONTROL_STYLING } from './reviewStying';
+
+/**
+ * @name $ReviewControlHeader
+ * @param {Object} params
+ * @param {String} params.title Header title
+ * @param {String} params.btnStr Button label/text
+ * @param {String} params.routeStep Router param(step as string)
+ * @returns JSX(HTML)
+ */
+export const $ReviewControlHeader = (params: {
+ title: string;
+ btnStr: string;
+ routeStep: string;
+ toggleDisclaimerModal: (val: boolean) => void;
+ backTrackingDisclaimer: boolean;
+}) => {
+ const { title, btnStr, routeStep } = params;
+ const stepBack = () => {
+ const { toggleDisclaimerModal, backTrackingDisclaimer } = params;
+
+ if (backTrackingDisclaimer === false && toggleDisclaimerModal) {
+ toggleDisclaimerModal(true);
+ } else {
+ Router.push(`/marriageintention?step=${routeStep}`);
+ }
+ };
+
+ return (
+
+
+
{title}
+
+
+
+
+
+
+ );
+};
+
+/**
+ * @name ReviewFieldValuePair
+ * @param {Object} params
+ * @param {String} params.field
+ * @param {String} params.value
+ * @returns JSX(HTML)
+ */
+export const $ReviewFieldValuePair = (params: {
+ field: string;
+ value: string;
+}) => {
+ const { field, value } = params;
+ return (
+
+
+ {value}
+
+ );
+};
diff --git a/services-js/registry-certs/client/marriageintention/forms/reviewUI/contact.tsx b/services-js/registry-certs/client/marriageintention/forms/reviewUI/contact.tsx
new file mode 100644
index 000000000..85c4623a2
--- /dev/null
+++ b/services-js/registry-certs/client/marriageintention/forms/reviewUI/contact.tsx
@@ -0,0 +1,63 @@
+/** @jsx jsx */
+
+import { jsx } from '@emotion/core';
+import { Component } from 'react';
+import { observer } from 'mobx-react';
+
+import { REVIEW_FORM_STYLING } from './reviewStying';
+import { formatPhoneNumber } from '../../helpers/formUtils';
+import { $ReviewControlHeader, $ReviewFieldValuePair } from './components';
+
+interface Props {
+ appointmentDateTime: string;
+ requestInformation: {
+ email: string;
+ dayPhone: string;
+ };
+ toggleDisclaimerModal: (val: boolean) => void;
+ backTrackingDisclaimer: boolean;
+}
+
+@observer
+export default class ContactUX extends Component
{
+ constructor(props: Props) {
+ super(props);
+ }
+
+ public render() {
+ const { appointmentDateTime, requestInformation } = this.props;
+
+ return (
+
+ {$ReviewControlHeader({
+ title: `Contact Information`,
+ btnStr: `Edit This Page`,
+ routeStep: `contactInfo`,
+ backTrackingDisclaimer: this.props.backTrackingDisclaimer,
+ toggleDisclaimerModal: this.props.toggleDisclaimerModal,
+ })}
+
+
+
+
Personal Information
+
+ {$ReviewFieldValuePair({
+ field: `Email`,
+ value: `${requestInformation.email}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Phone #`,
+ value: `${formatPhoneNumber(requestInformation.dayPhone)}`,
+ })}
+
+ {$ReviewFieldValuePair({
+ field: `Appointment Date`,
+ value: `${appointmentDateTime}`,
+ })}
+
+
+
+ );
+ }
+}
diff --git a/services-js/registry-certs/client/marriageintention/forms/reviewUI/header.tsx b/services-js/registry-certs/client/marriageintention/forms/reviewUI/header.tsx
new file mode 100644
index 000000000..9c8221907
--- /dev/null
+++ b/services-js/registry-certs/client/marriageintention/forms/reviewUI/header.tsx
@@ -0,0 +1,26 @@
+/** @jsx jsx */
+
+import { jsx } from '@emotion/core';
+import { Component } from 'react';
+import { REVIEW_INTRO_HEADER_STYLING } from './reviewStying';
+
+export default class HeaderUX extends Component {
+ public render() {
+ return (
+
+
Review Your Information
+
+
+ {' '}
+ If you need to make any changes, you can go back and edit the previous
+ pages. Please make sure your information is accurate. During your
+ appointment, we will review and finalize the information you share
+ here and make sure everything’s set before it is printed onto your
+ marriage intention form.
+
+
+ );
+ }
+}
diff --git a/services-js/registry-certs/client/marriageintention/forms/reviewUI/reviewStying.tsx b/services-js/registry-certs/client/marriageintention/forms/reviewUI/reviewStying.tsx
new file mode 100644
index 000000000..622d50762
--- /dev/null
+++ b/services-js/registry-certs/client/marriageintention/forms/reviewUI/reviewStying.tsx
@@ -0,0 +1,131 @@
+import { css } from '@emotion/core';
+import {
+ CHARLES_BLUE,
+ OPTIMISTIC_BLUE_DARK,
+ WHITE,
+ SANS,
+ MEDIA_SMALL_MAX,
+ MEDIA_SMALL,
+ DEFAULT_TEXT,
+} from '@cityofboston/react-fleet';
+
+export const REVIEW_INTRO_HEADER_STYLING = css({
+ fontSize: '0.9378rem',
+ marginBottom: '2em',
+ lineHeight: '1.4em',
+ color: `${CHARLES_BLUE}`,
+ fontFamily: 'Lora',
+
+ H1: {
+ fontWeight: 700,
+ fontSize: '1.88em',
+ textTransform: 'uppercase',
+ fontFamily: 'Montserrat !important',
+ lineHeight: '1.21em',
+ marginBottom: '0em',
+ },
+});
+
+export const REVIEW_CONTROL_STYLING = css(`
+ display: flex;
+ overflow: hidden;
+ align-items: center;
+ align-items: center;
+ justify-content: space-between;
+ margin: 1em 0;
+ color: #fff;
+
+ .wrapper-title {
+ // flex-grow: 1;
+
+ h1, h2 {
+ color: ${CHARLES_BLUE};
+ font-size: 1.0rem;
+ font-weight: 700;
+ text-transform: uppercase;
+ font-family: ${SANS};
+ line-height: 1.875em;
+ }
+
+ h2 {
+ font-size: 1.125rem;
+ }
+ }
+
+ .wrapper-btn {
+ .btn {
+ color: ${CHARLES_BLUE};
+ background: ${WHITE};
+ border: 2px solid ${CHARLES_BLUE};
+
+ &:hover {
+ color: ${WHITE};
+ background: ${OPTIMISTIC_BLUE_DARK};
+ }
+ }
+ }
+
+ ${MEDIA_SMALL} {
+ .wrapper-title {
+ flex-grow: 1;
+
+ h1, h2 {
+ color: ${CHARLES_BLUE};
+ font-size: 1.5625rem;
+ line-height: 1.875em;
+ }
+ }
+ }
+
+ ${MEDIA_SMALL_MAX} {
+ .wrapper-title {
+ h1 {
+ line-height: 1.25em;
+ }
+ }
+
+ .wrapper-btn {
+ .btn {
+ font-size: 12px;
+ padding: 1em;
+ }
+ }
+ }
+`);
+
+export const REVIEW_FORM_STYLING = css(`
+ .section-wrapper {
+ font-size: 0.9375rem;
+ font-family: ${SANS};
+ margin-bottom: 2em;
+
+ h2 {
+ color: ${CHARLES_BLUE};
+ font-size: 1.125rem;
+ font-weight: bold;
+ text-transform: uppercase;
+ margin-bottom: 0.5em;
+ }
+
+ .field-value-pair {
+ display: flex;
+ margin-bottom: 1em;
+
+ label { font-weight: normal; }
+
+ .field {
+ display: inline-block;
+ width: 60%;
+ color: ${DEFAULT_TEXT};
+ font-size: 0.9375rem;
+ text-transform: uppercase;
+ }
+
+ .value {
+ display: inline-block;
+ width: 40%;
+ font-weight: normal;
+ }
+ }
+ }
+`);
diff --git a/services-js/registry-certs/client/marriageintention/forms/styling.tsx b/services-js/registry-certs/client/marriageintention/forms/styling.tsx
index 048140076..8b577796b 100644
--- a/services-js/registry-certs/client/marriageintention/forms/styling.tsx
+++ b/services-js/registry-certs/client/marriageintention/forms/styling.tsx
@@ -1,9 +1,24 @@
import { css } from '@emotion/core';
-import { MEDIA_MEDIUM } from '@cityofboston/react-fleet';
+import { MEDIA_MEDIUM, SANS } from '@cityofboston/react-fleet';
+
+export const INSTRUCTIONS_NOTE = css(`
+ background: #FFE5A0;
+ display: inline-block;
+ vertical-align: middle;
+ padding: 0.35em 0.75em;
+ // font-family: 'Montserrat';
+ font-family: ${SANS};
+ font-size: 0.95em;
+
+ .note {
+ font-weight: bold;
+ padding-right: 0.25em;
+ }
+`);
export const MI_REVIEW_STYLING = css({
- fontSize: '1.35em',
+ fontSize: '0.9378em',
label: {
fontWeight: 'bold',
@@ -24,7 +39,6 @@ export const PAIRED_COLUMNS_STYLING = css({
clear: 'both',
minHeight: '1px',
overflow: 'hidden',
- // background: 'yellow',
},
});
diff --git a/services-js/registry-certs/client/marriageintention/helpers/formUtils.ts b/services-js/registry-certs/client/marriageintention/helpers/formUtils.ts
new file mode 100644
index 000000000..b33ddc319
--- /dev/null
+++ b/services-js/registry-certs/client/marriageintention/helpers/formUtils.ts
@@ -0,0 +1,347 @@
+import { COUNTRIES, US_STATES } from '../../../utils/data';
+import { MARRIAGE_COUNT, PARTNERSHIP_TYPE } from '../forms/inputData';
+
+/**
+ * @name retPartnerRequestInformation
+ * @description Destructure Data Obj/Value based on partner (form) page (Flag aka A|B)
+ * @param {string} partnerFlag
+ * @param {object} requestInformation
+ * @returns Object - Destructure object
+ * @example retPartnerRequestInformation('A', { ... MarriageIntentionCertObj })
+ */
+export const retPartnerRequestInformation = (
+ partnerFlag: string,
+ requestInformation: any
+) => {
+ let retObj = {
+ lastName: '',
+ firstName: '',
+ dob: '',
+ age: '',
+ surName: '',
+ useSurname: '',
+ occupation: '',
+ bloodRelation: '',
+ bloodRelationDesc: '',
+ birthCity: '',
+ birthState: '',
+ birthCountry: '',
+ residenceAddress: '',
+ residenceCountry: '',
+ residenceCity: '',
+ residenceZip: '',
+ residenceState: '',
+ parentsMarriedAtBirth: '',
+ parentA_Name: '',
+ parentA_Surname: '',
+ parentB_Name: '',
+ parentB_Surname: '',
+ partnershipType: '',
+ partnershipTypeDissolved: '',
+ partnershipState: '',
+ marriageNumb: '',
+ marriedBefore: '',
+ lastMarriageStatus: '',
+ additionalParent: '',
+ };
+
+ retObj.firstName = requestInformation[`partner${partnerFlag}_firstName`];
+ retObj.lastName = requestInformation[`partner${partnerFlag}_lastName`];
+ retObj.dob = requestInformation[`partner${partnerFlag}_dob`];
+ retObj.age = requestInformation[`partner${partnerFlag}_age`];
+ retObj.surName = requestInformation[`partner${partnerFlag}_surName`];
+ retObj.useSurname = requestInformation[`partner${partnerFlag}_useSurname`];
+ retObj.occupation = requestInformation[`partner${partnerFlag}_occupation`];
+
+ retObj.bloodRelation =
+ requestInformation[`partner${partnerFlag}_bloodRelation`];
+
+ retObj.bloodRelationDesc =
+ requestInformation[`partner${partnerFlag}_bloodRelationDesc`];
+
+ retObj.birthCity = requestInformation[`partner${partnerFlag}_birthCity`];
+ retObj.birthState = requestInformation[`partner${partnerFlag}_birthState`];
+ retObj.birthCountry =
+ requestInformation[`partner${partnerFlag}_birthCountry`];
+ retObj.residenceAddress =
+ requestInformation[`partner${partnerFlag}_residenceAddress`];
+ retObj.residenceCountry =
+ requestInformation[`partner${partnerFlag}_residenceCountry`];
+ retObj.residenceCity =
+ requestInformation[`partner${partnerFlag}_residenceCity`];
+ retObj.residenceZip =
+ requestInformation[`partner${partnerFlag}_residenceZip`];
+ retObj.residenceState =
+ requestInformation[`partner${partnerFlag}_residenceState`];
+ retObj.parentsMarriedAtBirth =
+ requestInformation[`partner${partnerFlag}_parentsMarriedAtBirth`];
+ retObj.parentA_Name =
+ requestInformation[`partner${partnerFlag}_parentA_Name`];
+ retObj.parentA_Surname =
+ requestInformation[`partner${partnerFlag}_parentA_Surname`];
+ retObj.parentB_Name =
+ requestInformation[`partner${partnerFlag}_parentB_Name`];
+ retObj.parentB_Surname =
+ requestInformation[`partner${partnerFlag}_parentB_Surname`];
+ retObj.partnershipType =
+ requestInformation[`partner${partnerFlag}_partnershipType`];
+ retObj.partnershipTypeDissolved =
+ requestInformation[`partner${partnerFlag}_partnershipTypeDissolved`];
+ retObj.partnershipState =
+ requestInformation[`partner${partnerFlag}_partnershipState`];
+ retObj.marriageNumb =
+ requestInformation[`partner${partnerFlag}_marriageNumb`];
+ retObj.marriedBefore =
+ requestInformation[`partner${partnerFlag}_marriedBefore`];
+ retObj.lastMarriageStatus =
+ requestInformation[`partner${partnerFlag}_lastMarriageStatus`];
+ retObj.additionalParent =
+ requestInformation[`partner${partnerFlag}_additionalParent`];
+
+ return retObj;
+};
+
+/**
+ * @name isPartnerFormPageComplete
+ * @param {string} partnerFlag Partner Form Page A | B
+ * @param requestInformation {object} MarriageIntentionCertificateRequest Instance
+ * @returns {boolean} Boolean - true | false
+ */
+export const isPartnerFormPageComplete = (
+ partnerFlag: string,
+ requestInformation: object
+): boolean => {
+ const data = retPartnerRequestInformation(partnerFlag, requestInformation);
+
+ let bloodRelReq = true;
+ let useSurnameReq = true;
+ let additionalParentsReq = true;
+ let marriedBeforeReq = true;
+ let partnership_dissolved = true;
+ let lastMarriageStatusReq = true;
+ let birthStateZip = true;
+ let partnershipStateBool = true;
+ let residenceZipBool = true;
+ let residenceStateBool = true;
+ let additionalParent_Name = true;
+ let additionalParent_Surname = true;
+
+ if (data.residenceCountry === 'USA' && data.residenceState === '') {
+ residenceStateBool = false;
+ }
+
+ if (data.residenceCountry === 'USA' && data.residenceZip === '') {
+ residenceZipBool = false;
+ }
+
+ if (
+ data.partnershipType !== PARTNERSHIP_TYPE[0].value &&
+ data.residenceState &&
+ typeof data.residenceState === 'string' &&
+ data.partnershipState.length < 2
+ ) {
+ partnershipStateBool = false;
+ }
+
+ let bloodRelDescReq =
+ data.bloodRelation && data.bloodRelation == '1' ? true : false;
+
+ if (bloodRelDescReq && data.bloodRelationDesc.length < 1) {
+ bloodRelReq = false;
+ }
+
+ if (bloodRelDescReq && data.bloodRelationDesc.length > 1) {
+ bloodRelReq = true;
+ }
+
+ const surNameTextReq =
+ data.useSurname && data.useSurname === '1' ? true : false;
+
+ if ((surNameTextReq && data.surName.length < 1) || data.useSurname == '') {
+ useSurnameReq = false;
+ }
+
+ const addParentsReq =
+ data.additionalParent && data.additionalParent == '1' ? true : false;
+
+ if (
+ (addParentsReq &&
+ (data.parentB_Name.length < 1 || data.parentB_Surname.length < 1)) ||
+ data.additionalParent == ''
+ ) {
+ additionalParentsReq = false;
+ }
+
+ if (data.additionalParent == '1' && data.parentB_Name.length < 1)
+ additionalParent_Name = false;
+
+ if (data.additionalParent == '1' && data.parentB_Surname.length < 1)
+ additionalParent_Surname = false;
+
+ if (data.birthCountry === 'USA') {
+ birthStateZip = data.birthState.length > 0 ? true : false;
+ }
+
+ const marriedBeforeBool = data.marriedBefore === '1' ? true : false;
+
+ if (data.marriedBefore === '') marriedBeforeReq = false;
+ if (marriedBeforeBool && data.marriageNumb === '') marriedBeforeReq = false;
+
+ const getMarriageNumb = (): { label: string; value: string } => {
+ let retOb = MARRIAGE_COUNT.find(entry => entry.value == data.marriageNumb);
+
+ if (!retOb) retOb = { label: '', value: '' };
+
+ return retOb;
+ };
+
+ const marriageNumbBool: {
+ label: string;
+ value: string;
+ } = getMarriageNumb();
+
+ if (marriageNumbBool && marriageNumbBool.value !== '') {
+ if (data.lastMarriageStatus === '') {
+ lastMarriageStatusReq = false;
+ }
+ }
+
+ if (data.partnershipType !== PARTNERSHIP_TYPE[0].value) {
+ if (data.partnershipTypeDissolved === '') {
+ partnership_dissolved = false;
+ }
+ }
+
+ const is_Complete = !!(
+ data.lastName &&
+ data.firstName &&
+ data.dob &&
+ data.age &&
+ data.occupation &&
+ data.bloodRelation &&
+ data.birthCity &&
+ data.birthCountry &&
+ data.residenceAddress &&
+ data.residenceCountry &&
+ data.residenceCity &&
+ data.parentsMarriedAtBirth &&
+ data.partnershipType &&
+ data.parentA_Name &&
+ data.parentA_Surname &&
+ partnership_dissolved &&
+ lastMarriageStatusReq &&
+ partnershipStateBool &&
+ birthStateZip &&
+ bloodRelReq &&
+ additionalParentsReq &&
+ marriedBeforeReq &&
+ useSurnameReq &&
+ residenceZipBool &&
+ residenceStateBool &&
+ additionalParent_Name &&
+ additionalParent_Surname
+ );
+
+ return is_Complete;
+};
+
+/**
+ * @name adjustForTimezone
+ * @description Adjust a date to the client (browser, etc) Timezone
+ * @param {date} date Date (JS) object
+ * @returns Date - Date (JS) object
+ * @example adjustForTimezone(new Date("Sun Jan 28 2024 19:43:53 GMT-0500 (Eastern Standard Time)")) = 1706507033000
+ */
+export const adjustForTimezone = (date: Date): Date => {
+ const timeOffsetInMS: number = date.getTimezoneOffset() * 60000;
+ date.setTime(date.getTime() + timeOffsetInMS);
+ return date;
+};
+
+/**
+ * @name formatDate
+ * @description Format date to the following style: `mmm dd, yyyy`
+ * @returns {string} Date string in the format of `mmm dd, yyyy`
+ * @example formatDate(new Date('12/1/2023')) = `Dec 01, 2023`
+ */
+export const formatDate = (date_Obj: Date | null | undefined): any => {
+ if (!date_Obj) return ``;
+
+ const dateObj = new Date(adjustForTimezone(date_Obj));
+ const year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(
+ dateObj
+ );
+ const month = new Intl.DateTimeFormat('en', { month: 'short' }).format(
+ dateObj
+ );
+ const day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(dateObj);
+
+ return `${month} ${day}, ${year}`;
+};
+
+/**
+ * @name getCountryFullName
+ * @description Convert a 2-3 letter Country Code into the full country name
+ * @param {name} string Country Code
+ * @returns {string} Country Full Name
+ * @example getCountryFullName('USA') = 'United States of America'
+ */
+export const getCountryFullName = (name: string) => {
+ const countryObj = COUNTRIES.find(entry => entry.value === name);
+ let retVal = '';
+
+ if (countryObj && countryObj.label) {
+ retVal = ` ${countryObj.label.toLocaleUpperCase()}`;
+ if (countryObj.shortLabel)
+ retVal = ` ${countryObj.shortLabel.toLocaleUpperCase()}`;
+ }
+
+ return retVal;
+};
+
+/**
+ * @name getStateFullName
+ * @description Convert a State Code into state name
+ * @param {name} string State Code
+ * @returns {string} State Name
+ * @example getStateFullName('MA') = 'MA'
+ */
+export const getStateFullName = (name: string) => {
+ const countryObj = US_STATES.find(entry => entry.value === name);
+ return countryObj && countryObj.label && countryObj.label !== '--'
+ ? countryObj.label
+ : '';
+};
+
+/**
+ * @name yesNoUnknownAnswer
+ * @description Convert boolean (true bool, numeric bool, string bool) into Y|N string
+ * @param {val} string | boolean | 1 | 2 | '1' | '2'
+ * @returns {string} Yes|No
+ * @example yesNoUnknownAnswer('1') = 'Yes'
+ */
+export const yesNoAnswer = (
+ val: '1' | '2' | 1 | 2 | string | boolean
+): string => {
+ if (!val) return ``;
+ if (typeof val === 'boolean') return val === true ? 'Yes' : 'No';
+ if (typeof val === 'number') return val === 1 ? 'Yes' : 'No';
+ return parseInt(val) === 1 ? 'Yes' : 'No';
+};
+
+/**
+ * @name formatPhoneNumber
+ * @description Format Phone number in US standard + country code
+ * @param phoneStr Phone # as a string
+ * @returns {string}
+ * @example formatPhoneNumber("16174450011") = "1 (617) 445-0011"
+ */
+export const formatPhoneNumber = (phoneStr: string): string => {
+ const cleaned = ('' + phoneStr).replace(/\D/g, '');
+ const match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);
+ if (match) {
+ const intlCode = match[1] ? '+1 ' : '';
+ return [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('');
+ }
+ return '';
+};
diff --git a/services-js/registry-certs/client/marriageintention/helpers/postConfirmationEmail.ts b/services-js/registry-certs/client/marriageintention/helpers/postConfirmationEmail.ts
index 2c9bc33d4..d52c1bd04 100644
--- a/services-js/registry-certs/client/marriageintention/helpers/postConfirmationEmail.ts
+++ b/services-js/registry-certs/client/marriageintention/helpers/postConfirmationEmail.ts
@@ -9,8 +9,6 @@ async function PostConfirmationEmail(data: {
fullName: string;
}) {
const { email, from, subject, message, fullName } = data;
- // eslint-disable-next-line no-console
- // console.log('PostConfirmationEmail > data: ', data);
try {
let dataObj = qs.stringify({
@@ -33,16 +31,16 @@ async function PostConfirmationEmail(data: {
return await axios(config)
.then(response => {
// eslint-disable-next-line no-console
- // console.log(JSON.stringify(response.data));
+ // console.error(JSON.stringify(response.data));
return response.data;
})
.catch(error => {
// eslint-disable-next-line no-console
- console.log(error);
+ console.error(error);
});
} catch (e) {
// eslint-disable-next-line no-console
- console.log('RESPONSE 200 >', e);
+ console.error('RESPONSE 200 >', e);
return e;
}
}
diff --git a/services-js/registry-certs/client/marriageintention/index.tsx b/services-js/registry-certs/client/marriageintention/index.tsx
index 351fec990..aea86f24a 100644
--- a/services-js/registry-certs/client/marriageintention/index.tsx
+++ b/services-js/registry-certs/client/marriageintention/index.tsx
@@ -20,6 +20,8 @@ import PageWrapper from '../PageWrapper';
import { INTENTION } from './styling';
import { ContactForm } from '@cityofboston/react-fleet';
+import StatusModal from '../StatusModal';
+
import Instructions from './forms/instructions';
import PartnerFormA from './forms/partnerFormA';
import PartnerFormB from './forms/partnerFormB';
@@ -27,6 +29,8 @@ import ReviewForms from './forms/reviewForms';
import ContactInfo from './forms/contactInfo';
import Receipt from './forms/receipt';
+import { isPartnerFormPageComplete } from '../marriageintention/helpers/formUtils';
+
interface InitialProps {
currentStep: MarriageIntentionStep;
}
@@ -38,6 +42,7 @@ interface Props
| 'marriageIntentionCertificateRequest'
| 'siteAnalytics'
| 'marriageIntentionDao'
+ | 'completedSteps'
> {}
interface State {
@@ -57,6 +62,12 @@ interface State {
* doesn’t receive prevProps.)
*/
currentStep: MarriageIntentionStep;
+ completedSteps: Set;
+ allowProceed: boolean;
+ errorElemSrc: object;
+ backTrackingDisclaimer: boolean;
+ showDisclaimer: boolean;
+ contactFormComplete: boolean;
}
/**
@@ -119,16 +130,48 @@ export default class IndexPage extends React.Component {
return null;
}
};
+ // REFs Def
+ partnerA_nameFieldsRef: React.RefObject;
+ partnerA_residenceRef: React.RefObject;
+ partnerA_marriageRef: React.RefObject;
+ partnerA_datePlaceOfBirthRef: React.RefObject;
+ partnerA_parentsRef: React.RefObject;
+
+ partnerB_nameFieldsRef: React.RefObject;
+ partnerB_residenceRef: React.RefObject;
+ partnerB_marriageRef: React.RefObject;
+ partnerB_datePlaceOfBirthRef: React.RefObject;
+ partnerB_parentsRef: React.RefObject;
constructor(props: Props) {
super(props);
+ // STATE
this.state = {
localMarriageIntentionCertificateRequest: props.marriageIntentionCertificateRequest.clone(),
globalMarriageIntentionCertificateRequest:
props.marriageIntentionCertificateRequest,
currentStep: props.currentStep,
+ completedSteps: this.props.completedSteps || new Set([0]),
+ allowProceed: true,
+ errorElemSrc: {},
+ backTrackingDisclaimer: false,
+ showDisclaimer: false,
+ contactFormComplete: false,
};
+
+ // REFs Inits
+ this.partnerA_nameFieldsRef = React.createRef();
+ this.partnerA_residenceRef = React.createRef();
+ this.partnerA_marriageRef = React.createRef();
+ this.partnerA_datePlaceOfBirthRef = React.createRef();
+ this.partnerA_parentsRef = React.createRef();
+
+ this.partnerB_nameFieldsRef = React.createRef();
+ this.partnerB_residenceRef = React.createRef();
+ this.partnerB_marriageRef = React.createRef();
+ this.partnerB_datePlaceOfBirthRef = React.createRef();
+ this.partnerB_parentsRef = React.createRef();
}
componentDidMount() {
@@ -145,30 +188,6 @@ export default class IndexPage extends React.Component {
}
}
- private advanceQuestion = (
- modifiedRequest: MarriageIntentionCertificateRequest
- ) => {
- const { currentStep, marriageIntentionCertificateRequest } = this.props;
-
- if (marriageIntentionCertificateRequest !== modifiedRequest) {
- marriageIntentionCertificateRequest.updateFrom(modifiedRequest);
- }
-
- // Have to do this after updateFrom because the answers to questions can
- // affect the steps.
- const newSteps = marriageIntentionCertificateRequest.steps;
- const currentIndex = newSteps.indexOf(currentStep);
-
- if (currentIndex < 0) {
- throw new Error(`Step ${currentStep} not found in new steps`);
- }
-
- this.gaEventActionAndLabel();
-
- const nextStep = newSteps[currentIndex + 1];
- Router.push(`/marriageintention?step=${nextStep}`);
- };
-
// Determine correct GA Action and Label for the events to be sent during
// each step in the questions flow.
private gaEventActionAndLabel = (): void => {
@@ -196,8 +215,6 @@ export default class IndexPage extends React.Component {
};
gaAnswerQuestion = (action: string, label: string): void => {
- // eslint-disable-next-line no-console
- // console.log(`gaAnswerQuestion: , action: ${action} | label: ${label}`);
this.props.siteAnalytics.sendEvent(action, {
category: 'MarriageIntention',
label,
@@ -207,45 +224,17 @@ export default class IndexPage extends React.Component {
private submitRequest = async (
modifiedRequest: MarriageIntentionCertificateRequest
) => {
- // eslint-disable-next-line no-console
- // console.log('ReviewForm > submitRequest', this);
-
// DIG-2105
- // console.log('submitRequest: ', modifiedRequest);
- const {
- // currentStep,
- // marriageIntentionCertificateRequest,
- marriageIntentionDao,
- } = this.props;
+ const { marriageIntentionDao } = this.props;
try {
- // let formCompleted: any = null;
-
- // eslint-disable-next-line no-console
- // console.log('index > submitRequest > modifiedRequest: ', modifiedRequest);
-
// DIG-2105
await marriageIntentionDao.submitMarriageIntentionCertificateRequest(
modifiedRequest
);
- // formCompleted = await marriageIntentionDao.submitMarriageIntentionCertificateRequest(
- // modifiedRequest
- // );
- // eslint-disable-next-line no-console
- // console.log(
- // 'ReviewForm > submitRequest > formCompleted: ',
- // formCompleted
- // );
-
// DIG-2105
this.advanceQuestion(modifiedRequest);
-
- // DIG-2105
- // const newSteps = marriageIntentionCertificateRequest.steps;
- // const currentIndex = newSteps.indexOf(currentStep);
- // const nextStep = newSteps[currentIndex + 1];
- // Router.push(`/marriageintention?step=${nextStep}`);
} catch (e) {
if ((window as any).Rollbar) {
(window as any).Rollbar.error(e);
@@ -261,6 +250,43 @@ export default class IndexPage extends React.Component {
this.props.marriageIntentionCertificateRequest.clearCertificateRequest();
};
+ private advanceQuestion = (
+ modifiedRequest: MarriageIntentionCertificateRequest
+ ) => {
+ const { currentStep, marriageIntentionCertificateRequest } = this.props;
+
+ const {
+ localMarriageIntentionCertificateRequest,
+ completedSteps,
+ } = this.state;
+ const { steps } = localMarriageIntentionCertificateRequest;
+
+ if (marriageIntentionCertificateRequest !== modifiedRequest) {
+ marriageIntentionCertificateRequest.updateFrom(modifiedRequest);
+ }
+
+ // Have to do this after updateFrom because the answers to questions can
+ // affect the steps.
+ const newSteps = marriageIntentionCertificateRequest.steps;
+ let currentIndex = newSteps.indexOf(currentStep);
+
+ if (currentIndex < 0) {
+ console.error(`Step ${currentStep} not found in new steps`);
+ console.error(`currentIndex: ${currentIndex}`);
+ throw new Error(`Step ${currentStep} not found in new steps`);
+ // currentIndex = 0;
+ }
+
+ this.gaEventActionAndLabel();
+
+ const nextStep = newSteps[currentIndex + 1];
+ this.setState({
+ completedSteps: new Set([...completedSteps, steps.indexOf(nextStep)]),
+ });
+
+ Router.push(`/marriageintention?step=${nextStep}`);
+ };
+
private stepBackOneQuestion = (): void => {
const {
marriageIntentionCertificateRequest: { steps },
@@ -274,40 +300,156 @@ export default class IndexPage extends React.Component {
Router.push(`/marriageintention?step=${steps[newIndex]}`);
};
+ private formErrors = (data: {
+ action: string;
+ ref?: React.RefObject | null;
+ section: string;
+ }) => {
+ const { action, ref, section } = data;
+ if (action === 'add') {
+ this.state.errorElemSrc[section] = ref;
+ } else {
+ delete this.state.errorElemSrc[section];
+ }
+ };
+
+ private toggleDisclaimerModal = (val: boolean): void => {
+ this.setState({ showDisclaimer: val });
+ };
+
+ private disclaimerModalConfirmed = (dest?: string) => {
+ const {
+ marriageIntentionCertificateRequest: { steps },
+ currentStep,
+ } = this.props;
+
+ this.setState({
+ backTrackingDisclaimer: true,
+ showDisclaimer: false,
+ });
+
+ const posDest = [
+ 'partnerFormA',
+ 'partnerFormB',
+ 'contactInfo',
+ 'reviewForms',
+ ];
+
+ if (
+ steps.indexOf(currentStep) > 0 &&
+ steps.indexOf(currentStep) <= steps.length
+ ) {
+ let destStep = `${steps[steps.indexOf(currentStep) - 1]}`;
+
+ if (dest && typeof dest === 'string' && posDest.indexOf(dest) > -1) {
+ destStep = `${dest}`;
+ }
+
+ Router.push(`/marriageintention?step=${destStep}`);
+ } else {
+ Router.push(`/marriageintention?step=${steps[0]}`);
+ }
+ };
+
+ private progressNavClick = (i: number) => {
+ const {
+ marriageIntentionCertificateRequest: { steps },
+ currentStep,
+ } = this.props;
+ const { backTrackingDisclaimer } = this.state;
+ const direction = i < steps.indexOf(currentStep) ? '-' : '+';
+ let partnerFlag = '';
+
+ if (currentStep === 'partnerFormA') partnerFlag = 'A';
+ if (currentStep === 'partnerFormB') partnerFlag = 'B';
+
+ const isDisclaimerable =
+ currentStep === 'contactInfo' ||
+ currentStep === 'partnerFormA' ||
+ currentStep === 'partnerFormB' ||
+ currentStep === 'reviewForms'
+ ? true
+ : false;
+
+ if (isDisclaimerable && backTrackingDisclaimer === false) {
+ this.toggleDisclaimerModal(true);
+ } else {
+ if (partnerFlag.length > 0 && direction === '+') {
+ const isCompleteRet = this.isComplete(
+ partnerFlag,
+ this.state.localMarriageIntentionCertificateRequest
+ );
+
+ if (
+ isCompleteRet &&
+ Object.entries(this.state.errorElemSrc).length === 0
+ ) {
+ Router.push(`/marriageintention?step=${steps[i]}`);
+ } else {
+ if (this.state.errorElemSrc['nameFields']) {
+ this.scrollToElem(this.state.errorElemSrc['nameFields']);
+ } else if (this.state.errorElemSrc['datePlaceOfBirth']) {
+ this.scrollToElem(this.state.errorElemSrc['datePlaceOfBirth']);
+ } else if (this.state.errorElemSrc['residence']) {
+ this.scrollToElem(this.state.errorElemSrc['residence']);
+ } else if (this.state.errorElemSrc['marriageBlock']) {
+ this.scrollToElem(this.state.errorElemSrc['marriageBlock']);
+ } else if (this.state.errorElemSrc['parents']) {
+ this.scrollToElem(this.state.errorElemSrc['parents']);
+ }
+ }
+ } else {
+ Router.push(`/marriageintention?step=${steps[i]}`);
+ }
+ }
+ };
+
+ private scrollToElem = (ref: HTMLSpanElement) => {
+ window.scrollTo({
+ top: ref['current'].offsetTop,
+ behavior: 'smooth',
+ });
+ };
+
+ private isComplete(
+ partnerFlag: string,
+ { requestInformation }: MarriageIntentionCertificateRequest
+ ): boolean {
+ const advance = isPartnerFormPageComplete(partnerFlag, requestInformation);
+ return advance;
+ }
+
render() {
const { currentStep } = this.props;
- const { localMarriageIntentionCertificateRequest } = this.state;
+ const {
+ localMarriageIntentionCertificateRequest,
+ completedSteps,
+ backTrackingDisclaimer,
+ } = this.state;
+ const { steps, labels } = localMarriageIntentionCertificateRequest;
- let isStepComplete: boolean = false;
let questionsEl: React.ReactNode = null;
+ const $defaultUI = (
+ <>
+
+
+ {emailContentBlock()}
+ >
+ );
+
switch (currentStep) {
case 'instructions':
- questionsEl = (
- <>
-
-
- {emailContentBlock()}
- >
- );
-
- // DIG-2105
- // questionsEl = (
- //
- // );
+ questionsEl = $defaultUI;
break;
case 'contactInfo':
questionsEl = (
@@ -321,6 +463,8 @@ export default class IndexPage extends React.Component {
localMarriageIntentionCertificateRequest
)}
handleStepBack={this.stepBackOneQuestion}
+ toggleDisclaimerModal={this.toggleDisclaimerModal}
+ backTrackingDisclaimer={backTrackingDisclaimer}
/>
{emailContentBlock()}
@@ -340,6 +484,18 @@ export default class IndexPage extends React.Component {
)}
handleStepBack={this.stepBackOneQuestion}
partnerLabel={'A'}
+ partnerNum={1}
+ formErrors={this.formErrors}
+ refObjs={{
+ nameFieldsRef: this.partnerA_nameFieldsRef,
+ residenceRef: this.partnerA_residenceRef,
+ marriageRef: this.partnerA_marriageRef,
+ datePlaceOfBirthRef: this.partnerA_datePlaceOfBirthRef,
+ parentsRef: this.partnerA_parentsRef,
+ }}
+ errorElemSrc={this.state.errorElemSrc}
+ toggleDisclaimerModal={this.toggleDisclaimerModal}
+ backTrackingDisclaimer={backTrackingDisclaimer}
/>
{emailContentBlock()}
@@ -359,6 +515,18 @@ export default class IndexPage extends React.Component {
)}
handleStepBack={this.stepBackOneQuestion}
partnerLabel={'B'}
+ partnerNum={2}
+ formErrors={this.formErrors}
+ refObjs={{
+ nameFieldsRef: this.partnerB_nameFieldsRef,
+ residenceRef: this.partnerB_residenceRef,
+ marriageRef: this.partnerB_marriageRef,
+ datePlaceOfBirthRef: this.partnerB_datePlaceOfBirthRef,
+ parentsRef: this.partnerA_parentsRef,
+ }}
+ errorElemSrc={this.state.errorElemSrc}
+ backTrackingDisclaimer={this.state.backTrackingDisclaimer}
+ toggleDisclaimerModal={this.toggleDisclaimerModal}
/>
{emailContentBlock()}
@@ -366,11 +534,6 @@ export default class IndexPage extends React.Component {
);
break;
case 'reviewForms':
- // eslint-disable-next-line no-console
- // console.log(
- // 'index>switch>reviewForms: ',
- // localMarriageIntentionCertificateRequest
- // );
questionsEl = (
<>
{
localMarriageIntentionCertificateRequest
)}
handleStepBack={this.stepBackOneQuestion}
+ toggleDisclaimerModal={this.toggleDisclaimerModal}
+ backTrackingDisclaimer={backTrackingDisclaimer}
/>
{emailContentBlock()}
@@ -398,35 +563,22 @@ export default class IndexPage extends React.Component {
);
break;
default:
- questionsEl = (
- <>
-
-
- {emailContentBlock()}
- >
- );
+ questionsEl = $defaultUI;
break;
}
- const { steps } = localMarriageIntentionCertificateRequest;
-
return (
{
{questionsEl}
- {/* DIG-2105 */}
- {/* {emailContentBlock()} */}
+ {this.state.showDisclaimer && (
+
+
+ If you edit your information, you must click the `Save and
+ Continue` button to save your changes.
+
+
+ )}
);
diff --git a/services-js/registry-certs/client/store/MarriageIntentionCertificateRequest.ts b/services-js/registry-certs/client/store/MarriageIntentionCertificateRequest.ts
index 1c631bb4b..2c3ac32a5 100644
--- a/services-js/registry-certs/client/store/MarriageIntentionCertificateRequest.ts
+++ b/services-js/registry-certs/client/store/MarriageIntentionCertificateRequest.ts
@@ -8,6 +8,7 @@ import { GaSiteAnalytics } from '@cityofboston/next-client-common';
import {
MarriageIntentionCertificateRequestInformation,
MarriageIntentionStep,
+ MarriageIntentionStepLabels,
JSONObject,
JSONValue,
} from '../types';
@@ -27,6 +28,7 @@ export const INITIAL_REQUEST_INFORMATION: Readonly<
partnerA_lastName: '',
partnerA_middleName: '',
partnerA_surName: '',
+ partnerA_useSurname: '',
partnerA_dob: null,
partnerA_age: '',
partnerA_occupation: '',
@@ -53,6 +55,9 @@ export const INITIAL_REQUEST_INFORMATION: Readonly<
partnerA_residenceZip: '',
partnerA_marriageNumb: '',
partnerA_lastMarriageStatus: '',
+ partnerA_marriedBefore: '',
+ partnerA_additionalParent: '',
+ partnerA_formPageComplete: '',
partnerB_fullName: '',
partnerB_firstMiddleName: '',
@@ -61,6 +66,7 @@ export const INITIAL_REQUEST_INFORMATION: Readonly<
partnerB_lastName: '',
partnerB_middleName: '',
partnerB_surName: '',
+ partnerB_useSurname: '',
partnerB_dob: null,
partnerB_age: '',
partnerB_occupation: '',
@@ -87,6 +93,9 @@ export const INITIAL_REQUEST_INFORMATION: Readonly<
partnerB_residenceZip: '',
partnerB_marriageNumb: '',
partnerB_lastMarriageStatus: '',
+ partnerB_marriedBefore: '',
+ partnerB_additionalParent: '',
+ partnerB_formPageComplete: '',
email: '',
emailConfirm: '',
@@ -103,6 +112,15 @@ export const QUESTION_STEPS: MarriageIntentionStep[] = [
'reviewForms',
];
+export const LABEL_STEPS: MarriageIntentionStepLabels[] = [
+ 'Getting Started',
+ 'Person 1',
+ 'Person 2',
+ 'Contact Info',
+ 'Review',
+ 'Submit',
+];
+
export const CHECKOUT_STEPS: MarriageIntentionStep[] = ['reviewRequest'];
type MarriageIntentionCertificateRequestInformationJson = {
@@ -148,6 +166,7 @@ export default class MarriageIntentionCertificateRequest {
partnerA_lastName: this.requestInformation.partnerA_lastName,
partnerA_middleName: this.requestInformation.partnerA_middleName,
partnerA_surName: this.requestInformation.partnerA_surName,
+ partnerA_useSurname: this.requestInformation.partnerA_useSurname,
partnerA_dob: this.requestInformation.partnerA_dob
? this.requestInformation.partnerA_dob.toISOString()
: null,
@@ -187,6 +206,11 @@ export default class MarriageIntentionCertificateRequest {
partnerA_marriageNumb: this.requestInformation.partnerA_marriageNumb,
partnerA_lastMarriageStatus: this.requestInformation
.partnerA_lastMarriageStatus,
+ partnerA_marriedBefore: this.requestInformation.partnerA_marriedBefore,
+ partnerA_additionalParent: this.requestInformation
+ .partnerA_additionalParent,
+ partnerA_formPageComplete: this.requestInformation
+ .partnerA_formPageComplete,
partnerB_fullName: this.requestInformation.partnerB_fullName,
partnerB_firstMiddleName: this.requestInformation
@@ -196,6 +220,7 @@ export default class MarriageIntentionCertificateRequest {
partnerB_lastName: this.requestInformation.partnerB_lastName,
partnerB_middleName: this.requestInformation.partnerB_middleName,
partnerB_surName: this.requestInformation.partnerB_surName,
+ partnerB_useSurname: this.requestInformation.partnerB_useSurname,
partnerB_dob: this.requestInformation.partnerB_dob
? this.requestInformation.partnerB_dob.toISOString()
: null,
@@ -235,6 +260,11 @@ export default class MarriageIntentionCertificateRequest {
partnerB_marriageNumb: this.requestInformation.partnerB_marriageNumb,
partnerB_lastMarriageStatus: this.requestInformation
.partnerB_lastMarriageStatus,
+ partnerB_marriedBefore: this.requestInformation.partnerB_marriedBefore,
+ partnerB_additionalParent: this.requestInformation
+ .partnerB_additionalParent,
+ partnerB_formPageComplete: this.requestInformation
+ .partnerB_formPageComplete,
email: this.requestInformation.email,
emailConfirm: this.requestInformation.emailConfirm,
@@ -243,7 +273,6 @@ export default class MarriageIntentionCertificateRequest {
appointmentDate: this.requestInformation.appointmentDate
? this.requestInformation.appointmentDate.toISOString()
: null,
- // appointmentTime: this.requestInformation.appointmentTime,
};
return {
@@ -264,6 +293,7 @@ export default class MarriageIntentionCertificateRequest {
partnerA_lastName: obj.requestInformation.partnerA_lastName,
partnerA_middleName: obj.requestInformation.partnerA_middleName,
partnerA_surName: obj.requestInformation.partnerA_surName,
+ partnerA_useSurname: obj.requestInformation.partnerA_useSurname,
partnerA_dob: obj.requestInformation.partnerA_dob
? new Date(obj.requestInformation.partnerA_dob)
: null,
@@ -300,6 +330,11 @@ export default class MarriageIntentionCertificateRequest {
partnerA_marriageNumb: obj.requestInformation.partnerA_marriageNumb,
partnerA_lastMarriageStatus:
obj.requestInformation.partnerA_lastMarriageStatus,
+ partnerA_marriedBefore: obj.requestInformation.partnerA_marriedBefore,
+ partnerA_additionalParent:
+ obj.requestInformation.partnerA_additionalParent,
+ partnerA_formPageComplete:
+ obj.requestInformation.partnerA_formPageComplete,
partnerB_fullName: this.requestInformation.partnerB_fullName,
partnerB_firstMiddleName: this.requestInformation
@@ -309,6 +344,7 @@ export default class MarriageIntentionCertificateRequest {
partnerB_lastName: obj.requestInformation.partnerB_lastName,
partnerB_middleName: obj.requestInformation.partnerB_middleName,
partnerB_surName: obj.requestInformation.partnerB_surName,
+ partnerB_useSurname: obj.requestInformation.partnerB_useSurname,
partnerB_dob: obj.requestInformation.partnerB_dob
? new Date(obj.requestInformation.partnerB_dob)
: null,
@@ -345,6 +381,11 @@ export default class MarriageIntentionCertificateRequest {
partnerB_marriageNumb: obj.requestInformation.partnerB_marriageNumb,
partnerB_lastMarriageStatus:
obj.requestInformation.partnerB_lastMarriageStatus,
+ partnerB_marriedBefore: obj.requestInformation.partnerB_marriedBefore,
+ partnerB_additionalParent:
+ obj.requestInformation.partnerB_additionalParent,
+ partnerB_formPageComplete:
+ obj.requestInformation.partnerB_formPageComplete,
email: obj.requestInformation.email,
emailConfirm: obj.requestInformation.emailConfirm,
@@ -353,7 +394,6 @@ export default class MarriageIntentionCertificateRequest {
appointmentDate: obj.requestInformation.appointmentDate
? obj.requestInformation.appointmentDate.toISOString()
: null,
- // appointmentTime: obj.requestInformation.appointmentTime,
};
}
@@ -393,27 +433,12 @@ export default class MarriageIntentionCertificateRequest {
@computed
public get steps(): MarriageIntentionStep[] {
- return [
- ...QUESTION_STEPS,
- // ...(this.needsIdentityVerification ? VERIFY_IDENTIFICATION_STEPS : []),
- ...CHECKOUT_STEPS,
- ];
+ return [...QUESTION_STEPS, ...CHECKOUT_STEPS];
}
@computed
- public get needsIdentityVerification(): boolean {
- // const {
- // partnerA_firstName,
- // partnerA_lastName,
- // partnerA_surName,
- // } = this.requestInformation;
-
- // const firstName = partnerA_firstName && partnerA_firstName !== '';
- // const lastName = partnerA_lastName && partnerA_lastName !== '';
- // return !!(partnerA_firstName && partnerA_firstName !== '');
-
- // return !!(partnerA_firstName && partnerA_lastName && partnerA_surName);
- return true;
+ public get labels(): MarriageIntentionStepLabels[] {
+ return [...LABEL_STEPS];
}
// A user’s answer may span several fields:
@@ -423,7 +448,6 @@ export default class MarriageIntentionCertificateRequest {
partnerLabel: string
): void {
partnerLabel = partnerLabel || '';
- // console.log(`answerQuestion>partnerLabel: [${partnerLabel}]`);
if (partnerLabel === '') {
this.requestInformation = {
...this.requestInformation,
@@ -467,26 +491,10 @@ export default class MarriageIntentionCertificateRequest {
@computed
public get completedQuestionSteps() {
const steps = {
- // partnerFormA: false,
- // partnerFormB: false,
partnerFormA: true,
partnerFormB: true,
- // verifyIdentification: true,
};
- // const {
- // partnerA,
- // partnerB,
- // } = this.requestInformation;
-
- // if (partnerA.firstName && partnerA.lastName && partnerA.surName) {
- // steps.partnerFormA = true;
- // }
-
- // if (partnerB.firstName && partnerB.lastName && partnerB.surName) {
- // steps.partnerFormB = true;
- // }
-
return steps;
}
diff --git a/services-js/registry-certs/client/types.ts b/services-js/registry-certs/client/types.ts
index 000677e96..ca671940f 100644
--- a/services-js/registry-certs/client/types.ts
+++ b/services-js/registry-certs/client/types.ts
@@ -36,7 +36,7 @@ export type Relation =
| 'other'
| '';
-export type YesNoUnknownAnswer = 'yes' | 'no' | 'unknown' | '';
+export type yesNoUnknownAnswer = 'yes' | 'no' | 'unknown' | '';
// Death-specific
export interface DeathCertificate
@@ -97,6 +97,14 @@ export type MarriageIntentionStep =
| 'reviewForms'
| 'reviewRequest';
+export type MarriageIntentionStepLabels =
+ | 'Getting Started'
+ | 'Person 1'
+ | 'Person 2'
+ | 'Contact Info'
+ | 'Review'
+ | 'Submit';
+
export type IntentionQuestion = 'introStart';
// Marriage-specific
@@ -126,13 +134,13 @@ export type MarriageStep =
export type BirthCertificateRequestInformation = {
forSelf: boolean | null;
howRelated?: Relation;
- bornInBoston: YesNoUnknownAnswer;
- parentsLivedInBoston?: YesNoUnknownAnswer;
+ bornInBoston: yesNoUnknownAnswer;
+ parentsLivedInBoston?: yesNoUnknownAnswer;
firstName: string;
lastName: string;
altSpelling: string;
birthDate?: Date | null;
- parentsMarried: YesNoUnknownAnswer;
+ parentsMarried: yesNoUnknownAnswer;
parent1FirstName: string;
parent1LastName: string;
parent2FirstName: string;
@@ -152,6 +160,7 @@ export type MarriageIntentionCertificateRequestInformation = {
partnerA_lastName: string;
partnerA_middleName: string;
partnerA_surName: string;
+ partnerA_useSurname: string;
partnerA_dob?: Date | null;
partnerA_age: string;
partnerA_occupation: string;
@@ -178,6 +187,9 @@ export type MarriageIntentionCertificateRequestInformation = {
partnerA_residenceZip: string;
partnerA_marriageNumb: string;
partnerA_lastMarriageStatus: string;
+ partnerA_marriedBefore: string;
+ partnerA_additionalParent: string;
+ partnerA_formPageComplete: '' | '1' | null;
partnerB_fullName: string;
partnerB_firstMiddleName: string;
@@ -186,6 +198,7 @@ export type MarriageIntentionCertificateRequestInformation = {
partnerB_lastName: string;
partnerB_middleName: string;
partnerB_surName: string;
+ partnerB_useSurname: string;
partnerB_dob?: Date | null;
partnerB_age: string;
partnerB_occupation: string;
@@ -212,19 +225,21 @@ export type MarriageIntentionCertificateRequestInformation = {
partnerB_residenceZip: string;
partnerB_marriageNumb: string;
partnerB_lastMarriageStatus: string;
+ partnerB_marriedBefore: string;
+ partnerB_additionalParent: string;
+ partnerB_formPageComplete: '' | '1' | null;
email: string;
emailConfirm: string;
dayPhone: string;
dayPhoneUnformattedStr: string;
appointmentDate: Date | null;
- // appointmentTime: string;
};
export type MarriageCertificateRequestInformation = {
forSelf: boolean | null;
howRelated?: Relation;
- filedInBoston: YesNoUnknownAnswer;
+ filedInBoston: yesNoUnknownAnswer;
dateOfMarriageExact?: Date | null;
dateOfMarriageUnsure?: string;
fullName1: string;
@@ -233,8 +248,8 @@ export type MarriageCertificateRequestInformation = {
maidenName2?: string;
altSpellings1?: string;
altSpellings2?: string;
- parentsMarried1: YesNoUnknownAnswer;
- parentsMarried2: YesNoUnknownAnswer;
+ parentsMarried1: yesNoUnknownAnswer;
+ parentsMarried2: yesNoUnknownAnswer;
// customerNotes?: string;
// only required if parentsMarried[1, 2] !== true:
diff --git a/services-js/registry-certs/lib/interfaces.ts b/services-js/registry-certs/lib/interfaces.ts
new file mode 100644
index 000000000..0ece2c72f
--- /dev/null
+++ b/services-js/registry-certs/lib/interfaces.ts
@@ -0,0 +1,18 @@
+export interface ProgressProps {
+ totalSteps: number;
+ currentStep: number;
+ currentStepCompleted: boolean;
+ offset?: number | undefined;
+ showStepName?: string;
+}
+
+export interface ProgressNavProps {
+ steps: Array
;
+ totalSteps: number;
+ currentStep: number;
+ showStepName?: boolean;
+ offset?: number;
+ completed?: Array;
+ clickHandler?: ((e: any) => void) | undefined;
+ blockStepBackAfterLastNav?: boolean;
+}
diff --git a/services-js/registry-certs/pages/_app.tsx b/services-js/registry-certs/pages/_app.tsx
index 296d39334..762f2b68e 100644
--- a/services-js/registry-certs/pages/_app.tsx
+++ b/services-js/registry-certs/pages/_app.tsx
@@ -88,6 +88,7 @@ export interface PageDependencies extends GetInitialPropsDependencies {
routerListener: RouterListener;
orderProvider: OrderProvider;
siteAnalytics: GaSiteAnalytics;
+ completedSteps: Set | null;
}
// It’s important to cache the dependencies passed to getInitialProps because
@@ -180,6 +181,7 @@ export default class RegistryCertsApp extends App {
stripe,
checkoutDao: new CheckoutDao(fetchGraphql, stripe),
marriageIntentionDao: new MarriageIntentionDao(fetchGraphql),
+ completedSteps: null,
routerListener: new RouterListener(),
screenReaderSupport: new ScreenReaderSupport(),
siteAnalytics,
diff --git a/services-js/registry-certs/server/graphql/mutation.ts b/services-js/registry-certs/server/graphql/mutation.ts
index 2323b28fe..e747ac83e 100644
--- a/services-js/registry-certs/server/graphql/mutation.ts
+++ b/services-js/registry-certs/server/graphql/mutation.ts
@@ -429,7 +429,6 @@ const mutationResolvers: Resolvers = {
{ registryDb }
): Promise => {
console.log('mutation > submitMarriageIntentionCertificateOrder:');
- // console.log(rollbar, stripe, emails, registryDb);
const {
Email,
DayPhone,
diff --git a/services-js/registry-certs/server/services/RegistryDb.ts b/services-js/registry-certs/server/services/RegistryDb.ts
index 5a2facd6a..ac0c7a435 100644
--- a/services-js/registry-certs/server/services/RegistryDb.ts
+++ b/services-js/registry-certs/server/services/RegistryDb.ts
@@ -15,7 +15,6 @@ import {
import RegistryDbFake from './RegistryDbFake';
import { AnnotatedFilePart, PACKAGE_SRC_ROOT } from '../util';
-// import { COUNTRIES } from '../../client/marriageintention/forms/inputData';
export const COUNTRIES = [
{
label: 'United States of America',
diff --git a/services-js/registry-certs/templates/stylesheets.json b/services-js/registry-certs/templates/stylesheets.json
index 4e5700798..302e7e0b7 100644
--- a/services-js/registry-certs/templates/stylesheets.json
+++ b/services-js/registry-certs/templates/stylesheets.json
@@ -1,3 +1,3 @@
[
- "https://patterns.boston.gov/css/public.css"
+ "https://patterns-stg.boston.gov/css/public.css"
]
\ No newline at end of file
diff --git a/services-js/registry-certs/utils/data.ts b/services-js/registry-certs/utils/data.ts
new file mode 100644
index 000000000..f0690a96f
--- /dev/null
+++ b/services-js/registry-certs/utils/data.ts
@@ -0,0 +1,404 @@
+export const COUNTRIES = [
+ {
+ label: 'United States of America',
+ shortLabel: 'USA',
+ value: 'USA',
+ },
+ {
+ label: 'United States Virgin Islands',
+ shortLabel: 'Virgin Islands',
+ value: 'VIR',
+ },
+ { label: 'Afghanistan', value: 'AFG' },
+ {
+ label: 'Åland Islands',
+ shortLabel: 'Aland Islands',
+ value: 'ALA',
+ },
+ { label: 'Albania', value: 'ALB' },
+ { label: 'Algeria', value: 'DZA' },
+ { label: 'American Samoa', value: 'ASM' },
+ { label: 'Andorra', value: 'AND' },
+ { label: 'Angola', value: 'AGO' },
+ { label: 'Anguilla', value: 'AIA' },
+ { label: 'Antigua and Barbuda', value: 'ATG' },
+ { label: 'Argentina', value: 'ARG' },
+ { label: 'Armenia', value: 'ARM' },
+ { label: 'Aruba', value: 'ABW' },
+ { label: 'Australia', value: 'AUS' },
+ { label: 'Austria', value: 'AUT' },
+ { label: 'Azerbaijan', value: 'AZE' },
+ { label: 'Bahamas', value: 'BHS' },
+ { label: 'Bahrain', value: 'BHR' },
+ { label: 'Bangladesh', value: 'BGD' },
+ { label: 'Barbados', value: 'BRB' },
+ { label: 'Belarus', value: 'BLR' },
+ { label: 'Belgium', value: 'BEL' },
+ { label: 'Belize', value: 'BLZ' },
+ { label: 'Benin', value: 'BEN' },
+ { label: 'Bermuda', value: 'BMU' },
+ { label: 'Bhutan', value: 'BTN' },
+ {
+ label: 'Bolivia (Plurinational State of)',
+ shortLabel: 'Bolivia',
+ value: 'BOL',
+ },
+ {
+ label: 'Bonaire, Saint Eustatius and Saba',
+ shortLabel: 'Bonaire',
+ value: 'BES',
+ },
+ { label: 'Bosnia and Herzegovina', value: 'BIH' },
+ { label: 'Botswana', value: 'BWA' },
+ { label: 'Brazil', value: 'BRA' },
+ { label: 'British Virgin Islands', value: 'VGB' },
+ { label: 'Brunei Darussalam', value: 'BRN' },
+ { label: 'Bulgaria', value: 'BGR' },
+ { label: 'Burkina Faso', value: 'BFA' },
+ { label: 'Burundi', value: 'BDI' },
+ { label: 'Cabo Verde', value: 'CPV' },
+ { label: 'Cambodia', value: 'KHM' },
+ { label: 'Cameroon', value: 'CMR' },
+ { label: 'Canada', value: 'CAN' },
+ { label: 'Cayman Islands', value: 'CYM' },
+ { label: 'Central African Republic', value: 'CAF' },
+ { label: 'Chad', value: 'TCD' },
+ { label: 'Chile', value: 'CHL' },
+ { label: 'China', value: 'CHN' },
+ {
+ label: 'China, Hong Kong Special Administrative Region',
+ shortLabel: 'China',
+ value: 'HKG',
+ },
+ {
+ label: 'China, Macao Special Administrative Region',
+ shortLabel: 'Macao',
+ value: 'MAC',
+ },
+ { label: 'Colombia', value: 'COL' },
+ { label: 'Comoros', value: 'COM' },
+ { label: 'Congo', value: 'COG' },
+ { label: 'Cook Islands', value: 'COK' },
+ { label: 'Costa Rica', value: 'CRI' },
+ { label: "Côte d'Ivoire", value: 'CIV' },
+ { label: 'Croatia', value: 'HRV' },
+ { label: 'Cuba', value: 'CUB' },
+ { label: 'Curaçao', value: 'CUW' },
+ { label: 'Cyprus', value: 'CYP' },
+ { label: 'Czech Republic', value: 'CZE' },
+ {
+ label: "Democratic People's Republic of Korea",
+ shortLabel: 'North Korea',
+ value: 'PRK',
+ },
+ {
+ label: 'Democratic Republic of the Congo',
+ shortLabel: 'Congo',
+ value: 'COD',
+ },
+ { label: 'Denmark', value: 'DNK' },
+ { label: 'Djibouti', value: 'DJI' },
+ { label: 'Dominica', value: 'DMA' },
+ { label: 'Dominican Republic', value: 'DOM' },
+ { label: 'Ecuador', value: 'ECU' },
+ { label: 'Egypt', value: 'EGY' },
+ { label: 'El Salvador', value: 'SLV' },
+ { label: 'Equatorial Guinea', value: 'GNQ' },
+ { label: 'Eritrea', value: 'ERI' },
+ { label: 'Estonia', value: 'EST' },
+ { label: 'Ethiopia', value: 'ETH' },
+ { label: 'Faeroe Islands', value: 'FRO' },
+ {
+ label: 'Falkland Islands (Malvinas)',
+ shortLabel: 'Falkland Islands',
+ value: 'FLK',
+ },
+ { label: 'Fiji', value: 'FJI' },
+ { label: 'Finland', value: 'FIN' },
+ { label: 'France', value: 'FRA' },
+ { label: 'French Guiana', value: 'GUF' },
+ { label: 'French Polynesia', value: 'PYF' },
+ { label: 'Gabon', value: 'GAB' },
+ { label: 'Gambia', value: 'GMB' },
+ { label: 'Georgia', value: 'GEO' },
+ { label: 'Germany', value: 'DEU' },
+ { label: 'Ghana', value: 'GHA' },
+ { label: 'Gibraltar', value: 'GIB' },
+ { label: 'Greece', value: 'GRC' },
+ { label: 'Greenland', value: 'GRL' },
+ { label: 'Grenada', value: 'GRD' },
+ { label: 'Guadeloupe', value: 'GLP' },
+ { label: 'Guam', value: 'GUM' },
+ { label: 'Guatemala', value: 'GTM' },
+ { label: 'Guernsey', value: 'GGY' },
+ { label: 'Guinea', value: 'GIN' },
+ { label: 'Guinea-Bissau', value: 'GNB' },
+ { label: 'Guyana', value: 'GUY' },
+ { label: 'Haiti', value: 'HTI' },
+ { label: 'Holy See', value: 'VAT' },
+ { label: 'Honduras', value: 'HND' },
+ { label: 'Hungary', value: 'HUN' },
+ { label: 'Iceland', value: 'ISL' },
+ { label: 'India', value: 'IND' },
+ { label: 'Indonesia', value: 'IDN' },
+ {
+ label: 'Iran (Islamic Republic of)',
+ shortLabel: 'Iran',
+ value: 'IRN',
+ },
+ { label: 'Iraq', value: 'IRQ' },
+ { label: 'Ireland', value: 'IRL' },
+ { label: 'Isle of Man', value: 'IMN' },
+ { label: 'Israel', value: 'ISR' },
+ { label: 'Italy', value: 'ITA' },
+ { label: 'Jamaica', value: 'JAM' },
+ { label: 'Japan', value: 'JPN' },
+ { label: 'Jersey', value: 'JEY' },
+ { label: 'Jordan', value: 'JOR' },
+ { label: 'Kazakhstan', value: 'KAZ' },
+ { label: 'Kenya', value: 'KEN' },
+ { label: 'Kiribati', value: 'KIR' },
+ { label: 'Kuwait', value: 'KWT' },
+ { label: 'Kyrgyzstan', value: 'KGZ' },
+ {
+ label: "Lao People's Democratic Republic",
+ shortLabel: 'Lao',
+ value: 'LAO',
+ },
+ { label: 'Latvia', value: 'LVA' },
+ { label: 'Lebanon', value: 'LBN' },
+ { label: 'Lesotho', value: 'LSO' },
+ { label: 'Liberia', value: 'LBR' },
+ { label: 'Libya', value: 'LBY' },
+ { label: 'Liechtenstein', value: 'LIE' },
+ { label: 'Lithuania', value: 'LTU' },
+ { label: 'Luxembourg', value: 'LUX' },
+ { label: 'Madagascar', value: 'MDG' },
+ { label: 'Malawi', value: 'MWI' },
+ { label: 'Malaysia', value: 'MYS' },
+ { label: 'Maldives', value: 'MDV' },
+ { label: 'Mali', value: 'MLI' },
+ { label: 'Malta', value: 'MLT' },
+ { label: 'Marshall Islands', value: 'MHL' },
+ { label: 'Martinique', value: 'MTQ' },
+ { label: 'Mauritania', value: 'MRT' },
+ { label: 'Mauritius', value: 'MUS' },
+ { label: 'Mayotte', value: 'MYT' },
+ { label: 'Mexico', value: 'MEX' },
+ {
+ label: 'Micronesia (Federated States of)',
+ shortLabel: 'Micronesia',
+ value: 'FSM',
+ },
+ { label: 'Monaco', value: 'MCO' },
+ { label: 'Mongolia', value: 'MNG' },
+ { label: 'Montenegro', value: 'MNE' },
+ { label: 'Montserrat', value: 'MSR' },
+ { label: 'Morocco', value: 'MAR' },
+ { label: 'Mozambique', value: 'MOZ' },
+ { label: 'Myanmar', value: 'MMR' },
+ { label: 'Namibia', value: 'NAM' },
+ { label: 'Nauru', value: 'NRU' },
+ { label: 'Nepal', value: 'NPL' },
+ { label: 'Netherlands', value: 'NLD' },
+ { label: 'New Caledonia', value: 'NCL' },
+ { label: 'New Zealand', value: 'NZL' },
+ { label: 'Nicaragua', value: 'NIC' },
+ { label: 'Niger', value: 'NER' },
+ { label: 'Nigeria', value: 'NGA' },
+ { label: 'Niue', value: 'NIU' },
+ { label: 'Norfolk Island', value: 'NFK' },
+ {
+ label: 'Northern Mariana Islands',
+ shortLabel: 'Mariana Islands',
+ value: 'MNP',
+ },
+ { label: 'Norway', value: 'NOR' },
+ { label: 'Oman', value: 'OMN' },
+ { label: 'Pakistan', value: 'PAK' },
+ { label: 'Palau', value: 'PLW' },
+ { label: 'Panama', value: 'PAN' },
+ { label: 'Papua New Guinea', value: 'PNG' },
+ { label: 'Paraguay', value: 'PRY' },
+ { label: 'Peru', value: 'PER' },
+ { label: 'Philippines', value: 'PHL' },
+ { label: 'Pitcairn', value: 'PCN' },
+ { label: 'Poland', value: 'POL' },
+ { label: 'Portugal', value: 'PRT' },
+ { label: 'Puerto Rico', value: 'PRI' },
+ { label: 'Qatar', value: 'QAT' },
+ { label: 'Republic of Korea', value: 'KOR' },
+ {
+ label: 'Republic of Moldova',
+ shortLabel: 'Moldova',
+ value: 'MDA',
+ },
+ { label: 'Réunion', value: 'REU' },
+ { label: 'Romania', value: 'ROU' },
+ { label: 'Russian Federation', value: 'RUS' },
+ { label: 'Rwanda', value: 'RWA' },
+ { label: 'Saint-Barthélemy', value: 'BLM' },
+ { label: 'Saint Helena', value: 'SHN' },
+ { label: 'Saint Kitts and Nevis', value: 'KNA' },
+ { label: 'Saint Lucia', value: 'LCA' },
+ {
+ label: 'Saint-Martin (French part)',
+ shortLabel: 'Saint-Martin',
+ value: 'MAF',
+ },
+ { label: 'Saint Pierre and Miquelon', value: 'SPM' },
+ {
+ label: 'Saint Vincent and the Grenadines',
+ value: 'VCT',
+ },
+ { label: 'Samoa', value: 'WSM' },
+ { label: 'San Marino', value: 'SMR' },
+ { label: 'Sao Tome and Principe', value: 'STP' },
+ { label: 'Saudi Arabia', value: 'SAU' },
+ { label: 'Senegal', value: 'SEN' },
+ { label: 'Serbia', value: 'SRB' },
+ { label: 'Seychelles', value: 'SYC' },
+ { label: 'Sierra Leone', value: 'SLE' },
+ { label: 'Singapore', value: 'SGP' },
+ {
+ label: 'Sint Maarten (Dutch part)',
+ shortLabel: 'Sint Maarten',
+ value: 'SXM',
+ },
+ { label: 'Slovakia', value: 'SVK' },
+ { label: 'Slovenia', value: 'SVN' },
+ { label: 'Solomon Islands', value: 'SLB' },
+ { label: 'Somalia', value: 'SOM' },
+ { label: 'South Africa', value: 'ZAF' },
+ { label: 'South Sudan', value: 'SSD' },
+ { label: 'Spain', value: 'ESP' },
+ { label: 'Sri Lanka', value: 'LKA' },
+ {
+ label: 'State of Palestine',
+ shortLabel: 'Palestine',
+ value: 'PSE',
+ },
+ { label: 'Sudan', value: 'SDN' },
+ { label: 'Suriname', value: 'SUR' },
+ {
+ label: 'Svalbard and Jan Mayen Islands',
+ shortLabel: 'Svalbard',
+ value: 'SJM',
+ },
+ { label: 'Swaziland', value: 'SWZ' },
+ { label: 'Sweden', value: 'SWE' },
+ { label: 'Switzerland', value: 'CHE' },
+ { label: 'Syrian Arab Republic', value: 'SYR' },
+ { label: 'Taiwan', value: 'TWAN' },
+ { label: 'Tajikistan', value: 'TJK' },
+ { label: 'Thailand', value: 'THA' },
+ {
+ label: 'The former Yugoslav Republic of Macedonia',
+ shortLabel: 'Macedonia',
+ value: 'MKD',
+ },
+ { label: 'Timor-Leste', value: 'TLS' },
+ { label: 'Togo', value: 'TGO' },
+ { label: 'Tokelau', value: 'TKL' },
+ { label: 'Tonga', value: 'TON' },
+ { label: 'Trinidad and Tobago', value: 'TTO' },
+ { label: 'Tunisia', value: 'TUN' },
+ { label: 'Turkey', value: 'TUR' },
+ { label: 'Turkmenistan', value: 'TKM' },
+ {
+ label: 'Turks and Caicos Islands',
+ shortLabel: 'Turks & Caicos',
+ value: 'TCA',
+ },
+ { label: 'Tuvalu', value: 'TUV' },
+ { label: 'Uganda', value: 'UGA' },
+ { label: 'Ukraine', value: 'UKR' },
+ {
+ label: 'United Arab Emirates',
+ shortLabel: 'UAE',
+ value: 'ARE',
+ },
+ {
+ label: 'United Kingdom of Great Britain and Northern Ireland',
+ shortLabel: 'United Kingdom',
+ value: 'GBR',
+ },
+ {
+ label: 'United Republic of Tanzania',
+ shortLabel: 'United Republic of Tanzania',
+ value: 'TZA',
+ },
+ { label: 'Uruguay', value: 'URY' },
+ { label: 'Uzbekistan', value: 'UZB' },
+ { label: 'Vanuatu', value: 'VUT' },
+ {
+ label: 'Venezuela (Bolivarian Republic of)',
+ shortLabel: 'Venezuela',
+ value: 'VEN',
+ },
+ { label: 'Vietnam', value: 'VNM' },
+ {
+ label: 'Wallis and Futuna Islands',
+ shortLabel: 'Wallis',
+ value: 'WLF',
+ },
+ { label: 'Western Sahara', value: 'ESH' },
+ { label: 'Yemen', value: 'YEM' },
+ { label: 'Zambia', value: 'ZMB' },
+ { label: 'Zimbabwe', value: 'ZWE' },
+];
+
+export const US_STATES = [
+ { label: '--', value: '', field: '' },
+ { label: 'AL', value: 'AL', field: '' },
+ { label: 'AK', value: 'AK', field: '' },
+ { label: 'AZ', value: 'AZ', field: '' },
+ { label: 'AR', value: 'AR', field: '' },
+ { label: 'CA', value: 'CA', field: '' },
+ { label: 'CO', value: 'CO', field: '' },
+ { label: 'CT', value: 'CT', field: '' },
+ { label: 'DE', value: 'DE', field: '' },
+ { label: 'DC', value: 'DC', field: '' },
+ { label: 'FL', value: 'FL', field: '' },
+ { label: 'GA', value: 'GA', field: '' },
+ { label: 'HI', value: 'HI', field: '' },
+ { label: 'ID', value: 'ID', field: '' },
+ { label: 'IL', value: 'IL', field: '' },
+ { label: 'IN', value: 'IN', field: '' },
+ { label: 'IA', value: 'IA', field: '' },
+ { label: 'KS', value: 'KS', field: '' },
+ { label: 'KY', value: 'KY', field: '' },
+ { label: 'LA', value: 'LA', field: '' },
+ { label: 'ME', value: 'ME', field: '' },
+ { label: 'MD', value: 'MD', field: '' },
+ { label: 'MA', value: 'MA', field: '' },
+ { label: 'MI', value: 'MI', field: '' },
+ { label: 'MN', value: 'MN', field: '' },
+ { label: 'MS', value: 'MS', field: '' },
+ { label: 'MO', value: 'MO', field: '' },
+ { label: 'MT', value: 'MT', field: '' },
+ { label: 'NE', value: 'NE', field: '' },
+ { label: 'NV', value: 'NV', field: '' },
+ { label: 'NH', value: 'NH', field: '' },
+ { label: 'NJ', value: 'NJ', field: '' },
+ { label: 'NM', value: 'NM', field: '' },
+ { label: 'NY', value: 'NY', field: '' },
+ { label: 'NC', value: 'NC', field: '' },
+ { label: 'ND', value: 'ND', field: '' },
+ { label: 'OH', value: 'OH', field: '' },
+ { label: 'OK', value: 'OK', field: '' },
+ { label: 'OR', value: 'OR', field: '' },
+ { label: 'PA', value: 'PA', field: '' },
+ { label: 'RI', value: 'RI', field: '' },
+ { label: 'SC', value: 'SC', field: '' },
+ { label: 'SD', value: 'SD', field: '' },
+ { label: 'TN', value: 'TN', field: '' },
+ { label: 'TX', value: 'TX', field: '' },
+ { label: 'UT', value: 'UT', field: '' },
+ { label: 'VT', value: 'VT', field: '' },
+ { label: 'VA', value: 'VA', field: '' },
+ { label: 'WA', value: 'WA', field: '' },
+ { label: 'WV', value: 'WV', field: '' },
+ { label: 'WI', value: 'WI', field: '' },
+ { label: 'WY', value: 'WY', field: '' },
+];