Bug 27682

Summary: Add a floating table header for Search engine configuration
Product: Koha Reporter: Séverine Queune <severine.queune>
Component: Searching - ElasticsearchAssignee: Owen Leonard <oleonard>
Status: Pushed to master --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: david, fridolin.somers, jonathan.druart+koha
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Text to go in the release notes:
This enhancement adds a search filter and a floating table header (that "sticks" to the top of the browser window as you scroll down) to the search engine configuration pages (Administration > Catalog > Search engine configuration (Elasticsearch)). The "Search fields" table is sortable, but the "Bibliographic records" and "Authorities" tables are not as they have drag-and-drop row reordering.
Version(s) released in:
21.05.00
Bug Depends on: 27403    
Bug Blocks:    
Attachments: Bug 27682: Add a floating table header for Search engine configuration
Bug 27682: Add a floating table header for Search engine configuration
Bug 27682: Add a floating table header for Search engine configuration
Bug 27682: (follow-up) Make sure table is drawn with correct width

Description Séverine Queune 2021-02-11 13:10:48 UTC
The table header in Elastic search should be a floating bar, as the table could be veeeeery long.
It's sometimes hard to remember what is the order of the different Yes/No dropdown menus and it can be the source of confusion or bad settings.
Comment 1 Owen Leonard 2021-02-19 17:07:44 UTC
Created attachment 117088 [details] [review]
Bug 27682: Add a floating table header for Search engine configuration

This patch adds DataTables options to the tables on the search engine
configuration pages. The table on the "Search fields" tab will be
sortable, all tables will be searchable, and all tables will have
floating headers.

To test you should have the SearchEngine preference set to
"Elasticsearch."

- Apply the patch and go to Administration -> Search engine
  configuration (Elasticsearch)
- Test the tables under each tab, "Search fields," "Bibliographic
  records," and "Authorities," the table has a search filter and the
  header row "sticks" to the top of the browser window as you scroll
  down.
- The "Search fields" table should be sortable, but the other two should
  not--they have drag-and-drop row reordering.
Comment 2 David Nind 2021-02-19 23:51:00 UTC
Created attachment 117104 [details] [review]
Bug 27682: Add a floating table header for Search engine configuration

This patch adds DataTables options to the tables on the search engine
configuration pages. The table on the "Search fields" tab will be
sortable, all tables will be searchable, and all tables will have
floating headers.

To test you should have the SearchEngine preference set to
"Elasticsearch."

- Apply the patch and go to Administration -> Search engine
  configuration (Elasticsearch)
- Test the tables under each tab, "Search fields," "Bibliographic
  records," and "Authorities," the table has a search filter and the
  header row "sticks" to the top of the browser window as you scroll
  down.
- The "Search fields" table should be sortable, but the other two should
  not--they have drag-and-drop row reordering.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2021-02-28 17:53:05 UTC
Created attachment 117422 [details] [review]
Bug 27682: Add a floating table header for Search engine configuration

This patch adds DataTables options to the tables on the search engine
configuration pages. The table on the "Search fields" tab will be
sortable, all tables will be searchable, and all tables will have
floating headers.

To test you should have the SearchEngine preference set to
"Elasticsearch."

- Apply the patch and go to Administration -> Search engine
  configuration (Elasticsearch)
- Test the tables under each tab, "Search fields," "Bibliographic
  records," and "Authorities," the table has a search filter and the
  header row "sticks" to the top of the browser window as you scroll
  down.
- The "Search fields" table should be sortable, but the other two should
  not--they have drag-and-drop row reordering.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-03-01 14:07:05 UTC
1. There is a weird behaviour, when you hit land on the page the floating header is wider than the thead.
However if you go to the bibliographic or authorities tab and come back, it's ok.

2.
tableInit( "", "search_fields");

In tableInit we should test if oldtabid is passed.
Comment 5 Owen Leonard 2021-03-04 18:43:31 UTC
Created attachment 117759 [details] [review]
Bug 27682: (follow-up) Make sure table is drawn with correct width

The DataTables plugin calculates the width of the fixed header based on
the initial width of the corresponding table. Since these tables are
inside jQueryUI tabs, the width changes when the tabs are initialized
and jQueryUI adds its classes to the table's container.

This patch "manually" adds the relevant classes to the markup so that
the table's container is drawn with the right padding from the start.

Also fixed: Don't try to destroy "oldTableId" if the tableInit function
didn't pass an oldtabid.
Comment 6 Jonathan Druart 2021-03-09 16:20:07 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-03-12 11:23:51 UTC
Super enhancement.

I'd like to see it in 20.11.x.

I've applied patches with a small conflict but table header is not floating :(

Can you create patches for 20.11.x please ?
Comment 8 Owen Leonard 2021-03-16 12:31:22 UTC
(In reply to Fridolin Somers from comment #7)

> Can you create patches for 20.11.x please ?

The feature depends on Bug 27403. I've updated the dependencies to reflect it.
Comment 9 Fridolin Somers 2021-03-16 14:46:05 UTC
(In reply to Owen Leonard from comment #8)
> (In reply to Fridolin Somers from comment #7)
> 
> > Can you create patches for 20.11.x please ?
> 
> The feature depends on Bug 27403. I've updated the dependencies to reflect
> it.

Ok super thanks.

In the end this is too much a change for stable branch.

One can always cherry-pick the patches ;)

Enhancement not pushed to 20.11.x