-
Notifications
You must be signed in to change notification settings - Fork 46
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
10074 bug: Auto Scroll Issues on Petitions Clerk Create Case Form (and more) #5382
Changes from all commits
4dd0483
d63f3bc
285a98e
19b8053
82e3b6a
b169982
bb241d6
c4cb6e8
cc5e87b
0706b7e
4bf80c7
ec8583b
eed3942
8b3c5a5
02014eb
c5b0ef8
6f7b9db
9ba2682
7753a96
eb57afe
0aba290
3f08d23
5fa5ee1
2f10204
6d2a075
de8d665
479b89d
c23a088
1650c94
e85f96d
eebcfaf
3d2e2fc
dd6d219
8fb1b8d
8a08e96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const setScrollToErrorNotificationAction = ({ props }) => { | ||
return { | ||
...props, | ||
scrollToErrorNotification: true, | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ export const setValidationAlertErrorsAction = ({ | |
} | ||
}), | ||
), | ||
scrollToErrorNotification: props.scrollToErrorNotification || false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gives us a way explicitly telling the app when to scroll to the |
||
title: 'Please correct the following errors on the page:', | ||
}; | ||
store.set(state.alertError, alertError); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ export const validateCaseDetailsAction = async ({ | |
caseDetail: { | ||
...caseDetail, | ||
...form, | ||
caseType: form.caseType || null, | ||
petitionPaymentDate: form.petitionPaymentDate || null, | ||
petitionPaymentMethod: form.petitionPaymentMethod || null, | ||
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes issue 2 as listed in the PR description by triggering the validation rather than allowing the form to pass and then cause a 400. |
||
preferredTrialCity: form.preferredTrialCity | ||
? form.preferredTrialCity | ||
: null, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ export const validatePetitionerAction = ({ | |
applicationContext, | ||
get, | ||
path, | ||
store, | ||
}: ActionProps) => { | ||
const { contact } = get(state.form); | ||
const caseDetail = get(state.caseDetail); | ||
|
@@ -26,11 +25,9 @@ export const validatePetitionerAction = ({ | |
existingPetitioners: caseDetail.petitioners, | ||
}); | ||
|
||
store.set(state.validationErrors.contact, errors); | ||
|
||
if (isEmpty(errors)) { | ||
return path.success(); | ||
} else { | ||
return path.error({ errors }); | ||
return path.error({ errors: { contact: errors } }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way this action was functioning was failing to update the corresponding form ( |
||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ export const alertHelper = (get: Get): any => { | |
|
||
return { | ||
messagesDeduped: uniq(alertError.messages).filter(Boolean), | ||
preventAutoScroll: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is useless since it is always false. |
||
responseCode: alertError.responseCode, | ||
showErrorAlert: | ||
!!alertError.title || !!alertError.message || !!alertError.messages, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ import { getPendingMotionDocketEntriesAction } from '@web-client/presenter/actio | |
import { getSubmittedAndCavCasesByJudgeAction } from '@web-client/presenter/actions/JudgeActivityReport/getSubmittedAndCavCasesByJudgeAction'; | ||
import { parallel } from 'cerebral'; | ||
import { resetHasUserSubmittedFormAction } from '@web-client/presenter/actions/JudgeActivityReport/resetHasUserSubmittedFormAction'; | ||
import { setAlertErrorAction } from '../../actions/setAlertErrorAction'; | ||
import { setCavAndSubmittedCasesAction } from '@web-client/presenter/actions/JudgeActivityReport/setCavAndSubmittedCasesAction'; | ||
import { setDefaultSubmittedAndCavSortOrderAction } from '@web-client/presenter/actions/JudgeActivityReport/setDefaultSubmittedAndCavSortOrderAction'; | ||
import { setJudgeActivityReportFiltersAction } from '@web-client/presenter/actions/JudgeActivityReport/setJudgeActivityReportFiltersAction'; | ||
import { setPendingMotionDocketEntriesForCurrentJudgeAction } from '@web-client/presenter/actions/PendingMotion/setPendingMotionDocketEntriesForCurrentJudgeAction'; | ||
import { setScrollToErrorNotificationAction } from '@web-client/presenter/actions/setScrollToErrorNotificationAction'; | ||
import { setValidationAlertErrorsAction } from '../../actions/setValidationAlertErrorsAction'; | ||
import { setValidationErrorsAction } from '../../actions/setValidationErrorsAction'; | ||
import { showProgressSequenceDecorator } from '@web-client/presenter/utilities/showProgressSequenceDecorator'; | ||
|
@@ -27,8 +27,8 @@ export const submitJudgeActivityReportSequence = showProgressSequenceDecorator([ | |
validateJudgeActivityReportSearchAction, | ||
{ | ||
error: [ | ||
setAlertErrorAction, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Throughout, I have removed |
||
setValidationErrorsAction, | ||
setScrollToErrorNotificationAction, | ||
setValidationAlertErrorsAction, | ||
], | ||
success: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { clearAlertsAction } from '@web-client/presenter/actions/clearAlertsAction'; | ||
import { setValidationAlertErrorsAction } from '@web-client/presenter/actions/setValidationAlertErrorsAction'; | ||
import { setValidationErrorsAction } from '../../actions/setValidationErrorsAction'; | ||
import { showProgressSequenceDecorator } from '../../utilities/showProgressSequenceDecorator'; | ||
import { validateStatusReportOrderFormAction } from '../../actions/StatusReportOrder/validateStatusReportOrderFormAction'; | ||
|
||
export const validateStatusReportOrderSequence = [ | ||
showProgressSequenceDecorator([ | ||
clearAlertsAction, | ||
validateStatusReportOrderFormAction, | ||
{ | ||
error: [setValidationErrorsAction, setValidationAlertErrorsAction], | ||
success: [clearAlertsAction], | ||
}, | ||
]), | ||
] as unknown as () => void; |
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.
Just making the order of these consistent in the file.