aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-04-19 17:28:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-19 21:10:58 +0100
commitb99e1012f0ad1dc82a769df15a232280c8e57b9e (patch)
tree0fa03bdcaf8bef2f855295c2c3e8dd438dce725e
parent820761e664cd2d62cc6c333a0e59580b0c4a034d (diff)
downloadbitbake-b99e1012f0ad1dc82a769df15a232280c8e57b9e.tar.gz
bitbake-b99e1012f0ad1dc82a769df15a232280c8e57b9e.tar.bz2
bitbake-b99e1012f0ad1dc82a769df15a232280c8e57b9e.zip
toaster: fix sorting after hiding a column in build tables
When hiding a column in the build tasks or build packages included table, if the column is set as the current order by for the table, the order by is not reset to the default. The result is that the table stays sorted by the hidden column. Set the default_orderby for these two tables correctly to ensure the corresponding table is re-sorted when a column is hidden, if that column was being used as the order by. [YOCTO #9011] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/toastergui/templates/tasks.html2
-rwxr-xr-xlib/toaster/toastergui/views.py50
2 files changed, 26 insertions, 26 deletions
diff --git a/lib/toaster/toastergui/templates/tasks.html b/lib/toaster/toastergui/templates/tasks.html
index 23eb9575..84bc1038 100644
--- a/lib/toaster/toastergui/templates/tasks.html
+++ b/lib/toaster/toastergui/templates/tasks.html
@@ -131,7 +131,7 @@
<script type="text/javascript">
$(document).ready(function() {
- // enable blue hightlight animation for the order link
+ // highlight heading on the column for the field used for ordering
if (location.href.search('#') > -1) {
var task_order = location.href.split('#')[1];
$("#" + task_order).addClass("highlight");
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 30295a72..a11c9da5 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -663,7 +663,9 @@ def recipe_packages(request, build_id, recipe_id):
def target_common( request, build_id, target_id, variant ):
template = "target.html"
- (pagesize, orderby) = _get_parameters_values(request, 25, 'name:+')
+ default_orderby = 'name:+'
+
+ (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
retval = _verify_parameters( request.GET, mandatory_parameters )
if retval:
@@ -683,8 +685,6 @@ def target_common( request, build_id, target_id, variant ):
queryset = queryset.select_related("recipe", "recipe__layer_version", "recipe__layer_version__layer")
packages = _build_page_range( Paginator(queryset, pagesize), request.GET.get( 'page', 1 ))
-
-
build = Build.objects.get( pk = build_id )
# bring in package dependencies
@@ -801,7 +801,7 @@ eans multiple licenses exist that cover different parts of the source',
'objects' : packages,
'packages_sum' : packages_sum[ 'installed_size__sum' ],
'object_search_display': "packages included",
- 'default_orderby' : orderby,
+ 'default_orderby' : default_orderby,
'tablecols' : [
tc_package,
tc_packageVersion,
@@ -996,29 +996,29 @@ def tasks_common(request, build_id, variant, task_anchor):
anchor=task_anchor
# default ordering depends on variant
- if 'buildtime' == variant:
- title_variant='Time'
- object_search_display="time data"
- filter_search_display="tasks"
- (pagesize, orderby) = _get_parameters_values(request, 25, 'elapsed_time:-')
- elif 'diskio' == variant:
- title_variant='Disk I/O'
- object_search_display="disk I/O data"
- filter_search_display="tasks"
- (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-')
- elif 'cputime' == variant:
+ default_orderby = None
+ filter_search_display = 'tasks'
+
+ if 'buildtime' == variant:
+ default_orderby = 'elapsed_time:-'
+ title_variant = 'Time'
+ object_search_display = 'time data'
+ elif 'diskio' == variant:
+ default_orderby = 'disk_io:-'
+ title_variant = 'Disk I/O'
+ object_search_display = 'disk I/O data'
+ elif 'cputime' == variant:
+ default_orderby = 'cpu_time_system:-'
title_variant='CPU time'
- object_search_display="CPU time data"
- filter_search_display="tasks"
- (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_time_system:-')
- else :
- title_variant='Tasks'
- object_search_display="tasks"
- filter_search_display="tasks"
- (pagesize, orderby) = _get_parameters_values(request, 25, 'order:+')
+ object_search_display = 'CPU time data'
+ else:
+ default_orderby = 'order:+'
+ title_variant = 'Tasks'
+ object_search_display = 'tasks'
+ (pagesize, orderby) = _get_parameters_values(request, 25, default_orderby)
- mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
+ mandatory_parameters = {'count': pagesize, 'page' : 1, 'orderby': orderby}
template = 'tasks.html'
retval = _verify_parameters( request.GET, mandatory_parameters )
@@ -1212,7 +1212,7 @@ def tasks_common(request, build_id, variant, task_anchor):
'mainheading': title_variant,
'build': build,
'objects': task_objects,
- 'default_orderby' : orderby,
+ 'default_orderby' : default_orderby,
'search_term': search_term,
'total_count': queryset_with_search.count(),
'tablecols':[