Bug 26234

Summary: Default DataTables must know our own classes
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26233
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Bug Depends on:    
Bug Blocks: 28349    
Attachments: Bug 26234: Teach our KohaTable constructor the specific th classes
Bug 26234: Teach our KohaTable constructor the specific th classes
Bug 26234: Teach our KohaTable constructor the specific th classes

Description Jonathan Druart 2020-08-18 09:59:01 UTC
We have different classes we can use to set specific behaviours on table columns: title-string, string-sort, anti-the and NoSort.
We should not need to pass them to the DataTable constructor, we could teach it that we always want to apply them.

It will avoid bug like bug 26233
Comment 1 Jonathan Druart 2020-08-18 10:02:52 UTC
Created attachment 108440 [details] [review]
Bug 26234: Teach our KohaTable constructor the specific th classes

We have different classes we can use to set specific behaviours on table columns: title-string, string-sort, anti-the and NoSort.
We should not need to pass them to the DataTable constructor, we could teach it that we always want to apply them.

It will avoid bug like bug 26233

The goal is to define them in a centralised place (columns_settings.inc) then
only use the class on the th

Test plan:
Different behaviour and tables must be tested to confirm it works correctly.
Focus must be put on table when aoColumnsDefs is passed from the template
and confirm that this will add more info to aoColumnsDefs and not remove
the existing ones.
Note that this only work when KohaTable is used.
Comment 2 Owen Leonard 2020-08-18 14:34:29 UTC
Created attachment 108520 [details] [review]
Bug 26234: Teach our KohaTable constructor the specific th classes

We have different classes we can use to set specific behaviours on
table columns: title-string, string-sort, anti-the and NoSort.
We should not need to pass them to the DataTable constructor, we could
teach it that we always want to apply them.

It will avoid bug like bug 26233

The goal is to define them in a centralised place
(columns_settings.inc) then only use the class on the th

Test plan:
Different behaviour and tables must be tested to confirm it works
correctly. Focus must be put on table when aoColumnsDefs is passed from
the template and confirm that this will add more info to aoColumnsDefs
and not remove the existing ones.

Note that this only work when KohaTable is used.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2020-08-18 22:09:34 UTC
Created attachment 108563 [details] [review]
Bug 26234: Teach our KohaTable constructor the specific th classes

We have different classes we can use to set specific behaviours on
table columns: title-string, string-sort, anti-the and NoSort.
We should not need to pass them to the DataTable constructor, we could
teach it that we always want to apply them.

It will avoid bug like bug 26233

The goal is to define them in a centralised place
(columns_settings.inc) then only use the class on the th

Test plan:
Different behaviour and tables must be tested to confirm it works
correctly. Focus must be put on table when aoColumnsDefs is passed from
the template and confirm that this will add more info to aoColumnsDefs
and not remove the existing ones.

Note that this only work when KohaTable is used.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-08-19 07:36:36 UTC
Pushed to master for 20.11, thanks to everybody involved!