Skip to content
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

Support customization / props of submit button using ui:submitButtonOptions #2640

Merged
merged 70 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
eef9605
Merge pull request #2 from rjsf-team/master
jacqueswho Apr 9, 2020
04b3d07
Merge pull request #4 from rjsf-team/master
jacqueswho Jun 1, 2020
9e2dff9
Merge branch 'rjsf-team:master' into master
jacqueswho Oct 28, 2021
28e86ba
feat: submit button props
jacqueswho Dec 29, 2021
0f4c77c
feat: ui options playground options
jacqueswho Dec 29, 2021
807a377
feat: other themes to implement widget
jacqueswho Dec 29, 2021
43a175f
feat: remove hidden option
jacqueswho Dec 30, 2021
7656dd3
chore: required to allowed
jacqueswho Jan 14, 2022
7b4673a
chore: requested changes
jacqueswho Jan 17, 2022
1c2800d
doc: change prop
jacqueswho Jan 17, 2022
4c5960c
chore: version bump changes
jacqueswho Jan 18, 2022
ff636fe
Update CHANGELOG.md
jacqueswho Jan 18, 2022
492a2bc
Update docs/api-reference/uiSchema.md
jacqueswho Jan 18, 2022
20cf440
Update docs/api-reference/uiSchema.md
jacqueswho Jan 18, 2022
1a484d5
Update docs/api-reference/uiSchema.md
jacqueswho Jan 18, 2022
16bc002
dox: updated
jacqueswho Jan 18, 2022
29a5f3a
chore: version changes
jacqueswho Jan 25, 2022
3aeae46
chore: revert version
jacqueswho Jan 25, 2022
36f57b3
Merge branch 'rjsf-team:master' into master
jacqueswho Jan 25, 2022
911d5f3
Squashed commit of the following:
jacqueswho Jan 25, 2022
2c1ed48
Merge branch 'master' into feature/submit_button_props
jacqueswho Jan 25, 2022
1b0c918
lint: cs-check
jacqueswho Jan 25, 2022
35f5bd2
linting: js format
jacqueswho Jan 25, 2022
24b8d80
feat: updated util types
jacqueswho Jan 26, 2022
e30ea18
feat: getSubmitButtonOptions type
jacqueswho Jan 26, 2022
73f515c
chore: update tests
jacqueswho Jan 26, 2022
45405be
chore: tests updated
jacqueswho Jan 26, 2022
9b16d83
hocer: snapshots updated
jacqueswho Jan 26, 2022
d9eb5c9
chore: test:update command
jacqueswho Jan 26, 2022
3654887
Update snapshots
epicfaace Jan 26, 2022
f3aebb5
Update PR template with snapshot update command
epicfaace Jan 26, 2022
cc6d90c
feat: remove default className
jacqueswho Jan 26, 2022
c94591f
chore: update util tests
jacqueswho Jan 26, 2022
5d98df6
chore: remove classname test
jacqueswho Jan 26, 2022
629e0bb
chore: snapshots updated
jacqueswho Jan 27, 2022
d6a09eb
Merge branch 'rjsf-team:master' into master
jacqueswho Feb 16, 2022
e91212c
Squashed commit of the following:
jacqueswho Feb 16, 2022
2e3a3d8
merge with master
jacqueswho Feb 16, 2022
81347a2
Merge branch 'feature/submit_button_props' of https://github.com/jacq…
jacqueswho Feb 16, 2022
64fc369
Revert "Squashed commit of the following:"
jacqueswho Feb 18, 2022
2e17c56
Merge branch 'master' of git://github.com/rjsf-team/react-jsonschema-…
jacqueswho Feb 18, 2022
0507f87
chore: update tests
jacqueswho Feb 18, 2022
2f5a808
Merge branch 'master' into feature/submit_button_props
jacqueswho Feb 18, 2022
2a559fa
Merge branch 'master' into feature/submit_button_props
jacqueswho Feb 24, 2022
68f9d28
Merge branch 'master' of github.com:jacqueswho/react-jsonschema-form …
jacqueswho Feb 25, 2022
2d354da
Merge branch 'master' of git://github.com/rjsf-team/react-jsonschema-…
jacqueswho Feb 25, 2022
7858979
Merge branch 'master' into feature/submit_button_props
jacqueswho Mar 1, 2022
7e220d7
Merge branch 'master' into feature/submit_button_props
epicfaace Mar 4, 2022
b58c34c
Merge branch 'master' of git://github.com/rjsf-team/react-jsonschema-…
jacqueswho Mar 4, 2022
b596d2b
Merge branch 'feature/submit_button_props' of github.com:jacqueswho/r…
jacqueswho Mar 4, 2022
e6fd8cb
test: snapshots updated
jacqueswho Mar 5, 2022
cb89a03
chore: norender changes
jacqueswho Mar 5, 2022
0088b0d
Merge branch 'feature/submit_button_props' of https://github.com/jacq…
epicfaace Mar 15, 2022
62fc572
revert
epicfaace Mar 15, 2022
2f677cd
update snapshots
epicfaace Mar 15, 2022
769a035
fix: include correct code again for submit button props
jacqueswho Mar 15, 2022
386a029
chore: update snapshots
jacqueswho Mar 15, 2022
6b176aa
Merge branch 'master' into feature/submit_button_props
jacqueswho Mar 16, 2022
8ac01ee
Merge branch 'master' of github.com:rjsf-team/react-jsonschema-form i…
jacqueswho Apr 7, 2022
9b440d3
Merge branch 'master' into feature/submit_button_props
jacqueswho Apr 7, 2022
43e79a6
Merge branch 'feature/submit_button_props' of github.com:jacqueswho/r…
jacqueswho Apr 7, 2022
8ee49f5
Merge branch 'master' of github.com:rjsf-team/react-jsonschema-form i…
jacqueswho Apr 8, 2022
23dea6f
Merge branch 'master' of github.com:rjsf-team/react-jsonschema-form i…
jacqueswho Apr 12, 2022
540f456
chore: update snapshots
jacqueswho Apr 12, 2022
1fe1e4c
chore: snapshots updated
jacqueswho Apr 12, 2022
e1ebb05
chore: update snapshots semantic-ui
jacqueswho Apr 12, 2022
fe2d6ae
Merge branch 'master' of https://github.com/rjsf-team/react-jsonschem…
jacqueswho Apr 13, 2022
8462132
chore: get latest version master
jacqueswho Apr 13, 2022
4b8f901
Merge branch 'master' into feature/submit_button_props
jacqueswho Apr 13, 2022
0b436f1
chore: snapshots updated
jacqueswho Apr 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.

