Bug 39534: Hide reports subgroup filter if there are no subgroups
This patch updates the JavaScript which runs on the list of saved SQL reports, adding a check for report subgroups to the display of the report subgroups dropdown. The patch also hides the subgroups dropdown if there is no saved tab, in which case the tabsInit function doesn't run. To test you should have multiple reports organized in multiple groups and subgroups. See the test plan on Bug 39534. - Go to Reports -> Saved SQL reports. - If the page loads with the "All" tab active, there should be no subgroups dropdown. - If the page loads under a different tab, the subgroups dropdown should only show if that group has subgroups. - Switch between the various report group tabs to confirm that the subgroups dropdown is shown or hidden correctly based on the existence of subgroups. Sponsored-by: Athens County Public Libraries Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit1e57f5c8d3) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (cherry picked from commitd7bf63a327) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
35dee71d00
commit
859bf3c69c
|
|
@ -1844,6 +1844,9 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
var activeTab = localStorage.getItem("sql_reports_activetab");
|
||||
if( activeTab == 0 ){
|
||||
$("#subgroup_filter_block").hide();
|
||||
}
|
||||
|
||||
$("body").on('click',".fetch_chart_data",function(){
|
||||
if( [% unlimited_total || 0 | $raw %] > 1000 ){
|
||||
|
|
@ -2343,13 +2346,17 @@
|
|||
|
||||
if (g_id && g_id.length > 0) {
|
||||
col4.search(g_id, {exact:true}).visible(false);
|
||||
for(var i in group_subgroups[g_id]) {
|
||||
$("#subgroup_filter").append(
|
||||
'<option value="' + group_subgroups[g_id][i][0] + '">'
|
||||
+ group_subgroups[g_id][i][1] + '</option>'
|
||||
);
|
||||
if( group_subgroups[g_id] && group_subgroups[g_id].length > 0 ){
|
||||
for(var i in group_subgroups[g_id]) {
|
||||
$("#subgroup_filter").append(
|
||||
'<option value="' + group_subgroups[g_id][i][0] + '">'
|
||||
+ group_subgroups[g_id][i][1] + '</option>'
|
||||
);
|
||||
}
|
||||
$("#subgroup_filter_block").show();
|
||||
} else {
|
||||
$("#subgroup_filter_block").hide();
|
||||
}
|
||||
$("#subgroup_filter_block").show();
|
||||
} else {
|
||||
$("#subgroup_filter_block").hide();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue