-
Notifications
You must be signed in to change notification settings - Fork 128
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
Refactor forms-system onBack, routing, BackLink #34118
base: main
Are you sure you want to change the base?
Conversation
c077d75
to
656710c
Compare
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.
dev notes
@@ -1,4 +1,4 @@ | |||
import { createRoutes } from 'platform/forms-system/src/js/routing'; | |||
import { createRoutes } from 'platform/forms-system/src/js/routing/createRoutes'; |
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 was a cyclical dependency here, so just did some refactoring (should be no change)
@@ -14,58 +13,68 @@ import { setData as setDataAction } from '../actions'; | |||
* ```jsx | |||
* <BackLink /> | |||
* ``` | |||
* |
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 code only affects forms using useTopBackLink
property in their form config, which is 3 forms currently:
- mhv-supply-reordering
- 21-4138
- mock-form-minimal-header
None of these are currently enabled on prod.
@@ -0,0 +1,68 @@ | |||
import { createFormPageList, createPageList } from '../helpers'; |
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.
should be no change here. just moved this function from the above routing.js
to remove the cyclical dependency with FormPage
); | ||
} | ||
|
||
export function goBack({ |
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 function and the below function is new. the code above this was just migrated from routing.js
router, | ||
setData, | ||
}) { | ||
const path = getPreviousPagePath(pageList, formData, location.pathname); |
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 code should match exactly what was in FormPage
onBack
. Extracted so that other places besides FormPage
could use this too.
@@ -640,11 +640,11 @@ va-accordion-item[data-unviewed-pages="true"] { | |||
} | |||
|
|||
.schemaform-confirmation-section-header { | |||
font-size: $h3-font-size; | |||
font-size: $font-size-h3; |
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 specific css props seemed to have broke recently. this fixes it.
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.
Looks good with regards to the 10-10 work. 🚀
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.
Looks great! Good work. 👍
656710c
to
53b6c21
Compare
Summary
FormPage
'sonBack
so that it can be used in multiple placesBackLink
(only used in a few places currently) to useonBack
andva-link
Related issue(s)
department-of-veterans-affairs/va.gov-team-forms#1972
Testing done
/supporting-forms-for-claims/statement-to-support-claim-form-21-4138
which uses BackLink/mock-form-minimal-header/
with array builder (not committed yet)Screenshots
What areas of the site does it impact?
(Describe what parts of the site are impacted if code touched other areas)
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?