@sheerid/jslib 1.130.0 → 1.132.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es5/Tmetrix.bundle.js +5 -5
- package/es5/messages_ar.bundle.js +4 -4
- package/es5/messages_bg.bundle.js +4 -4
- package/es5/messages_cs.bundle.js +4 -4
- package/es5/messages_da.bundle.js +4 -4
- package/es5/messages_de.bundle.js +4 -4
- package/es5/messages_el.bundle.js +4 -4
- package/es5/messages_en-GB.bundle.js +4 -4
- package/es5/messages_es-ES.bundle.js +4 -4
- package/es5/messages_es.bundle.js +4 -4
- package/es5/messages_fi.bundle.js +4 -4
- package/es5/messages_fr-CA.bundle.js +4 -4
- package/es5/messages_fr.bundle.js +4 -4
- package/es5/messages_ga.bundle.js +4 -4
- package/es5/messages_hr.bundle.js +4 -4
- package/es5/messages_hu.bundle.js +4 -4
- package/es5/messages_id.bundle.js +4 -4
- package/es5/messages_it.bundle.js +4 -4
- package/es5/messages_iw.bundle.js +4 -4
- package/es5/messages_ja.bundle.js +4 -4
- package/es5/messages_ko.bundle.js +4 -4
- package/es5/messages_lo.bundle.js +4 -4
- package/es5/messages_lt.bundle.js +4 -4
- package/es5/messages_ms.bundle.js +4 -4
- package/es5/messages_nl.bundle.js +4 -4
- package/es5/messages_no.bundle.js +4 -4
- package/es5/messages_pl.bundle.js +4 -4
- package/es5/messages_pt-BR.bundle.js +4 -4
- package/es5/messages_pt.bundle.js +4 -4
- package/es5/messages_ru.bundle.js +4 -4
- package/es5/messages_sk.bundle.js +4 -4
- package/es5/messages_sl.bundle.js +4 -4
- package/es5/messages_sr.bundle.js +4 -4
- package/es5/messages_sv.bundle.js +4 -4
- package/es5/messages_th.bundle.js +4 -4
- package/es5/messages_tr.bundle.js +4 -4
- package/es5/messages_zh-HK.bundle.js +4 -4
- package/es5/messages_zh.bundle.js +4 -4
- package/manifest.json +48 -48
- package/package.json +1 -1
- package/sheerid-requestOrg.css +5 -5
- package/sheerid-requestOrg.css.map +1 -1
- package/sheerid-requestOrg.js +10 -10
- package/sheerid-requestOrg.js.map +1 -1
- package/sheerid-utils.js +8 -8
- package/sheerid-utils.js.map +1 -1
- package/sheerid.css +5 -5
- package/sheerid.css.map +1 -1
- package/sheerid.js +17 -17
- package/sheerid.js.map +1 -1
- package/sheerides6.js +113 -136
- package/sheerides6.js.map +1 -1
- package/src/components/DateComponent/DateComponent.d.ts +14 -0
- package/src/components/FormFields/ActiveDutyStartDate/ActiveDutyStartDateComponent.d.ts +2 -0
- package/src/components/FormFields/BirthDate/BirthDateComponent.d.ts +1 -11
- package/src/components/FormFields/DischargeDate/DischargeDateComponent.d.ts +1 -11
- package/src/lib/types/runtimeTypes.d.ts +3 -1
- package/src/lib/types/types.d.ts +27 -5
- package/types-reference.zip +0 -0
package/sheerides6.js
CHANGED
|
@@ -526,6 +526,7 @@ var VerificationStepsEnum;
|
|
|
526
526
|
VerificationStepsEnum["consolation"] = "consolation";
|
|
527
527
|
VerificationStepsEnum["override"] = "override";
|
|
528
528
|
VerificationStepsEnum["cancelDocUpload"] = "cancelDocUpload";
|
|
529
|
+
VerificationStepsEnum["missingRequiredMetadata"] = "missingRequiredMetadata";
|
|
529
530
|
})(VerificationStepsEnum || (VerificationStepsEnum = {}));
|
|
530
531
|
const VerificationSteps = Object.values(VerificationStepsEnum); // For runtime checks
|
|
531
532
|
// This depends on all collect steps starting with the string 'collect' if that
|
|
@@ -666,6 +667,7 @@ var FieldIdEnum;
|
|
|
666
667
|
FieldIdEnum["country"] = "country";
|
|
667
668
|
FieldIdEnum["state"] = "state";
|
|
668
669
|
FieldIdEnum["dischargeDate"] = "dischargeDate";
|
|
670
|
+
FieldIdEnum["activeDutyStartDate"] = "activeDutyStartDate";
|
|
669
671
|
FieldIdEnum["docUpload"] = "docUpload";
|
|
670
672
|
FieldIdEnum["status"] = "status";
|
|
671
673
|
FieldIdEnum["statuses"] = "statuses";
|
|
@@ -1382,6 +1384,10 @@ const setOptions = (newOptions) => {
|
|
|
1382
1384
|
options$1.customFormFields = newOptions.customFormFields;
|
|
1383
1385
|
logger.info('option "customFormFields" set to', options$1.customFormFields);
|
|
1384
1386
|
}
|
|
1387
|
+
if (newOptions.hasOwnProperty("customMetadata")) {
|
|
1388
|
+
options$1.customMetadata = newOptions.customMetadata;
|
|
1389
|
+
logger.info('option "customMetadata" set to', options$1.customMetadata);
|
|
1390
|
+
}
|
|
1385
1391
|
};
|
|
1386
1392
|
|
|
1387
1393
|
class ResponseTimeLogger {
|
|
@@ -3236,19 +3242,20 @@ const defaultMarketConsent = {
|
|
|
3236
3242
|
const defaultMetadata$1 = Object.freeze({
|
|
3237
3243
|
enabled: false,
|
|
3238
3244
|
keys: [],
|
|
3245
|
+
requiredKeys: [],
|
|
3239
3246
|
});
|
|
3240
3247
|
const getMetadataConfig = (programTheme) => {
|
|
3241
3248
|
let customMetadata = deepClone(defaultMetadata$1);
|
|
3242
3249
|
try {
|
|
3243
3250
|
if (getSafe(() => programTheme.config.customMetadata.enabled)) {
|
|
3244
|
-
customMetadata = programTheme.config.customMetadata;
|
|
3251
|
+
customMetadata = { ...customMetadata, ...programTheme.config.customMetadata };
|
|
3245
3252
|
}
|
|
3246
3253
|
}
|
|
3247
3254
|
catch (e) {
|
|
3248
3255
|
logger.warn("No custom metadata provided by the server.");
|
|
3249
3256
|
}
|
|
3250
3257
|
if (getOptions().customMetadata) {
|
|
3251
|
-
customMetadata = getOptions().customMetadata;
|
|
3258
|
+
customMetadata = { ...customMetadata, ...getOptions().customMetadata };
|
|
3252
3259
|
}
|
|
3253
3260
|
return customMetadata;
|
|
3254
3261
|
};
|
|
@@ -3532,6 +3539,7 @@ const activeMilitaryPInfoReqEmpty = {
|
|
|
3532
3539
|
...withLocaleAndCountryEmpty,
|
|
3533
3540
|
...withFieldsToSkipValidationEmpty,
|
|
3534
3541
|
...blankOrganization,
|
|
3542
|
+
activeDutyStartDate: "",
|
|
3535
3543
|
birthDate: "",
|
|
3536
3544
|
status: undefined,
|
|
3537
3545
|
metadata: {
|
|
@@ -3544,6 +3552,7 @@ const inactiveMilitaryPInfoReqEmpty = {
|
|
|
3544
3552
|
...withLocaleAndCountryEmpty,
|
|
3545
3553
|
...withFieldsToSkipValidationEmpty,
|
|
3546
3554
|
...blankOrganization,
|
|
3555
|
+
activeDutyStartDate: "",
|
|
3547
3556
|
birthDate: "",
|
|
3548
3557
|
dischargeDate: "",
|
|
3549
3558
|
status: undefined,
|
|
@@ -3714,6 +3723,7 @@ const initialErrorStructure = {
|
|
|
3714
3723
|
city: undefined,
|
|
3715
3724
|
country: undefined,
|
|
3716
3725
|
state: undefined,
|
|
3726
|
+
activeDutyStartDate: undefined,
|
|
3717
3727
|
dischargeDate: undefined,
|
|
3718
3728
|
docUpload: undefined,
|
|
3719
3729
|
status: undefined,
|
|
@@ -3758,6 +3768,7 @@ const getAllEmptyViewModels = () => ({
|
|
|
3758
3768
|
cancelSocialSecurityNumber: deepClone(emptyViewModel),
|
|
3759
3769
|
docReviewLimitExceeded: deepClone(emptyViewModel),
|
|
3760
3770
|
cancelDocUpload: deepClone(emptyViewModel),
|
|
3771
|
+
missingRequiredMetadata: deepClone(emptyViewModel),
|
|
3761
3772
|
});
|
|
3762
3773
|
const getFieldValidationErrorsEmpty = () => deepClone(initialErrorStructure);
|
|
3763
3774
|
const getExtendedFieldValidationErrorsEmpty = () => {
|
|
@@ -4535,20 +4546,36 @@ const getStateValidationError = (value) => {
|
|
|
4535
4546
|
return invalidError;
|
|
4536
4547
|
}
|
|
4537
4548
|
};
|
|
4549
|
+
const existsAndIsValidDate = (value) => value !== undefined && isValidDateFormat(value) && isValidDate(value);
|
|
4550
|
+
const isBeforeBirthdate = (value, vm) => {
|
|
4551
|
+
const date = new Date(value);
|
|
4552
|
+
const birthDate = new Date(vm.birthDate);
|
|
4553
|
+
return date < birthDate;
|
|
4554
|
+
};
|
|
4538
4555
|
const getDischargeDateValidationError = (value, formValidationOptions) => {
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
const dischargeDateBeforeBirthDate = "dischargeDateBeforeBirthDate";
|
|
4542
|
-
if (value === undefined || !isValidDateFormat(value) || !isValidDate(value)) {
|
|
4543
|
-
return invalidDischargeDate;
|
|
4556
|
+
if (!existsAndIsValidDate(value)) {
|
|
4557
|
+
return "invalidDischargeDate";
|
|
4544
4558
|
}
|
|
4545
4559
|
if (isFutureDate(value)) {
|
|
4546
|
-
return futureDischargeDate;
|
|
4560
|
+
return "futureDischargeDate";
|
|
4547
4561
|
}
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4562
|
+
if (isBeforeBirthdate(value, formValidationOptions.viewModel)) {
|
|
4563
|
+
return "dischargeDateBeforeBirthDate";
|
|
4564
|
+
}
|
|
4565
|
+
};
|
|
4566
|
+
const getActiveDutyStartDateValidationError = (value, formValidationOptions) => {
|
|
4567
|
+
if (!value && !formValidationOptions.strictMilitaryValidationEnabled) {
|
|
4568
|
+
// a falsey value is valid unless strictMilitaryValidation is enabled.
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4571
|
+
if (!existsAndIsValidDate(value)) {
|
|
4572
|
+
return "invalidActiveDutyStartDate";
|
|
4573
|
+
}
|
|
4574
|
+
if (isFutureDate(value)) {
|
|
4575
|
+
return "futureActiveDutyStartDate";
|
|
4576
|
+
}
|
|
4577
|
+
if (isBeforeBirthdate(value, formValidationOptions.viewModel)) {
|
|
4578
|
+
return "activeDutyStartDateBeforeBirthDate";
|
|
4552
4579
|
}
|
|
4553
4580
|
};
|
|
4554
4581
|
const getSsnValidationError = (value) => {
|
|
@@ -4773,6 +4800,9 @@ const validateFieldById = (fieldId, value, formValidationOptions) => {
|
|
|
4773
4800
|
case FieldIdEnum.dischargeDate:
|
|
4774
4801
|
defaultValidator = getDischargeDateValidationError;
|
|
4775
4802
|
return getValidationError(fieldId, value, defaultValidator, overriddenValidator, formValidationOptions);
|
|
4803
|
+
case FieldIdEnum.activeDutyStartDate:
|
|
4804
|
+
defaultValidator = getActiveDutyStartDateValidationError;
|
|
4805
|
+
return getValidationError(fieldId, value, defaultValidator, overriddenValidator, formValidationOptions);
|
|
4776
4806
|
case FieldIdEnum.socialSecurityNumber:
|
|
4777
4807
|
defaultValidator = getSsnValidationError;
|
|
4778
4808
|
return getValidationError(fieldId, value, defaultValidator, overriddenValidator, formValidationOptions);
|
|
@@ -11121,6 +11151,7 @@ const allMockedResponses = {
|
|
|
11121
11151
|
collectMedicalProfessionalPersonalInfo: mockMedicalProfessionalPersonalInfoResponse,
|
|
11122
11152
|
cancelSocialSecurityNumber: {},
|
|
11123
11153
|
cancelDocUpload: mockCancelDocUploadResponse,
|
|
11154
|
+
missingRequiredMetadata: mockErrorResponse,
|
|
11124
11155
|
};
|
|
11125
11156
|
|
|
11126
11157
|
/**
|
|
@@ -11855,6 +11886,7 @@ const activeMilitaryViewModelToRequest = (viewModel) => ({
|
|
|
11855
11886
|
firstName: viewModel.firstName,
|
|
11856
11887
|
lastName: viewModel.lastName,
|
|
11857
11888
|
birthDate: viewModel.birthDate,
|
|
11889
|
+
activeDutyStartDate: viewModel.activeDutyStartDate || undefined,
|
|
11858
11890
|
email: viewModel.email,
|
|
11859
11891
|
phoneNumber: viewModel.phoneNumber,
|
|
11860
11892
|
organization: viewModel.organization,
|
|
@@ -11868,6 +11900,7 @@ const inactiveMilitaryViewModelToRequest = (viewModel) => ({
|
|
|
11868
11900
|
firstName: viewModel.firstName,
|
|
11869
11901
|
lastName: viewModel.lastName,
|
|
11870
11902
|
birthDate: viewModel.birthDate,
|
|
11903
|
+
activeDutyStartDate: viewModel.activeDutyStartDate || undefined,
|
|
11871
11904
|
email: viewModel.email,
|
|
11872
11905
|
phoneNumber: viewModel.phoneNumber,
|
|
11873
11906
|
organization: viewModel.organization,
|
|
@@ -14200,6 +14233,7 @@ const createFetchVerificationRequest = async ({ dispatch, verificationResponsePr
|
|
|
14200
14233
|
dispatch({ type: "IS_LOADING", isLoading: false }),
|
|
14201
14234
|
dispatch({ orgList, type: "PRE_LOAD_ORGS" }),
|
|
14202
14235
|
dispatch({ type: "FORM_VALIDATION_OPTIONS" }),
|
|
14236
|
+
dispatch({ type: "REQUIRED_METADATA_CHECK" }),
|
|
14203
14237
|
]).then(() => {
|
|
14204
14238
|
getHook("ON_VERIFICATION_READY")(verificationResponse);
|
|
14205
14239
|
// This hook is a special case
|
|
@@ -14868,10 +14902,21 @@ const verificationServiceReducer = (state = getInitialState(), action) => {
|
|
|
14868
14902
|
maxAge: state.verificationResponse.maxAge || state.programTheme.config.maxAge,
|
|
14869
14903
|
minAge: state.verificationResponse.minAge || state.programTheme.config.minAge,
|
|
14870
14904
|
smsLoopEnabled: state.programTheme.smsLoopEnabled,
|
|
14905
|
+
strictMilitaryValidationEnabled: state.programTheme.strictMilitaryValidationEnabled,
|
|
14871
14906
|
currentStep: state.verificationResponse.currentStep,
|
|
14872
14907
|
viewModel: state.viewModel,
|
|
14873
14908
|
},
|
|
14874
14909
|
};
|
|
14910
|
+
case "REQUIRED_METADATA_CHECK":
|
|
14911
|
+
const metadataConfig = getMetadataConfig(state.programTheme);
|
|
14912
|
+
const metadata = getMetadata();
|
|
14913
|
+
return {
|
|
14914
|
+
...state,
|
|
14915
|
+
overrideStep: metadataConfig.enabled &&
|
|
14916
|
+
!(metadataConfig.requiredKeys || []).every((k) => metadata.hasOwnProperty(k))
|
|
14917
|
+
? "missingRequiredMetadata"
|
|
14918
|
+
: undefined,
|
|
14919
|
+
};
|
|
14875
14920
|
case "IS_LOADING":
|
|
14876
14921
|
return {
|
|
14877
14922
|
...state,
|
|
@@ -16953,12 +16998,14 @@ const formatTwoDigitValues = (value) => {
|
|
|
16953
16998
|
}
|
|
16954
16999
|
};
|
|
16955
17000
|
|
|
16956
|
-
const
|
|
16957
|
-
const
|
|
16958
|
-
const
|
|
16959
|
-
const
|
|
16960
|
-
const
|
|
16961
|
-
|
|
17001
|
+
const DateInput = ({ onChange, intl, isErrored, isRequired = true, value = "2000-01-01", errorMsg, label, fieldName, fieldId, mode = "date", }) => {
|
|
17002
|
+
const cssId = `sid-${fieldId}`;
|
|
17003
|
+
const dateParts = value.split("-");
|
|
17004
|
+
const dateYear = Number.parseInt(dateParts[0], 10) || undefined;
|
|
17005
|
+
const dateMonth = Number.parseInt(dateParts[1], 10) || undefined;
|
|
17006
|
+
// Default day to 1 if in month mode (where days are ignored) so that we return valid date strings.
|
|
17007
|
+
const dateDay = mode === "month" ? 1 : Number.parseInt(dateParts[2], 10) || undefined;
|
|
17008
|
+
const minYear = 1900;
|
|
16962
17009
|
const thisYear = new Date().getFullYear();
|
|
16963
17010
|
/* prettier-ignore */
|
|
16964
17011
|
const months = [
|
|
@@ -16976,98 +17023,86 @@ const BirthDate = ({ onChange, intl, isErrored, isRequired = true, errorId, valu
|
|
|
16976
17023
|
{ value: "12", label: intl.formatHTMLMessage({ id: "dateTime.december", defaultMessage: "December" }) },
|
|
16977
17024
|
];
|
|
16978
17025
|
const isDateFieldEmpty = (year, month, day) => (!day || day === "") && (!month || month === "") && (!year || year === "");
|
|
16979
|
-
const
|
|
16980
|
-
if (isDateFieldEmpty(
|
|
17026
|
+
const updateMonth = (month) => {
|
|
17027
|
+
if (isDateFieldEmpty(dateYear, month, dateDay)) {
|
|
16981
17028
|
onChange("");
|
|
16982
17029
|
return;
|
|
16983
17030
|
}
|
|
16984
17031
|
if (month === "" || month === null) {
|
|
16985
|
-
onChange(`${
|
|
17032
|
+
onChange(`${dateYear}--${dateDay}`);
|
|
16986
17033
|
}
|
|
16987
17034
|
const newVal = Number.parseInt(month, 10);
|
|
16988
17035
|
if (typeof newVal === "number" && newVal >= 1 && newVal <= 12) {
|
|
16989
|
-
onChange(`${
|
|
17036
|
+
onChange(`${dateYear}-${formatTwoDigitValues(month)}-${formatTwoDigitValues(dateDay)}`);
|
|
16990
17037
|
}
|
|
16991
17038
|
else {
|
|
16992
|
-
logger.warn(`Value '${newVal}' is an invalid
|
|
17039
|
+
logger.warn(`Value '${newVal}' is an invalid month`);
|
|
16993
17040
|
}
|
|
16994
17041
|
};
|
|
16995
|
-
const
|
|
16996
|
-
if (isDateFieldEmpty(
|
|
17042
|
+
const updateDay = (day) => {
|
|
17043
|
+
if (isDateFieldEmpty(dateYear, dateMonth, day)) {
|
|
16997
17044
|
onChange("");
|
|
16998
17045
|
return;
|
|
16999
17046
|
}
|
|
17000
17047
|
if (day === "") {
|
|
17001
|
-
onChange(`${
|
|
17048
|
+
onChange(`${dateYear}-${dateMonth}-`);
|
|
17002
17049
|
}
|
|
17003
17050
|
const newVal = Number.parseInt(day, 10);
|
|
17004
17051
|
if (typeof newVal === "number" && newVal >= 1 && newVal <= 31) {
|
|
17005
|
-
onChange(`${
|
|
17052
|
+
onChange(`${dateYear}-${formatTwoDigitValues(dateMonth)}-${formatTwoDigitValues(newVal)}`);
|
|
17006
17053
|
}
|
|
17007
17054
|
else {
|
|
17008
|
-
logger.warn(`Value '${newVal}' is an invalid
|
|
17055
|
+
logger.warn(`Value '${newVal}' is an invalid day`);
|
|
17009
17056
|
}
|
|
17010
17057
|
};
|
|
17011
17058
|
const updateBirthYear = (year) => {
|
|
17012
|
-
if (isDateFieldEmpty(year,
|
|
17059
|
+
if (isDateFieldEmpty(year, dateMonth, dateDay)) {
|
|
17013
17060
|
onChange("");
|
|
17014
17061
|
return;
|
|
17015
17062
|
}
|
|
17016
17063
|
if (year === "") {
|
|
17017
|
-
onChange(`-${
|
|
17064
|
+
onChange(`-${dateMonth}-${dateDay}`);
|
|
17018
17065
|
}
|
|
17019
17066
|
const newVal = Number.parseInt(year, 10);
|
|
17020
17067
|
if (typeof newVal === "number" && newVal >= 1 && newVal <= thisYear) {
|
|
17021
|
-
onChange(`${newVal}-${formatTwoDigitValues(
|
|
17068
|
+
onChange(`${newVal}-${formatTwoDigitValues(dateMonth)}-${formatTwoDigitValues(dateDay)}`);
|
|
17022
17069
|
}
|
|
17023
17070
|
else {
|
|
17024
|
-
logger.warn(`Value '${newVal}' is an invalid
|
|
17071
|
+
logger.warn(`Value '${newVal}' is an invalid year`);
|
|
17025
17072
|
}
|
|
17026
17073
|
};
|
|
17027
|
-
const
|
|
17028
|
-
if (!
|
|
17074
|
+
const getDate = () => {
|
|
17075
|
+
if (!dateDay && !dateMonth && !dateYear) {
|
|
17029
17076
|
onChange("");
|
|
17030
17077
|
}
|
|
17031
17078
|
else {
|
|
17032
|
-
onChange(`${
|
|
17079
|
+
onChange(`${dateYear}-${formatTwoDigitValues(dateMonth)}-${formatTwoDigitValues(dateDay)}`);
|
|
17033
17080
|
}
|
|
17034
17081
|
};
|
|
17035
|
-
const monthFieldId =
|
|
17036
|
-
const fieldLabelId =
|
|
17037
|
-
const
|
|
17038
|
-
|
|
17039
|
-
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidBirthDate", defaultMessage: "Invalid birth date" })));
|
|
17040
|
-
const birthDateDayRef = useRef(null);
|
|
17041
|
-
const birthDateYearRef = useRef(null);
|
|
17042
|
-
// NOTE: Dependency array omitted to account for use of resetRef(), as useEffect with dep arr
|
|
17043
|
-
// will only trigger on initial render leaving the refs empty, this replicates prior version
|
|
17044
|
-
// where ref callback would trigger with each re-render
|
|
17045
|
-
useEffect(() => {
|
|
17046
|
-
setRef("birthDateDay", birthDateDayRef.current);
|
|
17047
|
-
setRef("birthDateYear", birthDateYearRef.current);
|
|
17048
|
-
});
|
|
17049
|
-
return (React.createElement("div", { className: "sid-field sid-birthdate" },
|
|
17082
|
+
const monthFieldId = `${cssId}__month`;
|
|
17083
|
+
const fieldLabelId = `${cssId}-label`;
|
|
17084
|
+
const wrappedErrMsg = React.createElement("div", { className: "sid-field-error" }, errorMsg);
|
|
17085
|
+
return (React.createElement("div", { className: `sid-field ${cssId}` },
|
|
17050
17086
|
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
17051
|
-
React.createElement(FieldLabel, { text:
|
|
17087
|
+
React.createElement(FieldLabel, { text: label, htmlForLabel: monthFieldId, id: fieldLabelId, displayClasses: "sid-field__label-with-explanation", isRequired: isRequired },
|
|
17052
17088
|
React.createElement(FormattedHTMLMessage, { id: "verificationPurposesOnly", defaultMessage: "Used for verification purposes only" })),
|
|
17053
|
-
React.createElement("div", { className:
|
|
17054
|
-
React.createElement(InputSelectComponent, { className:
|
|
17089
|
+
React.createElement("div", { className: `${cssId}__inputs sid-date__inputs` },
|
|
17090
|
+
React.createElement(InputSelectComponent, { className: `${cssId}__month sid-date__month`, fieldId: fieldName, inputId: monthFieldId, fieldLabelId: fieldLabelId, isErrored: isErrored, options: months, onChange: (choice) => {
|
|
17055
17091
|
if (choice) {
|
|
17056
|
-
|
|
17092
|
+
updateMonth(choice.value);
|
|
17057
17093
|
}
|
|
17058
17094
|
else {
|
|
17059
17095
|
// clear the birth month
|
|
17060
|
-
|
|
17096
|
+
updateMonth(null);
|
|
17061
17097
|
}
|
|
17062
|
-
}, placeholder: intl.formatHTMLMessage({ id: "dateTime.month", defaultMessage: "Month" }), suppressPlaceholder: false, value:
|
|
17063
|
-
React.createElement(
|
|
17064
|
-
React.createElement(
|
|
17065
|
-
isErrored ?
|
|
17066
|
-
};
|
|
17067
|
-
BirthDate.defaultProps = {
|
|
17068
|
-
value: "2000-01-01",
|
|
17098
|
+
}, placeholder: intl.formatHTMLMessage({ id: "dateTime.month", defaultMessage: "Month" }), suppressPlaceholder: false, value: dateMonth ? months[dateMonth - 1] : undefined, isRequired: isRequired, buttonRef: "inputSelectButtonBirthDate" }),
|
|
17099
|
+
mode === "date" && (React.createElement(InputTextComponent, { className: `${cssId}__day sid-date__day sid-text-input sid-text-input--required ${isErrored ? "sid-text-input--error" : ""}`, id: `${fieldId}-day`, isErrored: isErrored, min: 1, max: 31, name: `${cssId}-day`, onChange: (e) => updateDay(e.target.value), onBlur: getDate, pattern: "\\d*", placeholder: intl.formatHTMLMessage({ id: "dateTime.day", defaultMessage: "Day" }), "aria-label": intl.formatHTMLMessage({ id: "dateTime.day", defaultMessage: "Day" }), "aria-labelledby": cssId, "aria-required": isRequired, refId: `${fieldName}Day`, type: "text", value: dateDay || "" })),
|
|
17100
|
+
React.createElement(InputTextComponent, { className: `${cssId}__year sid-date__year sid-text-input sid-text-input--required ${isErrored ? "sid-text-input--error" : ""}`, id: `${fieldId}-year`, name: `${cssId}-year`, type: "text", isErrored: isErrored, min: minYear, max: thisYear, value: dateYear || "", pattern: "\\d*", placeholder: intl.formatHTMLMessage({ id: "dateTime.year", defaultMessage: "Year" }), "aria-label": intl.formatHTMLMessage({ id: "dateTime.year", defaultMessage: "Year" }), "aria-labelledby": cssId, "aria-required": isRequired, refId: `${fieldName}Year`, onChange: (e) => updateBirthYear(e.target.value), onBlur: getDate })),
|
|
17101
|
+
isErrored ? wrappedErrMsg : null));
|
|
17069
17102
|
};
|
|
17070
|
-
const
|
|
17103
|
+
const DateComponent = injectIntl(DateInput);
|
|
17104
|
+
|
|
17105
|
+
const BirthDateComponent = ({ onChange, isErrored, isRequired = true, errorId, value = "2000-01-01", }) => (React.createElement(DateComponent, { value: value, label: React.createElement(FormattedHTMLMessage, { id: "birthDate", defaultMessage: "Date of birth" }), onChange: onChange, fieldId: "birthdate", fieldName: "birthDate", isErrored: isErrored, isRequired: isRequired, errorMsg: errorId ? (React.createElement(FormattedHTMLMessage, { id: `errorId.${errorId}`, defaultMessage: "Invalid birth date" })) : (React.createElement(FormattedHTMLMessage, { id: "errorId.invalidBirthDate", defaultMessage: "Invalid birth date" })) }));
|
|
17071
17106
|
|
|
17072
17107
|
function replaceCustomTags(text, tagmap) {
|
|
17073
17108
|
if (typeof text !== "string")
|
|
@@ -18046,6 +18081,8 @@ const BranchOfService = ({ autoFocus, onChange, value, isErrored, organizations,
|
|
|
18046
18081
|
};
|
|
18047
18082
|
const BranchOfServiceComponent = injectIntl(BranchOfService);
|
|
18048
18083
|
|
|
18084
|
+
const ActiveDutyStartDateComponent = ({ onChange, isErrored, errorId = "invalidActiveDutyStartDate", value = "2000-01-01", }) => (React.createElement(DateComponent, { value: value, label: React.createElement(FormattedHTMLMessage, { id: "activeDutyStartDate", defaultMessage: "Active Duty Start Date" }), onChange: onChange, fieldName: "activeDutyStartDate", fieldId: "sid-active-duty-start-date", isErrored: isErrored, isRequired: true, errorMsg: React.createElement(FormattedHTMLMessage, { id: `errorId.${errorId}`, defaultMessage: "Invalid start date" }) }));
|
|
18085
|
+
|
|
18049
18086
|
/**
|
|
18050
18087
|
* TODO - preamble
|
|
18051
18088
|
*/
|
|
@@ -18123,6 +18160,10 @@ const StepActiveMilitaryPersonalInfo = ({ intl, verificationService, }) => {
|
|
|
18123
18160
|
updateActiveMilitaryViewModel("birthDate", newValue);
|
|
18124
18161
|
updateFieldValidationErrorsByFieldId("birthDate", newValue, verificationService);
|
|
18125
18162
|
}, value: viewModel.birthDate }),
|
|
18163
|
+
verificationService.programTheme.strictMilitaryValidationEnabled && (React.createElement(ActiveDutyStartDateComponent, { isErrored: !!fieldValidationErrors.activeDutyStartDate, errorId: fieldValidationErrors.activeDutyStartDate, onChange: (newValue) => {
|
|
18164
|
+
updateActiveMilitaryViewModel("activeDutyStartDate", newValue);
|
|
18165
|
+
updateFieldValidationErrorsByFieldId("activeDutyStartDate", newValue, verificationService);
|
|
18166
|
+
}, value: viewModel.activeDutyStartDate })),
|
|
18126
18167
|
React.createElement(EmailComponent, { value: viewModel.email, isErrored: !!fieldValidationErrors.email, explanation: React.createElement(FormattedHTMLMessage, { id: "emailExplanation", defaultMessage: "Personal email address is recommended" }), onChange: (newValue) => {
|
|
18127
18168
|
updateActiveMilitaryViewModel("email", newValue);
|
|
18128
18169
|
updateFieldValidationErrorsByFieldId("email", newValue, verificationService);
|
|
@@ -18151,78 +18192,7 @@ const StepActiveMilitaryPersonalInfo = ({ intl, verificationService, }) => {
|
|
|
18151
18192
|
};
|
|
18152
18193
|
const StepActiveMilitaryPersonalInfoComponent = injectIntl(StepActiveMilitaryPersonalInfo);
|
|
18153
18194
|
|
|
18154
|
-
const
|
|
18155
|
-
const dischargeDateParts = value.split("-");
|
|
18156
|
-
const dischargeDateYear = Number.parseInt(dischargeDateParts[0], 10) || undefined;
|
|
18157
|
-
const dischargeDateMonth = Number.parseInt(dischargeDateParts[1], 10) || undefined;
|
|
18158
|
-
const dischargeDateDay = 1;
|
|
18159
|
-
const minDischargeYear = 1900;
|
|
18160
|
-
const thisYear = new Date().getFullYear();
|
|
18161
|
-
const inputId = "sid-discharge-date";
|
|
18162
|
-
/* prettier-ignore */
|
|
18163
|
-
const months = [
|
|
18164
|
-
{ value: "1", label: intl.formatHTMLMessage({ id: "dateTime.january", defaultMessage: "January" }), },
|
|
18165
|
-
{ value: "2", label: intl.formatHTMLMessage({ id: "dateTime.february", defaultMessage: "February" }), },
|
|
18166
|
-
{ value: "3", label: intl.formatHTMLMessage({ id: "dateTime.march", defaultMessage: "March" }), },
|
|
18167
|
-
{ value: "4", label: intl.formatHTMLMessage({ id: "dateTime.april", defaultMessage: "April" }), },
|
|
18168
|
-
{ value: "5", label: intl.formatHTMLMessage({ id: "dateTime.may", defaultMessage: "May" }) },
|
|
18169
|
-
{ value: "6", label: intl.formatHTMLMessage({ id: "dateTime.june", defaultMessage: "June" }) },
|
|
18170
|
-
{ value: "7", label: intl.formatHTMLMessage({ id: "dateTime.july", defaultMessage: "July" }) },
|
|
18171
|
-
{ value: "8", label: intl.formatHTMLMessage({ id: "dateTime.august", defaultMessage: "August" }), },
|
|
18172
|
-
{ value: "9", label: intl.formatHTMLMessage({ id: "dateTime.september", defaultMessage: "September" }), },
|
|
18173
|
-
{ value: "10", label: intl.formatHTMLMessage({ id: "dateTime.october", defaultMessage: "October" }), },
|
|
18174
|
-
{ value: "11", label: intl.formatHTMLMessage({ id: "dateTime.november", defaultMessage: "November" }), },
|
|
18175
|
-
{ value: "12", label: intl.formatHTMLMessage({ id: "dateTime.december", defaultMessage: "December" }), },
|
|
18176
|
-
];
|
|
18177
|
-
const updateDischargeMonth = (month) => {
|
|
18178
|
-
if (month === "" || month === null) {
|
|
18179
|
-
onChange(`${dischargeDateYear}--${dischargeDateDay}`);
|
|
18180
|
-
}
|
|
18181
|
-
const newVal = Number.parseInt(month, 10);
|
|
18182
|
-
if (typeof newVal === "number" && newVal >= 1 && newVal <= 12) {
|
|
18183
|
-
onChange(`${dischargeDateYear}-${formatTwoDigitValues(month)}-${formatTwoDigitValues(dischargeDateDay)}`);
|
|
18184
|
-
}
|
|
18185
|
-
else {
|
|
18186
|
-
logger.warn(`Value '${newVal}' is an invalid discharge month`);
|
|
18187
|
-
}
|
|
18188
|
-
};
|
|
18189
|
-
const updateDischargeYear = (year) => {
|
|
18190
|
-
if (year === "") {
|
|
18191
|
-
onChange(`-${dischargeDateMonth}-${dischargeDateDay}`);
|
|
18192
|
-
}
|
|
18193
|
-
const newVal = Number.parseInt(year, 10);
|
|
18194
|
-
if (typeof newVal === "number" && newVal >= 1 && newVal <= thisYear) {
|
|
18195
|
-
onChange(`${newVal}-${formatTwoDigitValues(dischargeDateMonth)}-${formatTwoDigitValues(dischargeDateDay)}`);
|
|
18196
|
-
}
|
|
18197
|
-
else {
|
|
18198
|
-
logger.warn(`Value '${newVal}' is an invalid discharge year`);
|
|
18199
|
-
}
|
|
18200
|
-
};
|
|
18201
|
-
const getDischargeDate = () => {
|
|
18202
|
-
onChange(`${dischargeDateYear}-${formatTwoDigitValues(dischargeDateMonth)}-${formatTwoDigitValues(dischargeDateDay)}`);
|
|
18203
|
-
};
|
|
18204
|
-
return (React.createElement("div", { className: `sid-field ${inputId}` },
|
|
18205
|
-
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
18206
|
-
React.createElement(FieldLabel, { text: React.createElement(FormattedHTMLMessage, { id: "dischargeDate", defaultMessage: "Discharge date" }), htmlForLabel: `${inputId}__month`, id: `${inputId}-label`, displayClasses: "sid-field__label-with-explanation" },
|
|
18207
|
-
React.createElement(FormattedHTMLMessage, { id: "verificationPurposesOnly", defaultMessage: "Used for verification purposes only" })),
|
|
18208
|
-
React.createElement("div", { className: `${inputId}__inputs` },
|
|
18209
|
-
React.createElement(InputSelectComponent, { className: `${inputId}__month`, fieldId: "dischargeDate", inputId: `${inputId}__month`, fieldLabelId: `${inputId}-label`, isErrored: isErrored, options: months, onChange: (choice) => {
|
|
18210
|
-
if (choice) {
|
|
18211
|
-
updateDischargeMonth(choice.value);
|
|
18212
|
-
}
|
|
18213
|
-
else {
|
|
18214
|
-
// clear the discharge month
|
|
18215
|
-
updateDischargeMonth(null);
|
|
18216
|
-
}
|
|
18217
|
-
}, placeholder: intl.formatHTMLMessage({ id: "dateTime.month", defaultMessage: "Month" }), suppressPlaceholder: false, value: dischargeDateMonth ? months[dischargeDateMonth - 1] : undefined, buttonRef: "inputSelectButtonDischargeDate", isRequired: true }),
|
|
18218
|
-
React.createElement(InputTextComponent, { className: `${inputId}__year`, id: "discharge-date-year", isErrored: isErrored, max: thisYear, min: minDischargeYear, onBlur: getDischargeDate, onChange: (e) => updateDischargeYear(e.target.value), pattern: "\\d*", placeholder: intl.formatHTMLMessage({ id: "dateTime.year", defaultMessage: "Year" }), hidePlaceholder: false, refId: "dischargeDateYear", required: true, value: dischargeDateYear || "", "aria-labelledby": "sid-discharge-date-label" })),
|
|
18219
|
-
isErrored ? (React.createElement("div", { className: "sid-field-error" },
|
|
18220
|
-
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidDischargeDate", defaultMessage: "Invalid discharge date" }))) : null));
|
|
18221
|
-
};
|
|
18222
|
-
DischargeDate.defaultProps = {
|
|
18223
|
-
value: "2000-01-01",
|
|
18224
|
-
};
|
|
18225
|
-
const DischargeDateComponent = injectIntl(DischargeDate);
|
|
18195
|
+
const DischargeDateComponent = ({ onChange, isErrored, value = "2000-01-01", }) => (React.createElement(DateComponent, { mode: "month", value: value, label: React.createElement(FormattedHTMLMessage, { id: "dischargeDate", defaultMessage: "Discharge date" }), onChange: onChange, fieldName: "dischargeDate", fieldId: "discharge-date", isErrored: isErrored, isRequired: true, errorMsg: React.createElement(FormattedHTMLMessage, { id: "errorId.invalidDischargeDate", defaultMessage: "Invalid discharge date" }) }));
|
|
18226
18196
|
|
|
18227
18197
|
/**
|
|
18228
18198
|
* TODO - preamble
|
|
@@ -18298,6 +18268,10 @@ const StepInactiveMilitaryPersonalInfo = ({ intl, verificationService, }) => {
|
|
|
18298
18268
|
updateInactiveMilitaryViewModel("birthDate", newValue);
|
|
18299
18269
|
updateFieldValidationErrorsByFieldId("birthDate", newValue, verificationService);
|
|
18300
18270
|
}, value: viewModel.birthDate }),
|
|
18271
|
+
verificationService.programTheme.strictMilitaryValidationEnabled && (React.createElement(ActiveDutyStartDateComponent, { isErrored: !!fieldValidationErrors.activeDutyStartDate, onChange: (newValue) => {
|
|
18272
|
+
updateInactiveMilitaryViewModel("activeDutyStartDate", newValue);
|
|
18273
|
+
updateFieldValidationErrorsByFieldId("activeDutyStartDate", newValue, verificationService);
|
|
18274
|
+
}, value: viewModel.activeDutyStartDate })),
|
|
18301
18275
|
React.createElement(DischargeDateComponent, { isErrored: !!fieldValidationErrors.dischargeDate, onChange: (newValue) => {
|
|
18302
18276
|
updateInactiveMilitaryViewModel("dischargeDate", newValue);
|
|
18303
18277
|
updateFieldValidationErrorsByFieldId("dischargeDate", newValue, verificationService);
|
|
@@ -21943,6 +21917,8 @@ const LoadStepComponent = ({ stepToLoad, verificationService }) => {
|
|
|
21943
21917
|
Component = getComponent("StepEmailLoopComponent");
|
|
21944
21918
|
isSecondaryStep = true;
|
|
21945
21919
|
break;
|
|
21920
|
+
case VerificationStepsEnum.missingRequiredMetadata:
|
|
21921
|
+
return (React.createElement(StepErrorComponent, { verificationService: verificationService, errorId: "missingRequiredMetadata" }));
|
|
21946
21922
|
// If explicitly trying to render the error component, such as when testing/styling
|
|
21947
21923
|
case VerificationStepsEnum.error:
|
|
21948
21924
|
Component = getComponent("StepErrorComponent");
|
|
@@ -22018,7 +21994,8 @@ const NewVerificationInnerComponent = ({ locale, messages, programTheme, verific
|
|
|
22018
21994
|
React.createElement(IntlProvider, { locale: "en", key: locale, messages: messagesWithOptions, textComponent: CustomTextWrapper },
|
|
22019
21995
|
React.createElement(CustomCssWrapperComponent, { styles: getCustomCss(programTheme) }, verificationService.isLoading ? (React.createElement(LoadingScreenComponent, { step: verificationService.loadingStep })) : (React.createElement("div", { className: `${rtlDetect_1.isRtlLang(modernizeLocale(locale)) ? "sid-rtl" : "sid-ltr"} sid-locale-${locale}` },
|
|
22020
21996
|
!getOptions().hideTestModeFlag && (React.createElement(TestModeFlagComponent, { verificationService: verificationService })),
|
|
22021
|
-
React.createElement(LoadStepComponent, { stepToLoad: verificationService.
|
|
21997
|
+
React.createElement(LoadStepComponent, { stepToLoad: verificationService.overrideStep ||
|
|
21998
|
+
verificationService.verificationResponse.currentStep, verificationService: verificationService }))))));
|
|
22022
21999
|
};
|
|
22023
22000
|
|
|
22024
22001
|
/*
|