From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3BB6DE00B21; Thu, 26 Nov 2015 08:05:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [74.125.82.44 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 67366E00AF6 for ; Thu, 26 Nov 2015 08:05:35 -0800 (PST) Received: by wmec201 with SMTP id c201so37417479wme.0 for ; Thu, 26 Nov 2015 08:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ypfbQe0ndvHmvenKvGjELGxQnuQAn8phy/FuhJDX8/o=; b=wd8W2TyKKXcUey3e90G1s9io0gVVkmopECYePNoicstKwzQcgXmbIs0LUF74QUGne4 pyXI+2UVgq8M4V0kxHrbCye9B++VRkNepDNwmu1t6wXzowOQOpwpiiIi19KS60OPoFha B8gN+jMuzmpVL/aAn8Oy1aNNOjZoEimYBZnDGId8RE1hd/z9NBvdU7QSH8NP57wRg5Ud grOQi5cIuBIVRc7k66C8D6yGrGhnoiSaDHz4d11xdYWiC9qpzH/J1kdYXb+Bo7D81UOC p6AwwirMJrjea8DHWaZikyIWi1tLk/kayQpGYqAGO1LRZKDcizvdjbN/LuXsoV6gAEp2 wfJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ypfbQe0ndvHmvenKvGjELGxQnuQAn8phy/FuhJDX8/o=; b=HbQBu05MlCrAKejcHfdLgmssIMcImv9s/KQB5Zj+80uwT3ik8toWcLq6zSYtabKCR/ t4dRNYQMocK0VMdLCYH52gv59dH1UnVKiCD16cg0rpI5jXkdbJUnqU77F6JSkiBIBSIC ErAkQagFxk4BPlrsy+6JJt3hpNxIvpb2LTb+yiihIV1OrgKKJxJmBFc4CVsvxgB3W5Mm Ue8Gn7jMigh4GCkRViGI6c/APTJA/7Zq1JOdTKXJoJBwXhZ70bQ4qk/3mv49FmkBk3vD cJqWD3sH9vbsQDevKRGgUROw9BRZJNuxvkFmwqLOTHGA1CmpMTFIhbLKozKBqKeLFK9A X6BQ== X-Gm-Message-State: ALoCoQlAccI3oAia306rRdoJ4GMgLfXkCD9PBmbxTjEy3LZetdxgx2ji1MwmJZ+oHB7awsDwQTLR X-Received: by 10.194.192.106 with SMTP id hf10mr49617634wjc.131.1448553934329; Thu, 26 Nov 2015 08:05:34 -0800 (PST) Received: from [192.168.2.10] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id t194sm3350823wmt.11.2015.11.26.08.05.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Nov 2015 08:05:33 -0800 (PST) To: "Smith, Elliot" , "Barros Pena, Belen" References: <1448278908-29158-1-git-send-email-michael.g.wood@intel.com> From: Michael Wood Message-ID: <56572DCD.6030507@intel.com> Date: Thu, 26 Nov 2015 16:05:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Cc: "toaster@yoctoproject.org" Subject: Re: [[PATCH v2]] toaster: projectconf Add feature for free form IMAGE_FSTYPES X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2015 16:05:38 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 26/11/15 14:28, Smith, Elliot wrote: > On 24 November 2015 at 13:26, Barros Pena, Belen > > wrote: > > On 23/11/2015 11:41, "toaster-bounces@yoctoproject.org > on behalf of > Michael Wood" on behalf of > michael.g.wood@intel.com > wrote: > > >Add feature to the projectconf page to allow free form input of > >IMAGE_FSTYPES. Sometimes a recipe can provide an IMAGE_FSTYPE that > >isn't in the normal image_types class. So would need to be specified > >manually. > > > >[YOCTO #7828] > > This seems to address all the issues from v1. Getting rid the 'already > selected' error message by not duplicating any values works well. > > > It works correctly, but there is one issue: if you enter an invalid > string as the image type (e.g. btrfss) and want to correct it, there's > no way to delete it from the list. To remove custom added values, you just have to click edit and then press 'Save'. > > Perhaps a button to set the list back to the defaults, or to remove > any invalid types ("cleanup")? > > Alternatively, add the user's custom image type to the checkbox list; > if they uncheck it, is disappears from the list. > > Elliot > > > From my perspective, this is good to go. > > Thanks! > > Belén > > > > >Signed-off-by: Michael Wood > > >--- > > .../toaster/toastergui/templates/projectconf.html | 128 > >+++++++++++++++------ > > 1 file changed, 95 insertions(+), 33 deletions(-) > > > >diff --git > a/bitbake/lib/toaster/toastergui/templates/projectconf.html > >b/bitbake/lib/toaster/toastergui/templates/projectconf.html > >index 30fd03e..13f9c66 100644 > >--- a/bitbake/lib/toaster/toastergui/templates/projectconf.html > >+++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html > >@@ -36,18 +36,36 @@ > > IMAGE_FSTYPES > > title="Formats of > >root file system images that you want to have created
>href='http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#va > >r-IMAGE_FSTYPES' target='_blank'>Read more in the manual">
> > > >-
> >- {{fstypes}} > >- >id="change-image_fstypes-icon"> > >-
>style="display:none;"> > >- >placeholder="Search image types" class="span4"> > >-
> >+
> >+ class="lead">{{fstypes}} > >+ id="change-image_fstypes-icon"> > >+ style="display:none;"> > >+ > >+ >placeholder="Search known image types" class="span4"> > >+
> >+
> >+
> >+ >id="fstypes-control-validation"> > >+ > >+ id="new-image-fstype-input"> > >+ > >+ > >
> >- >id="fstypes-error-message">You must select at least one image > type > >- > >- > >-
> >-
> >+ > >+ > >+
> >+ > >+ > >+
> >+ > >+ > > {% endif %} > > > > {% if image_install_append_defined %} > >@@ -305,20 +323,41 @@ > > return true; > > } > > > >- // Test to insure at least one FS Type is checked > >+ var fsTypesInput = $("#new-image-fstype-input"); > >+ var invalidCharsMsg = $("#invalid-chars-in-fstype-msg"); > >+ var fsTypesControl = $("#fstypes-control-validation"); > >+ var noFsType = $('#fstypes-error-message'); > >+ var fsTypesApplyBtn = $("#apply-change-image_fstypes"); > >+ > >+ /* Validation of fstypes */ > > function enableFsTypesSave() { > >- var any_checked = 0; > >- $(".fs-checkbox-fstypes:checked").each(function(){ > >- any_checked = 1; > >- }); > >- if ( 0 == any_checked ) { > >- > >$("#apply-change-image_fstypes").attr("disabled","disabled"); > >- $('#fstypes-error-message').show(); > >- } > >- else { > >- $("#apply-change-image_fstypes").removeAttr("disabled"); > >- $('#fstypes-error-message').hide(); > >- } > >+ var valid_input = false; > >+ var valid_checkboxes = false; > >+ var anyChecked = $(".fs-checkbox-fstypes:checked").length; > >+ > >+ /* No underscores allowed */ > >+ if (fsTypesInput.val().match(/\_/)) { > >+ invalidCharsMsg.show(); > >+ fsTypesControl.addClass("error"); > >+ valid_input = false; > >+ } else { > >+ fsTypesControl.removeClass("error"); > >+ invalidCharsMsg.hide(); > >+ valid_input = true; > >+ } > >+ > >+ if (!anyChecked && !fsTypesInput.val()){ > >+ noFsType.show(); > >+ valid_checkboxes = false; > >+ } else { > >+ noFsType.hide(); > >+ valid_checkboxes = true; > >+ } > >+ > >+ if (valid_checkboxes == false || valid_input == false) > >+ fsTypesApplyBtn.attr("disabled","disabled"); > >+ else > >+ fsTypesApplyBtn.removeAttr("disabled"); > > } > > > > // Preset or reset the Package Class checkbox labels > >@@ -597,17 +636,37 @@ > > } > > }); > > > >- $('#apply-change-image_fstypes').click(function(){ > >- // extract the selected fstypes and sort them > >- var fstypes_array = []; > >- var checkboxes = > >document.getElementsByClassName('fs-checkbox-fstypes'); > >- $(".fs-checkbox-fstypes:checked").each(function(){ > >- fstypes_array.push($(this).val()); > >- }); > >- fstypes_array.sort(); > >+ fsTypesInput.on('input', function(){ > >+ enableFsTypesSave(); > >+ }); > >+ > >+ fsTypesApplyBtn.click(function(e){ > >+ e.preventDefault(); > >+ > >+ var fstypes = ''; > >+ // extract the selected fstypes and sort them > >+ var fstypes_array = []; > >+ var checkboxes = > >document.getElementsByClassName('fs-checkbox-fstypes'); > >+ $(".fs-checkbox-fstypes:checked").each(function(){ > >+ fstypes_array.push($(this).val()); > >+ }); > >+ fstypes_array.sort(); > >+ > >+ /* If we have a value in our enter own image type > input > >and it > >+ * isn't already selected add it to the fstypes value > >+ */ > >+ if (fsTypesInput.val()){ > >+ var inputFsTypes = fsTypesInput.val().split(" "); > >+ > >+ for (var type in inputFsTypes){ > >+ if > (fstypes_array.indexOf(inputFsTypes[type].trim()) > >=== -1) > >+ { > >+ fstypes += inputFsTypes[type]+' '; > >+ } > >+ } > >+ } > > > > // now make a string of them > >- var fstypes = ''; > > for (var i = 0, length = fstypes_array.length; i < > >length; i++) { > > fstypes += fstypes_array[i] + ' '; > > } > >@@ -620,6 +679,9 @@ > > $("#change-image_fstypes-form").slideUp(function() { > > $('#image_fstypes, > >#change-image_fstypes-icon').show(); > > }); > >+ > >+ > >+ fsTypesInput.val(""); > > }); > > {% endif %} > > > >-- > >2.5.0 > > > >-- > >_______________________________________________ > >toaster mailing list > >toaster@yoctoproject.org > >https://lists.yoctoproject.org/listinfo/toaster > > -- > _______________________________________________ > toaster mailing list > toaster@yoctoproject.org > https://lists.yoctoproject.org/listinfo/toaster > > > > > -- > Elliot Smith > Software Engineer > Intel Open Source Technology Centre > > --------------------------------------------------------------------- > Intel Corporation (UK) Limited > Registered No. 1134945 (England) > Registered Office: Pipers Way, Swindon SN3 1RJ > VAT No: 860 2173 47 > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. >