Skip to content

Commit

Permalink
IVYPORTAL-17567 Homepage Selection leads to empty Page with misleadin…
Browse files Browse the repository at this point in the history
…g error log message: fix bug on LE
  • Loading branch information
lndanh-axonivy committed Sep 19, 2024
1 parent 22af8ac commit 898b52b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class CustomSubMenuItem {
private String icon;
private String label;
private Integer index;
private String name;

@JsonProperty("isExternal")
private Boolean isExternalLink;
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -75,7 +76,7 @@ private static Function<CustomSubMenuItem, SubMenuItem> 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)
Expand Down
2 changes: 2 additions & 0 deletions Showcase/portal-developer-examples/cms/cms_de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions Showcase/portal-developer-examples/cms/cms_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions Showcase/portal-developer-examples/cms/cms_es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions Showcase/portal-developer-examples/cms/cms_fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;",
Expand All @@ -48,15 +53,15 @@
"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);",
"}",
"",
"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);",
Expand Down

0 comments on commit 898b52b

Please sign in to comment.