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
mgr/dashboard: Add submit button component #21011
Conversation
* | ||
* To indicate that the request failed, returning the button to the enable | ||
* state, you need to insert an error in the form with the 'cdSubmitButton' key. | ||
* p.e.: this.rbdForm.setErrors({'cdSubmitButton': 'ERR'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use this.rbdForm.setErrors({'cdSubmitButton': true});
as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
@tspmelo rebase on top of master |
This component is to be used inside a form. It will render a submit button with the given label. The button will disabled itself and show a loading icon when the user clicks it, usually initiating a request to the server, and it will stay in that state until the request is finished. To indicate that the request failed, returning the button to the enable state, you need to insert an error in the form with the 'cdSubmitButton' key. It will also check if the form is valid, when clicking the button, and will focus on the first invalid input. Signed-off-by: Tiago Melo <tmelo@suse.com>
This component is to be used inside a form.
It will render a submit button with the given label.
The button will disabled itself and show a loading icon when the user clicks it,
usually initiating a request to the server, and it will stay in that state
until the request is finished.
To indicate that the request failed, returning the button to the enable state,
you need to insert an error in the form with the 'cdSubmitButton' key.
It will also check if the form is valid, when clicking the button, and will
focus on the first invalid input.
Signed-off-by: Tiago Melo <tmelo@suse.com>