Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 1DEA2E00B21; Thu, 26 Nov 2015 08:19:54 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C1A1DE00AF6 for ; Thu, 26 Nov 2015 08:19:49 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 26 Nov 2015 08:19:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,347,1444719600"; d="scan'208";a="847676316" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 26 Nov 2015 08:19:49 -0800 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.163]) by IRSMSX103.ger.corp.intel.com ([169.254.3.13]) with mapi id 14.03.0248.002; Thu, 26 Nov 2015 16:18:10 +0000 From: "Barros Pena, Belen" To: "Wood, Michael G" , "Smith, Elliot" Thread-Topic: [Toaster] [[PATCH v2]] toaster: projectconf Add feature for free form IMAGE_FSTYPES Thread-Index: AQHRJru9iI/iX5UAfkWVytSaQPSPuZ6uX+EAgAAbNoCAAAOGAA== Date: Thu, 26 Nov 2015 16:18:11 +0000 Message-ID: References: <1448278908-29158-1-git-send-email-michael.g.wood@intel.com> <56572DCD.6030507@intel.com> In-Reply-To: <56572DCD.6030507@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.8.151023 x-originating-ip: [10.237.224.34] MIME-Version: 1.0 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:19:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: <59E539D3CAD03C4EB9C5ABFC44FDB773@intel.com> Content-Transfer-Encoding: quoted-printable On 26/11/2015 16:05, "Michael Wood" wrote: >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'. The fact that Elliot couldn't work it out I think tells us something. We shouldn't leave it that way :/ > >> >> 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=E9n >> >> > >> >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 @@ >> > > >js-config-var-managed-name">IMAGE_FSTYPES >> > > title=3D"Formats of >> >root file system images that you want to have created
> =20 >>>href=3D'http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.htm= l# >>>va >> >r-IMAGE_FSTYPES' target=3D'_blank'>Read more in the manual"> >> > >> >-
>> >- {{fstypes}} >> >- > >id=3D"change-image_fstypes-icon"> >> >-
> >style=3D"display:none;"> >> >- > >placeholder=3D"Search image types" class=3D"span4"> >> >-
>> >+
>> >+ > class=3D"lead">{{fstypes}} >> >+ > id=3D"change-image_fstypes-icon"> >> >+ > style=3D"display:none;"> >> >+ >> >+ > >placeholder=3D"Search known image types" class=3D"span4"> >> >+
>> >+
>> >+
>> >+ > >id=3D"fstypes-control-validation"> >> >+ >> >+ > id=3D"new-image-fstype-input"> >> >+ >> >+ >> >
>> >- > >id=3D"fstypes-error-message">You must select at least one image >> type >> >- >> >- >> >-
>> >-
>> >+

> >id=3D"fstypes-error-message"> >> >+ You must select at least one image type. >>
>> >+ Choose from the list of known ones or type >> your >> >own. >> >+

>> >+

> >id=3D"invalid-chars-in-fstype-msg"> >> >+ A valid image type cannot include >>underscores. >> >+

>> >+
>> >+ >> >+ >> >+
>> >+ >> >+ >> > {% endif %} >> > >> > {% if image_install_append_defined %} >> >@@ -305,20 +323,41 @@ >> > return true; >> > } >> > >> >- // Test to insure at least one FS Type is checked >> >+ var fsTypesInput =3D $("#new-image-fstype-input"); >> >+ var invalidCharsMsg =3D $("#invalid-chars-in-fstype-msg"); >> >+ var fsTypesControl =3D $("#fstypes-control-validation"); >> >+ var noFsType =3D $('#fstypes-error-message'); >> >+ var fsTypesApplyBtn =3D $("#apply-change-image_fstypes"); >> >+ >> >+ /* Validation of fstypes */ >> > function enableFsTypesSave() { >> >- var any_checked =3D 0; >> >- $(".fs-checkbox-fstypes:checked").each(function(){ >> >- any_checked =3D 1; >> >- }); >> >- if ( 0 =3D=3D 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 =3D false; >> >+ var valid_checkboxes =3D false; >> >+ var anyChecked =3D >>$(".fs-checkbox-fstypes:checked").length; >> >+ >> >+ /* No underscores allowed */ >> >+ if (fsTypesInput.val().match(/\_/)) { >> >+ invalidCharsMsg.show(); >> >+ fsTypesControl.addClass("error"); >> >+ valid_input =3D false; >> >+ } else { >> >+ fsTypesControl.removeClass("error"); >> >+ invalidCharsMsg.hide(); >> >+ valid_input =3D true; >> >+ } >> >+ >> >+ if (!anyChecked && !fsTypesInput.val()){ >> >+ noFsType.show(); >> >+ valid_checkboxes =3D false; >> >+ } else { >> >+ noFsType.hide(); >> >+ valid_checkboxes =3D true; >> >+ } >> >+ >> >+ if (valid_checkboxes =3D=3D false || valid_input =3D=3D = 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 =3D []; >> >- var checkboxes =3D >> >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 =3D ''; >> >+ // extract the selected fstypes and sort them >> >+ var fstypes_array =3D []; >> >+ var checkboxes =3D >> >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 =3D fsTypesInput.val().split(" "= ); >> >+ >> >+ for (var type in inputFsTypes){ >> >+ if >> (fstypes_array.indexOf(inputFsTypes[type].trim()) >> >=3D=3D=3D -1) >> >+ { >> >+ fstypes +=3D inputFsTypes[type]+' '; >> >+ } >> >+ } >> >+ } >> > >> > // now make a string of them >> >- var fstypes =3D ''; >> > for (var i =3D 0, length =3D fstypes_array.length;= i < >> >length; i++) { >> > fstypes +=3D 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 >> >> >> >> >> --=20 >> 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. >> >