-
Notifications
You must be signed in to change notification settings - Fork 10
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
VATEAM-101161: Normalize Custom Step with pages and components #2454
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint is disabled
vets-website
uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.
What you can do
See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.
src/site/stages/build/drupal/static-data-files/digitalForm/tests/chapters.unit.spec.js
Show resolved
Hide resolved
...s/build/drupal/static-data-files/digitalForm/tests/fragments/customStep.graphql.unit.spec.js
Show resolved
Hide resolved
.../stages/build/drupal/static-data-files/digitalForm/tests/fragments/page.graphql.unit.spec.js
Show resolved
Hide resolved
...es/build/drupal/static-data-files/digitalForm/tests/fragments/textInput.graphql.unit.spec.js
Show resolved
Hide resolved
src/site/stages/build/drupal/static-data-files/digitalForm/tests/utils.unit.spec.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid overloading postProcessDigitalForm.js
, I've moved all code relating to chapters to this page.
const extractAdditionalFields = entity => { | ||
const { entityId } = entity.type.entity; | ||
|
||
switch (entityId) { | ||
case 'digital_form_address': | ||
return { | ||
militaryAddressCheckbox: entity.fieldMilitaryAddressCheckbox, | ||
}; | ||
case 'digital_form_list_loop': | ||
return { | ||
optional: entity.fieldOptional, | ||
}; | ||
case 'digital_form_phone_and_email': | ||
return { | ||
includeEmail: entity.fieldIncludeEmail, | ||
}; | ||
default: | ||
return {}; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no changes to extractAdditionalFields
type, | ||
}; | ||
|
||
switch (type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This switch
statement is ripe for a refactor, but it will make more sense to do that when I add custom List & Loops at a later date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods were moved out of postProcessDigitalForm.js
to give that file more focus. No changes were made to either method.
Are you removing or changing a registry.json
entryName
in this PR?entryName
s (skip to Summary and delete the rest of this section)entryName
Summary
Example output
Related issue(s)
Testing done
What areas of the site does it impact?
Only affects the output of
digital-forms.json
.Acceptance criteria
Quality Assurance & Testing
Error Handling
Authentication
Requested Feedback
(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?