This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git

commit 563ad0fb968de59c76640f31c6d3223d7178a02b
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Tue Sep 12 21:47:04 2023 -0400

    Script editor for #885
---
 .../karavan-app/src/main/webui/src/project/file/FileEditor.tsx      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx 
b/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx
index f5db8eca..1fc3b67c 100644
--- a/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx
+++ b/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx
@@ -62,7 +62,8 @@ export function FileEditor (props: Props) {
     }
 
     function getEditor () {
-        const language = file?.name.split('.').pop();
+        const extension = file?.name.split('.').pop();
+        const language = extension === 'sh' ? 'shell' : extension;
         return (
             file !== undefined &&
             <Editor
@@ -83,9 +84,10 @@ export function FileEditor (props: Props) {
     const isYaml = file !== undefined && file.name.endsWith("yaml");
     const isIntegration = isYaml && file?.code && 
CamelDefinitionYaml.yamlIsIntegration(file.code);
     const isProperties = file !== undefined && 
file.name.endsWith("properties");
+    const isScript = file !== undefined && file.name.endsWith("sh");
     const isCode = file !== undefined && (file.name.endsWith("java") || 
file.name.endsWith("groovy") || file.name.endsWith("json"));
     const showDesigner = isYaml && isIntegration && mode === 'design';
-    const showEditor = isCode || (isYaml && !isIntegration) || (isYaml && mode 
=== 'code');
+    const showEditor = isCode || (isYaml && !isIntegration) || (isYaml && mode 
=== 'code') || isScript;
     return (
         <>
             {showDesigner && getDesigner()}

Reply via email to