[Kimchi-devel] [PATCH] Issue #317: disable storage pool create by default in UI

Yu Xin Huo huoyuxin at linux.vnet.ibm.com
Wed May 14 09:11:15 UTC 2014


Tested this patch and got issues below:

1. Once I input the storage pool name, an error message occurs which 
looks like some request is sent.


2. The button is enabled only when the 'Storage Path' field lose focus.
     it should bind to 'keyup' event to make the button enabled once 
there is a valid input and disabled once user clear the path.



On 5/14/2014 11:38 AM, shaohef at linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
>
> All button status of add/create pages should be consistent - it should
> be disabled by default until the minimum of the required fields are
> filled.
>
> Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
> ---
>   ui/js/src/kimchi.storagepool_add_main.js | 8 ++++++++
>   ui/pages/storagepool-add.html.tmpl       | 2 +-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
> index 86dbe7f..7bed152 100644
> --- a/ui/js/src/kimchi.storagepool_add_main.js
> +++ b/ui/js/src/kimchi.storagepool_add_main.js
> @@ -145,6 +145,14 @@ kimchi.initStorageAddPage = function() {
>       $('#iscsiportId').keyup(function(event) {
>           $(this).toggleClass("invalid-field",!/^[0-9]+$/.test($(this).val()));
>       });
> +    $('#form-pool-add').change(function() {
> +        if (kimchi.validateForm()) {
> +            $('#pool-doAdd').removeAttr('disabled');
> +        } else {
> +            $('#pool-doAdd').attr('disabled', 'disabled');
> +        }
> +
> +    });
>   };
>
>   kimchi.validateForm = function() {
> diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
> index 977db66..7406bab 100644
> --- a/ui/pages/storagepool-add.html.tmpl
> +++ b/ui/pages/storagepool-add.html.tmpl
> @@ -152,7 +152,7 @@
>           </div>
>           <footer>
>               <div class="btn-group">
> -                <button id="pool-doAdd" class="btn-normal">
> +                <button id="pool-doAdd" class="btn-normal" disabled="disabled">
>                       <span class="text">$_("Create")</span>
>                   </button>
>               </div>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140514/9314ffb5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfcaidjf.png
Type: image/png
Size: 52986 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140514/9314ffb5/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dfjegbbe.png
Type: image/png
Size: 10913 bytes
Desc: not available
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140514/9314ffb5/attachment-0001.png>


More information about the Kimchi-devel mailing list