Bug 15522 - New interface for revamped circulation rules
Summary: New interface for revamped circulation rules
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL: https://gitlab.com/joubu/Koha/commits...
Keywords:
Depends on: 18936 21156 15520
Blocks: 15523 18886
  Show dependency treegraph
 
Reported: 2016-01-07 21:54 UTC by Jesse Weaver
Modified: 2019-08-05 09:45 UTC (History)
19 users (show)

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


Attachments
Bug 15522: Add API for circulation rules (23.45 KB, patch)
2017-10-17 23:00 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add JS build pipeline (95.20 KB, patch)
2017-10-17 23:00 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add production JS build mode (4.71 KB, patch)
2017-10-17 23:00 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: New interface for updated circulation rules (59.04 KB, patch)
2017-10-17 23:00 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Remove old circulation rules interface (85.27 KB, patch)
2017-10-17 23:00 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add API for circulation rules (23.12 KB, patch)
2018-01-29 23:30 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add JS build pipeline (95.20 KB, patch)
2018-01-29 23:30 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add production JS build mode (4.71 KB, patch)
2018-01-29 23:30 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: New interface for updated circulation rules (59.10 KB, patch)
2018-01-29 23:30 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Remove old circulation rules interface (87.32 KB, patch)
2018-01-29 23:30 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Remove old circulation rules interface (86.78 KB, patch)
2018-02-26 19:20 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Remove old circulation rules interface (87.26 KB, patch)
2018-02-26 19:35 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 15522: Add API for circulation rules (23.27 KB, patch)
2019-08-05 03:03 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: Add JS build pipeline (4.64 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: New interface for updated circulation rules (58.16 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: Remove old circulation rules interface (90.90 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: Add yarn.lock (autogenerated) (84.30 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: Fix permission name manage_circ_rules_from_any_libraries (2.85 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bud 15522: Restore categories filtering (1.61 KB, patch)
2019-08-05 03:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15522: Replace the obsoleted fixFloat occurrence to use Sticky (990 bytes, patch)
2019-08-05 03:04 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 Jesse Weaver 2016-01-07 21:54:18 UTC
This interface would allow editing individual rules for each branch/category/itemtype, and be reorganized to clearly show the specificity order of default rules. 

(See http://wiki.koha-community.org/wiki/Circulation_Rules_Interface_and_Backend_Revamp_RFC#Frontend for more information and a rough mockup.)
Comment 1 Jesse Weaver 2017-10-17 23:00:00 UTC Comment hidden (obsolete)
Comment 2 Jesse Weaver 2017-10-17 23:00:04 UTC Comment hidden (obsolete)
Comment 3 Jesse Weaver 2017-10-17 23:00:07 UTC Comment hidden (obsolete)
Comment 4 Jesse Weaver 2017-10-17 23:00:10 UTC Comment hidden (obsolete)
Comment 5 Jesse Weaver 2017-10-17 23:00:14 UTC Comment hidden (obsolete)
Comment 6 George Williams (NEKLS) 2018-01-09 18:08:33 UTC
Signed off based on video that Jesse put together for me.
Comment 7 Jonathan Druart 2018-01-09 19:00:28 UTC
(In reply to George Williams (NEKLS) from comment #6)
> Signed off based on video that Jesse put together for me.

Well, none of the dependencies apply cleanly, where are the patches ? :)
Comment 8 Jesse Weaver 2018-01-29 23:30:09 UTC
Created attachment 71048 [details] [review]
Bug 15522: Add API for circulation rules

Test plan:
  1) Run t/db_dependent/api/v1/circ_rules.t .
Comment 9 Jesse Weaver 2018-01-29 23:30:13 UTC
Created attachment 71049 [details] [review]
Bug 15522: Add JS build pipeline

This is not directly testable, but can be either used through the
Makefile:

$ make js-build

(This will automatically install all dependencies.)

Or by manually installing yarn:

$ sudo apt install nodejs npm
$ sudo npm install -g yarn
$ yarn install
$ yarn build

(There is also `make js-watch` and `yarn watch`, which automatically
recompile when files are changed.)
Comment 10 Jesse Weaver 2018-01-29 23:30:17 UTC
Created attachment 71050 [details] [review]
Bug 15522: Add production JS build mode

To use, run yarn build (or make js-build) with PRODUCTION=1.
Comment 11 Jesse Weaver 2018-01-29 23:30:23 UTC
Created attachment 71051 [details] [review]
Bug 15522: New interface for updated circulation rules

Test plan:
  1) Make sure all dependencies are applied, and that their DB upgrades
     have been applied.
  2) Build JS (see previous patches for HOWTO).
  3) Load .../cgi-bin/koha/admin/policy.pl .
  4) Try changing an existing rule (one with a textbox or dropdown). Hit
     "Save rules", ensure that your changes are saved.
  5) Until changes are saved, all cells that are changed or affected by
     your changes should be highlighted in yellow.
  6) Same as above, but deleting a rule by hitting the "x" next to it.
  7) Add rows and columns using the "Choose rule..." and "Choose
     category/item type..." dropdowns.
  8) Add rules by clicking the pencil in a currently unset rule cell.
     Ensure changes are saved.
  9) Hit "Cleanup rules"; all redundant rules should be removed. As this
     only removes rules that are the same as the defaults, this should
     not change any effective rules.
 10) Use the filters at the top right ("Circulation", "Holds" and
     "Fines") to filter the kinds of rules that are shown.
 11) Ensure that any desired library can be shown, including (if
     selected) all at the same time.
Comment 12 Jesse Weaver 2018-01-29 23:30:28 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2018-02-26 17:35:23 UTC
Waiting for depending bugs that are not signed off yet.

