Bug 32613: Add autocomplete to SQL reports editor
authorJacob O'Mara <jacob.omara@ptfs-europe.com>
Mon, 23 Jan 2023 16:03:20 +0000 (16:03 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Mar 2023 17:45:28 +0000 (14:45 -0300)
commita3b2f42cc7d0d23b2ae9bfdd4825920ae88bf96c
treeb65d1c1a706fc69b2f38d94925954550dcd57d49
parent652743e30d9fd08cf65356257a79211a4b15a905
Bug 32613: Add autocomplete to SQL reports editor

This adds auto-complete for the sql reports editor codemirror instance.
To prevent a regression in syntax highlighting the overlay mode
'sqlPlaceholders' has been removed and replaced with a highlighting
engine that works correctly with the autocomplete engine.

Test Plan:
1. Navigate to reports and create a new sql report
2. Write an Sql query and observe that there is no autocomplete options
3. Apply patch
4. Write a new Sql query and observe that there are now auto-complete
   options that can be navigated through with the arrow keys and
   accepted with either tab or the enter keys.
5. Ensure that items bounded in << >> or [[ ]] are still syntax
   highlighted post-patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/lib/codemirror/highlight.css [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/codemirror/highlight.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/codemirror/show-hint.css [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/codemirror/show-hint.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/codemirror/sql-hint.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/lib/codemirror/sql.js
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt