* [PATCH 0/2] Revert to default sorting when table column is hidden @ 2016-03-29 9:07 Elliot Smith 2016-03-29 9:07 ` [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes Elliot Smith 2016-03-29 9:07 ` [PATCH 2/2] toaster: fix sorting after hiding a column in build tables Elliot Smith 0 siblings, 2 replies; 4+ messages in thread From: Elliot Smith @ 2016-03-29 9:07 UTC (permalink / raw) To: toaster Hiding a column in a table does not revert the sort order to the default one for the table: the table remains sorted by the hidden column. Modify ToasterTable and non-ToasterTable tables so that hiding a column will revert the sort order to the default. This should fix the issue for all of the tables in Toaster. Changes since eea41e44 (toaster-next) are in git://git.yoctoproject.org/poky-contrib, elliot/toaster/default_sort-9011 http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/default_sort-9011 Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9011 Elliot Smith (1): toaster: fix sorting after hiding a column in build tables Michael Wood (1): toaster: ensure ToasterTable headings are reset when order by changes bitbake/lib/toaster/toastergui/static/js/table.js | 6 ++- .../lib/toaster/toastergui/templates/tasks.html | 2 +- bitbake/lib/toaster/toastergui/views.py | 50 +++++++++++----------- 3 files changed, 31 insertions(+), 27 deletions(-) -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes 2016-03-29 9:07 [PATCH 0/2] Revert to default sorting when table column is hidden Elliot Smith @ 2016-03-29 9:07 ` Elliot Smith 2016-03-29 9:07 ` [PATCH 2/2] toaster: fix sorting after hiding a column in build tables Elliot Smith 1 sibling, 0 replies; 4+ messages in thread From: Elliot Smith @ 2016-03-29 9:07 UTC (permalink / raw) To: toaster From: Michael Wood <michael.g.wood@intel.com> If a ToasterTable is ordered by an optional column and that column is subsequently hidden, the table ordering switches back to the default ordering for the table. However, the table headings don't update to reflect the new ordering. This is because the code which sets the heading weight and hides/shows the caret symbols only runs when the table is first loaded. Store the default order by and re-apply it when the data is updated. [YOCTO #9011] Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> --- bitbake/lib/toaster/toastergui/static/js/table.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index a7e4fba..b2a7d59 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -232,6 +232,10 @@ function tableInit(ctx){ } } + if (col.field_name === tableData.default_orderby){ + title.addClass("default-orderby"); + } + } else { /* Not orderable */ header.css("font-weight", "normal"); @@ -377,7 +381,7 @@ function tableInit(ctx){ if (col === tableParams.orderby || '-' + col === tableParams.orderby){ tableParams.orderby = null; - loadData(tableParams); + $("#"+ctx.tableName +" .default-orderby").click(); } } -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] toaster: fix sorting after hiding a column in build tables 2016-03-29 9:07 [PATCH 0/2] Revert to default sorting when table column is hidden Elliot Smith 2016-03-29 9:07 ` [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes Elliot Smith @ 2016-03-29 9:07 ` Elliot Smith 2016-04-19 16:32 ` Michael Wood 1 sibling, 1 reply; 4+ messages in thread From: Elliot Smith @ 2016-03-29 9:07 UTC (permalink / raw) To: toaster 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> --- .../lib/toaster/toastergui/templates/tasks.html | 2 +- bitbake/lib/toaster/toastergui/views.py | 50 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html index 23eb957..84bc103 100644 --- a/bitbake/lib/toaster/toastergui/templates/tasks.html +++ b/bitbake/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/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index cc7ad17..71c74e2 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -662,7 +662,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: @@ -682,8 +684,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 @@ -800,7 +800,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, @@ -995,29 +995,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 ) @@ -1211,7 +1211,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':[ -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] toaster: fix sorting after hiding a column in build tables 2016-03-29 9:07 ` [PATCH 2/2] toaster: fix sorting after hiding a column in build tables Elliot Smith @ 2016-04-19 16:32 ` Michael Wood 0 siblings, 0 replies; 4+ messages in thread From: Michael Wood @ 2016-04-19 16:32 UTC (permalink / raw) To: toaster Sent to bitbake-devel and added to toaster-next Thanks, Michael On 29/03/16 10:07, Elliot Smith wrote: > 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> > --- > .../lib/toaster/toastergui/templates/tasks.html | 2 +- > bitbake/lib/toaster/toastergui/views.py | 50 +++++++++++----------- > 2 files changed, 26 insertions(+), 26 deletions(-) > > diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html > index 23eb957..84bc103 100644 > --- a/bitbake/lib/toaster/toastergui/templates/tasks.html > +++ b/bitbake/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/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py > index cc7ad17..71c74e2 100755 > --- a/bitbake/lib/toaster/toastergui/views.py > +++ b/bitbake/lib/toaster/toastergui/views.py > @@ -662,7 +662,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: > @@ -682,8 +684,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 > @@ -800,7 +800,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, > @@ -995,29 +995,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 ) > @@ -1211,7 +1211,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':[ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-19 16:32 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-29 9:07 [PATCH 0/2] Revert to default sorting when table column is hidden Elliot Smith 2016-03-29 9:07 ` [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes Elliot Smith 2016-03-29 9:07 ` [PATCH 2/2] toaster: fix sorting after hiding a column in build tables Elliot Smith 2016-04-19 16:32 ` Michael Wood
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.