Bug 24193 - Add CodeMirror linting of JavaScript, CSS, HTML, and YAML system preferences
Summary: Add CodeMirror linting of JavaScript, CSS, HTML, and YAML system preferences
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 1 vote (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-09 18:11 UTC by Owen Leonard
Modified: 2020-04-01 05:35 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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