Bug 27643

Summary: Add CodeMirror custom syntax highlighting for SQL runtime parameters
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ReportsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
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
Circulation function:
Bug Depends on:    
Bug Blocks: 27644, 27747    
Attachments: Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters
Bug 27643: Add CodeMirror custom syntax highlighting for SQL runtime parameters

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