Jesse, can you provide a remote branch with all the patches applied?
Comment 14 Jesse Weaver 2018-02-26 19:20:57 UTC Comment hidden (obsolete)
Comment 15 Jesse Weaver 2018-02-26 19:35:39 UTC
Created attachment 72242 [details] [review]
Bug 15522: Remove old circulation rules interface
Comment 16 Jesse Weaver 2018-02-26 19:44:12 UTC
(In reply to Jonathan Druart from comment #13)
> Waiting for depending bugs that are not signed off yet.
> 
> Jesse, can you provide a remote branch with all the patches applied?

https://github.com/pianohacker/koha , branch bz15522-withdeps .
Comment 17 Owen Leonard 2019-02-20 16:08:26 UTC
Is there still a way forward for this bug, assuming its dependencies are taken care of?
Comment 18 Jonathan Druart 2019-02-22 10:23:29 UTC
(In reply to Owen Leonard from comment #17)
> Is there still a way forward for this bug, assuming its dependencies are
> taken care of?

I am taking care of the dependencies. This patchset is to big to keep it up-to-date with all the deps.

If you want to give it a try you should use Jesse's remote branch.
Comment 19 Victor Grousset/tuxayo 2019-05-20 19:54:39 UTC Comment hidden (obsolete)
Comment 20 Jonathan Druart 2019-05-23 02:42:35 UTC
(In reply to Victor Grousset/tuxayo from comment #19)
> Hi :), I tried to test https://github.com/pianohacker/koha => branch
> bz15522-withdeps
> 
> As it is, before trying to rebase it on master.

Please do not do that. See the related bug reports, I am on it already. You should focus on bugs that are before this one in the dependency tree.
Comment 21 Victor Grousset/tuxayo 2019-05-24 15:42:39 UTC
Ok, I got confused by the previous message, I should have noticed that it was in "BLOCKED" and not in "Need Signoff"

So, I think I did all I could in bug 18930 and bug 18936.
I there something else doable in the dependencies of this bug?

Maybe trying to get one of my colleagues to QA Bug 18928 ?
Comment 22 Cab Vinton 2019-07-10 20:34:11 UTC
If it's not too late to add a suggestion, systems with multiple (N) branches often end up with the same rule duplicated N times, once for each library.

Ideally, this would be simplified to a single rule that applies to all branches.

Thinking a button to run a clean-up script might do the trick.
Comment 23 Jonathan Druart 2019-08-05 03:03:55 UTC
Created attachment 91977 [details] [review]
Bug 15522: Add API for circulation rules

Test plan:
  1) Run t/db_dependent/api/v1/circ_rules.t .
Comment 24 Jonathan Druart 2019-08-05 03:04:01 UTC
Created attachment 91978 [details] [review]
Bug 15522: Add JS build pipeline

This is not directly testable, but can be either used through the
Makefile:

$ make js-build

(This will automatically install all dependencies.)

Or by manually installing yarn:

$ sudo apt install nodejs npm
$ sudo npm install -g yarn
$ yarn install
$ yarn build

(There is also `make js-watch` and `yarn watch`, which automatically
recompile when files are changed.)

JD note: the make rule does not work
Comment 25 Jonathan Druart 2019-08-05 03:04:07 UTC
Created attachment 91979 [details] [review]
Bug 15522: New interface for updated circulation rules

Test plan:
  1) Make sure all dependencies are applied, and that their DB upgrades
     have been applied.
  2) Build JS (see previous patches for HOWTO).
  3) Load .../cgi-bin/koha/admin/policy.pl .
  4) Try changing an existing rule (one with a textbox or dropdown). Hit
     "Save rules", ensure that your changes are saved.
  5) Until changes are saved, all cells that are changed or affected by
     your changes should be highlighted in yellow.
  6) Same as above, but deleting a rule by hitting the "x" next to it.
  7) Add rows and columns using the "Choose rule..." and "Choose
     category/item type..." dropdowns.
  8) Add rules by clicking the pencil in a currently unset rule cell.
     Ensure changes are saved.
  9) Hit "Cleanup rules"; all redundant rules should be removed. As this
     only removes rules that are the same as the defaults, this should
     not change any effective rules.
 10) Use the filters at the top right ("Circulation", "Holds" and
     "Fines") to filter the kinds of rules that are shown.
 11) Ensure that any desired library can be shown, including (if
     selected) all at the same time.

JD edits: Removed the changes to filtered categories, will be done in a
follow-up
Comment 26 Jonathan Druart 2019-08-05 03:04:14 UTC
Created attachment 91980 [details] [review]
Bug 15522: Remove old circulation rules interface
Comment 27 Jonathan Druart 2019-08-05 03:04:20 UTC
Created attachment 91981 [details] [review]
Bug 15522: Add yarn.lock (autogenerated)
Comment 28 Jonathan Druart 2019-08-05 03:04:26 UTC
Created attachment 91982 [details] [review]
Bug 15522: Fix permission name manage_circ_rules_from_any_libraries

On 15520 followups have been provided to not use a negative permission.

Note that two api tests are failing (get 400). I would like some help to
investigate here why 400 is returned instead of 403.
Comment 29 Jonathan Druart 2019-08-05 03:04:31 UTC
Created attachment 91983 [details] [review]
Bud 15522: Restore categories filtering

Mimicking what is done for Branches
Comment 30 Jonathan Druart 2019-08-05 03:04:36 UTC
Created attachment 91984 [details] [review]
Bug 15522: Replace the obsoleted fixFloat occurrence to use Sticky
Comment 31 Jonathan Druart 2019-08-05 03:08:05 UTC
Screenshot: https://snag.gy/ujakOo.jpg