Bug 30489

Summary: Convert MARC and authority subfield edit tabs to Bootstrap
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, martin.renvoize, testopia
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
22.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 29226    
Attachments: Bug 30489: Convert MARC and authority subfield edit tabs to Bootstrap
Bug 30489: Convert MARC and authority subfield edit tabs to Bootstrap

Description Owen Leonard 2022-04-07 14:20:59 UTC
Continuing the process of phasing out jQueryUI, this patch will replace jQueryUI tabs in two places:

- admin/auth_subfields_structure.tt
- admin/marc_subfields_structure

The difficulty with the templates is that in many cases Koha wants to use "@" as the tab text. jQueryUI didn't have any problem with this, but Bootstrap doesn't like it.

One idea I had was to handle that specific case and create a variable specifically for the tab's anchor text:

        if( $row_data{tagsubfield} eq "@" ){
            $row_data{subfieldanchor} = "AT";
        } else {
            $row_data{subfieldanchor} = $row_data{tagsubfield};
        }

Seems unfortunate to have to check for that one case, so maybe someone else has a better idea.
Comment 1 Owen Leonard 2022-04-14 11:46:58 UTC
Created attachment 133304 [details] [review]
Bug 30489: Convert MARC and authority subfield edit tabs to Bootstrap

This patch updates the MARC and authority subfield edit interface to
replace jQueryUI tabs with Bootstrap. The code for handling
drag-to-reorder tabs is updated to accommodate the new markup.

To test, apply the patch and restart_all.

- Go to Administration -> MARC bibliographic framework -> Default
  framework and choose "MARC structure" from the Actions menu.
- In the row for 000 LEADER, click Actions -> View subfields.
- Click "Edit." On the edit page the tabs should look correct and work
  correctly.
- Return to the list of tags and click "View subfields" for the 245 tag.
- Click one of the "Edit" buttons for any but the first subfield, e.g.
  "a".
- On the "Tag 245 Subfield constraints" page the "a" tab should be
  pre-selected.
- Click any of the subfield tabs and drag it to re-order it in the
  sequence of tags.
- It should stay in the correct slot when you release it.
- Save and confirm that the new sequence of subfields has been saved.

Perform all the same tests under Administration -> Authority types.
Comment 2 Martin Renvoize (ashimema) 2022-04-20 16:15:09 UTC
Created attachment 133490 [details] [review]
Bug 30489: Convert MARC and authority subfield edit tabs to Bootstrap

This patch updates the MARC and authority subfield edit interface to
replace jQueryUI tabs with Bootstrap. The code for handling
drag-to-reorder tabs is updated to accommodate the new markup.

To test, apply the patch and restart_all.

- Go to Administration -> MARC bibliographic framework -> Default
  framework and choose "MARC structure" from the Actions menu.
- In the row for 000 LEADER, click Actions -> View subfields.
- Click "Edit." On the edit page the tabs should look correct and work
  correctly.
- Return to the list of tags and click "View subfields" for the 245 tag.
- Click one of the "Edit" buttons for any but the first subfield, e.g.
  "a".
- On the "Tag 245 Subfield constraints" page the "a" tab should be
  pre-selected.
- Click any of the subfield tabs and drag it to re-order it in the
  sequence of tags.
- It should stay in the correct slot when you release it.
- Save and confirm that the new sequence of subfields has been saved.

Perform all the same tests under Administration -> Authority types.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2022-04-20 16:15:50 UTC
Looking great and working great.. nice one..

Going straight for PQA here too.. Scripts are happy and no regressions found.

PQA
Comment 4 Fridolin Somers 2022-05-02 21:25:09 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