Summary: | If no columns in a table can be toggled, don't show columns button | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | System Administration | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | gmcharlt, lucas, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 23611 | ||
Attachments: |
Bug 23612: If no columns in a table can be toggled, don't show columns button
Works well with all DataTables I tested. Bug 23612: If no columns in a table can be toggled, don't show columns button Bug 23612: (RM follow-up) Fix failing tests |
Description
Owen Leonard
2019-09-13 17:59:04 UTC
Created attachment 92818 [details] [review] Bug 23612: If no columns in a table can be toggled, don't show columns button This patch makes a change to the JavaScript setup for DataTables button controls so that if there are no toggle-able buttons (or there is no columns configuration at all) the column selection menu button will not appear. To test, apply the patch and go to Administration -> Columns settings. - In the Administration section, find the section for the "libraries" table. - In the "Cannot be toggled" column, check all the checkboxes. - Save. - Go to Administration -> Libraries. - At the top of the table there should be no "Columns" button, only "Clear filter" and "Export" buttons. Created attachment 92865 [details] [review] Works well with all DataTables I tested. Bug 23612: If no columns in a table can be toggled, don't show columns button This patch makes a change to the JavaScript setup for DataTables button controls so that if there are no toggle-able buttons (or there is no columns configuration at all) the column selection menu button will not appear. To test, apply the patch and go to Administration -> Columns settings. - In the Administration section, find the section for the "libraries" table. - In the "Cannot be toggled" column, check all the checkboxes. - Save. - Go to Administration -> Libraries. - At the top of the table there should be no "Columns" button, only "Clear filter" and "Export" buttons. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 93457 [details] [review] Bug 23612: If no columns in a table can be toggled, don't show columns button This patch makes a change to the JavaScript setup for DataTables button controls so that if there are no toggle-able buttons (or there is no columns configuration at all) the column selection menu button will not appear. To test, apply the patch and go to Administration -> Columns settings. - In the Administration section, find the section for the "libraries" table. - In the "Cannot be toggled" column, check all the checkboxes. - Save. - Go to Administration -> Libraries. - At the top of the table there should be no "Columns" button, only "Clear filter" and "Export" buttons. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Nice work! Pushed to master for 19.11.00 Created attachment 93787 [details] [review] Bug 23612: (RM follow-up) Fix failing tests Trailing comma's were causing hidden javascript errors during selenium tests. Error was identified by adding a $s->capture($driver) line to the relevant selenium test and using the following JS snippet to dump errors to the screen. (function () { var ul = null; function createErrorList() { ul = document.createElement('ul'); ul.setAttribute('id', 'js_error_list'); //ul.style.display = 'none'; document.body.appendChild(ul); } window.onerror = function(msg){ if (ul === null) createErrorList(); var li = document.createElement("li"); li.appendChild(document.createTextNode(msg)); ul.appendChild(li); }; })(); Which clearly showed the following error. ReferenceError: KohaTable is not defined Removing the trailing comma's introduced in this bug resolved the issue. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> |