Skip to content

Commit f0da5f2

Browse files
committed
feat(admin-ui): auto apply highglight on edit page
1 parent 6a3358c commit f0da5f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

admin-ui/plugins/admin/components/CustomScripts/CustomScriptForm.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function CustomScriptForm({ item, scripts, handleSubmit }) {
4343
}
4444
return false
4545
})
46-
const [selectedLanguage, setSelectedLanguage] = useState()
46+
const [selectedLanguage, setSelectedLanguage] = useState(item.programmingLanguage)
4747

4848
function activate() {
4949
if (!init) {
@@ -331,8 +331,8 @@ function CustomScriptForm({ item, scripts, handleSubmit }) {
331331
}}
332332
>
333333
<option value="">{t('Choose')}...</option>
334-
<option value="java">Java</option>
335-
<option value="python">Jython</option>
334+
<option value="JAVA">Java</option>
335+
<option value="PYTHON">Jython</option>
336336
</CustomInput>
337337
</InputGroup>
338338
{formik.errors.programmingLanguage &&
@@ -466,7 +466,7 @@ function CustomScriptForm({ item, scripts, handleSubmit }) {
466466
<GluuInputEditor
467467
doc_category={SCRIPT}
468468
name="script"
469-
language={selectedLanguage}
469+
language={selectedLanguage?.toLowerCase()}
470470
label="script"
471471
lsize={2}
472472
rsize={10}

0 commit comments

Comments
 (0)