DF-944: Implement TrackingField component - #470
Conversation
| "Hidden fields can be pre-populated from query string parameters — see [Pre-populating state](../code-based/pre-populate-state.md) for details." | ||
| ], | ||
| "TrackingField": [ | ||
| "Tracking fields can track the user's progress through the form. They are hidden fields that are set to `true` when the user reaches a certain point in the form." |
There was a problem hiding this comment.
'...when the user reaches a certain point in the form...' - suggest '...when the user reaches the page the tracking field is on..'
There was a problem hiding this comment.
I nearly went with this but then reverted. It's only once the user passes then page (through a POST) that it's set to true (i.e. not on the GET).
There was a problem hiding this comment.
How about 'They are hidden fields that are set to true when the user passes the page in the form.'
| */ | ||
| static getAllPossibleErrors(): ErrorMessageTemplateList { | ||
| return { | ||
| baseErrors: [{ type: 'required', template: messageTemplate.required }], |
There was a problem hiding this comment.
Will we have any errors for this field? It will always be there so we'll never hit a 'required' error
There was a problem hiding this comment.
I guess they could if they were to delete the hidden input but no ordinarily there couldn't be an error.
I was basing this component on the existing HiddenField which does also have the 1 base required error - is that incorrect for that field then too do you think?
jbarnsley10
left a comment
There was a problem hiding this comment.
A couple of minor comments
|



Proposed change
Adds new component
TrackingField.Renders a hidden
<input>with a value oftruethat can be used to track progress through a formDependent on
forms-modelbump hereJira ticket: https://eaflood.atlassian.net/browse/DF-994
Type of change
Checklist
README.mdanddocs/*(where appropriate, e.g. new features).npm run test).npm run lint).npm run format).