Bugzilla – Attachment 96112 Details for
Bug 20930
Validate and cache parsed YAML/JSON type system preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20930: (follow-up) Improve formatting of error message
Bug-20930-follow-up-Improve-formatting-of-error-me.patch (text/plain), 4.51 KB, created by
Owen Leonard
on 2019-12-09 18:00:49 UTC
(
hide
)
Description:
Bug 20930: (follow-up) Improve formatting of error message
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-12-09 18:00:49 UTC
Size:
4.51 KB
patch
obsolete
>From b190e3e3fc92c889d91ad11da89724ce796a6878 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 9 Dec 2019 17:49:22 +0000 >Subject: [PATCH] Bug 20930: (follow-up) Improve formatting of error message > >This patch makes a few changes to system preferences JavaScript so that >the error message for invalid YAML is output on one line. CSS has been >modified to improve the readability of multiple error messages. > >The order of CSS files loaded by preferences.tt has been changed to >ensure that CSS in preferences.css overrides plugin-related CSS. > >Unrelated: An incorrect ";" has been replaced with ":" in >preferences.tt. > >To test, apply the patch and repeat the previous test plan. Confirm that >the error messages appear as expected. >--- > koha-tmpl/intranet-tmpl/prog/css/preferences.css | 8 +++++++- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt | 6 +++--- > koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 5 +++-- > 3 files changed, 13 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css >index 7ecce1be4d9..5fb9435d7ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css >@@ -62,9 +62,15 @@ h3.collapsed { > padding-left : 12px; > } > >+.humanMsg { >+ font-size: 20px; >+ line-height: 30px; >+} >+ > .humanMsg strong { > display: block; > font-weight: normal; >+ margin-bottom: 1em; > } > > #yui-main { >@@ -134,4 +140,4 @@ span.overridden { > border: 1px solid #EEE; > margin: 1em 1em 1em 0; > resize: vertical; >-} >\ No newline at end of file >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >index 75fa80f42eb..7b9d7e13ba6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt >@@ -5,10 +5,10 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › System preferences</title> > [% INCLUDE 'doc-head-close.inc' %] >-[% Asset.css("css/preferences.css") | $raw %] >-[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %] > [% Asset.css("css/humanmsg.css") | $raw %] > [% Asset.css("lib/codemirror/codemirror.css") | $raw %] >+[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %] >+[% Asset.css("css/preferences.css") | $raw %] > </head> > <body id="admin_preferences" class="admin"> > [% INCLUDE 'header.inc' %] >@@ -207,7 +207,7 @@ > var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section"); > var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" ); > var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" ); >- var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" ); >+ var MSG_DATA_NOT_SAVED = _( "Error: your data might not have been saved" ); > var MSG_LOADING = _( "Loading..." ); > var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values"); > var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >index f1fd2800893..05190b66d55 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >@@ -55,11 +55,12 @@ KOHA.Preferences = { > modified_pref = modified_pref.replace("pref_",""); > if (modified_pref in form.sysprefs) { > if (form.sysprefs[modified_pref].error === 'Koha::Exceptions::Config::InvalidSyntax') { >- msg += "<strong>"+ MSG_INVALID_SYNTAX.format(modified_pref) + "</strong>\n"; >+ msg += "<strong>"+ MSG_INVALID_SYNTAX.format(modified_pref) + ". "; > var location = form.sysprefs[modified_pref].message.match(/line (\d+), column (\d+)/); > if (typeof location !== 'undefined' && Array.isArray(location) && location.length===3) { >- msg += "<strong>"+ MSG_INVALID_SYNTAX_LOCATION.format(location[1], location[2]) + "</strong>\n"; >+ msg += MSG_INVALID_SYNTAX_LOCATION.format(location[1], location[2]); > } >+ msg += "</strong>\n"; > } else { > msg += "<strong>"+ form.type + "</strong>\n"; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20930
:
76382
|
76383
|
76384
|
91861
|
91862
|
91863
|
94412
|
94413
|
96108
|
96109
|
96110
|
96111
|
96112
|
96817
|
96818
|
96819
|
96820
|
96821