Skip to content

Commit

Permalink
Doc: Feedback #3070 - Add the value prop (#76)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

This PR adds a prop `value` that can be passed to `inputType` when set
to `hidden`. This prop set a pre-defined text in the input to be
submitted.

You can find more information on the task `EDU-9870 Feedback #2996 -
Improvement`

---------

Co-authored-by: Carolina Menezes <60782333+carolinamenezes@users.noreply.github.com>
  • Loading branch information
mariana-caetano and carolinamenezes authored Jul 6, 2023
1 parent 7e037b3 commit 3cada09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
- Prop `value` to the documentation

## [0.10.0] - 2023-02-28

### Added
Expand Down
9 changes: 5 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ In the example below, the form block is contained in a Flex Layout row:

| Prop name | Type | Description | Default Value |
| ----------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| `pointer` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) JSON schema pointer i.e. the JSON schema path (for example: #/properties/firstName) in which the form block inputs should be validated against. | `undefined` |
| `inputType` | `enum` | Defines which type of a text field should be rendered: <br>`input`: renders a normal text field.<br>`hidden`: does not render any text field. It should be used in scenarios in which you want to pre-define a field value to be submitted to the form but that shouldn't be visible (and therefore editable) to users. <br>`password`: renders a password text field. | `input` |
| `label` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) Field's name when rendered | Property's title |
| `pointer` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) JSON schema path (e.g., `#/properties/firstName`) for validating form block inputs. | `undefined` |
| `inputType` | `enum` | Defines the type of the text field. Possible values are: `input` - renders a regular text field; `hidden` - renders a hidden text field used for pre-defining an editable value to be submitted to the form; `password` - renders a password text field. | `input` |
| `value` (optional) | `string` | Displays a pre-defined text to be submitted when the `inputType` is set as `hidden`. | `undefined` |
| `label` | `string` | ![https://img.shields.io/badge/-Mandatory-red](https://img.shields.io/badge/-Mandatory-red) Label of the input field. | Property's title |
| `placeholder` | `string` | Placeholder for the text input. | `undefined` |

### `form-field-group` props
Expand Down Expand Up @@ -204,7 +205,7 @@ Where `childName` should be replaced for the desired sub-property name and the
- `checkbox`: the sub-property will be rendered as a`form-input.checkbox` block.
- `upload`: the sub-property will be rendered as a`form-input.upload` block.

## Modus operandi
## App behavior

The JSON schema created in Master Data is firstly responsible for telling form blocks which data they must receive i.e. specifying which kind of input each form field should expect from users.

Expand Down

0 comments on commit 3cada09

Please sign in to comment.