Bug 27025 - jQuery testing with specific user
Summary: jQuery testing with specific user
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-14 04:32 UTC by Christopher Brannon
Modified: 2021-05-11 14:43 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2020-11-14 04:32:36 UTC
I have been able to apply jQuery that only applies to a specific user that is logged in.  I would propose that Koha would use similar techniques and create a jQuery test field that only applies to Koha if a specific user is logged in.  This would be completely separate from the usual jQuery that is applied, but applied along with the usual jQuery, for testing purposes.  It would have no affect on other users in a production environment, but allow for admin to test new jQuery before applying to the regular jQuery.
Comment 1 David Cook 2020-11-16 00:38:58 UTC
That's an interesting idea. I think that this could be quite useful for Javascript and CSS actually.
Comment 2 Christopher Brannon 2021-04-07 23:15:22 UTC
I've been thinking more about this, and how to make this more practical.  I think there should be a superlibrarian tab in the side tabs in the user account (obviously that only shows if the user is a superlibrarian, and it is the same account that is logged in.

Under that tab, there would be fields like OPAC and Staff jQuery and CSS.  If left blank, the normal fields in administration are used.  If one of these superlibrarian fields has anything in it, it overrides it's counterpart, and the one in admin is not used.

The idea is that only the logged in superlibrarian can create an override, and only under their own account.  They can't create an override for another superlibrarian, and that override only works when that superlibrarian is logged in.  It has no effect on other logged in users.  This gives a good, isolated testing area for admin.

Perhaps for good measure, there should also be a permission under the superlibrarian permission to enable/disable the overrides.  It would not prevent access to the tab or override fields, but it would allow that superlibrarian and other superlibrarians the ability to render it inactive, in case, during testing, the override has some unexpected affect that keeps that user from being able to undo the code.  It would also allow that superlibrarian to turn on/off the code they are testing without having to clear the fields in between testing.
Comment 3 Barbara Johnson 2021-05-11 14:43:37 UTC
This would be really useful.