summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2015-10-06 16:43:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 05:33:03 +0100
commit466bbec24250086fb014fc34649da94f78d7f00f (patch)
tree993a634b61d8667f62cd4fa172e3581edc06118a /bitbake
parent8b7d846c68f722066d3d31846216816c2ea80841 (diff)
downloadpoky-466bbec24250086fb014fc34649da94f78d7f00f.tar.gz
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] (Bitbake rev: 9a825eb928cb35096d2c1563788310fb6a13e93e) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/projectconf.html21
1 files changed, 18 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html
index 4c5a188a86..5333ec5d05 100644
--- a/bitbake/lib/toaster/toastergui/templates/projectconf.html
+++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -43,6 +43,7 @@
43 <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="span4"> 43 <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="span4">
44 <div id="all-image_fstypes" class="scrolling"> 44 <div id="all-image_fstypes" class="scrolling">
45 </div> 45 </div>
46 <span class="help-block" id="fstypes-error-message">You must select at least one image type</span>
46 <button id="apply-change-image_fstypes" type="button" class="btn">Save</button> 47 <button id="apply-change-image_fstypes" type="button" class="btn">Save</button>
47 <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button> 48 <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button>
48 </form> 49 </form>
@@ -312,9 +313,11 @@
312 }); 313 });
313 if ( 0 == any_checked ) { 314 if ( 0 == any_checked ) {
314 $("#apply-change-image_fstypes").attr("disabled","disabled"); 315 $("#apply-change-image_fstypes").attr("disabled","disabled");
316 $('#fstypes-error-message').show();
315 } 317 }
316 else { 318 else {
317 $("#apply-change-image_fstypes").removeAttr("disabled"); 319 $("#apply-change-image_fstypes").removeAttr("disabled");
320 $('#fstypes-error-message').hide();
318 } 321 }
319 } 322 }
320 323
@@ -546,10 +549,14 @@
546 // Add the un-checked boxes second 549 // Add the un-checked boxes second
547 for (var i = 0, length = fstypes_list.length; i < length; i++) { 550 for (var i = 0, length = fstypes_list.length; i < length; i++) {
548 if (0 > fstypes.indexOf(" "+fstypes_list[i].value+" ")) { 551 if (0 > fstypes.indexOf(" "+fstypes_list[i].value+" ")) {
549 html += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label>\n'; 552 html += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label>\n';
550 } 553 }
551 } 554 }
555 // Add the 'no search matches' line last
556 html += '<label id="no-match-fstypes">No image types found</label>\n';
557 // Display the list
552 document.getElementById("all-image_fstypes").innerHTML = html; 558 document.getElementById("all-image_fstypes").innerHTML = html;
559 $('#no-match-fstypes').hide();
553 560
554 // Watch elements to disable Save when none are checked 561 // Watch elements to disable Save when none are checked
555 $(".fs-checkbox-fstypes").each(function(){ 562 $(".fs-checkbox-fstypes").each(function(){
@@ -558,8 +565,9 @@
558 }); 565 });
559 }); 566 });
560 567
561 // clear the previous filter values 568 // clear the previous filter values and warning messages
562 $("input#filter-image_fstypes").val(""); 569 $("input#filter-image_fstypes").val("");
570 $('#fstypes-error-message').hide();
563 }); 571 });
564 572
565 $('#cancel-change-image_fstypes').click(function(){ 573 $('#cancel-change-image_fstypes').click(function(){
@@ -569,17 +577,24 @@
569 }); 577 });
570 578
571 $('#filter-image_fstypes').on('input', function(){ 579 $('#filter-image_fstypes').on('input', function(){
572 var valThis = $(this).val().toLowerCase(); 580 var valThis = $(this).val().toLowerCase();
581 var matchCount=0;
573 $('#all-image_fstypes label').each(function(){ 582 $('#all-image_fstypes label').each(function(){
574 var text = $(this).text().toLowerCase(); 583 var text = $(this).text().toLowerCase();
575 var match = text.indexOf(valThis); 584 var match = text.indexOf(valThis);
576 if (match >= 0) { 585 if (match >= 0) {
577 $(this).show(); 586 $(this).show();
587 matchCount += 1;
578 } 588 }
579 else { 589 else {
580 $(this).hide(); 590 $(this).hide();
581 } 591 }
582 }); 592 });
593 if (matchCount === 0) {
594 $('#no-match-fstypes').show();
595 } else {
596 $('#no-match-fstypes').hide();
597 }
583 }); 598 });
584 599
585 $('#apply-change-image_fstypes').click(function(){ 600 $('#apply-change-image_fstypes').click(function(){