LG-4876 Adding the new doc capture error warning view#5593
LG-4876 Adding the new doc capture error warning view#5593amathews-fs merged 20 commits intomainfrom
Conversation
There was a problem hiding this comment.
we've been naming these files kebab-case, can we rename?
| import withProps from '../higher-order/withProps'; | |
| import withProps from '../higher-order/with-props'; |
app/javascript/packages/document-capture/components/form-steps.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The parameter here is used for location=, so should be unique. It can be whatever you want to call it, e.g.
| url: getFailureToProofURL('capture_tips'), | |
| url: getFailureToProofURL('post_submission'), |
There was a problem hiding this comment.
Oops. That was a copy and paste that I forgot to fix. Thanks for catching that.
There was a problem hiding this comment.
This should be lowercase, since the capitalized Number refers to a different thing.
| * @prop {Number=} remaining_attempts Number of remaining doc capture attempts for user. | |
| * @prop {number=} remaining_attempts Number of remaining doc capture attempts for user. |
There was a problem hiding this comment.
Damned, I even looked that up and was surprised to find it had a primitive vs. Object number. I thought about fixing it but apparently never did.
spec/javascripts/packages/document-capture/higher-order/with-props-spec.jsx
Outdated
Show resolved
Hide resolved
…ut before review step.
aae3d48 to
5e63b6f
Compare
| {!!unknownFieldErrors && | ||
| unknownFieldErrors.map(({ error }) => <p key={error.message}>{error.message}</p>)} | ||
|
|
||
| {remainingAttempts <= 3 && ( |
There was a problem hiding this comment.
Minor: Might be good idea to pull out this magic number as a constant toward the top of the file.
There was a problem hiding this comment.
Yeah, good call. I thought about making it a config but then decided against it and just didn't think about pulling it out as a constant.
| const steps = [STEPS[1]]; | ||
|
|
||
| const { getByRole } = render(<FormSteps steps={steps} />); | ||
| const button = getByRole('button', { name: 'Create Step Error' }); |
There was a problem hiding this comment.
The corresponding button in the STEPS example content existed only for this test case, so could be removed as well.
There was a problem hiding this comment.
Good catch. I'll remove it.
Adding the new doc capture error warning view after failure but before review step.