diff --git a/docs/tutorials/form-service/building-forms.md b/docs/tutorials/form-service/building-forms.md index 5293050db..7462dc6ef 100644 --- a/docs/tutorials/form-service/building-forms.md +++ b/docs/tutorials/form-service/building-forms.md @@ -32,6 +32,20 @@ Sometimes a specific answer to a question will influence the flow of the form. A Jsonforms automatically handles basic input validation, such as ensuring required fields are filled in, dates are formatted correctly, or that numbers are, indeed, numbers. More sophisticated validation is also possible; you can add [custom error messages](https://jsonforms.io/docs/validation/) or even [integrate a custom AJV validator](https://jsonforms.io/docs/validation/) to [harness the full power of AJV](https://ajv.js.org/), which gives you complete control over validation. +#### Required Fields + +There is a known issue in jsonforms that allows an empty string to satisfy the required validation rule. To work around this, you should also add a minimum length of 1 to required string fields, e.g. + +```json +{ + "firstName": { + "type": "string", + "minLength": 1 + }, + "required": ["firstName"] +} +``` + ### Repeating Items You will sometimes need to capture [lists of information](/adsp-monorepo/tutorials/form-service/repeated-items.html) in a form. Lists contain a variable number of items, each containing the necessary details. For example, an application for a Farmers Market License may require list of vendors, each with contact information, a classification, and their expected yearly revenue. Users are able to add one item at a time and fill in the details as needed. diff --git a/docs/tutorials/form-service/cheat-sheet.md b/docs/tutorials/form-service/cheat-sheet.md index 945af73eb..ae0401f80 100644 --- a/docs/tutorials/form-service/cheat-sheet.md +++ b/docs/tutorials/form-service/cheat-sheet.md @@ -24,7 +24,7 @@ Note: in some UI schemas you will see "ComponentProps" in the options element. C ### Common data formats {#target-common-formats} -Here are some out-of-the-box formats that not only render with the correct input widget, but ensure that the data provided by users is valid. +Here are some out-of-the-box formats that not only render with the correct input widget, but ensure that the data provided by users is valid. NOTE: There is a known issue in jsonforms that allows an empty string to satisfy the required validation rule. To work around this, you should also add a minimum length of 1 to required string fields (see Limited text with required validation) below. diff --git a/docs/tutorials/form-service/form-app.md b/docs/tutorials/form-service/form-app.md index 4ac0fed8f..8633f531c 100644 --- a/docs/tutorials/form-service/form-app.md +++ b/docs/tutorials/form-service/form-app.md @@ -20,10 +20,9 @@ https://form.adsp-uat.alberta.ca/afids/Farmers-Market-License-Application ### Users -Currently only GoA personnel are able to log-in and use the _Form-App_, although ADSP will be implementing other, secure techniques to enable other Albertans to use the product, including +Forms can be configured to allow only those people with GoA or Alberta.ca credentials to access and fill them in. This gives users the best experience, as they will be able to fill in the information over several sessions, as needed. In addition, they will be able to initiate online conversations with form administrators if they have questions. -- use of My Alberta Digital ID -- use of email and verification codes +However, you can also configure a form to allow anonymous access. Anyone will be able to fill in and submit a form, without logging in. In this case, they will have to complete the form in one session, and they will not have access to the "chat" capability. ### Security