Bug 34114 - Replace the use of jQueryUI sortable
Summary: Replace the use of jQueryUI sortable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 29222 34270 35194
  Show dependency treegraph
 
Reported: 2023-06-23 14:40 UTC by Owen Leonard
Modified: 2023-11-09 16:17 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 34114: Quick test with Sortable (2.39 KB, patch)
2023-07-05 08:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34114: Replace the use of jQueryUI sortable (65.83 KB, patch)
2023-07-13 12:40 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34114: Replace the use of jQueryUI sortable (65.88 KB, patch)
2023-08-18 09:15 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 34114: Replace the use of jQueryUI sortable (65.97 KB, patch)
2023-08-31 13:22 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-06-23 14:40:31 UTC
As discussed in Bug 29222, jQueryUI sortable should be replaced. The last time I checked it was used in these places:

  - Administration -> MARC frameworks -> Subfield structure -> Tab reordering.
  - Administration -> Authority types -> Subfield structure -> Tab reordering.
  - Administration -> System preferences -> Language and OPACLanguage reordering
  - Cataloging -> Basic MARC editor -> Subfield reordering.
  - Tools -> Stock rotation -> Stage reordering.

It looks like Drupal switched to this library: https://github.com/SortableJS/Sortable
Comment 1 Jonathan Druart 2023-07-05 08:47:06 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2023-07-05 08:47:38 UTC
This is working very easily and the doc is great. Good catch, Owen!
Comment 3 Owen Leonard 2023-07-13 12:40:00 UTC Comment hidden (obsolete)
Comment 4 Biblibre Sandboxes 2023-08-18 09:15:44 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2023-08-31 13:22:56 UTC
Created attachment 155008 [details] [review]
Bug 34114: Replace the use of jQueryUI sortable

This patch adds a replacement for jQueryUI sortable, a standalone
library called Sortable. The patch updates pages which previously used
jQueryUI for sorting.

The patch updates the style of most sortable elements to use the
"grip-vertical" Font Awesome icon.

To test, apply the patch and test the following pages, confirming that
sortable elements are sortable and that the newly sorted state is saved
correctly:

- Administration -> System prefernces -> I18N/L10N
  - With multiple languages installed, test that languages listed in the
    'language' and 'OPACLanguages' preferences can be sorted and that
    after saving your changes the interface relfects your changes: In
    the footer and header of the OPAC and in the footer of the staff
    interface.
- Administration -> MARC bibliographic framework -> MARC structure ->
  Edit subfields of a tag.
  - Test using a tag with multiple subfields, e.g. MARC21 245.
    - Test that you can click and drag to reorder the tabs in the
      subfield edit view.
    - Test that when you save your changes, including changes to the
      "New" tab position, that fields are ordered correctly both in the
       display on this page and in the basic MARC editor.
  - Perform the same tests on Authorities: Administration -> Authority
    types -> MARC structure -> Edit subfields of a tag.
- Authorities -> New (or edit) authority
  - Multiple subfields of a tag should be sortable.
  - Multiple copies of the same tag should be sortable relative to each
    other.
  - Confirm that your changes are saved correctly and that the detail
    view of your updated authority record is correct.
  - Perform the same tests on Cataloging -> New (or edit) record in the
    basic MARC editor.
- Enable the StockRotation system preference if necessary.
  - Go to Cataloging -> Stock rotation
    - If necessary, create a new rota and add multiple stages
      - In the "Manage stages" view you should be able to click and drag
        to reorder stages. The new position should be saved immediately
        via AJAX.

Signed-off-by: paul <paul.poulain@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2023-09-22 16:00:37 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-09-22 20:50:53 UTC
Enhancement not pushed to 23.05.x