From Vue components.
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.