Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add character limits for Appoint a Representative #33725

Merged
merged 15 commits into from
Jan 6, 2025
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/claimant/claimantContactMailing.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.

import {
addressSchema,
Expand Down Expand Up @@ -28,8 +28,31 @@
type: 'object',
properties: {
profileNotUpdatedNote: { type: 'object', properties: {} },
homeAddress: addressSchema({
omit: ['street3'],
}),
homeAddress: {
...addressSchema({ omit: ['street3'] }),
properties: {
...addressSchema({ omit: ['street3'] }).properties,
street: {
type: 'string',
maxLength: 30,
},
street2: {
type: 'string',
maxLength: 5,
},
city: {
type: 'string',
maxLength: 18,
},
state: {
type: 'string',
maxLength: 2,
},
postalCode: {
type: 'string',
maxLength: 9,
},
},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/claimant/claimantContactPhoneEmail.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.

import {
phoneUI,
Expand Down Expand Up @@ -30,6 +30,10 @@
titleSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
applicantPhone: phoneSchema,
applicantEmail: emailSchema,
applicantEmail: {
...emailSchema,
type: 'string',
maxLength: 31,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/claimant/claimantPersonalInformation.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { cloneDeep } from 'lodash';

import {
Expand Down Expand Up @@ -33,7 +33,24 @@
properties: {
titleSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
applicantName: fullNameSchema,
applicantName: {
...fullNameSchema,
properties: {
...fullNameSchema.properties,
first: {
type: 'string',
maxLength: 12,
},
middle: {
type: 'string',
maxLength: 1,
},
last: {
type: 'string',
maxLength: 18,
},
},
},
applicantDOB: dateOfBirthSchema,
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/claimant/claimantRelationship.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import {
radioSchema,
radioUI,
Expand Down Expand Up @@ -32,6 +32,7 @@
expandUnder: 'claimantRelationship',
expandUnderCondition: 'RELATIONSHIP_NOT_LISTED',
expandedContentFocus: true,
maxLength: 42,
},
'ui:errorMessages': {
required: `Please enter your relationship to the Veteran`,
Expand Down Expand Up @@ -59,6 +60,6 @@
required: ['claimantRelationship'],
properties: {
claimantRelationship: radioSchema(Object.keys(claimantRelationships)),
relationshipNotListed: { type: 'string' },
relationshipNotListed: { type: 'string', maxLength: 42 },
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/veteran/veteranContactMailing.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.

import {
addressSchema,
Expand Down Expand Up @@ -28,8 +28,31 @@
properties: {
titleSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
veteranHomeAddress: addressSchema({
omit: ['street3'],
}),
veteranHomeAddress: {
...addressSchema({ omit: ['street3'] }),
properties: {
...addressSchema({ omit: ['street3'] }).properties,
street: {
type: 'string',
maxLength: 30,
},
street2: {
type: 'string',
maxLength: 5,
},
city: {
type: 'string',
maxLength: 18,
},
state: {
type: 'string',
maxLength: 2,
},
postalCode: {
type: 'string',
maxLength: 9,
},
},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {

Check warning on line 1 in src/applications/representative-appoint/pages/veteran/veteranContactMailingClaimant.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
addressSchema,
addressUI,
titleUI,
Expand All @@ -18,8 +18,32 @@
type: 'object',
properties: {
titleSchema,
veteranHomeAddress: addressSchema({
omit: ['street3'],
}),
profileNotUpdatedNote: { type: 'object', properties: {} },
veteranHomeAddress: {
...addressSchema({ omit: ['street3'] }),
properties: {
...addressSchema({ omit: ['street3'] }).properties,
street: {
type: 'string',
maxLength: 30,
},
street2: {
type: 'string',
maxLength: 5,
},
city: {
type: 'string',
maxLength: 18,
},
state: {
type: 'string',
maxLength: 2,
},
postalCode: {
type: 'string',
maxLength: 9,
},
},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/veteran/veteranContactPhoneEmail.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.

import {
phoneUI,
Expand Down Expand Up @@ -30,6 +30,10 @@
titleSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
primaryPhone: phoneSchema,
veteranEmail: emailSchema,
veteranEmail: {
...emailSchema,
type: 'string',
maxLength: 61,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/veteran/veteranIdentification.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.

import {
ssnUI,
Expand Down Expand Up @@ -49,7 +49,13 @@
descriptionSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
veteranSocialSecurityNumber: ssnSchema,
veteranVAFileNumber: vaFileNumberSchema,
veteranServiceNumber: serviceNumberSchema,
veteranVAFileNumber: {
...vaFileNumberSchema,
maxLength: 9,
},
veteranServiceNumber: {
...serviceNumberSchema,
maxLength: 9,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/pages/veteran/veteranPersonalInformation.js

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { cloneDeep } from 'lodash';

import {
dateOfBirthUI,
dateOfBirthSchema,
fullNameUI,
fullNameSchema,
titleUI,
titleSchema,
} from 'platform/forms-system/src/js/web-component-patterns';
Expand Down Expand Up @@ -35,8 +34,25 @@
properties: {
titleSchema,
profileNotUpdatedNote: { type: 'object', properties: {} },
veteranFullName: fullNameSchema,
veteranFullName: {
type: 'object',
required: ['first', 'last'],
properties: {
first: {
type: 'string',
maxLength: 12,
},
middle: {
type: 'string',
maxLength: 1,
},
last: {
type: 'string',
maxLength: 18,
},
},
},
veteranDateOfBirth: dateOfBirthSchema,
},
required: ['veteranDateOfBirth'],
required: ['veteranDateOfBirth', 'veteranFullName'],
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/claimant/claimantContactMailing.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';

Expand Down Expand Up @@ -27,4 +27,14 @@

expect($('button[type="submit"]', container)).to.exist;
});

it('should have proper max lengths for address fields', () => {
const addressProps = schema.properties.homeAddress.properties;

expect(addressProps.street.maxLength).to.equal(30);
expect(addressProps.street2.maxLength).to.equal(5);
expect(addressProps.city.maxLength).to.equal(18);
expect(addressProps.state.maxLength).to.equal(2);
expect(addressProps.postalCode.maxLength).to.equal(9);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/claimant/claimantContactPhoneEmail.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -34,4 +34,8 @@

expect(container.querySelector('button[type="submit"]')).to.exist;
});

it('should have proper max length for email field', () => {
expect(schema.properties.applicantEmail.maxLength).to.equal(31);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/claimant/claimantPersonalInformation.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -37,4 +37,12 @@

expect($('button[type="submit"]', container)).to.exist;
});

it('should have proper max lengths for name fields', () => {
const nameProps = schema.properties.applicantName.properties;

expect(nameProps.first.maxLength).to.equal(12);
expect(nameProps.middle.maxLength).to.equal(1);
expect(nameProps.last.maxLength).to.equal(18);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/claimant/claimantRelationship.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';

Expand Down Expand Up @@ -27,4 +27,9 @@

expect($('button[type="submit"]', container)).to.exist;
});

it('should have proper max length for relationshipNotListed field', () => {
expect(schema.properties.relationshipNotListed.maxLength).to.equal(42);
expect(uiSchema.relationshipNotListed['ui:options'].maxLength).to.equal(42);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/veteran/veteranContactMailing.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { render } from '@testing-library/react';
import { expect } from 'chai';
import { DefinitionTester } from 'platform/testing/unit/schemaform-utils';
Expand Down Expand Up @@ -26,4 +26,14 @@

expect(container.querySelector('button[type="submit"]')).to.exist;
});

it('should have proper max lengths for address fields', () => {
const addressProps = schema.properties.veteranHomeAddress.properties;

expect(addressProps.street.maxLength).to.equal(30);
expect(addressProps.street2.maxLength).to.equal(5);
expect(addressProps.city.maxLength).to.equal(18);
expect(addressProps.state.maxLength).to.equal(2);
expect(addressProps.postalCode.maxLength).to.equal(9);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/veteran/veteranContactPhoneEmail.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -34,4 +34,8 @@

expect(container.querySelector('button[type="submit"]')).to.exist;
});

it('should have proper max length for email field', () => {
expect(schema.properties.veteranEmail.maxLength).to.equal(61);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/veteran/veteranIdentification.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -34,4 +34,9 @@

expect(container.querySelector('button[type="submit"]')).to.exist;
});

it('should have proper max lengths in schema', () => {
expect(schema.properties.veteranVAFileNumber.maxLength).to.equal(9);
expect(schema.properties.veteranServiceNumber.maxLength).to.equal(9);
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

Check warning on line 1 in src/applications/representative-appoint/tests/pages/veteran/veteranPersonalInformation.unit.spec.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -34,4 +34,12 @@

expect(container.querySelector('button[type="submit"]')).to.exist;
});

it('should have proper max lengths for name fields', () => {
const nameProps = schema.properties.veteranFullName.properties;

expect(nameProps.first.maxLength).to.equal(12);
expect(nameProps.middle.maxLength).to.equal(1);
expect(nameProps.last.maxLength).to.equal(18);
});
});
Loading