Bug 22175 - Make stock rotation table sortable
Summary: Make stock rotation table sortable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-19 22:54 UTC by Katrin Fischer
Modified: 2019-04-26 13:57 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Bug 22175: Make stock rotation table sortable (8.89 KB, patch)
2019-01-25 14:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22175: Make stock rotation table sortable (8.97 KB, patch)
2019-01-25 18:49 UTC, José-Mario Monteiro-Santos
Details | Diff | Splinter Review
Bug 22175: Make stock rotation table sortable (8.98 KB, patch)
2019-02-01 17:07 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22175: Make stock rotation table sortable (9.07 KB, patch)
2019-02-08 20:11 UTC, José-Mario Monteiro-Santos
Details | Diff | Splinter Review
Bug 22175: (follow-up) Identify columns to exclude from export (4.06 KB, patch)
2019-04-11 18:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22175: Make stock rotation table sortable (9.14 KB, patch)
2019-04-12 08:20 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22175: (follow-up) Identify columns to exclude from export (4.13 KB, patch)
2019-04-12 08:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2019-01-19 22:54:05 UTC
The table for stock rotation rotas is not sortable yet. It would be nice if it was.

- Go to Tools > Stock rotation
- Add some rotas using "New rota"
- Verify table is not sortable
Comment 1 Owen Leonard 2019-01-25 14:12:12 UTC Comment hidden (obsolete)
Comment 2 José-Mario Monteiro-Santos 2019-01-25 18:49:33 UTC Comment hidden (obsolete)
Comment 3 José-Mario Monteiro-Santos 2019-01-25 18:52:52 UTC
"- Choose a rota with multiple items on it and select manage ->
     stages. Repeat the above DataTables functionality tests."

I assumed this meant manage -> items, since that's where the DataTable is.

Also, I'm not sure if this is expected behavior but when exporting the rota table, the "Number of items" column isn't exported.
Comment 4 Owen Leonard 2019-01-26 18:26:38 UTC
(In reply to José-Mario Monteiro-Santos from comment #3)
> I assumed this meant manage -> items, since that's where the DataTable is.

Yes, sorry about that.
 
> Also, I'm not sure if this is expected behavior but when exporting the rota
> table, the "Number of items" column isn't exported.

That isn't expected, so I'll take another look at it.
Comment 5 Owen Leonard 2019-02-01 17:07:43 UTC
Created attachment 84637 [details] [review]
Bug 22175: Make stock rotation table sortable

This patch adds sorting and column configuration to the stock
rotation tables, both rotas and items. No new defaults for the table are
defined.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Tools -> Stock rotation.
   - In the table of rotas test that sorting works correctly.
   - Test that the "Column visibility" button works to show and hide
     columns. The "actions" column should be excluded.
   - Test that export options (Excel, CSV, etc) exclude the "actions"
     column.
   - Choose a rota with multiple items on it and select manage ->
     items. Repeat the above DataTables functionality tests.

 - Go to Administration -> Columns settings and edit the default
   configuration of the stock rotation tables. Confirm that these
   changes are reflected in the corresponding tables.
Comment 6 José-Mario Monteiro-Santos 2019-02-08 20:11:47 UTC
Created attachment 84897 [details] [review]
Bug 22175: Make stock rotation table sortable

This patch adds sorting and column configuration to the stock
rotation tables, both rotas and items. No new defaults for the table are
defined.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Tools -> Stock rotation.
   - In the table of rotas test that sorting works correctly.
   - Test that the "Column visibility" button works to show and hide
     columns. The "actions" column should be excluded.
   - Test that export options (Excel, CSV, etc) exclude the "actions"
     column.
   - Choose a rota with multiple items on it and select manage ->
     items. Repeat the above DataTables functionality tests.

 - Go to Administration -> Columns settings and edit the default
   configuration of the stock rotation tables. Confirm that these
   changes are reflected in the corresponding tables.

Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>
Comment 7 José-Mario Monteiro-Santos 2019-02-08 20:17:17 UTC
Once again, I've noticed that the export function might not function as expected (blame my lack of experience with Koha for not knowing how it's supposed to behave). 

On other tables, the export buttons only export columns that are set to visible. However, both tables updated by this patch export all columns, regardless of their visibility.
Comment 8 Katrin Fischer 2019-02-09 08:57:06 UTC
Good catch! Marking Failed QA for Owen to take a look.
Comment 9 Owen Leonard 2019-04-11 18:56:10 UTC
Created attachment 87807 [details] [review]
Bug 22175: (follow-up) Identify columns to exclude from export

Bug 21216 added a way to designate DataTables columns to include in
export operations (Copy, CSV, print, etc). However, this solution did
not take hidden columns into account. This patch revises the global
columns configuration settings so that exports will include only visible
columns and will exclude columns with a "noExport" class on the <th>.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Tools -> Stock rotation
 - In the table of rotas, hide some columns in the table and verify that
   export operations include only your visible selections, excluding the
   last column with buttons.
 - Choose a rota and select Manage -> Items. Test that this table works
   in the same way.
Comment 10 Katrin Fischer 2019-04-12 08:20:47 UTC
Created attachment 87847 [details] [review]
Bug 22175: Make stock rotation table sortable

This patch adds sorting and column configuration to the stock
rotation tables, both rotas and items. No new defaults for the table are
defined.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Tools -> Stock rotation.
   - In the table of rotas test that sorting works correctly.
   - Test that the "Column visibility" button works to show and hide
     columns. The "actions" column should be excluded.
   - Test that export options (Excel, CSV, etc) exclude the "actions"
     column.
   - Choose a rota with multiple items on it and select manage ->
     items. Repeat the above DataTables functionality tests.

 - Go to Administration -> Columns settings and edit the default
   configuration of the stock rotation tables. Confirm that these
   changes are reflected in the corresponding tables.

Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-04-12 08:20:51 UTC
Created attachment 87848 [details] [review]
Bug 22175: (follow-up) Identify columns to exclude from export

Bug 21216 added a way to designate DataTables columns to include in
export operations (Copy, CSV, print, etc). However, this solution did
not take hidden columns into account. This patch revises the global
columns configuration settings so that exports will include only visible
columns and will exclude columns with a "noExport" class on the <th>.

To test, apply the patch and clear your browser cache if necessary.

 - Go to Tools -> Stock rotation
 - In the table of rotas, hide some columns in the table and verify that
   export operations include only your visible selections, excluding the
   last column with buttons.
 - Choose a rota and select Manage -> Items. Test that this table works
   in the same way.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Nick Clemens 2019-04-18 12:07:24 UTC
Awesome work all!

Pushed to master for 19.05
Comment 13 Martin Renvoize 2019-04-26 13:57:20 UTC
Enhancement will not be backported to 18.11.x series.