Bug 15887 - Revise layout and behavior of item search fields management
Summary: Revise layout and behavior of item search fields management
Status: CLOSED 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: /cgi-bin/koha/admin/items_search_fiel...
Keywords:
Depends on: 11425
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-23 19:21 UTC by Owen Leonard
Modified: 2017-06-14 22:10 UTC (History)
7 users (show)

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


Attachments
Bug 15887 - Revise layout and behavior of item search fields management (17.88 KB, patch)
2016-02-23 19:54 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15887: Revise layout and behavior of item search fields management (17.96 KB, patch)
2016-02-24 15:08 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15887: Revise layout and behavior of item search fields management (17.59 KB, patch)
2016-03-01 14:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 15887: Revise layout and behavior of item search fields management (17.62 KB, patch)
2016-03-02 07:50 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 2016-02-23 19:21:29 UTC
The item search fields management page is unusual in that it show the list of existing custom search fields on the same page as an add form. I propose to add some JavaScript to show and hide the add form in order to simplify the interface and give each task better focus.
Comment 1 Owen Leonard 2016-02-23 19:54:03 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-02-24 15:08:27 UTC Comment hidden (obsolete)
Comment 3 Héctor Eduardo Castro Avalos 2016-02-24 15:12:36 UTC
Hi Owen

Good Job. Looks much better. Just one comment, this page does not have help page.

Add here Nicole.
Comment 4 Nicole C. Engard 2016-02-26 16:02:04 UTC
Entering a new bug for the documentation issue.
Comment 5 Nicole C. Engard 2016-02-26 16:11:19 UTC
Documentation https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15926
Comment 6 Jonathan Druart 2016-03-01 10:05:55 UTC
> - Convert MARC tag and subfield dropdowns to regular inputs (Bug 15384).

Could you please revert this change?
Before this patch, we had a validation on the MARC field values, now we don't.
What happens if we enter 10 instead of 010, does it still work?
I think we should add a validation on this form, but it's outside the scope of this patch.
Comment 7 Owen Leonard 2016-03-01 13:45:41 UTC
(In reply to Jonathan Druart from comment #6)
> > - Convert MARC tag and subfield dropdowns to regular inputs (Bug 15384).
>
> I think we should add a validation on this form, but it's outside the scope
> of this patch.

I think you're right that I'm pushing the limit on scope here, but I wonder if it isn't better for now to allow free entry on the form fields given the fact that in its current state there are some entries which cannot be made at all?

Cait's comment on Bug 15384:

> the subfield list is missing capital letters as often used for
> additional item fields.

If that doesn't sound like a good enough reason I'm happy to revise the patch.
Comment 8 Jonathan Druart 2016-03-01 14:30:00 UTC
(In reply to Owen Leonard from comment #7)
> Cait's comment on Bug 15384:
> 
> > the subfield list is missing capital letters as often used for
> > additional item fields.
> 
> If that doesn't sound like a good enough reason I'm happy to revise the
> patch.

The main reason to move it to its own bug report is that the fix could be backported to stable branches.
If it is embedded to this patch (enh), it won't be easy.
Comment 9 Owen Leonard 2016-03-01 14:53:32 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2016-03-01 22:19:20 UTC
Sorry - I think I was to blame here!
Comment 11 Jonathan Druart 2016-03-02 07:50:42 UTC
Created attachment 48539 [details] [review]
Bug 15887: Revise layout and behavior of item search fields management

This patch adds some JavaScript to the item search fields management
page so that the add form is not displayed by default. This simplifies
the interface and makes it more consistent with other similar
interfaces.

Also changed in this patch:
- Changing instances of "Items search fields" to "Item search fields."
- Correct form structure to use ordered list
- Add "required" classes and enable built-in JS form validation.
- Add explicitly labeled "Choose" options to <select>s.
- Add missing ids to form fields (labels don't work without them).
- Correct classes of message and alert dialogs.
- Add JS confirmation of deletions.
- Convert MARC tag and subfield dropdowns to regular inputs (Bug 15384).

To test, apply the patch and go to Administration.

- Confirm that the "Item search fields" link is correct.
- Follow the link and confirm that the list of existing fields is shown
  by default, or a message saying there are no existing fields.
- Click the "New search field" button and confirm that it displays the
  entry form.
  - Confirm that submitting an empty form does not work.
  - Confirm that clicking the "Cancel" link correctly hides the form.
  - Confirm that submitting valid data works correctly.
- In the table of existing item search fields, confirm that the "Edit"
  button works correctly.
  - Confirm that submitting edits works correctly.
- In the table of existing item search fields, confirm that clicking
  "Delete" highlights the row in question and a confirmation dialog
  appears.
  - Test both canceling and confirming deletion.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. JSHint OK, koha-qa OK.

Revision per QA: Undid the change making tag and subfield inputs text
fields.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Brendan Gallagher 2016-03-02 22:37:20 UTC
Pushed to Mater - Should be in the May 2016 Release.  thanks!