Bug 32721: (QA follow up) - fix QA issues

This patches addresses issues raised by the QA tests. It also adds a missed import of the Branches file in the document head

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 32721: (QA follow-up) Add missing imports

Missing imports added in three template files
Exec flag added to atomic update file
Tinymce imports removed

A new bug will be created to move codemirror into an inc file at latest
version

Test plan as before

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 32721: Tidy up - duplicate fetching of userjs and css

Currently UserJS and UserCSS is injected into the template as a parameter through Auth.pm but is then fetched using Koha.Preference() in the template. This patch tidies this up by removing the parameters from Auth.pm

Test plan as per first commit

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-01-27 14:46:44 +00:00 committed by Tomas Cohen Arazi
parent dd3d59f1f8
commit 6deab09c13
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
7 changed files with 25 additions and 7 deletions

View file

@ -573,7 +573,6 @@ sub get_template_and_user {
OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"),
OPACShelfBrowser => "" . C4::Context->preference("OPACShelfBrowser"),
OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
OPACUserCSS => "" . C4::Context->preference("OPACUserCSS"),
OpacAuthorities => C4::Context->preference("OpacAuthorities"),
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'},
opac_search_limit => $opac_search_limit,
@ -593,7 +592,6 @@ sub get_template_and_user {
OpacFavicon => C4::Context->preference("OpacFavicon"),
opaclanguagesdisplay => "" . C4::Context->preference("opaclanguagesdisplay"),
opacreadinghistory => C4::Context->preference("opacreadinghistory"),
OPACUserJS => C4::Context->preference("OPACUserJS"),
opacuserlogin => "" . C4::Context->preference("opacuserlogin"),
OpenLibrarySearch => C4::Context->preference("OpenLibrarySearch"),
ShowReviewer => C4::Context->preference("ShowReviewer"),
@ -1374,6 +1372,12 @@ sub checkauth {
OpacFavicon => C4::Context->preference("OpacFavicon"),
opacreadinghistory => C4::Context->preference("opacreadinghistory"),
opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
opacbookbag => "" . C4::Context->preference("opacbookbag"),
OpacCloud => C4::Context->preference("OpacCloud"),
OpacTopissue => C4::Context->preference("OpacTopissue"),
OpacAuthorities => C4::Context->preference("OpacAuthorities"),
OpacBrowser => C4::Context->preference("OpacBrowser"),
TagsEnabled => C4::Context->preference("TagsEnabled"),
OPACUserJS => C4::Context->preference("OPACUserJS"),
OPACUserCSS => C4::Context->preference("OPACUserCSS"),
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),

View file

@ -292,7 +292,7 @@
<label for="UserJS">UserJS: </label>
<div style="display:flex; flex-direction:column;">
<a class="expand-textarea" id="expand_userjs" data-target="userjs" data-syntax="javascript" href="#">Click to edit</a>
<textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs %]</textarea>
<textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs | html %]</textarea>
<a class="collapse-textarea" id="collapse_userjs" data-target="userjs" data-syntax="javascript" style="display:none" href="#">Click to collapse</br></a>
</div>
</li>
@ -300,7 +300,7 @@
<label for="UserCSS">UserCSS: </label>
<div style="display:flex; flex-direction:column;">
<a class="expand-textarea" id="expand_usercss" data-target="usercss" data-syntax="css" href="#">Click to edit</a>
<textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss %]</textarea>
<textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss | html %]</textarea>
<a class="collapse-textarea" id="collapse_usercss" data-target="usercss" data-syntax="css" style="display:none" href="#">Click to collapse</br></a>
</div>
</li>
@ -504,7 +504,6 @@
[% Asset.js("js/admin-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
[% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
[% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
[% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
@ -520,7 +519,6 @@
[% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %]
[% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %]
[% Asset.css("lib/codemirror/codemirror.css") | $raw %]
[% INCLUDE 'str/tinymce_i18n.inc' %]
<style>
.CodeMirror {
border: 1px solid #EEE;

View file

@ -1,5 +1,6 @@
[% USE raw %]
[% USE Koha %]
[% USE Branches %]
[%- USE KohaPlugins -%]
[% USE Asset %]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

View file

@ -43,6 +43,11 @@
[% Asset.css("css/sco.css") | $raw %]
[% END %]
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %]
<style>
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %]
</style>
[% END %]
[% IF ( Koha.Preference('SelfCheckInUserCSS') ) %]<style>[% Koha.Preference('SelfCheckInUserCSS') | $raw %]</style>[% END %]
<script>
var Koha = {};

View file

@ -13,6 +13,11 @@
[% Asset.css("lib/fontawesome/css/solid.min.css") | $raw %]
[% Asset.css("css/sco.css") | $raw %]
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %]
<style>
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %]
</style>
[% END %]
[% IF ( SCOUserCSS ) %]<style>[% SCOUserCSS | $raw %]</style>[% END %]
<script>
var Koha = {};

View file

@ -23,6 +23,11 @@
[% Asset.css("css/sco.css") | $raw %]
[% END %]
[% IF ( Koha.Preference('OPACUserCSS') ) %]<style>[% Koha.Preference('OPACUserCSS') | $raw %]</style>[% END %]
[% IF Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) %]
<style>
[% Branches.GetBranchSpecificCSS( Branches.GetLoggedInBranchcode() || default_branch) | $raw %]
</style>
[% END %]
[% IF ( Koha.Preference('SCOUserCSS') ) %]<style>[% Koha.Preference('SCOUserCSS') | $raw %]</style>[% END %]
<script>
var Koha = {};

View file

@ -218,7 +218,7 @@ subtest 'pickup_locations() tests' => sub {
$schema->storage->txn_rollback;
};
subtest 'branch specfic js and css' => sub {
subtest 'branch specific js and css' => sub {
plan tests => 2;