summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2016-04-08 09:39:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-09 23:00:46 +0100
commit52cfdb6a88060605f3a0d21e0227477db1049f12 (patch)
treeb20481334b12c9b7b68fa9013f3910203777ef64 /bitbake/lib/toaster/toastergui
parentdae4ffb55387edc55fd102c5b6013ab1ebb44a8d (diff)
downloadpoky-52cfdb6a88060605f3a0d21e0227477db1049f12.tar.gz
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 <dave.lerner@windriver.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/customrecipe.js9
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/table.js11
-rw-r--r--bitbake/lib/toaster/toastergui/templates/customrecipe.html22
3 files changed, 30 insertions, 12 deletions
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) {
265 }); 265 });
266 } 266 }
267 267
268 $("#no-results-show-all-packages").click(function(){
269 $(".no-results-search-input").val("");
270 });
271
272 $("#no-results-remove-search-btn").click(function(){
273 $(".no-results-search-input").val("");
274 $(this).hide();
275 });
276
268 /* Trigger a build of your custom image */ 277 /* Trigger a build of your custom image */
269 $(".build-custom-image").click(function(){ 278 $(".build-custom-image").click(function(){
270 libtoaster.startABuild(null, ctx.recipe.name, 279 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){
75 75
76 if (tableData.total === 0){ 76 if (tableData.total === 0){
77 tableContainer.hide(); 77 tableContainer.hide();
78 $("#new-search-input-"+ctx.tableName).val(tableParams.search); 78 if ($("#no-results-special-"+ctx.tableName).length > 0) {
79 $("#no-results-"+ctx.tableName).show(); 79 /* use this page's special no-results form instead of the default */
80 $("#no-results-search-input-"+ctx.tableName).val(tableParams.search);
81 $("#no-results-special-"+ctx.tableName).show();
82 $("#results-found-"+ctx.tableName).hide();
83 } else {
84 $("#new-search-input-"+ctx.tableName).val(tableParams.search);
85 $("#no-results-"+ctx.tableName).show();
86 }
80 table.trigger("table-done", [tableData.total, tableParams]); 87 table.trigger("table-done", [tableData.total, tableParams]);
81 88
82 return; 89 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 @@
103 Download recipe file 103 Download recipe file
104 </a> 104 </a>
105 </div> 105 </div>
106 <div id="no-package-results" class="air" style="display:none;"> 106 <div id="no-results-special-{{table_name}}" class="air" style="display:none;">
107 <div class="alert"> 107 <div class="alert">
108 <h3>No packages found</h3> 108 <h3>No packages found</h3>
109 <p>You might consider <a href="all-software-recipes.html">searching the list of recipes</a> instead. If you find a recipe that matches the name of the package you want:</p> 109 <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead. If you find a recipe that matches the name of the package you want:</p>
110 <ol> 110 <ol>
111 <li>Add the layer providing the recipe to your project</li> 111 <li>Add the layer providing the recipe to your project</li>
112 <li>Build the recipe</li> 112 <li>Build the recipe</li>
113 <li>Once the build completes, come back to this page and search for the package</li> 113 <li>Once the build completes, come back to this page and search for the package</li>
114 </ol> 114 </ol>
115 <form class="input-append no-results"> 115 <form class="input-append no-results">
116 <input type="text" class="input-xlarge" value="search query"> 116 <input type="text" class="input-xlarge no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" />
117 <a href="#" class="add-on btn"> 117 <a href="#" class="add-on btn" id="no-results-remove-search-btn" tabindex="-1">
118 <i class="icon-remove"></i> 118 <i class="icon-remove"></i>
119 </a> 119 </a>
120 <button class="btn">Search</button> 120 <button class="btn search-submit-{{table_name}}">Search</button>
121 <button class="btn btn-link" id="show-all">Show all packages</button> 121 <button class="btn btn-link" id="no-results-show-all-packages">Show all packages</button>
122 </form> 122 </form>
123 </div> 123 </div>
124 </div> 124 </div>
125 <div id="results-found-{{table_name}}">
125 <div id="packages-table"> 126 <div id="packages-table">
126 {% if recipe.get_all_packages.count == 0 and last_build == None %} 127 {% if recipe.get_all_packages.count == 0 and last_build == None %}
127 <h2> Add | Remove packages </h2> 128 <h2> Add | Remove packages </h2>
@@ -136,6 +137,7 @@
136 {% include "toastertable.html" %} 137 {% include "toastertable.html" %}
137 {% endif %} 138 {% endif %}
138 </div> 139 </div>
140 </div>
139 </div> 141 </div>
140 <div class="span4 well"> 142 <div class="span4 well">
141 <h2 style="margin-bottom:20px;">About {{recipe.name}}</h2> 143 <h2 style="margin-bottom:20px;">About {{recipe.name}}</h2>