From 52cfdb6a88060605f3a0d21e0227477db1049f12 Mon Sep 17 00:00:00 2001 From: Dave Lerner Date: Fri, 8 Apr 2016 09:39:28 +0100 Subject: bitbake: toaster: fixes for customimage package not found For a custom image, if a search for a package results in no packages found, then additional information should be presented to the user. This is different than a 'no results' found for a search in other contexts, for example, a search for a package in a non-customised build. For a custom image, a package search failure can happen because the package was not added to the custom image. This commit presents more information to the user, suggesting why the package was not found in the custom image. The generic table view handling js changes to handle a new div element no-results-special-... such that, if present, that template section is shown rather than the default no-results-... section. [YOCTO #9154] (Bitbake rev: 66b7c7ef61058b52031d71b10effcfe69afbd57b) Signed-off-by: Dave Lerner Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- .../toaster/toastergui/static/js/customrecipe.js | 9 +++++++++ bitbake/lib/toaster/toastergui/static/js/table.js | 11 +++++++++-- .../toaster/toastergui/templates/customrecipe.html | 22 ++++++++++++---------- 3 files changed, 30 insertions(+), 12 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js index a31c26834e..1c0ef9e37d 100644 --- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js +++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js @@ -265,6 +265,15 @@ function customRecipePageInit(ctx) { }); } + $("#no-results-show-all-packages").click(function(){ + $(".no-results-search-input").val(""); + }); + + $("#no-results-remove-search-btn").click(function(){ + $(".no-results-search-input").val(""); + $(this).hide(); + }); + /* Trigger a build of your custom image */ $(".build-custom-image").click(function(){ libtoaster.startABuild(null, ctx.recipe.name, diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index a7e4fbad09..2ae7695071 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -75,8 +75,15 @@ function tableInit(ctx){ if (tableData.total === 0){ tableContainer.hide(); - $("#new-search-input-"+ctx.tableName).val(tableParams.search); - $("#no-results-"+ctx.tableName).show(); + if ($("#no-results-special-"+ctx.tableName).length > 0) { + /* use this page's special no-results form instead of the default */ + $("#no-results-search-input-"+ctx.tableName).val(tableParams.search); + $("#no-results-special-"+ctx.tableName).show(); + $("#results-found-"+ctx.tableName).hide(); + } else { + $("#new-search-input-"+ctx.tableName).val(tableParams.search); + $("#no-results-"+ctx.tableName).show(); + } table.trigger("table-done", [tableData.total, tableParams]); return; diff --git a/bitbake/lib/toaster/toastergui/templates/customrecipe.html b/bitbake/lib/toaster/toastergui/templates/customrecipe.html index 4b589926c5..ea3c9c7324 100644 --- a/bitbake/lib/toaster/toastergui/templates/customrecipe.html +++ b/bitbake/lib/toaster/toastergui/templates/customrecipe.html @@ -103,25 +103,26 @@ Download recipe file - +
{% if recipe.get_all_packages.count == 0 and last_build == None %}

Add | Remove packages

@@ -136,6 +137,7 @@ {% include "toastertable.html" %} {% endif %}
+

About {{recipe.name}}

-- cgit v1.2.3-54-g00ecf