Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 957a077

Browse files
authored
DMT | Fix submission errors part 2 (#43761)
* Remove maxlength on marriage ended city * Use strict date schema * Fix dates not formatted with a leading zero
1 parent 60b3d32 commit 957a077

23 files changed

Lines changed: 153 additions & 54 deletions

File tree

src/applications/dependents/686c-674/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ schema: {
272272
type: 'object',
273273
required: ['endDate'],
274274
properties: {
275-
endDate: currentOrPastDateSchema,
275+
endDate: DATE_SCHEMA, // using a strict date Regex (no "X"s)
276276
},
277277
},
278278
```

src/applications/dependents/686c-674/components/picklist/spouseMarriageEnded.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ const spouseMarriageEnded = {
139139
value={itemData.endCity || ''}
140140
onVaInput={onChange}
141141
required
142-
maxlength={30}
143142
/>
144143
{itemData.endOutsideUs ? (
145144
<>

src/applications/dependents/686c-674/components/picklist/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export const getPastDateError = (
363363
}
364364

365365
const parsedDate = parse(date, 'yyyy-MM-dd', new Date());
366-
if (!isValid(parsedDate)) {
366+
if (!isValid(parsedDate) || date.includes('X')) {
367367
return 'Enter a valid date';
368368
}
369369
if (!isPast(parsedDate)) {

src/applications/dependents/686c-674/config/chapters/674/studentAttendancePages.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import {
33
yesNoUI,
44
yesNoSchema,
55
currentOrPastDateUI,
6-
currentOrPastDateSchema,
76
} from 'platform/forms-system/src/js/web-component-patterns';
87
import VaMemorableDateField from 'platform/forms-system/src/js/web-component-fields/VaMemorableDateField';
98
import { validateCurrentOrFutureDate } from 'platform/forms-system/src/js/validation';
109

1110
import { AccreditedSchool, TermDateHint } from './helpers';
1211
import { generateHelpText } from '../../helpers';
12+
import { DATE_SCHEMA } from '../../constants';
1313

1414
export const studentAttendancePage = {
1515
uiSchema: {
@@ -77,7 +77,7 @@ export const studentStoppedAttendingDatePage = {
7777
schoolInformation: {
7878
type: 'object',
7979
properties: {
80-
dateFullTimeEnded: currentOrPastDateSchema,
80+
dateFullTimeEnded: DATE_SCHEMA,
8181
},
8282
},
8383
},
@@ -172,12 +172,9 @@ export const studentTermDatesPage = {
172172
],
173173
type: 'object',
174174
properties: {
175-
officialSchoolStartDate: currentOrPastDateSchema,
176-
expectedStudentStartDate: currentOrPastDateSchema,
177-
expectedGraduationDate: {
178-
type: 'string',
179-
pattern: '^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$',
180-
},
175+
officialSchoolStartDate: DATE_SCHEMA,
176+
expectedStudentStartDate: DATE_SCHEMA,
177+
expectedGraduationDate: DATE_SCHEMA,
181178
},
182179
},
183180
},
@@ -264,8 +261,8 @@ export const previousTermDatesPage = {
264261
lastTermSchoolInformation: {
265262
type: 'object',
266263
properties: {
267-
termBegin: currentOrPastDateSchema,
268-
dateTermEnded: currentOrPastDateSchema,
264+
termBegin: DATE_SCHEMA,
265+
dateTermEnded: DATE_SCHEMA,
269266
},
270267
},
271268
},

src/applications/dependents/686c-674/config/chapters/674/studentEducationPages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
radioUI,
88
radioSchema,
99
currentOrPastDateUI,
10-
currentOrPastDateSchema,
1110
} from 'platform/forms-system/src/js/web-component-patterns';
1211

1312
import {
1413
benefitSchemaLabels,
1514
benefitUiLabels,
1615
ProgramExamples,
1716
} from './helpers';
17+
import { DATE_SCHEMA } from '../../constants';
1818

1919
/** @returns {PageSchema} */
2020
export const studentEducationBenefitsPage = {
@@ -147,7 +147,7 @@ export const studentEducationBenefitsStartDatePage = {
147147
schema: {
148148
type: 'object',
149149
properties: {
150-
benefitPaymentDate: currentOrPastDateSchema,
150+
benefitPaymentDate: DATE_SCHEMA,
151151
},
152152
},
153153
};

src/applications/dependents/686c-674/config/chapters/674/studentIdentityPages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
arrayBuilderItemSubsequentPageTitleUI,
55
fullNameNoSuffixSchema,
66
currentOrPastDateUI,
7-
currentOrPastDateSchema,
87
checkboxUI,
98
checkboxSchema,
109
radioUI,
@@ -17,6 +16,7 @@ import { relationshipToStudentLabels } from './helpers';
1716
import { addStudentsOptions } from './addStudentsSetup';
1817
import { NO_SSN_REASON_UI_MAPPINGS } from '../../dataMappings';
1918
import { fullNameNoSuffixWithAsciiUI } from '../../helpers';
19+
import { DATE_SCHEMA } from '../../constants';
2020

2121
/** @returns {PageSchema} */
2222
export const studentInformationPage = {
@@ -83,7 +83,7 @@ export const studentInformationPage = {
8383
properties: {
8484
'view:studentNameTitle': { type: 'object', properties: {} },
8585
fullName: fullNameNoSuffixSchema,
86-
birthDate: currentOrPastDateSchema,
86+
birthDate: DATE_SCHEMA,
8787
'view:studentIdTitle': { type: 'object', properties: {} },
8888
noSsn: checkboxSchema,
8989
noSsnReason: radioSchema(['NONRESIDENT_ALIEN', 'NONE_ASSIGNED']),

src/applications/dependents/686c-674/config/chapters/674/studentPersonalPages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
yesNoUI,
88
yesNoSchema,
99
currentOrPastDateUI,
10-
currentOrPastDateSchema,
1110
} from 'platform/forms-system/src/js/web-component-patterns';
1211
import { asciiValidation } from '../../helpers';
12+
import { DATE_SCHEMA } from '../../constants';
1313

1414
/** @returns {PageSchema} */
1515
export const studentIncomePage = {
@@ -149,7 +149,7 @@ export const studentMarriageDatePage = {
149149
schema: {
150150
type: 'object',
151151
properties: {
152-
marriageDate: currentOrPastDateSchema,
152+
marriageDate: DATE_SCHEMA,
153153
},
154154
},
155155
};

src/applications/dependents/686c-674/config/chapters/report-add-a-spouse/does-live-with-spouse/doesLiveWithSpouse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {
22
yesNoSchema,
33
yesNoUI,
44
currentOrPastDateUI,
5-
currentOrPastDateSchema,
65
titleUI,
76
} from 'platform/forms-system/src/js/web-component-patterns';
7+
import { DATE_SCHEMA } from '../../../constants';
88

99
export const schema = {
1010
type: 'object',
@@ -18,7 +18,7 @@ export const schema = {
1818
currentMarriageInformation: {
1919
type: 'object',
2020
properties: {
21-
date: currentOrPastDateSchema,
21+
date: DATE_SCHEMA,
2222
},
2323
},
2424
},

src/applications/dependents/686c-674/config/chapters/report-add-a-spouse/spouseMarriageHistoryArrayPages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
radioUI,
99
radioSchema,
1010
currentOrPastDateUI,
11-
currentOrPastDateSchema,
1211
} from 'platform/forms-system/src/js/web-component-patterns';
1312
import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
1413
import VaSelectField from 'platform/forms-system/src/js/web-component-fields/VaSelectField';
@@ -21,6 +20,7 @@ import {
2120
fullNameNoSuffixWithAsciiUI,
2221
} from '../../helpers';
2322
import { getFullName } from '../../../../shared/utils';
23+
import { DATE_SCHEMA } from '../../constants';
2424

2525
/** @type {ArrayBuilderOptions} */
2626
export const spouseMarriageHistoryOptions = {
@@ -156,7 +156,7 @@ export const formerMarriageStartDatePage = {
156156
type: 'object',
157157
required: ['startDate'],
158158
properties: {
159-
startDate: currentOrPastDateSchema,
159+
startDate: DATE_SCHEMA,
160160
},
161161
},
162162
};
@@ -193,7 +193,7 @@ export const formerMarriageEndDatePage = {
193193
type: 'object',
194194
required: ['endDate'],
195195
properties: {
196-
endDate: currentOrPastDateSchema,
196+
endDate: DATE_SCHEMA,
197197
},
198198
},
199199
};

src/applications/dependents/686c-674/config/chapters/report-add-a-spouse/veteranMarriageHistoryArrayPages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
radioUI,
88
radioSchema,
99
currentOrPastDateUI,
10-
currentOrPastDateSchema,
1110
} from 'platform/forms-system/src/js/web-component-patterns';
1211
import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
1312
import VaSelectField from 'platform/forms-system/src/js/web-component-fields/VaSelectField';
@@ -22,6 +21,7 @@ import {
2221
fullNameNoSuffixWithAsciiUI,
2322
} from '../../helpers';
2423
import { getFullName } from '../../../../shared/utils';
24+
import { DATE_SCHEMA } from '../../constants';
2525

2626
/* NOTE:
2727
* In "Add mode" of the array builder, formData represents the entire formData object.
@@ -172,7 +172,7 @@ export const vetFormerMarriageStartDatePage = {
172172
type: 'object',
173173
required: ['startDate'],
174174
properties: {
175-
startDate: currentOrPastDateSchema,
175+
startDate: DATE_SCHEMA,
176176
},
177177
},
178178
};
@@ -209,7 +209,7 @@ export const vetFormerMarriageEndDatePage = {
209209
type: 'object',
210210
required: ['endDate'],
211211
properties: {
212-
endDate: currentOrPastDateSchema,
212+
endDate: DATE_SCHEMA,
213213
},
214214
},
215215
};

0 commit comments

Comments
 (0)