Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3facbb0d authored by Sebastian-Ion TINCU's avatar Sebastian-Ion TINCU
Browse files

Pull request #109: EDELIVERY-13531 Part 4 UI Enhancement Support for Multiple...

Pull request #109: EDELIVERY-13531 Part 4 UI Enhancement Support for Multiple Languages Internationalization

Merge in EDELIVERY/smp from feature/EDELIVERY-13531-part-4-ui-enhancement-support-for-multiple-languages-internationalization to development

* commit 'a98b85fd':
  EDELIVERY-13764 Upgrade Libraries and Plugins
  EDELIVERY-13531 Part 4 UI Enhancement Support for Multiple Languages Internationalization
parents f495a791 a98b85fd
No related branches found
No related tags found
No related merge requests found
Pipeline #195313 failed
Showing
with 161 additions and 93 deletions
...@@ -61,17 +61,6 @@ export class AppComponent { ...@@ -61,17 +61,6 @@ export class AppComponent {
return user ? user.username : ""; return user ? user.username : "";
} }
get currentUserRoleDescription(): string {
if (this.securityService.isCurrentUserSystemAdmin()) {
return "System administrator";
} else if (this.securityService.isCurrentUserSMPAdmin()) {
return "SMP administrator";
} else if (this.securityService.isCurrentUserServiceGroupAdmin()) {
return "Resource administrator";
}
return "";
}
logout(event: Event): void { logout(event: Event): void {
this.router.navigate(['/search']).then((result) => { this.router.navigate(['/search']).then((result) => {
if (result) { if (result) {
......
...@@ -98,7 +98,8 @@ export class ResourceDetailsPanelComponent implements BeforeLeaveGuard { ...@@ -98,7 +98,8 @@ export class ResourceDetailsPanelComponent implements BeforeLeaveGuard {
routerLink: "resource-document", routerLink: "resource-document",
selected: true, selected: true,
tooltip: "", tooltip: "",
transient: true transient: true,
i18n: "navigation.label.edit.resource.document"
} }
} }
......
...@@ -165,7 +165,8 @@ export class SubresourcePanelComponent implements AfterViewInit, BeforeLeaveGuar ...@@ -165,7 +165,8 @@ export class SubresourcePanelComponent implements AfterViewInit, BeforeLeaveGuar
routerLink: "subresource-document", routerLink: "subresource-document",
selected: true, selected: true,
tooltip: "", tooltip: "",
transient: true transient: true,
i18n: "navigation.label.edit.subresource.document"
} }
} }
......
import {Component, EventEmitter, Input, Output} from '@angular/core'; import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {NavigationNode} from "../../sidenav/navigation-model.service"; import {NavigationNode} from "../../sidenav/navigation-model.service";
import {TranslateService} from "@ngx-translate/core";
/** /**
...@@ -14,16 +15,21 @@ import {NavigationNode} from "../../sidenav/navigation-model.service"; ...@@ -14,16 +15,21 @@ import {NavigationNode} from "../../sidenav/navigation-model.service";
styleUrls: ['./breadcrumb-item.component.scss'] styleUrls: ['./breadcrumb-item.component.scss']
}) })
export class BreadcrumbItemComponent { export class BreadcrumbItemComponent implements OnInit {
@Output() onClickEvent: EventEmitter<NavigationNode> = new EventEmitter(); @Output() onClickEvent: EventEmitter<NavigationNode> = new EventEmitter();
@Input() value : NavigationNode; @Input() value : NavigationNode;
get icon() { name = "";
return this.value.icon;
constructor(public translationService: TranslateService) {
} }
get name() { ngOnInit() {
return this.value.name; this.translationService.get(this.value.i18n).subscribe(value1 => this.name = value1);
}
get icon() {
return this.value.icon;
} }
get description() { get description() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[id]="data.code+'Button'" [id]="data.code+'Button'"
(click)="triggerClickEvent()"> (click)="triggerClickEvent()">
<mat-icon *ngIf="data.icon">{{data.icon}}</mat-icon> <mat-icon *ngIf="data.icon">{{data.icon}}</mat-icon>
<span>{{ data.name }}</span> <span>{{ name }}</span>
</button> </button>
<mat-menu #itemMenu="matMenu" xPosition="before" yPosition="below"> <mat-menu #itemMenu="matMenu" xPosition="before" yPosition="below">
<ng-container *ngFor="let item of data.children; let i = index"> <ng-container *ngFor="let item of data.children; let i = index">
...@@ -16,5 +16,5 @@ ...@@ -16,5 +16,5 @@
[id]="data.code+'Button'" [id]="data.code+'Button'"
(click)="triggerClickEvent()"> (click)="triggerClickEvent()">
<mat-icon *ngIf="data.icon">{{data.icon}}</mat-icon> <mat-icon *ngIf="data.icon">{{data.icon}}</mat-icon>
<span>{{ data.name }}</span></button> <span>{{ name }}</span></button>
</ng-template> </ng-template>
import {Component, EventEmitter, Input, Output} from "@angular/core"; import {Component, EventEmitter, Input, OnInit, Output} from "@angular/core";
import {NavigationNode} from "../navigation-model.service"; import {NavigationNode} from "../navigation-model.service";
import {TranslateService} from "@ngx-translate/core";
@Component({ @Component({
selector: "nav-tree-menu", selector: "nav-tree-menu",
templateUrl: "nav-tree-menu.component.html", templateUrl: "nav-tree-menu.component.html",
}) })
export class NavTreeMenu { export class NavTreeMenu implements OnInit {
@Output() notifyClickMenu: EventEmitter<NavigationNode> = new EventEmitter(); @Output() notifyClickMenu: EventEmitter<NavigationNode> = new EventEmitter();
@Input() data: NavigationNode; @Input() data: NavigationNode;
@Input() trigger = "Trigger"; @Input() trigger = "Trigger";
@Input() isRootNode = false; @Input() isRootNode = false;
name = "";
constructor(public translateService: TranslateService) {
}
triggerClickEvent() { triggerClickEvent() {
this.notifyClickMenu.emit(this.data); this.notifyClickMenu.emit(this.data);
} }
ngOnInit() {
console.log(1, this.data.i18n)
this.translateService.get(this.data.i18n).subscribe(value => this.name = value);
}
get isLeaf() { get isLeaf() {
return !this.data.children || this.data.children.length == 0 return !this.data.children || this.data.children.length == 0
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<li *ngIf="!node.transient" class="mat-tree-node nav-tree-leaf" [ngClass]="{ 'navigation-selected': navigationModel.selected === node}"> <li *ngIf="!node.transient" class="mat-tree-node nav-tree-leaf" [ngClass]="{ 'navigation-selected': navigationModel.selected === node}">
<button [id]="node.code+'Button'" mat-menu-item (click)="menuClickHandler(node)"> <button [id]="node.code+'Button'" mat-menu-item (click)="menuClickHandler(node)">
<mat-icon *ngIf="node.icon">{{node.icon}}</mat-icon> <mat-icon *ngIf="node.icon">{{node.icon}}</mat-icon>
<span *ngIf="fullMenu">{{node.name}}</span> <span *ngIf="fullMenu">{{ node.i18n | translate }}</span>
</button> </button>
</li> </li>
</mat-tree-node> </mat-tree-node>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</a> </a>
<button [id]="node.code+'Button'" mat-menu-item (click)="menuClickHandler(node)"> <button [id]="node.code+'Button'" mat-menu-item (click)="menuClickHandler(node)">
<mat-icon *ngIf="node.icon">{{node.icon}}</mat-icon> <mat-icon *ngIf="node.icon">{{node.icon}}</mat-icon>
<span *ngIf="fullMenu">{{node.name}}</span> <span *ngIf="fullMenu">{{ node.i18n | translate }}</span>
</button> </button>
</ng-container> </ng-container>
<ng-template #iconButton> <ng-template #iconButton>
......
...@@ -15,22 +15,22 @@ import {filter, map} from "rxjs/operators"; ...@@ -15,22 +15,22 @@ import {filter, map} from "rxjs/operators";
let PUBLIC_NAVIGATION_TREE: NavigationNode = { let PUBLIC_NAVIGATION_TREE: NavigationNode = {
code: "home", code: "home",
name: "Home", i18n: "navigation.label.home",
icon: "home", icon: "home",
routerLink: "", routerLink: "",
children: [ children: [
{ {
code: "search-tools", code: "search-tools",
name: "Search", i18n: "navigation.label.search",
icon: "search", icon: "search",
tooltip: "Search tools", tooltipI18n: "navigation.tooltip.search.tools",
routerLink: "public", routerLink: "public",
children: [ children: [
{ {
code: "search-resources", code: "search-resources",
name: "Resources", i18n: "navigation.label.search.resources",
icon: "find_in_page", icon: "find_in_page",
tooltip: "Search registered resources", tooltipI18n: "navigation.tooltip.search.resources",
routerLink: "search-resources", routerLink: "search-resources",
} }
] ]
...@@ -45,9 +45,9 @@ let PUBLIC_NAVIGATION_TREE: NavigationNode = { ...@@ -45,9 +45,9 @@ let PUBLIC_NAVIGATION_TREE: NavigationNode = {
*/ */
export interface NavigationNode { export interface NavigationNode {
code: string; code: string;
name: string; i18n: string;
icon?: string; icon?: string;
tooltip?: string; tooltipI18n?: string;
routerLink?: string; routerLink?: string;
children?: NavigationNode[]; children?: NavigationNode[];
clickable?: boolean; clickable?: boolean;
...@@ -312,7 +312,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -312,7 +312,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
/** Remove node from tree */ /** Remove node from tree */
public remove(node: NavigationNode) { public remove(node: NavigationNode) {
const newTreeData = {code: "home", name: "Home", icon: "home", children: this.data}; const newTreeData: NavigationNode = {code: "home", i18n: "navigation.label.home", icon: "home", children: this.data};
this._remove(node, newTreeData); this._remove(node, newTreeData);
this.data = newTreeData.children; this.data = newTreeData.children;
} }
...@@ -325,13 +325,13 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -325,13 +325,13 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
protected _add(newNode: NavigationNode, parent: NavigationNode, tree: NavigationNode) { protected _add(newNode: NavigationNode, parent: NavigationNode, tree: NavigationNode) {
if (tree === parent) { if (tree === parent) {
console.log( console.log(
`replacing children array of '${parent.name}', adding ${newNode.name}` `replacing children array of '${parent.i18n}', adding ${newNode.i18n}`
); );
tree.children = [...tree.children!, newNode]; tree.children = [...tree.children!, newNode];
return true; return true;
} }
if (!tree.children) { if (!tree.children) {
console.log(`reached leaf node '${tree.name}', backing out`); console.log(`reached leaf node '${tree.i18n}', backing out`);
return false; return false;
} }
return this.update(tree, this._add.bind(this, newNode, parent)); return this.update(tree, this._add.bind(this, newNode, parent));
...@@ -347,7 +347,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -347,7 +347,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
...tree.children.slice(0, i), ...tree.children.slice(0, i),
...tree.children.slice(i + 1) ...tree.children.slice(i + 1)
]; ];
console.log(`found ${node.name}, removing it from`, tree); console.log(`found ${node.i18n}, removing it from`, tree);
return true; return true;
} }
return this.update(tree, this._remove.bind(this, node)); return this.update(tree, this._remove.bind(this, node));
...@@ -358,7 +358,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -358,7 +358,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
tree.children!.find((node, i) => { tree.children!.find((node, i) => {
if (predicate(node)) { if (predicate(node)) {
console.log(`creating new node for '${node.name}'`); console.log(`creating new node for '${node.i18n}'`);
updatedTree = {...node}; updatedTree = {...node};
updatedIndex = i; updatedIndex = i;
return true; return true;
...@@ -367,7 +367,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -367,7 +367,7 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
}); });
if (updatedTree!) { if (updatedTree!) {
console.log(`replacing node '${tree.children![updatedIndex!].name}'`); console.log(`replacing node '${tree.children![updatedIndex!].i18n}'`);
tree.children![updatedIndex!] = updatedTree!; tree.children![updatedIndex!] = updatedTree!;
return true; return true;
} }
...@@ -401,12 +401,12 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> { ...@@ -401,12 +401,12 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
return { return {
code: "login", code: "login",
icon: "login", icon: "login",
name: "Login", i18n: "navigation.label.login",
routerLink: "login", routerLink: "login",
clickable: true, clickable: true,
selected: true, selected: true,
tooltip: "", tooltipI18n: "",
transient: true, transient: true
} }
} }
......
...@@ -818,5 +818,35 @@ ...@@ -818,5 +818,35 @@
"app.component.button.collapse": "Collapse sidebar", "app.component.button.collapse": "Collapse sidebar",
"app.component.tooltip.collapse": "Collapse", "app.component.tooltip.collapse": "Collapse",
"app.component.tooltip.expand": "Expand" "app.component.tooltip.expand": "Expand",
"navigation.label.home": "Home",
"navigation.label.search": "Search",
"navigation.label.search.resources": "Resources",
"navigation.label.search.dns.tools": "DNS Tools",
"navigation.label.login": "Login",
"navigation.label.reset.token": "Reset Token",
"navigation.label.edit": "Administration",
"navigation.label.edit.domains": "Edit Domains",
"navigation.label.edit.groups": "Edit Groups",
"navigation.label.edit.resources": "Edit Resources",
"navigation.label.edit.resource.document": "Edit Resource Document",
"navigation.label.edit.subresource.document": "Edit Subresource Document",
"navigation.label.system.settings": "System Settings",
"navigation.label.system.settings.alerts": "Alerts",
"navigation.label.system.settings.domains": "Domain",
"navigation.label.system.settings.extensions": "Extension",
"navigation.label.system.settings.keystores": "Keystore",
"navigation.label.system.settings.properties": "Properties",
"navigation.label.system.settings.truststores": "Truststore",
"navigation.label.system.settings.users": "User",
"navigation.label.user.settings": "User Settings",
"navigation.label.user.settings.profile": "Profile",
"navigation.label.user.settings.access.tokens": "Access Tokens",
"navigation.label.user.settings.certificates": "Certificate",
"navigation.label.user.settings.alerts": "Alerts",
"navigation.label.user.settings.membership": "Membership",
"navigation.tooltip.search.resources": "Search registered resources",
"navigation.tooltip.search.tools": "Search tools",
"navigation.tooltip.search.dns.tools": "DNS lookup tools"
} }
...@@ -324,24 +324,24 @@ ...@@ -324,24 +324,24 @@
"edit.group.label.members": "Membrii", "edit.group.label.members": "Membrii",
"edit.group.label.user.not.administrator": "Utilizatorul nu este Administrator al niciunui grup", "edit.group.label.user.not.administrator": "Utilizatorul nu este Administrator al niciunui grup",
"edit.group.label.select.domain": "Grup selectat", "edit.group.label.select.domain": "Grup selectat",
"edit.group.label.select.group": "Selectat Group", "edit.group.label.select.group": "Grupul selectat",
"edit.group.placeholder.select.domain": "Selectat domain", "edit.group.placeholder.select.domain": "Selecteaza domeniu",
"edit.group.placeholder.select.group": "Select group", "edit.group.placeholder.select.group": "Selecteaza grup",
"edit.group.text": "Modifica group administration panel is a tool for group administrators to manage group members and resources", "edit.group.text": "Panoul de administrare a grupurilor este un instrument pentru Administratorilor de grupuri cu care acestia pot gestiona membrii grupurilor si resursele",
"edit.group.title": "Modifica Group", "edit.group.title": "Modifica Grup",
"edit.group.tooltip.select.domain": "Selectat domain.", "edit.group.tooltip.select.domain": "Domeniu selectat.",
"edit.group.tooltip.select.group": "Select group.", "edit.group.tooltip.select.group": "Grup selectat.",
"document.wizard.dialog.button.cancel": "Anuleaza", "document.wizard.dialog.button.cancel": "Anuleaza",
"document.wizard.dialog.button.ok": "OK", "document.wizard.dialog.button.ok": "OK",
"document.wizard.dialog.title": "Resource Extension Wizard", "document.wizard.dialog.title": "Expert Extensie Resursa",
"resource.details.panel.label.resource.id": "Identificator resursa", "resource.details.panel.label.resource.id": "Identificator resursa",
"resource.details.panel.label.resource.name": "Modifica documentul resursei", "resource.details.panel.label.resource.name": "Modifica documentul resursei",
"resource.details.panel.label.resource.scheme": "Schema resursa", "resource.details.panel.label.resource.scheme": "Schema resursa",
"resource.details.panel.label.resource.type": "Tip resursa", "resource.details.panel.label.resource.type": "Tip resursa",
"resource.details.panel.label.resource.visibility": "Vizibilitate resursa", "resource.details.panel.label.resource.visibility": "Vizibilitate resursa",
"resource.details.panel.label.resource.visibility.private": "Resursa privata este accesibila doar membrilor resoursei!", "resource.details.panel.label.resource.visibility.private": "Resursa privata este accesibila doar membrilor resursei!",
"resource.details.panel.label.resource.visibility.private.group": "Resursa apartine grupului privat. Doar membrii grupului si membrii grupului resursei o pot accesa!", "resource.details.panel.label.resource.visibility.private.group": "Resursa apartine grupului privat. Doar membrii grupului si membrii grupului resursei o pot accesa!",
"resource.details.panel.label.resource.visibility.private.domain": "Resursa apartine domeniului privat. Doar membrii domeniului, membrii grupului domeniului si membrii grupului resursei o pot accesa!", "resource.details.panel.label.resource.visibility.private.domain": "Resursa apartine domeniului privat. Doar membrii domeniului, membrii grupului domeniului si membrii grupului resursei o pot accesa!",
"resource.details.panel.label.resource.visibility.public": "Resursa este publica in grupul public si in domeniul public. Datele resursei sunt accesibile tuturor utilizatorilor.", "resource.details.panel.label.resource.visibility.public": "Resursa este publica in grupul public si in domeniul public. Datele resursei sunt accesibile tuturor utilizatorilor.",
...@@ -818,5 +818,35 @@ ...@@ -818,5 +818,35 @@
"app.component.button.collapse": "Restrangeti bara laterala", "app.component.button.collapse": "Restrangeti bara laterala",
"app.component.tooltip.collapse": "Retrangeti", "app.component.tooltip.collapse": "Retrangeti",
"app.component.tooltip.expand": "Extindeti" "app.component.tooltip.expand": "Extindeti",
"navigation.label.home": "Pagina de start",
"navigation.label.search": "Cautare",
"navigation.label.search.resources": "Resurse",
"navigation.label.search.dns.tools": "Instrumente DNS",
"navigation.label.login": "Authentificare",
"navigation.label.reset.token": "Resetare Token",
"navigation.label.edit": "Administrare",
"navigation.label.edit.domains": "Editare Domenii",
"navigation.label.edit.groups": "Editare Grupuri",
"navigation.label.edit.resources": "Editare Resurse",
"navigation.label.edit.resource.document": "Editare Documentul Resursei",
"navigation.label.edit.subresource.document": "Editare Documentul Subresursei",
"navigation.label.system.settings": "Setari de Sistem",
"navigation.label.system.settings.alerts": "Alerte",
"navigation.label.system.settings.domains": "Domenii",
"navigation.label.system.settings.extensions": "Extensii",
"navigation.label.system.settings.keystores": "Keystore",
"navigation.label.system.settings.properties": "Proprietati",
"navigation.label.system.settings.truststores": "Truststore",
"navigation.label.system.settings.users": "Utilizatori",
"navigation.label.user.settings": "Setari Utilizator",
"navigation.label.user.settings.profile": "Profil",
"navigation.label.user.settings.access.tokens": "Token-uri de Acces",
"navigation.label.user.settings.certificates": "Certificate",
"navigation.label.user.settings.alerts": "Alerte",
"navigation.label.user.settings.membership": "Calitate de Membru",
"navigation.tooltip.search.resources": "Cauta resurse inregistrate",
"navigation.tooltip.search.tools": "Cauta resurse inregistrate",
"navigation.tooltip.search.dns.tools": "Instrumente de cautare DNS"
} }
...@@ -31,26 +31,26 @@ public class NavigationTreeNodeRO extends BaseRO { ...@@ -31,26 +31,26 @@ public class NavigationTreeNodeRO extends BaseRO {
private static final long serialVersionUID = 9008583888835630011L; private static final long serialVersionUID = 9008583888835630011L;
private String code; private String code;
private String name; private String i18n;
private String icon; private String icon;
private String tooltip; private String tooltipI18n;
private String routerLink; private String routerLink;
private final List<NavigationTreeNodeRO> children = new ArrayList<>(); private final List<NavigationTreeNodeRO> children = new ArrayList<>();
public NavigationTreeNodeRO() { public NavigationTreeNodeRO() {
} }
public NavigationTreeNodeRO(String code, String name, String icon, String routerLink) { public NavigationTreeNodeRO(String code, String i18n, String icon, String routerLink) {
this(code, name, icon, routerLink, null); this(code, i18n, icon, routerLink, null);
} }
public NavigationTreeNodeRO(String code, String name, String icon, String routerLink, String tooltip) { public NavigationTreeNodeRO(String code, String i18n, String icon, String routerLink, String tooltipI18n) {
this.code = code; this.code = code;
this.name = name; this.i18n = i18n;
this.icon = icon; this.icon = icon;
this.routerLink = routerLink; this.routerLink = routerLink;
this.tooltip = tooltip; this.tooltipI18n = tooltipI18n;
} }
public String getCode() { public String getCode() {
...@@ -61,12 +61,12 @@ public class NavigationTreeNodeRO extends BaseRO { ...@@ -61,12 +61,12 @@ public class NavigationTreeNodeRO extends BaseRO {
this.code = code; this.code = code;
} }
public String getName() { public String getI18n() {
return name; return i18n;
} }
public void setName(String name) { public void setI18n(String name) {
this.name = name; this.i18n = name;
} }
public String getIcon() { public String getIcon() {
...@@ -77,12 +77,12 @@ public class NavigationTreeNodeRO extends BaseRO { ...@@ -77,12 +77,12 @@ public class NavigationTreeNodeRO extends BaseRO {
this.icon = icon; this.icon = icon;
} }
public String getTooltip() { public String getTooltipI18n() {
return tooltip; return tooltipI18n;
} }
public void setTooltip(String tooltip) { public void setTooltipI18n(String tooltip) {
this.tooltip = tooltip; this.tooltipI18n = tooltip;
} }
public String getRouterLink() { public String getRouterLink() {
......
...@@ -119,7 +119,7 @@ public class UserController { ...@@ -119,7 +119,7 @@ public class UserController {
LOG.info("get User Navigation tree for user ID: {}", userId); LOG.info("get User Navigation tree for user ID: {}", userId);
Long entityId = decryptEntityId(userId); Long entityId = decryptEntityId(userId);
DBUser user = uiUserService.findUser(entityId); DBUser user = uiUserService.findUser(entityId);
NavigationTreeNodeRO home = new NavigationTreeNodeRO("home", "Home", "home", ""); NavigationTreeNodeRO home = new NavigationTreeNodeRO("home", "navigation.label.home", "home", "");
home.addChild(createPublicNavigationTreeNode()); home.addChild(createPublicNavigationTreeNode());
// create administration nodes for domains, groups and resources // create administration nodes for domains, groups and resources
NavigationTreeNodeRO adminNodes = createEditNavigationTreeNode(); NavigationTreeNodeRO adminNodes = createEditNavigationTreeNode();
...@@ -296,39 +296,39 @@ public class UserController { ...@@ -296,39 +296,39 @@ public class UserController {
protected NavigationTreeNodeRO createPublicNavigationTreeNode() { protected NavigationTreeNodeRO createPublicNavigationTreeNode() {
NavigationTreeNodeRO node = new NavigationTreeNodeRO("search-tools", "Search", "search", "public"); NavigationTreeNodeRO node = new NavigationTreeNodeRO("search-tools", "navigation.label.search", "search", "public");
node.addChild(new NavigationTreeNodeRO("search-resources", "Resources", "find_in_page", "search-resource", "Search registered resources")); node.addChild(new NavigationTreeNodeRO("search-resources", "navigation.label.search.resources", "find_in_page", "search-resource", "navigation.tooltip.search.resources"));
node.addChild(new NavigationTreeNodeRO("dns-tools", "DNS tools", "dns", "dns-tools" , "DNS lookup tools")); node.addChild(new NavigationTreeNodeRO("dns-tools", "navigation.label.search.dns.tools", "dns", "dns-tools" , "navigation.tooltip.search.dns.tools"));
return node; return node;
} }
protected NavigationTreeNodeRO createUserProfileNavigationTreeNode() { protected NavigationTreeNodeRO createUserProfileNavigationTreeNode() {
NavigationTreeNodeRO node = new NavigationTreeNodeRO("user-data", "User Settings", "account_circle", "user-settings"); NavigationTreeNodeRO node = new NavigationTreeNodeRO("user-data", "navigation.label.user.settings", "account_circle", "user-settings");
node.addChild(new NavigationTreeNodeRO("user-data-profile", "Profile", "account_circle", "user-profile")); node.addChild(new NavigationTreeNodeRO("user-data-profile", "navigation.label.user.settings.profile", "account_circle", "user-profile"));
node.addChild(new NavigationTreeNodeRO("user-data-access-token", "Access tokens", "key", "user-access-token")); node.addChild(new NavigationTreeNodeRO("user-data-access-token", "navigation.label.user.settings.access.tokens", "key", "user-access-token"));
node.addChild(new NavigationTreeNodeRO("user-data-certificates", "Certificates", "article", "user-certificate")); node.addChild(new NavigationTreeNodeRO("user-data-certificates", "navigation.label.user.settings.certificates", "article", "user-certificate"));
node.addChild(new NavigationTreeNodeRO("user-data-alert", "Alerts", "notifications", "user-alert")); node.addChild(new NavigationTreeNodeRO("user-data-alert", "navigation.label.user.settings.alerts", "notifications", "user-alert"));
return node; return node;
} }
protected NavigationTreeNodeRO createSystemAdminNavigationTreeNode() { protected NavigationTreeNodeRO createSystemAdminNavigationTreeNode() {
NavigationTreeNodeRO node = new NavigationTreeNodeRO("system-settings", "System settings", "admin_panel_settings", "system-settings"); NavigationTreeNodeRO node = new NavigationTreeNodeRO("system-settings", "navigation.label.system.settings", "admin_panel_settings", "system-settings");
node.addChild(new NavigationTreeNodeRO("system-admin-user", "Users", "people", "user")); node.addChild(new NavigationTreeNodeRO("system-admin-user", "navigation.label.system.settings.users", "people", "user"));
node.addChild(new NavigationTreeNodeRO("system-admin-domain", "Domains", "domain", "domain")); node.addChild(new NavigationTreeNodeRO("system-admin-domain", "navigation.label.system.settings.domains", "domain", "domain"));
node.addChild(new NavigationTreeNodeRO("system-admin-keystore", "Keystore", "key", "keystore")); node.addChild(new NavigationTreeNodeRO("system-admin-keystore", "navigation.label.system.settings.keystores", "key", "keystore"));
node.addChild(new NavigationTreeNodeRO("system-admin-truststore", "Truststore", "article", "truststore")); node.addChild(new NavigationTreeNodeRO("system-admin-truststore", "navigation.label.system.settings.truststores", "article", "truststore"));
node.addChild(new NavigationTreeNodeRO("system-admin-extension", "Extensions", "extension", "extension")); node.addChild(new NavigationTreeNodeRO("system-admin-extension", "navigation.label.system.settings.extensions", "extension", "extension"));
node.addChild(new NavigationTreeNodeRO("system-admin-properties", "Properties", "settings", "properties")); node.addChild(new NavigationTreeNodeRO("system-admin-properties", "navigation.label.system.settings.properties", "settings", "properties"));
// node.addChild(new NavigationTreeNodeRO("system-admin-authentication", "Authentication", "shield", "authentication")); // node.addChild(new NavigationTreeNodeRO("system-admin-authentication", "navigation.label.system.settings.authentication", "shield", "authentication"));
node.addChild(new NavigationTreeNodeRO("system-admin-alert", "Alerts", "notifications", "alert")); node.addChild(new NavigationTreeNodeRO("system-admin-alert", "navigation.label.system.settings.alerts", "notifications", "alert"));
return node; return node;
} }
protected NavigationTreeNodeRO createEditNavigationTreeNode() { protected NavigationTreeNodeRO createEditNavigationTreeNode() {
NavigationTreeNodeRO node = new NavigationTreeNodeRO("edit", "Administration", "tune", "edit"); NavigationTreeNodeRO node = new NavigationTreeNodeRO("edit", "navigation.label.edit", "tune", "edit");
node.addChild(new NavigationTreeNodeRO("edit-domain", "Edit domains", "account_circle", "edit-domain")); node.addChild(new NavigationTreeNodeRO("edit-domain", "navigation.label.edit.domains", "account_circle", "edit-domain"));
node.addChild(new NavigationTreeNodeRO("edit-group", "Edit groups", "group", "edit-group")); node.addChild(new NavigationTreeNodeRO("edit-group", "navigation.label.edit.groups", "group", "edit-group"));
node.addChild(new NavigationTreeNodeRO("edit-resource", "Edit resources", "article", "edit-resource")); node.addChild(new NavigationTreeNodeRO("edit-resource", "navigation.label.edit.resources", "article", "edit-resource"));
return node; return node;
} }
} }
...@@ -69,8 +69,8 @@ class UserControllerIT extends AbstractControllerTest { ...@@ -69,8 +69,8 @@ class UserControllerIT extends AbstractControllerTest {
assertNotNull(result); assertNotNull(result);
assertEquals(4, result.getChildren().size()); assertEquals(4, result.getChildren().size());
List<String> childrenNames = result.getChildren().stream().map(NavigationTreeNodeRO::getName).collect(Collectors.toList()); List<String> childrenNames = result.getChildren().stream().map(NavigationTreeNodeRO::getI18n).collect(Collectors.toList());
assertEquals(Arrays.asList("Search", "Administration", "System settings", "User Settings"), childrenNames); assertEquals(Arrays.asList("navigation.label.search", "navigation.label.edit", "navigation.label.system.settings", "navigation.label.user.settings"), childrenNames);
} }
@Test @Test
...@@ -87,8 +87,8 @@ class UserControllerIT extends AbstractControllerTest { ...@@ -87,8 +87,8 @@ class UserControllerIT extends AbstractControllerTest {
assertNotNull(result); assertNotNull(result);
assertEquals(3, result.getChildren().size()); assertEquals(3, result.getChildren().size());
List<String> childrenNames = result.getChildren().stream().map(NavigationTreeNodeRO::getName).collect(Collectors.toList()); List<String> childrenNames = result.getChildren().stream().map(NavigationTreeNodeRO::getI18n).collect(Collectors.toList());
assertEquals(Arrays.asList("Search", "Administration", "User Settings"), childrenNames); assertEquals(Arrays.asList("navigation.label.search", "navigation.label.edit", "navigation.label.user.settings"), childrenNames);
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment