diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/configuration/CustomSubMenuItem.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/configuration/CustomSubMenuItem.java index 5aed1c55d50..1112af91fe6 100644 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/configuration/CustomSubMenuItem.java +++ b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/configuration/CustomSubMenuItem.java @@ -9,6 +9,7 @@ public class CustomSubMenuItem { private String icon; private String label; private Integer index; + private String name; @JsonProperty("isExternal") private Boolean isExternalLink; @@ -62,4 +63,12 @@ public String getVersion() { public void setVersion(String version) { this.version = version; } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } } \ No newline at end of file diff --git a/AxonIvyPortal/portal/src/com/axonivy/portal/service/CustomSubMenuItemService.java b/AxonIvyPortal/portal/src/com/axonivy/portal/service/CustomSubMenuItemService.java index 5f9590a450a..8866d3e8341 100644 --- a/AxonIvyPortal/portal/src/com/axonivy/portal/service/CustomSubMenuItemService.java +++ b/AxonIvyPortal/portal/src/com/axonivy/portal/service/CustomSubMenuItemService.java @@ -17,6 +17,7 @@ import com.axonivy.portal.enums.PortalCustomSignature; import ch.addon.portal.generic.menu.SubMenuItem; +import ch.addon.portal.generic.userprofile.homepage.HomepageType; import ch.ivy.addon.portalkit.enums.MenuKind; import ch.ivy.addon.portalkit.enums.PortalVariable; import ch.ivy.addon.portalkit.persistence.converter.BusinessEntityConverter; @@ -75,7 +76,7 @@ private static Function convertToSubmenuItem() { SubMenuItem result = new SubMenuItem(); result.setLink(customMenu.getLink()); result.setLabel(customMenu.getLabel()); - result.setName(customMenu.getLabel()); + result.setName(HomepageType.CUSTOM.name()); result.setIcon(StringUtils.defaultIfBlank(customMenu.getIcon(), DEFAULT_ICON)); result.setMenuKind(Optional.ofNullable(customMenu) diff --git a/Showcase/portal-developer-examples/cms/cms_de.yaml b/Showcase/portal-developer-examples/cms/cms_de.yaml index f9b905e26ab..a550522f217 100644 --- a/Showcase/portal-developer-examples/cms/cms_de.yaml +++ b/Showcase/portal-developer-examples/cms/cms_de.yaml @@ -177,3 +177,5 @@ Processes: name: Pizza bestellen description: 3 Aufgaben erstellen, jede Aufgabe hat CustomerName und ShipmentDate name: Aufgaben für die Anpassung der Aufgabenliste erstellen + UserExampleGuide: Anleitung mit Benutzerbeispielen + google: GE Google diff --git a/Showcase/portal-developer-examples/cms/cms_en.yaml b/Showcase/portal-developer-examples/cms/cms_en.yaml index 8a879247536..bb000b4a4d8 100644 --- a/Showcase/portal-developer-examples/cms/cms_en.yaml +++ b/Showcase/portal-developer-examples/cms/cms_en.yaml @@ -271,3 +271,5 @@ Processes: name: Pizza Order description: Create 3 tasks, each task has CustomerName and ShipmentDate name: Create Tasks For Task List Customization + UserExampleGuide: User Example Guide + google: Google diff --git a/Showcase/portal-developer-examples/cms/cms_es.yaml b/Showcase/portal-developer-examples/cms/cms_es.yaml index 1524cabc65f..4f4748fb93a 100644 --- a/Showcase/portal-developer-examples/cms/cms_es.yaml +++ b/Showcase/portal-developer-examples/cms/cms_es.yaml @@ -177,3 +177,5 @@ Processes: name: Pedido de pizza description: Crear 3 tareas, cada tarea tiene CustomerName y ShipmentDate name: Crear tareas para la personalización de la lista de tareas + UserExampleGuide: Guía de ejemplos de uso + google: SP Google diff --git a/Showcase/portal-developer-examples/cms/cms_fr.yaml b/Showcase/portal-developer-examples/cms/cms_fr.yaml index bcdcc948a42..3cdeb331592 100644 --- a/Showcase/portal-developer-examples/cms/cms_fr.yaml +++ b/Showcase/portal-developer-examples/cms/cms_fr.yaml @@ -177,3 +177,5 @@ Processes: name: Commande de pizzas description: Créez 3 tâches, chaque tâche a le nom du client et la date d'expédition. name: Créer des tâches pour la personnalisation de la liste de tâches + UserExampleGuide: Guide d'exemple d'utilisation + google: FR Google diff --git a/Showcase/portal-developer-examples/processes/Functional Processes/CustomLoadSubMenuItems.p.json b/Showcase/portal-developer-examples/processes/Functional Processes/CustomLoadSubMenuItems.p.json index ce806a618a0..5c36441704c 100644 --- a/Showcase/portal-developer-examples/processes/Functional Processes/CustomLoadSubMenuItems.p.json +++ b/Showcase/portal-developer-examples/processes/Functional Processes/CustomLoadSubMenuItems.p.json @@ -39,7 +39,12 @@ "name" : "Load menu items", "config" : { "output" : { + "map" : { + "out" : "in", + "out.subMenuItems" : "in.subMenuItems" + }, "code" : [ + "import com.axonivy.portal.components.publicapi.ApplicationMultiLanguageAPI;", "import com.axonivy.portal.components.configuration.CustomSubMenuItem;", "import com.axonivy.portal.components.publicapi.ProcessStartAPI;", "import org.apache.commons.lang3.StringUtils;", @@ -48,7 +53,7 @@ "if (!StringUtils.isEmpty(userExampleGuideLink)){ ", " CustomSubMenuItem userExampleGuide = new CustomSubMenuItem();", " userExampleGuide.setIcon(\"si si-bulb\");", - " userExampleGuide.setLabel(\"User example guide\");", + " userExampleGuide.setLabel(ivy.cms.co(\"/Processes/UserExampleGuide\"));", " userExampleGuide.setLink(userExampleGuideLink + \"?embedInFrame\");", " userExampleGuide.setIndex(0);", " in.subMenuItems.add(userExampleGuide);", @@ -56,7 +61,7 @@ "", "CustomSubMenuItem google = new CustomSubMenuItem();", "google.setIcon(\"si si-information-circle\");", - "google.setLabel(\"Google\");", + "google.setLabel(ApplicationMultiLanguageAPI.getCmsValueByUserLocale(\"/Processes/google\"));", "google.setLink(\"www.google.com\");", "google.setIsExternalLink(true);", "google.setIndex(1);",