From 0ab280301145c3ed5fbb5300a4165e515672ef15 Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 21 Nov 2023 17:39:36 +0000 Subject: [PATCH] FOUR-12505:Other script executor does not have an icon on the modal script list --- ProcessMaker/Models/ScriptExecutor.php | 5 ++++- .../scripts/components/LanguageScript.vue | 20 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ProcessMaker/Models/ScriptExecutor.php b/ProcessMaker/Models/ScriptExecutor.php index 055374973b..e36a90b580 100644 --- a/ProcessMaker/Models/ScriptExecutor.php +++ b/ProcessMaker/Models/ScriptExecutor.php @@ -154,7 +154,10 @@ public static function list($language = null) } foreach ($executors->get() as $executor) { - $list[$executor->id] = $executor->language; + $list[$executor->id] = [ + 'language' => $executor->language, + 'title' => $executor->title, + ]; } return $list; diff --git a/resources/js/processes/scripts/components/LanguageScript.vue b/resources/js/processes/scripts/components/LanguageScript.vue index a81de50ec9..133517d434 100644 --- a/resources/js/processes/scripts/components/LanguageScript.vue +++ b/resources/js/processes/scripts/components/LanguageScript.vue @@ -9,17 +9,17 @@ > - {{ lang }} + {{ lang.language }} @@ -59,7 +59,17 @@ export default { * Get the Icon of the language */ getImage(lang) { - return `/img/script_lang/${lang}.svg`; + let srcImage = ""; + switch (lang.language) { + case "php": + case "javascript": + case "lua": + srcImage = `/img/script_lang/${lang.language}.svg`; + break; + default: + srcImage = "/img/script_lang/default.svg"; + } + return srcImage; }, /** * Add the border to the item selected @@ -68,7 +78,7 @@ export default { for (const item in this.$refs) { this.$refs[item][0].className = "card mb-2 card-lang"; } - this.$refs[lang][0].className = "card mb-2 card-lang selected"; + this.$refs[lang.title][0].className = "card mb-2 card-lang selected"; }, }, };