tasks:
- init: npm install && npm run build
command: npm run start


15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,22 @@ should change the heading of the (upcoming) version to include a major version b
## @rjsf/core
- Don't crash when non-object formData is passed in to a schema item with additionalProperties (https://github.com/rjsf-team/react-jsonschema-form/pull/2595)
- Upgrade jsonpointer to 5.0.0 to address security vulnerability (https://github.com/rjsf-team/react-jsonschema-form/pull/2599)
- Feature for ui:submitButtonOptions on the submit button for forms (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)

## Dev / docs / playground
- Enable ui options in playground, to demonstrate submit button options (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)

## @rjsf/bootstrap-4
- SubmitButton widget to use new ui:submitButtonOptions on the submit button for forms (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)

## @rjsf/semantic-ui
- SubmitButton widget to use new ui:submitButtonOptions on the submit button for forms (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)

## @rjsf/antd
- SubmitButton widget to use new ui:submitButtonOptions on the submit button for forms (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)

## @rjsf/fluent-ui
- SubmitButton widget to use new ui:submitButtonOptions on the submit button for forms (https://github.com/rjsf-team/react-jsonschema-form/pull/2640)
Comment on lines +97 to +112
Copy link
Member

@heath-freenome heath-freenome Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacqueswho This should be moved up under a new 4.2.0 section (4.1.1 was already released) rather than being under v3.2.1 and include ## @material-ui as well, since we actually haven't published this feature yet.


# v3.2.0

Expand Down
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If your PR is non-trivial and you'd like to schedule a synchronous review, pleas
* [ ] **I'm updating documentation**
- [ ] I've [checked the rendering](https://react-jsonschema-form.readthedocs.io/en/latest/#contributing) of the Markdown text I've added
* [ ] **I'm adding or updating code**
- [ ] I've added and/or updated tests
- [ ] I've added and/or updated tests. I've run `npm run test:update` to update snapshots, if needed.
- [ ] I've updated [docs](https://react-jsonschema-form.readthedocs.io/) if needed
- [ ] I've updated the [changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/master/CHANGELOG.md) with a description of the PR
* [ ] **I'm adding a new feature**
Expand Down
58 changes: 57 additions & 1 deletion docs/api-reference/uiSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,30 @@ In other words, the following uiSchemas are equivalent:
{
"ui:title": "Title",
"ui:description": "Description"
"ui:submitButtonOptions": {
"props": {
"disabled": false,
"className": "btn btn-info",
},
"norender": false,
"submitText": "Submit"
},
}
```

```json
{
"ui:options": {
"title": "Title",
"description": "Description"
"description": "Description",
"submitButtonOptions": {
"props": {
"disabled": false,
"className": "btn btn-info",
},
"norender": false,
"submitText": "Submit"
},
}
}
```
Expand Down Expand Up @@ -226,5 +242,45 @@ const uiSchema = {
"ui:title": "Your password"
};
```

## submitButtonOptions

Sometimes it's convenient to change the behavior of the submit button for the form. This is the purpose of the `ui:submitButtonOptions` uiSchema directive:

You can pass any other prop to the submit button if you want, by default, this library will set the following options / props mentioned below for all submit buttons:

### `norender` option

You can set this property to `true` to remove the submit button completely from the form. Nice option, if the form is just for viewing purposes.

### `submitText` option

You can use this option to change the text of the submit button. Set to "Submit" by default.

### `props` section

You can pass any other prop to the submit button if you want, via this section.


jacqueswho marked this conversation as resolved.
Show resolved Hide resolved
#### `disabled` prop

You can use this option to disable the submit button.

#### `className` prop

You can use this option to specify a class name for the submit button.

```js
const uiSchema = {
"ui:submitButtonOptions": {
"props": {
"disabled": false,
"className": "btn btn-info",
},
"norender": false,
"submitText": "Submit"
}
};
```
## Theme Options
[Semantic UI](themes/semantic-ui/uiSchema.md)
Loading