Commit 033f766a authored by Alicia.DeDiosFuente's avatar Alicia.DeDiosFuente Committed by Florent POITTEVIN
Browse files

fix: mutualise toolbar and menu titles

parent 7dcda807
......@@ -12,6 +12,7 @@ import {
StringUtil,
TRANSLATE,
} from "solidify-frontend";
import {AppHelper} from "@app/app.helper";
function getQueryParam(): string {
// NEED FOR OAUTH 2 CODE QUERY PARAM
......@@ -37,7 +38,7 @@ const routes: DlcmRoutes = [
// @ts-ignore Dynamic import
loadChildren: () => import("./features/deposit/deposit.module").then(m => m.DepositModule),
data: {
breadcrumb: TRANSLATE("breadcrumb.deposit.root"),
breadcrumb: AppHelper.deposit,
permission: ApplicationRolePermissionEnum.userPermission,
},
canActivate: [ApplicationRoleGuardService],
......@@ -47,7 +48,7 @@ const routes: DlcmRoutes = [
// @ts-ignore Dynamic import
loadChildren: () => import("./features/preservation-space/preservation-space.module").then(m => m.PreservationSpaceModule),
data: {
breadcrumb: TRANSLATE("breadcrumb.preservation-space.root"),
breadcrumb: AppHelper.preservationSpace,
permission: ApplicationRolePermissionEnum.userPermission,
},
canActivate: [ApplicationRoleGuardService],
......@@ -57,7 +58,7 @@ const routes: DlcmRoutes = [
// @ts-ignore Dynamic import
loadChildren: () => import("./features/admin/admin.module").then(m => m.AdminModule),
data: {
breadcrumb: TRANSLATE("breadcrumb.admin.root"),
breadcrumb: AppHelper.admin,
permission: ApplicationRolePermissionEnum.adminPermission,
},
canActivate: [ApplicationRoleGuardService],
......@@ -67,7 +68,7 @@ const routes: DlcmRoutes = [
// @ts-ignore Dynamic import
loadChildren: () => import("./features/preservation/preservation.module").then(m => m.PreservationModule),
data: {
breadcrumb: TRANSLATE("breadcrumb.preservation.root"),
breadcrumb: AppHelper.preservationPlanning,
permission: ApplicationRolePermissionEnum.adminPermission,
},
canActivate: [ApplicationRoleGuardService],
......@@ -77,7 +78,7 @@ const routes: DlcmRoutes = [
// @ts-ignore Dynamic import
loadChildren: () => import("./features/order/order.module").then(m => m.OrderModule),
data: {
breadcrumb: TRANSLATE("breadcrumb.order.root"),
breadcrumb: AppHelper.order,
},
canActivate: [ApplicationRoleGuardService],
},
......
......@@ -48,7 +48,7 @@
mat-icon-button
mat-button
aria-label="Open cart"
[matTooltip]="'app.toolbar.cart' | translate"
[matTooltip]="'app.module.cart' | translate"
class="cart"
>
<dlcm-shared-icon class="icon"
......
import {TRANSLATE} from "solidify-frontend";
export class AppHelper {
static home: string = TRANSLATE("app.module.home");
static deposit: string = TRANSLATE("app.module.deposit");
static order: string = TRANSLATE("app.module.order");
static preservationSpace: string = TRANSLATE("app.module.preservation-space");
static admin: string = TRANSLATE("app.module.admin");
static preservationPlanning: string = TRANSLATE("app.module.preservation");
static cart: string = TRANSLATE("app.module.cart");
static languageSelector: string = TRANSLATE("app.module.languageSelector");
static login: string = TRANSLATE("app.module.login");
static logout: string = TRANSLATE("app.module.logout");
static profileInfo: string = TRANSLATE("app.module.profileInfo");
static themeSelector: string = TRANSLATE("app.module.themeSelector");
static token: string = TRANSLATE("app.module.token");
}
......@@ -12,7 +12,7 @@
(click)="profileInfo()"
>
<dlcm-shared-icon [iconName]="iconNameEnum.profile"></dlcm-shared-icon>
<span>{{'app.toolbar.profileInfo' | translate}}</span>
<span>{{'app.module.profileInfo' | translate}}</span>
</button>
<button mat-menu-item
solidifyShortCuts
......@@ -20,12 +20,12 @@
(click)="displayToken()"
>
<dlcm-shared-icon [iconName]="iconNameEnum.token"></dlcm-shared-icon>
<span>{{'app.toolbar.token' | translate}}</span>
<span>{{'app.module.token' | translate}}</span>
</button>
<button mat-menu-item
(click)="logout()"
>
<dlcm-shared-icon [iconName]="iconNameEnum.logout"></dlcm-shared-icon>
<span>{{'app.toolbar.logout' | translate}}</span>
<span>{{'app.module.logout' | translate}}</span>
</button>
</mat-menu>
<img class="selected-language-img"
[matTooltip]="'app.toolbar.languageSelector' | translate"
[matTooltip]="'app.module.languageSelector' | translate"
[matTooltipPosition]="'left'"
[src]="getPathToImage(currentLanguage)"
(click)="matSelect.open()"
......
......@@ -27,6 +27,7 @@ import {
TRANSLATE,
urlSeparator,
} from "solidify-frontend";
import {AppHelper} from "@app/app.helper";
@Directive()
export abstract class AbstractMainToolbarPresentational extends SharedAbstractPresentational {
......@@ -107,14 +108,14 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
{
click: (menu) => this.navigate(menu.path),
path: RoutesEnum.homePage,
labelToTranslate: TRANSLATE("app.toolbar.home"),
labelToTranslate: AppHelper.home,
isVisible: () => true,
icon: IconNameEnum.home,
},
{
click: (menu) => this.openOrder(),
path: RoutesEnum.order,
labelToTranslate: TRANSLATE("app.toolbar.order"),
labelToTranslate: AppHelper.order,
isVisible: () => PermissionUtil.isUserHavePermission(this.logged, ApplicationRolePermissionEnum.userPermission, this.userRoles),
icon: IconNameEnum.order,
// badgeCounter: () => "" + this.numberMyOrderReadyNew,
......@@ -124,14 +125,14 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
{
click: (menu) => this.navigate(menu.path),
path: RoutesEnum.deposit,
labelToTranslate: TRANSLATE("app.toolbar.deposit"),
labelToTranslate: AppHelper.deposit,
isVisible: () => PermissionUtil.isUserHavePermission(this.logged, ApplicationRolePermissionEnum.userPermission, this.userRoles),
icon: IconNameEnum.deposit,
},
{
click: (menu) => this.navigate(menu.path),
path: RoutesEnum.preservationSpace,
labelToTranslate: TRANSLATE("app.toolbar.preservation-space"),
labelToTranslate: AppHelper.preservationSpace,
isVisible: () => PermissionUtil.isUserHavePermission(this.logged, ApplicationRolePermissionEnum.userPermission, this.userRoles),
icon: IconNameEnum.preservationSpace,
badgeCounter: () => "" + this.numberPendingRequestNotificationInbox,
......@@ -141,14 +142,14 @@ export abstract class AbstractMainToolbarPresentational extends SharedAbstractPr
{
click: (menu) => this.navigate(menu.path),
path: RoutesEnum.preservationPlanning,
labelToTranslate: TRANSLATE("app.toolbar.preservation"),
labelToTranslate: AppHelper.preservationPlanning,
isVisible: () => PermissionUtil.isUserHavePermission(this.logged, ApplicationRolePermissionEnum.adminPermission, this.userRoles),
icon: IconNameEnum.preservationPlanning,
},
{
click: (menu) => this.navigate(menu.path),
path: RoutesEnum.admin,
labelToTranslate: TRANSLATE("app.toolbar.admin"),
labelToTranslate: AppHelper.admin,
isVisible: () => PermissionUtil.isUserHavePermission(this.logged, ApplicationRolePermissionEnum.adminPermission, this.userRoles),
icon: IconNameEnum.administration,
},
......
......@@ -51,7 +51,7 @@
<div class="login">
<a data-test="login-horizontal-input"
(click)="login()"
>{{'app.toolbar.login' | translate }}</a>
>{{'app.module.login' | translate }}</a>
</div>
</ng-template>
......
......@@ -57,7 +57,7 @@
>
<li data-test="login-vertical-input"
class="login"
[matTooltip]="'app.toolbar.login' | translate"
[matTooltip]="'app.module.login' | translate"
[matTooltipPosition]="'right'"
(click)="login()"
>
......
......@@ -50,13 +50,13 @@
[ngIfElse]="loggedOut"
>
<li class="login">
<a data-test="login-mobile-input" (click)="login()">{{'app.toolbar.login' | translate }}</a>
<a data-test="login-mobile-input" (click)="login()">{{'app.module.login' | translate }}</a>
</li>
</ng-template>
<ng-template #loggedOut>
<li class="logout">
<a data-test="logout-mobile-input" (click)="logout()">{{'app.toolbar.logout' | translate }}</a>
<a data-test="logout-mobile-input" (click)="logout()">{{'app.module.logout' | translate }}</a>
</li>
</ng-template>
......
<img class="selected-theme-img"
[matTooltip]="'app.toolbar.themeSelector' | translate"
[matTooltip]="'app.module.themeSelector' | translate"
[matTooltipPosition]="'right'"
[src]="getPathToImage(matSelect.value)" (click)="matSelect.open()">
......
<h1 id="admin-home-title">{{'admin.home.title' | translate}}</h1>
<h1 id="admin-home-title">{{'app.module.admin' | translate}}</h1>
<div class="toolbar"
cdkTrapFocus
[solidifyFocusFirstElement]="true"
......
......@@ -12,6 +12,8 @@ import {
} from "@shared/components/routables/shared-abstract-home/shared-abstract-home.routable";
import {IconNameEnum} from "@shared/enums/icon-name.enum";
import {TRANSLATE} from "solidify-frontend";
import {AppHelper} from "@app/app.helper";
@Component({
selector: "dlcm-admin-home-routable",
......
<h1>{{'order.home.title' | translate}}</h1>
<h1>{{'app.module.order' | translate}}</h1>
<div class="cards-container"
[solidifyFocusFirstElement]="true"
......
<h1>{{'preservation.space.home.title' | translate}}</h1>
<h1>{{'app.module.preservation-space' | translate}}</h1>
<dlcm-shared-tabs-container [tabs]="preservationSpaceTabs"
[isLoading]="isLoadingObs | async"
......
......@@ -50,7 +50,7 @@ export class PreservationSpaceHomeRoutable extends SharedAbstractPresentational
{
id: "CONTRIBUTOR",
icon: IconNameEnum.contributor,
titleToTranslate: TRANSLATE("admin.contributor.home.title"),
titleToTranslate: TRANSLATE("preservationSpace.contributor.home.title"),
suffixUrl: PreservationSpaceRoutesEnum.contributor,
route: () => [...this.rootUrl, PreservationSpaceRoutesEnum.contributor],
},
......
<h1>{{'preservation.home.title' | translate}}</h1>
<h1>{{'app.module.preservation' | translate}}</h1>
<div class="toolbar"
cdkTrapFocus
......
......@@ -62,9 +62,6 @@
"lastName": "Last name",
"orcid": "ORCID"
},
"home": {
"title": "Contributors"
},
"table": {
"header": {
"creation": {
......@@ -928,6 +925,21 @@
},
"title": "{{name}}: Status history"
},
"module": {
"admin": "Administration",
"cart": "Cart",
"deposit": "Deposits",
"home": "Home",
"languageSelector": "Select a language",
"login": "Log in",
"logout": "Log out",
"order": "Orders",
"preservation": "Preservation Planning",
"preservation-space": "Preservation Space",
"profileInfo": "Profile",
"themeSelector": "Application theme",
"token": "Token"
},
"navigation": {
"button": {
"back": "Back",
......@@ -987,21 +999,6 @@
"copyToClipboard": "Copy to the clipboard",
"title": "Token"
},
"toolbar": {
"admin": "Administration",
"cart": "Cart",
"deposit": "Deposits",
"home": "Home",
"languageSelector": "Select a language",
"login": "Log in",
"logout": "Log out",
"order": "Archives",
"preservation": "Preservation Planning",
"preservation-space": "Preservation Space",
"profileInfo": "Profile",
"themeSelector": "Application theme",
"token": "Token"
},
"tootlip": {
"copyToClipboard": "Copy ID to clipboard"
},
......@@ -1945,7 +1942,7 @@
"status": "Status"
},
"home": {
"subtitle": " ",
"subtitle": "All orders requests",
"title": "All orders"
},
"notification": {
......@@ -2450,6 +2447,9 @@
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributor"
},
"button": {
"refresh": "Refresh"
},
......
......@@ -62,9 +62,6 @@
"lastName": "Last name",
"orcid": "ORCID"
},
"home": {
"title": "Contributors"
},
"table": {
"header": {
"creation": {
......@@ -928,6 +925,21 @@
},
"title": "{{name}}: Status history"
},
"module": {
"admin": "Administration",
"cart": "Cart",
"deposit": "Deposits",
"home": "Home",
"languageSelector": "Select a language",
"login": "Log in",
"logout": "Log out",
"order": "Orders",
"preservation": "Preservation Planning",
"preservation-space": "Preservation Space",
"profileInfo": "Profile",
"themeSelector": "Application theme",
"token": "Token"
},
"navigation": {
"button": {
"back": "Back",
......@@ -987,21 +999,6 @@
"copyToClipboard": "Copy to the clipboard",
"title": "Token"
},
"toolbar": {
"admin": "Administration",
"cart": "Cart",
"deposit": "Deposits",
"home": "Home",
"languageSelector": "Select a language",
"login": "Log in",
"logout": "Log out",
"order": "Archives",
"preservation": "Preservation Planning",
"preservation-space": "Preservation Space",
"profileInfo": "Profile",
"themeSelector": "Application theme",
"token": "Token"
},
"tootlip": {
"copyToClipboard": "Copy ID to clipboard"
},
......@@ -1988,7 +1985,8 @@
}
},
"home": {
"title": "Orders"
"title": "Orders",
"subtitle": "All order requests"
},
"myOrder": {
"accessLevel": "Access level",
......@@ -2450,6 +2448,9 @@
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributor"
},
"button": {
"refresh": "Refresh"
},
......
......@@ -62,9 +62,6 @@
"lastName": "Nom",
"orcid": "ORCID"
},
"home": {
"title": "Contributeur-rice-s"
},
"table": {
"header": {
"creation": {
......@@ -928,6 +925,21 @@
},
"title": "{{name}} : Historique des statuts"
},
"module": {
"admin": "Administration",
"cart": "Panier",
"deposit": "Dépôts",
"home": "Accueil",
"languageSelector": "Sélectionner une langue",
"login": "Connexion",
"logout": "Déconnexion",
"order": "Orders",
"preservation": "Planification de préservation",
"preservation-space": "Espace de préservation",
"profileInfo": "Profil",
"themeSelector": "Thème d'application",
"token": "Token"
},
"navigation": {
"button": {
"back": "Retour",
......@@ -987,21 +999,6 @@
"copyToClipboard": "Copier dans le presse-papiers",
"title": "Token"
},
"toolbar": {
"admin": "Administration",
"cart": "Panier",
"deposit": "Dépôts",
"home": "Accueil",
"languageSelector": "Sélectionner une langue",
"login": "Connexion",
"logout": "Déconnexion",
"order": "Archives",
"preservation": "Planification de préservation",
"preservation-space": "Espace de préservation",
"profileInfo": "Profil",
"themeSelector": "Thème d'application",
"token": "Token"
},
"tootlip": {
"copyToClipboard": "Copier l'identifiant dans le presse-papiers"
},
......@@ -2450,6 +2447,9 @@
},
"preservationSpace": {
"contributor": {
"home": {
"title": "Contributeur-rice"
},
"button": {
"refresh": "Rafraichir"
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment