From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 0BA28E00BF3; Mon, 14 Sep 2015 07:19:19 -0700 (PDT) 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,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 * [209.85.212.172 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id B32E0E00804 for ; Mon, 14 Sep 2015 07:19:14 -0700 (PDT) Received: by wicfx3 with SMTP id fx3so134805954wic.0 for ; Mon, 14 Sep 2015 07:19:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=NS+rVC/U+98ExdAD0OvecNk3p+qoZW1zq/6AtQXwrpo=; b=eFkLqG8UbDL2Hp1wdaufUjnpqsv6DLlwmor8udkoEjaPEcFbY8OzD6io4bBIF25VE+ Um7HjiSyGZ6jCwCT7hm/bwl4h0svbvf0BgcOi45KpVJwNSasF+mNgngqwpWwnlsWpRVa sY9Re15WUSLBmCnl7dGq82RXMo4snUSSPxcgKZl9d1dPd4Okx7Znb1oRzhU0yplXYETg RnVouM5rS1VBW2Y8g67M3YeuvaCHYXd5BSu8Vi6aO8VOiuWM045Y4+0+whEWwLbYcWic 2Vt6N0bKMSEC0vIrwdk7zuTyMuBq/gwTjZ6nUBlJ1Gf4q+nIMEXKEJMd8ZKLyiBHXrN6 i5TA== X-Gm-Message-State: ALoCoQl7UkA4QtIkt80S/T9B14gE3y+luYVIi7wOXBMPpuMhDb6hXLOtuwX2hY0yFiBIvy6Q+pb+ X-Received: by 10.194.204.163 with SMTP id kz3mr28797438wjc.28.1442240353931; Mon, 14 Sep 2015 07:19:13 -0700 (PDT) Received: from [192.168.2.66] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id mz12sm14671201wic.4.2015.09.14.07.19.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 07:19:13 -0700 (PDT) Message-ID: <55F6D760.70602@intel.com> Date: Mon, 14 Sep 2015 15:19:12 +0100 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: toaster@yoctoproject.org References: <5E53D14CE4667A45B9A06760DE5D13D082655701@ALA-MBA.corp.ad.wrs.com> <5E53D14CE4667A45B9A06760DE5D13D082655F65@ALA-MBA.corp.ad.wrs.com> In-Reply-To: Subject: Re: [review-request][PATCH] 8126 Messages are missing when "IMAGE_FSTYPES" field is not properly edited 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: Mon, 14 Sep 2015 14:19:19 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 02/09/15 16:58, Barros Pena, Belen wrote: > > On 02/09/2015 15:46, "Reyna, David" wrote: > >> Hi Belén, >> >> Thank you for the observation. >> >> I have updated "dreyna/project_fstypes_8126" to address that issue, and >> the code now always pre-initializes the warning message element so that >> the previous value is not dangling. > yep: this seems to behave as expected now. Thanks! > > I've also realised that the base branch seems a bit old. Could you rebase > and resubmit? > > Cheers > > Belén > >> - David >> >> >>> -----Original Message----- >>> From: Barros Pena, Belen [mailto:belen.barros.pena@intel.com] >>> Sent: Wednesday, September 02, 2015 2:16 AM >>> To: Reyna, David >>> Cc: toaster@yoctoproject.org >>> Subject: Re: [Toaster] [review-request][PATCH] 8126 Messages are missing >>> when "IMAGE_FSTYPES" field is not properly edited >>> >>> >>> >>> On 02/09/2015 08:44, "Reyna, David" wrote: >>> >>>> Hi Belén, >>>> >>>> Please find the patch for 8126 here: >>>> >>>> dreyna/project_fstypes_8126 >>> Hi David, >>> >>> This is looking fairly good. I've only run across one problem. This is >>> how >>> to reproduce: >>> >>> 1. Click the 'change' icon for IMAGE_FSTYPES >>> >>> 2. Deselect all values: the 'save' button becomes disabled and the >>> message >>> asking you to select at least one image type appears. This is the >>> expected >>> behaviour >>> >>> 3. Now, click the 'cancel' link. The IMAGE_FSTYPES value stays the way >>> it >>> was before you clicked the 'change' icon. This is once more the correct >>> behaviour >>> >>> 4. Now click the 'change' icon again. There are image types selected, >>> but >>> the message 'You must select at least one image type' still shows, and >>> the >>> 'Save' button is disabled. This is not the correct behaviour. As long as >>> there is at least one checkbox ticked you should see no message and the >>> 'save' button should be enabled. If you make a change (untick a box), >>> the >>> validation kicks in and things return to the correct state. Sounds like >>> we >>> need to check the selected values whenever the 'change' icon is clicked >>> >>> Thanks! >>> >>> Belén >>> >>>> Note: for the message 'label' the I insert and then show when there are >>>> no matches, it is guaranteed not to pollute the database because it can >>>> never be in the checked state. >>>> >>>> - David >>>> Some review comments below: From bac104e20efc46d4746af58aebb0f920c37edfc3 Mon Sep 17 00:00:00 2001 From: David Reyna Date: Wed, 2 Sep 2015 15:34:14 -0700 Subject: bitbake: toaster: display warnings for bad "IMAGE_FSTYPES" values Display warning message for IMAGE_FSTYPES when no value is selected or when the filter does not have any matches [YOCTO #8126] Signed-off-by: David Reyna diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index 4c5a188..b477b4e 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html @@ -43,6 +43,7 @@
+ @@ -312,9 +313,11 @@ }); if ( 0 == any_checked ) { $("#apply-change-image_fstypes").attr("disabled","disabled"); + $('#fstypes-error-message').html("You must select at least one image type"); MW - Given that this error message doesn't change from this text, rather than adding and removing the text add the text to the DOM in the #fstypes-error-message element and .hide .show this makes it easier to update the error message in the html and keeps a slightly cleaner separation between the UI description and the logic of the javascript. } else { $("#apply-change-image_fstypes").removeAttr("disabled"); + $('#fstypes-error-message').html(""); } } @@ -546,10 +549,14 @@ // Add the un-checked boxes second for (var i = 0, length = fstypes_list.length; i < length; i++) { if (0 > fstypes.indexOf(" "+fstypes_list[i].value+" ")) { - html += '\n'; + html += '\n'; } } + // Add the 'no search matches' line last + html += '\n'; MW - Rather than appending this to the list just add the text to the #fstypes-error-message and set it it initially to style="display:none" and then toggle it with .hide .show + // Display the list document.getElementById("all-image_fstypes").innerHTML = html; + $('#no-match-fstypes').hide(); // Watch elements to disable Save when none are checked $(".fs-checkbox-fstypes").each(function(){ @@ -558,8 +565,9 @@ }); }); - // clear the previous filter values + // clear the previous filter values and warning messages $("input#filter-image_fstypes").val(""); + $('#fstypes-error-message').html(""); }); $('#cancel-change-image_fstypes').click(function(){ @@ -569,17 +577,24 @@ }); $('#filter-image_fstypes').on('input', function(){ - var valThis = $(this).val().toLowerCase(); + var valThis = $(this).val().toLowerCase(); + var match_count=0; MW - camelCase please $('#all-image_fstypes label').each(function(){ var text = $(this).text().toLowerCase(); var match = text.indexOf(valThis); if (match >= 0) { $(this).show(); + match_count += 1; } else { $(this).hide(); } }); + if (0 == match_count) { MW - This should be if (matchCount === 0) triple equals for full equality and variable on the left + $('#no-match-fstypes').show(); + } else { + $('#no-match-fstypes').hide(); + } }); $('#apply-change-image_fstypes').click(function(){ -- cgit v0.10.2