Description
Lari Taskula
2017-08-04 12:23:46 UTC
Created attachment 65497 [details]
example screenshot
This has been implement but needs a rebase to be suitable for applying on master. It uses REST API and requires Bug 18137. Code of our current implementation for the API endpoint is here https://github.com/KohaSuomi/Koha/commit/fc9f92651a39bf371cfde10fd46abdeb81e212ec ...and the GUI here https://github.com/KohaSuomi/Koha/commit/d089582e32d98fcd82e544b8a51aedcb7da3ba90 Attached a screenshot so you can see how it looks. Created attachment 65523 [details] [review] Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule To test: 1. prove t/db_dependent/api/v1/issuingrules.t 2. Send GET requests to /api/v1/issuingrules/effective with different parameters as defined in the path's Swagger spec 3. Make sure it returns the correct issuing rules (don't forget that system prefs like CircControl and HomeOrHoldingBranch affects the result) Created attachment 65524 [details] [review] KD-2316: Issuing rules test tool - GUI for test tool To test: 1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl 2. You should see a button below circulation rules matrix "Circulation and fine rules test tool" 3. Click it 4. You should see options for inputting test patron, item and branch 5. Play with the tester and make sure it returns correct issuing rules (CircControl and HomeOrHoldingBranch system preferences affects the result) Created attachment 65525 [details] [review] Bug 19037: Issuing rules test tool - GUI for test tool To test: 1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl 2. You should see a button below circulation rules matrix "Circulation and fine rules test tool" 3. Click it 4. You should see options for inputting test patron, item and branch 5. Play with the tester and make sure it returns correct issuing rules (CircControl and HomeOrHoldingBranch system preferences affects the result) Created attachment 65526 [details] [review] Bug 19037: Issuing rules test tool - GUI for test tool To test: 1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl 2. You should see a button below circulation rules matrix "Circulation and fine rules test tool" 3. Click it 4. You should see options for inputting test patron, item and branch 5. Play with the tester and make sure it returns correct issuing rules (CircControl and HomeOrHoldingBranch system preferences affects the result) Testing this tool requires Bug 18137. It has some Perl dependencies, please see the patch called "List Mojolicious::Plugin::OpenAPI and JSON::Validator as dependencies" for versions of dependencies that are confirmed to work. Make sure to install those versions or otherwise the endpoint (and the tool) may not work. Hi Lari When applying these patches I found that they threw an error even though I had the dependencies in my branch: Applying: Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule fatal: sha1 information is lacking or useless (t/db_dependent/api/v1/cities.t). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 19037: Issuing rules test tool - REST API endpoint for effective issuing rule The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-19037-Issuing-rules-test-tool---REST-API-endpo-M5ZrDP.patch *** Bug 26034 has been marked as a duplicate of this bug. *** Looking forward to this enhancement. We had this in Symphony and it was a life saver. Very much looking forward to this. +1 from RCLS Thank you for the recent interest. Sadly this is not currently in my to-do list, but if someone wants to take over this Bug, please do! Created attachment 168450 [details] [review] Bug 19037: Issuing rules test tool - GUI for test tool To test: 1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl 2. You should see a button below circulation rules matrix "Circulation and fine rules test tool" 3. Click it 4. You should see options for inputting test patron, item and branch 5. Play with the tester and make sure it returns correct issuing rules (CircControl and HomeOrHoldingBranch system preferences affects the result) Created attachment 168451 [details] [review] Bug 19037: Update to use PQA api endpoint and modern styling This patch updates the test tool to use the recently introduced API endpoint. TODO: This works nicely with 'Categorycode', 'Itemtype' and 'Library' selection right now, but does not yet work for the other select options in the tester. Would mind a bit of help cleaning this up.. the basics are working again but it needs some refinement around the select options that are exposed.. Created attachment 169037 [details] [review] Bug 19037: Issuing rules test tool - GUI for test tool To test: 1. Go to INTRANET/cgi-bin/koha/admin/smart-rules.pl 2. You should see a button below circulation rules matrix "Circulation and fine rules test tool" 3. Click it 4. You should see options for inputting test patron, item and branch 5. Play with the tester and make sure it returns correct issuing rules (CircControl and HomeOrHoldingBranch system preferences affects the result) Created attachment 169038 [details] [review] Bug 19037: Update to use PQA api endpoint and modern styling This patch updates the test tool to use the recently introduced API endpoint. TODO: This works nicely with 'Categorycode', 'Itemtype' and 'Library' selection right now, but does not yet work for the other select options in the tester. Created attachment 169039 [details] [review] Bug 19037: Move test tool to includes Created attachment 169040 [details] [review] Bug 19037: Update for change of API response I only get "undefined" box after clicking "find" in the tool. Also, the tool is always visible in my case so step 2 and 3 were confusing. I am also getting "undefined" on all tests. The rule tester is showing right away on page load and is above the actual circ rules. Your test plan suggests you intended it to be hidden on page load and beneath the circ rules, which would both be great. (In reply to Shi Yao Wang from comment #21) > I only get "undefined" box after clicking "find" in the tool. > Also, the tool is always visible in my case so step 2 and 3 were confusing. |