Bug 27643 - Add CodeMirror custom syntax highlighting for SQL runtime parameters
Summary: Add CodeMirror custom syntax highlighting for SQL runtime parameters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 27644 27747
  Show dependency treegraph
 
Reported: 2021-02-05 18:10 UTC by Owen Leonard
Modified: 2022-06-06 20:25 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch modifies the configuration of the reports module's SQL editor so that runtime parameters have their own syntax highlighting, setting them apart by color from other parts of the SQL code.
Version(s) released in:
21.05.00


Attachments
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters (9.13 KB, patch)
2021-02-05 18:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters (9.18 KB, patch)
2021-02-05 23:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters (9.24 KB, patch)
2021-02-06 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-02-05 18:10:36 UTC
I propose we add a basic syntax highlighting configuration for SQL parameters, defined as any string surrounded by double brackets: <<branches>>.
Comment 1 Owen Leonard 2021-02-05 18:51:43 UTC Comment hidden (obsolete)
Comment 2 David Nind 2021-02-05 23:35:48 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2021-02-06 21:02:49 UTC
Created attachment 116443 [details] [review]
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters

This patch adds some additional configuration to CodeMirror so that
runtime parameters have a distinct color in the CodeMirror SQL editor.

To test, apply the patch and create or edit an SQL report which contains
one or more runtime parameters, e.g. <<branches>>, <<categorycode>>,
etc.

Confirm that when editing the SQL, these parameters should appear as
green text. Save your report and view it. The syntax highlighting should
be updated in this view too.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2021-02-06 21:03:21 UTC
I like :)
Comment 5 Jonathan Druart 2021-02-08 16:05:23 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Jonathan Druart 2021-02-09 11:05:34 UTC
Owen, please fill the release notes.
Comment 7 Owen Leonard 2021-02-09 13:08:06 UTC
(In reply to Jonathan Druart from comment #6)
> Owen, please fill the release notes.

Done.
Comment 8 Fridolin Somers 2021-02-12 14:24:14 UTC
Enhancement not pushed to 20.11.x