Bug 24193

Summary: Add CodeMirror linting of JavaScript, CSS, HTML, and YAML system preferences
Product: Koha Reporter: Owen Leonard <oleonard>
Component: System AdministrationAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, david, dcook, gmcharlt, jonathan.druart, katrin.fischer, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20930
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds CodeMirror plugins for linting system preferences that include JS, CSS, HTML, and YAML. When invalid data is entered in a linted CodeMirror editor an icon is displayed in the editor's "gutter." Hovering over the icon displays the error message.
Version(s) released in:
20.05.00

Description Owen Leonard 2019-12-09 18:11:33 UTC
CodeMirror offers linting plugins for JavaScript, CSS, HTML, and YAML. We should incorporate these into the system preferences editor.

Note: The proposed patch can coexist with Bug 20930.
Comment 1 Owen Leonard 2019-12-09 19:19:07 UTC
This patch is too large to attach to Bugzilla so I've put a remote branch here:

https://gitlab.com/koha-dev/koha-dev/commits/bug-24193-codemirror-linting

Alternatively, a patch for download: 

https://zivotdesign.com/download/bug-24193-codemirror-linting.patch
Comment 2 David Nind 2020-02-15 04:16:35 UTC
Tested using ByWaterSolutions sandboxes.

Everything works as per the test plan.

(Not sure if this the correct way to sign-off remote patches.)
Comment 3 Katrin Fischer 2020-02-17 22:14:45 UTC
Hi Owen,

tried with the downloadable patch, but it does no longer apply. Can you please rebase and add David's sign-off?
Comment 4 Owen Leonard 2020-02-25 17:46:32 UTC
I've rebased the downloadable patch and the remote branch.
Comment 5 Jonathan Druart 2020-02-26 11:55:14 UTC
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt:[% Asset.css("lib/codemirror/codemirror.css") | $raw %]


Should not it be codemirror.min.css?
Comment 6 Jonathan Druart 2020-02-26 11:57:05 UTC
I thought we were going to move those pref to the "news"?
Comment 7 Owen Leonard 2020-02-26 16:15:53 UTC
(In reply to Jonathan Druart from comment #5)
 
> Should not it be codemirror.min.css?

Fixed.

> I thought we were going to move those pref to the "news"?

The HTML linting aspect will eventually be obsolete, but the JS, CSS, and YAML linting is still relevant.
Comment 8 Katrin Fischer 2020-02-29 23:01:25 UTC
Hm, can't run the QA tools on this patch: 
An error occurred : Unmatched ) in regex; marked by <-- HERE in m/_\([(?<string>[^[]*) <-- HERE [\)/ at /home/vagrant/qa-test-tools/QohA/File/JS.pm line 29.
Comment 9 Katrin Fischer 2020-02-29 23:10:38 UTC
@RM: can you please add missing sign-off lines? :)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize 2020-03-02 10:55:03 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-03-31 22:45:34 UTC
enhancement not backported to 19.11.x