diff options
author | David Reyna <David.Reyna@windriver.com> | 2015-10-06 16:43:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-11 05:33:03 +0100 |
commit | 466bbec24250086fb014fc34649da94f78d7f00f (patch) | |
tree | 993a634b61d8667f62cd4fa172e3581edc06118a | |
parent | 8b7d846c68f722066d3d31846216816c2ea80841 (diff) | |
download | openembedded-core-contrib-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>
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/projectconf.html | 21 |
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 @@ <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="span4"> <div id="all-image_fstypes" class="scrolling"> </div> + <span class="help-block" id="fstypes-error-message">You must select at least one image type</span> <button id="apply-change-image_fstypes" type="button" class="btn">Save</button> <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button> </form> @@ -312,9 +313,11 @@ }); 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(); } } @@ -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 += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label>\n'; + html += '<label class="checkbox"><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label>\n'; } } + // Add the 'no search matches' line last + html += '<label id="no-match-fstypes">No image types found</label>\n'; + // 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').hide(); }); $('#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 matchCount=0; $('#all-image_fstypes label').each(function(){ var text = $(this).text().toLowerCase(); var match = text.indexOf(valThis); if (match >= 0) { $(this).show(); + matchCount += 1; } else { $(this).hide(); } }); + if (matchCount === 0) { + $('#no-match-fstypes').show(); + } else { + $('#no-match-fstypes').hide(); + } }); $('#apply-change-image_fstypes').click(function(){ |