Bug 21352 - Allow plugins to add CSS and Javascript to Staff interface
Summary: Allow plugins to add CSS and Javascript to Staff interface
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Katrin Fischer
URL:
Keywords:
: 17490 17491 21016 (view as bug list)
Depends on: 20181 20764
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-14 23:32 UTC by Kyle M Hall
Modified: 2019-01-09 14:21 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
This enhancement allows plugin authors to make adaptations to the staff client using css and javascript.
Version(s) released in:


Attachments
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface (7.08 KB, patch)
2018-09-15 19:12 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface (7.06 KB, patch)
2018-09-20 19:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side (2.75 KB, patch)
2018-09-20 19:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface (7.07 KB, patch)
2018-09-26 16:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side (2.77 KB, patch)
2018-09-26 16:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface (6.94 KB, patch)
2018-10-01 18:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side (2.25 KB, patch)
2018-10-01 18:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Add missing USE statements (1.49 KB, patch)
2018-10-01 18:07 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface (6.97 KB, patch)
2018-10-03 13:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side (2.29 KB, patch)
2018-10-03 13:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21352: Add missing USE statements (1.53 KB, patch)
2018-10-03 13:25 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2018-09-14 23:32:44 UTC
We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.
Comment 1 Kyle M Hall 2018-09-15 19:12:10 UTC Comment hidden (obsolete)
Comment 2 David Cook 2018-09-16 17:15:14 UTC
Super excited for enhancements to plugins! 

I'm hoping to look at this later today. 

I was curious though about the order in which the plugin CSS/JS is applied. I'm guessing it's based on the order that plugins have been loaded into Koha? 

(I seem to recall Kyle and Andreas talking a bit at Kohacon about a way to specify order/priority but maybe I misheard what that was about.)
Comment 3 David Cook 2018-09-16 22:16:18 UTC
I think this plugin and test plan might be for the OPAC rather than the staff client?

Even on the OPAC, it's escaping the angle brackets so it just prints the CSS out as text. 

The HTML source looks like this:

<style>
          body {
            background-color: orange;
          }
        </style>
Comment 4 Kyle M Hall 2018-09-20 17:46:05 UTC
(In reply to David Cook from comment #3)
> I think this plugin and test plan might be for the OPAC rather than the
> staff client?
> 
> Even on the OPAC, it's escaping the angle brackets so it just prints the CSS
> out as text. 
> 
> The HTML source looks like this:
> 
> <style>
>           body {
>             background-color: orange;
>           }
>         </style>

Sounds like a regression. You are right about the test plan. It should say intranet, not opac.
Comment 5 Kyle M Hall 2018-09-20 19:31:43 UTC
Created attachment 79185 [details] [review]
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface

We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.19 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the staff intranet, notice you get an alert message and the background
   for your staff intranet is now orange ( assuming you've not customized the
   staff intranet in any way )
Comment 6 Kyle M Hall 2018-09-20 19:31:53 UTC
Created attachment 79186 [details] [review]
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side
Comment 7 Kyle M Hall 2018-09-26 11:11:28 UTC
Upping bug severity as followup contains a bug fix.
Comment 8 Nick Clemens 2018-09-26 11:14:40 UTC
*** Bug 17490 has been marked as a duplicate of this bug. ***
Comment 9 Nick Clemens 2018-09-26 11:16:48 UTC
*** Bug 17491 has been marked as a duplicate of this bug. ***
Comment 10 Owen Leonard 2018-09-26 16:47:05 UTC
Created attachment 79440 [details] [review]
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface

We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.19 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the staff intranet, notice you get an alert message and the background
   for your staff intranet is now orange ( assuming you've not customized the
   staff intranet in any way )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 11 Owen Leonard 2018-09-26 16:47:09 UTC
Created attachment 79441 [details] [review]
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 12 Katrin Fischer 2018-09-28 06:05:03 UTC
Hi Kyle,
I've tried this, but I don't see the effect in the staff client as described. 
Can you please check the plugin and if it still works for you?

Installed the plugin from the URl given and restarted everything mulitple times:
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
Comment 13 David Cook 2018-09-28 06:36:58 UTC
(In reply to Katrin Fischer from comment #12)
> Hi Kyle,
> I've tried this, but I don't see the effect in the staff client as
> described. 
> Can you please check the plugin and if it still works for you?
> 
> Installed the plugin from the URl given and restarted everything mulitple
> times:
>   
> https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/
> download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz

I had the same experience.
Comment 14 Kyle M Hall 2018-10-01 18:07:41 UTC
Created attachment 79754 [details] [review]
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface

We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.19 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the staff intranet, notice you get an console error log message and the background
   for your staff intranet is now orange ( assuming you've not customized the
   staff intranet in any way )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 15 Kyle M Hall 2018-10-01 18:07:51 UTC
Created attachment 79755 [details] [review]
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 16 Kyle M Hall 2018-10-01 18:07:54 UTC
Created attachment 79756 [details] [review]
Bug 21352: Add missing USE statements
Comment 17 Tomás Cohen Arazi 2018-10-03 13:25:00 UTC
Created attachment 79873 [details] [review]
Bug 21352: Allow plugins to add CSS and Javascript to Staff interface

We should have plugin hooks for the staff interface just like we have for the OPAC as detailed on bug 20181.

Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.19 or later )
   https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.19/koha-plugin-kitchen-sink-v2.1.19.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
   This will ensure the plugin takes effect right away, it should be
   necessary but it won't hurt anything!
5) Load the staff intranet, notice you get an console error log message and the background
   for your staff intranet is now orange ( assuming you've not customized the
   staff intranet in any way )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 18 Tomás Cohen Arazi 2018-10-03 13:25:07 UTC
Created attachment 79875 [details] [review]
Bug 21352: Use the raw filter for plugin hooks, both opac and staff side

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 19 Tomás Cohen Arazi 2018-10-03 13:25:27 UTC
Created attachment 79876 [details] [review]
Bug 21352: Add missing USE statements

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 20 Nick Clemens 2018-10-05 16:26:57 UTC
Awesome work all!

Pushed to master for 18.11
Comment 21 Martin Renvoize 2018-10-08 08:53:56 UTC
Pushed to 18.05.x for 18.05.05.

As per my policy of backporting invisible Plugin and API enhancements that allow plugin authors to support a broader range of Koha versions I have backported this work too.
Comment 22 Kyle M Hall 2018-10-11 11:00:46 UTC
(In reply to Martin Renvoize from comment #21)
> Pushed to 18.05.x for 18.05.05.
> 
> As per my policy of backporting invisible Plugin and API enhancements that
> allow plugin authors to support a broader range of Koha versions I have
> backported this work too.

Thanks Martin!
Comment 23 Fridolin SOMERS 2018-10-19 06:43:53 UTC Comment hidden (obsolete)
Comment 24 Fridolin SOMERS 2018-10-19 08:56:18 UTC
I've decided to backport to 17.11.x, this is very useful and not risky.

Pushed to 17.11.x for 17.11.11
Comment 25 Kyle M Hall 2019-01-09 14:21:59 UTC
*** Bug 21016 has been marked as a duplicate of this bug. ***