Bug 35718: Remove ES6 warns from JS system preferences
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 5 Jan 2024 19:05:01 +0000 (19:05 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 8 Mar 2024 17:58:22 +0000 (18:58 +0100)
commit5e3ae14aa0c204a8fa980d574a998f4194523586
treec0f7957c80233f868ea4e4c507e6299e0fb612c7
parent6bf839d89244e316d7ec936c439fa0d770f3665e
Bug 35718: Remove ES6 warns from JS system preferences

To test:
1. Add some JS like this to any of the UserJS system preferences:

$(document).ready( function() {
    let something = 1;
    const another_thing = 2;

    let an_arrow_function = (a, b) => a + b;
    console.log( an_arrow_function(something, another_thing) );
});

2. Notice the icons and warnings to the left of the line numbers:

let is available in ES6
const is available in ES6
arrow_function_syntax is available in ES6

3. APPLY PATCH
4. Try steps 1 and 2 again, the warnings should be gone.
5. Check that the JavaScript still works, in my example it should console.log 3.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js