diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts index bbe427529cc46266334c69c4e92a2c94bf961a67..7842a230cd6ae19ddb4aad4aa5a3c802413eae38 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts @@ -228,7 +228,7 @@ export class FileTreeMetadataComponent { this.fileService.tabRootNode.subscribe(tabRootNode => { if (tabRootNode){ let tabLabel = (<any>nodeNameToLabel)[tabRootNode.name]; - this.breadcrumbDataMetadata = [{ label: this.onResolveName(tabLabel), node: tabRootNode}]; + this.breadcrumbDataMetadata = [{ label: tabLabel, node: tabRootNode}]; if (tabRootNode.name !== breadCrumbNodeLabel){ if(node.parent){ if (node.parent.name!==tabRootNode.name){ @@ -237,9 +237,9 @@ export class FileTreeMetadataComponent { this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: '...' } ]); } } - this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: this.onResolveName(node.parent.name), node: node.parent } ]); + this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: node.parent.name, node: node.parent } ]); } - this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: breadCrumbNodeLabel } ]); + this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: breadCrumbNodeLabel, node: node } ]); } } } diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.html b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.html index 597287f4cec467a0ef9e909dbeecfa1dfb0f77e0..3e3f3f4f7e46b611f2eb66d5b0707b03b2bac830 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.html @@ -27,7 +27,7 @@ <div class="pastis-breadcrumb"> <ng-container *ngFor="let d of data; let last = last"> - <span (click)="onClick(d, !last)">{{d.label | translate}}</span> + <span (click)="onClick(d, !last)">{{getLabel(d) | translate}}</span> <i *ngIf="!last" class="material-icons px-2">trending_flat</i> </ng-container> </div> diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts index de2cf262b3519faf6c3dccbcef28b3bac2280746..800cfae00ff35c75e25f1db5b1bab456f6adc22c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts @@ -35,6 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { BreadcrumbDataMetadata } from '../../../profile/edit-profile/classes/breadcrumb'; +import { PastisPopupMetadataLanguageService } from '../../pastis-popup-metadata-language/pastis-popup-metadata-language.service'; @Component({ selector: 'pastis-breadcrumb', @@ -49,6 +51,8 @@ export class PastisBreadcrumbComponent implements OnInit { @Output() public selected = new EventEmitter<any>(); + constructor(private metadataLanguageService: PastisPopupMetadataLanguageService){} + ngOnInit() { } @@ -57,4 +61,15 @@ export class PastisBreadcrumbComponent implements OnInit { this.selected.emit(d); } } + + getLabel(data:BreadcrumbDataMetadata): string { + if (data.node) { + if (!this.metadataLanguageService.sedaLanguage.getValue()) { + if (data.node.sedaData.NameFr){ + return data.node.sedaData.NameFr; + } + } + } + return data.label; + } }