]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: Add submit button component 21011/head
authorTiago Melo <tmelo@suse.com>
Fri, 23 Mar 2018 16:40:29 +0000 (16:40 +0000)
committerTiago Melo <tmelo@suse.com>
Fri, 23 Mar 2018 16:40:29 +0000 (16:40 +0000)
commit03fa8585ef85e74e3eb5ca90e2ed8cfd5fb89fa3
tree757c1de7d6c7f8eecc00d67c2cae01fc84ae4eb2
parentf1936a2702795f524018a97b3be4eaa097491f14
mgr/dashboard: Add submit button component

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>
src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.html [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.scss [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.spec.ts [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.ts [new file with mode: 0644]