Repository: kestra-io/kestra (java)

Issue:
Icon for alias class are not displayed anymore 
Example for a schedule, but all renamed task are affected 

```yaml
triggers:
  - id: schedule
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "* * * * *"
```

![image](https://github.com/kestra-io/kestra/assets/2064609/b77f86b4-9aff-4482-9de9-7f2925e865be)


Pull request:
fix(webserver): add plugin alias icons
Fixes #4030

Patch:
diff --git a/ui/src/components/inputs/MonacoEditor.vue b/ui/src/components/inputs/MonacoEditor.vue
index 77748d229..72d7f3948 100644
--- a/ui/src/components/inputs/MonacoEditor.vue
+++ b/ui/src/components/inputs/MonacoEditor.vue
@@ -613,7 +613,9 @@
 
                     this.editor = monaco.editor.create(this.$el, options);
 
-                    await this.changeTab(this.currentTab?.path ?? this.currentTab?.name, () => this.value);
+                    if(!this.input){
+                        await this.changeTab(this.currentTab?.path ?? this.currentTab?.name, () => this.value);
+                    }
                 }
 
                 let editor = this.getModifiedEditor();
@@ -623,7 +625,7 @@
                     if (self.value !== value) {
                         self.$emit("change", value, event);
 
-                        if (self.currentTab && self.currentTab.name) {
+                        if (!self.input && self.currentTab && self.currentTab.name) {
                             self.changeOpenedTabs({
                                 action: "dirty",
                                 ...self.currentTab,
diff --git a/webserver/src/main/java/io/kestra/webserver/controllers/api/PluginController.java b/webserver/src/main/java/io/kestra/webserver/controllers/api/PluginController.java
index bb451a894..0930cce49 100644
--- a/webserver/src/main/java/io/kestra/webserver/controllers/api/PluginController.java
+++ b/webserver/src/main/java/io/kestra/webserver/controllers/api/PluginController.java
@@ -138,17 +138,13 @@ public class PluginController {
     public MutableHttpResponse<Map<String, PluginIcon>> icons() {
         Map<String, PluginIcon> icons = pluginRegistry.plugins()
             .stream()
-            .flatMap(plugin -> Stream
-                .concat(
+            .flatMap(plugin -> Stream.of(
                     plugin.getTasks().stream(),
-                    Stream.concat(
-                        Stream.concat(
-                            plugin.getTriggers().stream(),
-                            plugin.getConditions().stream()
-                        ),
-                        plugin.getTaskRunners().stream()
-                    )
+                    plugin.getTriggers().stream(),
+                    plugin.getConditions().stream(),
+                    plugin.getTaskRunners().stream()
                 )
+                .flatMap(i -> i)
                 .map(e -> new AbstractMap.SimpleEntry<>(
                     e.getName(),
                     new PluginIcon(
@@ -160,6 +156,20 @@ public class PluginController {
             )
             .filter(entry -> entry.getKey() != null)
             .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1));
+
+        // add aliases
+        Map<String, PluginIcon> aliasIcons = pluginRegistry.plugins().stream()
+            .flatMap(plugin -> plugin.getAliases().values().stream().map(e -> new AbstractMap.SimpleEntry<>(
+                e.getKey(),
+                new PluginIcon(
+                    e.getKey().substring(e.getKey().lastIndexOf('.') + 1),
+                    plugin.icon(e.getValue()),
+                    FlowableTask.class.isAssignableFrom(e.getValue())
+                ))))
+            .filter(entry -> entry.getKey() != null)
+            .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1));
+        icons.putAll(aliasIcons);
+
         return HttpResponse.ok(icons).header(HttpHeaders.CACHE_CONTROL, CACHE_DIRECTIVE);
     }
 


Test patch:
diff --git a/webserver/src/test/java/io/kestra/webserver/controllers/api/PluginControllerTest.java b/webserver/src/test/java/io/kestra/webserver/controllers/api/PluginControllerTest.java
index bcc809f21..9bcb7bb74 100644
--- a/webserver/src/test/java/io/kestra/webserver/controllers/api/PluginControllerTest.java
+++ b/webserver/src/test/java/io/kestra/webserver/controllers/api/PluginControllerTest.java
@@ -86,6 +86,8 @@ class PluginControllerTest {
             );
 
             assertThat(list.entrySet().stream().filter(e -> e.getKey().equals(Log.class.getName())).findFirst().orElseThrow().getValue().getIcon(), is(notNullValue()));
+            // test an alias
+            assertThat(list.entrySet().stream().filter(e -> e.getKey().equals("io.kestra.core.tasks.log.Log")).findFirst().orElseThrow().getValue().getIcon(), is(notNullValue()));
         });
     }