[Bug 41562] New: Introduce the concept of "stores" for regular javascript
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Bug ID: 41562 Summary: Introduce the concept of "stores" for regular javascript Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: jonathan.druart@gmail.com Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org For follow-up bug reports we will have the need to store syspref's values and permissions. It seems a good idea to have a "store" to share the permissions and system preferences' values we need for the current page. Several "script" tag can coexist and define their own permissions or sysprefs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 191062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191062&action=edit Bug 41562: Introduce "stores" for regular javascript We already have "Stores" in Vue, here we are going to use a shared object to store permissions and sysrepfs For follow-up bug reports we will have the need to store syspref's values and permissions. It seems a good idea to have a "store" to share the permissions and system preferences' values we need for the current page. Several "script" tag can coexist and define their own permissions or sysprefs. Added on its own bug for reusability purpose. Test plan: Test follow-up bug reports ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41563 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41563 [Bug 41563] Tidy kohaTable block - acqui -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191062|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 191289 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191289&action=edit Bug 41562: Introduce "stores" for regular javascript We already have "Stores" in Vue, here we are going to use a shared object to store permissions and sysrepfs For follow-up bug reports we will have the need to store syspref's values and permissions. It seems a good idea to have a "store" to share the permissions and system preferences' values we need for the current page. Several "script" tag can coexist and define their own permissions or sysprefs. Added on its own bug for reusability purpose. Test plan: Test follow-up bug reports ;) Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- I like the idea, but should we be namespacing these more? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #3)
I like the idea, but should we be namespacing these more?
Can you detail what you suggest exactly please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41568 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41568 [Bug 41568] Tidy kohaTable block - circ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #4)
(In reply to David Cook from comment #3)
I like the idea, but should we be namespacing these more?
Can you detail what you suggest exactly please?
Oh yeah my bad. I just mean putting it under something like window.Koha.permissions and window.Koha.prefs. Of course, as I say that, I know we haven't been great about the use of window.Koha and window.KOHA in the past. In the Koha code, I see Koha.i18n, Koha.frameworkPlugins, KOHA.coce, KOHA.browser, KOHA.LocalCover, KOHA.Preferences, KOHA.AJAX... I imagine some are used globally while others are only used locally on a single page... Maybe something like window.Koha.global.permissions / window.Koha.global.prefs. I'm not sure. It's just got a thought to avoid collisions with other Javascript and to make it clear that it's Koha code specifically. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41572 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41572 [Bug 41572] Tidy kohaTable block - members -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41575 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41575 [Bug 41575] Tidy kohaTable block - pos -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41581 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41581 [Bug 41581] Tidy kohaTable block - virtualshelves -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41582 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41582 [Bug 41582] Tidy kohaTable block - opac -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org --- Comment #6 from Owen Leonard <oleonard@myacpl.org> --- *** Bug 17498 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41573 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41573 [Bug 41573] Tidy kohaTable block - patron_lists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41574 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41574 [Bug 41574] Tidy kohaTable block - patroncards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41579 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41579 [Bug 41579] Tidy kohaTable block - suggestions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #5)
(In reply to Jonathan Druart from comment #4)
(In reply to David Cook from comment #3)
I like the idea, but should we be namespacing these more?
Can you detail what you suggest exactly please?
Oh yeah my bad. I just mean putting it under something like window.Koha.permissions and window.Koha.prefs.
Of course, as I say that, I know we haven't been great about the use of window.Koha and window.KOHA in the past.
In the Koha code, I see Koha.i18n, Koha.frameworkPlugins, KOHA.coce, KOHA.browser, KOHA.LocalCover, KOHA.Preferences, KOHA.AJAX... I imagine some are used globally while others are only used locally on a single page...
Maybe something like window.Koha.global.permissions / window.Koha.global.prefs.
I'm not sure. It's just got a thought to avoid collisions with other Javascript and to make it clear that it's Koha code specifically.
Yes, I think it makes sense. However I am suggesting to have a follow-up bug report for that, Owen already tested and signed off on a lot of bugs, and it will be messy to fix same one by one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41653 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41653 [Bug 41653] Stores for permissions and sysprefs should be under the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41577 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41577 [Bug 41577] Tidy kohaTable block - reserves -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41580 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41580 [Bug 41580] Tidy kohaTable block - tools -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191289|0 |1 is obsolete| | --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 192747 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192747&action=edit Bug 41562: Introduce "stores" for regular javascript We already have "Stores" in Vue, here we are going to use a shared object to store permissions and sysrepfs For follow-up bug reports we will have the need to store syspref's values and permissions. It seems a good idea to have a "store" to share the permissions and system preferences' values we need for the current page. Several "script" tag can coexist and define their own permissions or sysprefs. Added on its own bug for reusability purpose. Test plan: Test follow-up bug reports ;) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41562 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #10 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org