Summary: | Vue - Add API client class to interact with svc/config/systempreferences | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, lucas, martin.renvoize, pedro.amorim |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34369 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.05.00,22.11.05
|
|
Circulation function: | |||
Bug Depends on: | 33290 | ||
Bug Blocks: | 30708, 33408 | ||
Attachments: |
Bug 33289: Add API client class to interact with svc/config/systempreferences
Bug 33289: Add API client class to interact with svc/config/systempreferences Bug 33289: DO NOT PUSH - test plan only Bug 33289: Add API client class to interact with svc/config/systempreferences |
Description
Jonathan Druart
2023-03-21 07:47:10 UTC
Created attachment 148442 [details] [review] Bug 33289: Add API client class to interact with svc/config/systempreferences On bug 30708 we will need to modify sysprefs from the UI (Vue app), it could be useful for other developments as well and so it is moved on its own bug report. Test plan: It can be tested independently of bug 30708 using the following code: const client = APIClient.sysprefs client.sysprefs .update( "CardnumberLength", "42" ) Sponsored-by: BULAC - http://www.bulac.fr/ Created attachment 148596 [details] [review] Bug 33289: Add API client class to interact with svc/config/systempreferences On bug 30708 we will need to modify sysprefs from the UI (Vue app), it could be useful for other developments as well and so it is moved on its own bug report. Test plan: It can be tested independently of bug 30708 using the following code: const client = APIClient.sysprefs client.sysprefs .update( "CardnumberLength", "42" ) Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Sorry, the test plan is not detailed enough for me - can you please add some more info? (In reply to Katrin Fischer from comment #3) > Sorry, the test plan is not detailed enough for me - can you please add some > more info? You need to play with the code, or test a follow-up bug. The code I pasted in the commit message is enough to test the change. You can pick a place in a Vue component ('script' part), add the change, hit the page when the component is mounted, then confirm that the syspref value has been changed in DB. (In reply to Jonathan Druart from comment #4) > (In reply to Katrin Fischer from comment #3) > > Sorry, the test plan is not detailed enough for me - can you please add some > > more info? > > You need to play with the code, or test a follow-up bug. > > The code I pasted in the commit message is enough to test the change. You > can pick a place in a Vue component ('script' part), add the change, hit > the page when the component is mounted, then confirm that the syspref value > has been changed in DB. I only understood half of that, probably because I have not even basic knowledge of how Vue works. I'll leave this to someone more knowledgeable. Created attachment 149525 [details] [review] Bug 33289: DO NOT PUSH - test plan only @Katrin: Before applying patches: * Verify that 'cardnumberlength' is empty in the system preferences Apply both patches: * Visit /cgi-bin/koha/erm/agreements (it will run the test code to change a syspref value from the api-client.js + http-client.js) * Go back to the system preferences and verify that 'cardnumberlength' now has a value of 42 Created attachment 149526 [details] [review] Bug 33289: Add API client class to interact with svc/config/systempreferences On bug 30708 we will need to modify sysprefs from the UI (Vue app), it could be useful for other developments as well and so it is moved on its own bug report. Test plan: It can be tested independently of bug 30708 using the following code: const client = APIClient.sysprefs client.sysprefs .update( "CardnumberLength", "42" ) Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Clear and simple code all working as expected. Passing QA Pushed to master for 23.05. Nice work everyone, thanks! Nice work everyone! Pushed to stable for 22.11.x Missing dependencies for 22.05.x backport. |