Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dad/cines-vitamui
1 result
Show changes
Commits on Source (6)
Showing
with 131 additions and 113 deletions
......@@ -35,9 +35,9 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-C license and that you accept its terms.
*/
import {Injectable} from '@angular/core';
import {Injectable, OnDestroy} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {BehaviorSubject, ReplaySubject} from 'rxjs';
import {BehaviorSubject, ReplaySubject, Subscription} from 'rxjs';
import {SedaCardinalityConstants, SedaData, SedaElementConstants} from '../../profile/edit-profile/classes/seda-data';
import {FileNode, TypeConstants} from '../../profile/edit-profile/classes/file-node';
import {PastisDialogConfirmComponent} from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component';
......@@ -52,7 +52,7 @@ import { NoticeProfile, ProfileResponse } from '../../profile/edit-profile/class
providedIn: 'root'
})
export class FileService {
export class FileService implements OnDestroy {
currentTree = new ReplaySubject<FileNode[]>();
notice = new BehaviorSubject<NoticeProfile>(null);
......@@ -71,6 +71,8 @@ export class FileService {
parentNodeMap = new Map<FileNode, FileNode>();
sedaDataArchiveUnit : SedaData;
private _profileServiceGetProfileSubscription : Subscription;
constructor(private profileService: ProfileService, private fileMetadataService: FileTreeMetadataService,
private dialog: MatDialog, private sedaService: SedaService) { }
......@@ -80,6 +82,9 @@ export class FileService {
*/
updateTreeWithProfile(profileResponse: ProfileResponse) {
this.profileService.profileMode = profileResponse.type;
this.profileService.profileName = profileResponse.name;
this.profileService.profileId = profileResponse.id;
let sedaDataArray: SedaData[] = [this.sedaService.sedaRules[0]];
this.linkFileNodeToSedaData(null, [profileResponse.profile], sedaDataArray);
this.currentTree.next([profileResponse.profile]);
......@@ -94,7 +99,7 @@ export class FileService {
* @param id id of profile to get
*/
getProfileAndUpdateTree(id:number){
this.profileService.getProfile(id).subscribe((response) => {
this._profileServiceGetProfileSubscription = this.profileService.getProfile(id).subscribe((response) => {
this.updateTreeWithProfile(response);
});
}
......@@ -387,4 +392,11 @@ export class FileService {
this.fileMetadataService.dataSource.next(dataTable);
}
}
ngOnDestroy() {
console.log('fileService.currentTreeLoaded2 ' + this.currentTreeLoaded)
if(this._profileServiceGetProfileSubscription!= null){
this._profileServiceGetProfileSubscription.unsubscribe();
}
}
}
......@@ -53,6 +53,8 @@ export class ProfileService {
private apiServerPath: string;
public profileMode : string;
public profileName: string;
public profileId: number;
constructor(private apiService: PastisApiService, private pastisConfig: PastisConfiguration) {
this.apiServerPath = isDevMode() ? environment.apiServerUrl : pastisConfig.apiPastisUrl;
......
......@@ -11,7 +11,7 @@
<mat-sidenav #sidenav mode="side" [(opened)]="opened" (opened)="events.push('open!')"
(closed)="events.push('close!')"
class='pastis-side-nav'>
<pastis-edit-profile [profileId]="profileId"></pastis-edit-profile>
<pastis-edit-profile *ngIf="fileService.currentTreeLoaded"></pastis-edit-profile>
</mat-sidenav>
<mat-sidenav-content >
<div class="pastis-entete-bandeau"></div>
......
......@@ -40,7 +40,7 @@ import {CdkTextareaAutosize} from '@angular/cdk/text-field';
import {ActivatedRoute, Router} from '@angular/router';
import {ToggleSidenavService} from '../core/services/toggle-sidenav.service';
import {ToastContainerDirective, ToastrService} from 'ngx-toastr';
import {Subscription} from 'rxjs';
import {BehaviorSubject, ReplaySubject, Subscription} from 'rxjs';
import {EditProfileComponent} from '../profile/edit-profile/edit-profile.component';
import {FileNode, FileNodeInsertAttributeParams, FileNodeInsertParams} from "../profile/edit-profile/classes/file-node";
import { FileService } from '../core/services/file.service';
......@@ -63,12 +63,13 @@ export class MainComponent implements OnInit, OnDestroy {
opened: boolean;
events: string[] = [];
profileId: number;
noticeDisplay: boolean;
noticeDisplaySub: Subscription;
uploadedProfileResponse: ProfileResponse;
private _noticeDisplaySubscription: Subscription;
private _routeParamsSubscription : Subscription;
constructor(private route: ActivatedRoute,private sideNavService : ToggleSidenavService, private toastrService: ToastrService,
public fileService: FileService, private router: Router) {
this.uploadedProfileResponse = this.router.getCurrentNavigation().extras.state as ProfileResponse;
......@@ -77,23 +78,27 @@ export class MainComponent implements OnInit, OnDestroy {
this.opened = status;
})
this.noticeDisplaySub = this.sideNavService.noticeSelected.subscribe(statusNotice => {
this._noticeDisplaySubscription = this.sideNavService.noticeSelected.subscribe(statusNotice => {
this.noticeDisplay = statusNotice;
console.log('consolee ======> status'+ this.noticeDisplay)
})
}
ngOnInit() {
this.fileService.currentTreeLoaded = false;
this.fileService.currentTree = new ReplaySubject<FileNode[]>();
this.fileService.allData = new BehaviorSubject<FileNode[]>([]);
this.toastrService.overlayContainer = this.toastContainer;
this.route.params.subscribe(params => {
this.profileId = params['id'];
this._routeParamsSubscription = this.route.params.subscribe(params => {
let profileId = params['id'];
// If a profileId has been defined, it is retrieved from backend
if (this.profileId != undefined) {
this.fileService.getProfileAndUpdateTree(this.profileId);
if (profileId !== undefined) {
this.fileService.getProfileAndUpdateTree(profileId);
} else {
// Otherwise we must have an user uploaded profile
this.profileId = this.uploadedProfileResponse.id;
this.uploadedProfileResponse.id = null;
this.uploadedProfileResponse.name = 'Nouveau Profil';
this.fileService.updateTreeWithProfile(this.uploadedProfileResponse);
}
});
......@@ -131,7 +136,12 @@ export class MainComponent implements OnInit, OnDestroy {
}
ngOnDestroy(): void {
this.noticeDisplaySub.unsubscribe();
if(this._noticeDisplaySubscription!= null){
this._noticeDisplaySubscription.unsubscribe();
}
if(this._routeParamsSubscription!= null){
this._routeParamsSubscription.unsubscribe();
}
}
}
......@@ -8,7 +8,15 @@
<div class="pastis-metadata-option-container">
<!-- Top left panel container -->
<div class="pastis-metadata-option-entete-1">
<h5><i class="vitamui-icon vitamui-icon-dossier-physique"></i>{{profileModeLabel}}</h5>
<h5>
<i class="vitamui-icon vitamui-icon-dossier-physique"></i>
<ng-container *ngIf="this.profileService.profileMode==='PUA'">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PUA' | translate}}
</ng-container>
<ng-container *ngIf="this.profileService.profileMode==='PA'">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PA' | translate}}
</ng-container>
</h5>
</div>
<!--Top right panel container-->
<div class="pastis-metadata-option-entete-2">
......
......@@ -48,6 +48,7 @@ import { FileService } from '../core/services/file.service';
import { BreadcrumbDataTop } from '../profile/edit-profile/classes/breadcrumb';
import { StartupService } from 'ui-frontend-common';
import { environment } from '../../environments/environment';
@Component({
selector: 'pastis-notice',
templateUrl: './notice.component.html',
......@@ -124,8 +125,8 @@ export class NoticeComponent implements OnInit, OnDestroy {
ngOnInit() {
this.languagePopup = false;
this.docPath = 'assets/doc/VITAM UI - Documentation APP - PASTIS.pdf';
this.profileModeLabel = this.profileService.profileMode==='PUA'?'Profil d\'Unité Archivistique':'Profil d\'Archivage';
this.breadcrumbDataTop = [{ label: 'Portail', url: this.startupService.getPortalUrl(), external: true},{ label: 'Créer et gérer un profil d\'archivage', url: '/'}, { label: this.profileModeLabel }];
this.profileModeLabel = this.profileService.profileMode==='PUA'?"PROFILE.EDIT_PROFILE.BREADCRUMB.PUA":"PROFILE.EDIT_PROFILE.BREADCRUMB.PA";
this.breadcrumbDataTop = [{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.PORTAIL", url: this.startupService.getPortalUrl(), external: true},{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.CREER_ET_GERER_PROFIL", url: '/'}, { label: this.profileModeLabel }];
this.openedSub = this.sideNavService.isOpened.subscribe((status) => {
this.opened = status;
......
......@@ -123,9 +123,9 @@ export interface FileNodeInsertAttributeParams {
}
export enum nodeNameToLabel {
'notice' = 'Notice',
'ArchiveTransfer' = 'Entête',
'ManagementMetadata' = 'Règles',
'DescriptiveMetadata' = 'Unités d\'archives',
'DataObjectPackage' = 'Objets'
'notice' = 'PROFILE.EDIT_PROFILE.NOTICE_TAB',
'ArchiveTransfer' = 'PROFILE.EDIT_PROFILE.ENTETE',
'ManagementMetadata' = 'PROFILE.EDIT_PROFILE.REGLES',
'DescriptiveMetadata' = 'PROFILE.EDIT_PROFILE.UNITES_ARCHIVES',
'DataObjectPackage' = 'PROFILE.EDIT_PROFILE.OBJETS'
}
......@@ -3,10 +3,12 @@ import { FileNode } from "./file-node";
export interface ProfileResponse{
id:number;
name: string;
profile: FileNode;
notice?: NoticeProfile;
type: string;
}
export interface NoticeProfile{
Description: string;
_id: string;
......
......@@ -5,10 +5,11 @@
<div class="pastis-edit-profile-header-name">
<p class="text large bold text-primary">
<ng-container>{{getProfileName(profileId)}}</ng-container>
<ng-container>{{this.profileService.profileName}}</ng-container>
</p>
</div>
<div class="pastis-edit-profile-header-id">
<p class="text medium light">{{'PROFILE.EDIT_PROFILE.PROFILE_ID' | translate}} : {{profileId}}</p>
<div *ngIf="this.profileService.profileId!==null" class="pastis-edit-profile-header-id">
<p class="text medium light">{{'PROFILE.EDIT_PROFILE.PROFILE_ID' | translate}} : {{this.profileService.profileId}}</p>
</div>
</div>
<div class ="mat-table">
......@@ -19,12 +20,12 @@
(selectedTabChange)="loadProfile($event)"
fxFill>
<mat-tab label="{{puaMode ? tabLabels[5] : tabLabels[0]}}" *ngIf="canShowOnPuaMode(0)">
<mat-tab label="{{(puaMode ? tabLabels[5] : tabLabels[0]) | translate}}" *ngIf="canShowOnPuaMode(0)">
</mat-tab>
<mat-tab label="{{tabLabels[1]}}" *ngIf="canShowOnPuaMode(1)">
<mat-tab label="{{tabLabels[1] | translate}}" *ngIf="canShowOnPuaMode(1)">
<div class="pastis-tab-container" >
<ng-template matTabContent>
<pastis-file-tree
<pastis-file-tree *ngIf="fileService.currentTreeLoaded"
[rootElementName] = "rootNames[1]"
[rootElementShowName]="displayedRootNames[1]"
[childrenListToExclude]="headerTabChildrenToExclude"
......@@ -35,10 +36,10 @@
</div>
</mat-tab>
<mat-tab label="{{tabLabels[2]}}" *ngIf="canShowOnPuaMode(2)">
<mat-tab label="{{tabLabels[2] | translate}}" *ngIf="canShowOnPuaMode(2)">
<div class="pastis-tab-container">
<ng-template matTabContent>
<pastis-file-tree
<pastis-file-tree *ngIf="fileService.currentTreeLoaded"
[rootElementName]="rootNames[2]"
[rootElementShowName]="displayedRootNames[2]"
[childrenListToInclude]="rulesTabChildrenToInclude"
......@@ -50,10 +51,10 @@
</div>
</mat-tab>
<mat-tab label="{{puaMode ? tabLabels[6] : tabLabels[3]}}" *ngIf="canShowOnPuaMode(3)">
<mat-tab label="{{(puaMode ? tabLabels[6] : tabLabels[3]) | translate}}" *ngIf="canShowOnPuaMode(3)">
<div class="pastis-tab-container">
<ng-template matTabContent>
<pastis-file-tree
<pastis-file-tree *ngIf="fileService.currentTreeLoaded"
[rootElementName]="rootNames[3]"
[rootElementShowName]="displayedRootNames[3]"
[childrenListToInclude]="treeTabChildrenToInclude"
......@@ -65,10 +66,10 @@
</div>
</mat-tab>
<mat-tab label="{{tabLabels[4]}}" *ngIf="canShowOnPuaMode(4)">
<mat-tab label="{{tabLabels[4] | translate}}" *ngIf="canShowOnPuaMode(4)">
<div class="pastis-tab-container">
<ng-template matTabContent>
<pastis-file-tree
<pastis-file-tree *ngIf="fileService.currentTreeLoaded"
[rootElementName]="rootNames[4]"
[rootElementShowName]="displayedRootNames[4]"
[childrenListToInclude]="objectTabChildrenToInclude"
......
......@@ -36,23 +36,20 @@ The fact that you are presently reading this means that you have had
knowledge of the CeCILL-C license and that you accept its terms.
*/
import { Component, OnDestroy, ViewChild, Input } from '@angular/core';
import { Component, OnDestroy, ViewChild } from '@angular/core';
import { ToggleSidenavService } from '../../core/services/toggle-sidenav.service';
import { FileService } from '../../core/services/file.service';
import { SedaService } from '../../core/services/seda.service';
import { FileNode } from './classes/file-node';
import { MatTabChangeEvent } from '@angular/material/tabs';
import { MatTreeNestedDataSource } from '@angular/material/tree';
import { NestedTreeControl } from '@angular/cdk/tree';
import { BehaviorSubject} from 'rxjs';
import { BehaviorSubject, Subscription} from 'rxjs';
import { FileTreeComponent } from './file-tree/file-tree.component';
import { SedaData } from './classes/seda-data';
import { NgxUiLoaderService } from 'ngx-ui-loader';
import { ProfileService } from 'projects/pastis/src/app/core/services/profile.service';
import { ProfileDescription } from '../list-profile/models/profile-description.model';
import { FileTreeService } from './file-tree/file-tree.service';
import { Router} from '@angular/router';
import {TranslateService} from '@ngx-translate/core';
import {environment} from "../../../environments/environment";
......@@ -71,13 +68,6 @@ export interface UploadedProfileResponse {
export class EditProfileComponent implements OnDestroy {
@Input()
profileId: number;
profileName: string;
profileList: ProfileDescription[];
nodeToSend: FileNode;
sedaParentNode: SedaData;
......@@ -134,30 +124,23 @@ export class EditProfileComponent implements OnDestroy {
@ViewChild(FileTreeComponent, {static: false}) fileTreeComponent: FileTreeComponent;
noticeSelected: boolean;
private _fileServiceCurrentTreeSubscription : Subscription;
constructor(private sedaService: SedaService, private fileService: FileService,
private sideNavService: ToggleSidenavService, private profileService: ProfileService,
private loaderService: NgxUiLoaderService, private fileTreeService:FileTreeService, private router: Router,
private sideNavService: ToggleSidenavService, public profileService: ProfileService,
private loaderService: NgxUiLoaderService, private fileTreeService:FileTreeService,
private translateService: TranslateService) {
}
initAll(){
if(this.router.url != '/new'){
this.profileService.getAllProfiles().subscribe(profileList => {
if (profileList) {
this.profileList = profileList;
}
})
}
if(!this.isStandalone){
this.noticeTab = this.translated('.NOTICE_TAB');
this.entete = this.translated('.ENTETE');
this.regles = this.translated('.REGLES');
this.unitesArchives = this.translated('.UNITES_ARCHIVES');
this.objets = this.translated('.OBJETS');
this.noticePuaMode = this.translated('.NOTICE_PUA_MODE');
this.unitesArchivesPuaMode= this.translated('.UNITES_ARCHIVES_PUA_MODE');
this.noticeTab = 'PROFILE.EDIT_PROFILE.NOTICE_TAB';
this.entete = 'PROFILE.EDIT_PROFILE.ENTETE';
this.regles = 'PROFILE.EDIT_PROFILE.REGLES';
this.unitesArchives = 'PROFILE.EDIT_PROFILE.UNITES_ARCHIVES';
this.objets = 'PROFILE.EDIT_PROFILE.OBJETS';
this.noticePuaMode = 'PROFILE.EDIT_PROFILE.NOTICE_PUA_MODE';
this.unitesArchivesPuaMode= 'PROFILE.EDIT_PROFILE.UNITES_ARCHIVES_PUA_MODE';
}
this.tabLabels.push(this.noticeTab, this.entete, this.regles, this.unitesArchives, this.objets, this.noticePuaMode,this.unitesArchivesPuaMode);
//Set tab and metadata rules according to profile type
......@@ -202,7 +185,7 @@ export class EditProfileComponent implements OnDestroy {
}
ngAfterViewInit () {
this.fileService.currentTree.subscribe(response => {
this._fileServiceCurrentTreeSubscription = this.fileService.currentTree.subscribe(response => {
this.initActiveTabAndProfileMode();
this.initAll();
if (response && response!==undefined) {
......@@ -308,23 +291,10 @@ export class EditProfileComponent implements OnDestroy {
return this.profileService.profileMode === "PUA" ? (tabIndex === 0 || tabIndex === 3 || tabIndex === 5) : true;
}
getProfileName(profileId: number): string{
if(profileId == undefined) {
return null
};
if(this.profileList != undefined){
let profiles: ProfileDescription[] = this.profileList.filter(profile => profile.id == profileId);
this.profileName = profiles[0].baseName;
if(this.profileName != undefined){
return profiles[0].baseName;
}
}
return null;
}
ngOnDestroy() {
if(this._fileServiceCurrentTreeSubscription!= null){
this._fileServiceCurrentTreeSubscription.unsubscribe();
}
}
}
......@@ -8,7 +8,15 @@
<div class="pastis-metadata-option-container">
<!-- Top left panel container -->
<div class="pastis-metadata-option-entete-1">
<h5><i class="vitamui-icon vitamui-icon-dossier-physique"></i>{{profileModeLabel}}</h5>
<h5>
<i class="vitamui-icon vitamui-icon-dossier-physique"></i>
<ng-container *ngIf="this.profileService.profileMode==='PUA'">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PUA' | translate}}
</ng-container>
<ng-container *ngIf="this.profileService.profileMode==='PA'">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PA' | translate}}
</ng-container>
</h5>
<pastis-breadcrumb
[data]="breadcrumbDataMetadata"
(selected)="navigateMetadata($event)">
......@@ -166,18 +174,17 @@
<mat-menu #menu="matMenu" [overlapTrigger]="false" class="pastis-menu-item-vitam">
<!-- Dupliquer-->
<mat-divider *ngIf="isDuplicated(element.nomDuChamp)" style="border-top-color:#E0E0E0;">
<mat-divider *ngIf="isDuplicated(element.nomDuChamp) && this.profileService.profileMode==='PA'" style="border-top-color:#E0E0E0;">
</mat-divider>
<button *ngIf="isDuplicated(element.nomDuChamp)" mat-menu-item (click)="onDuplicateNode(element.id)">
<button *ngIf="isDuplicated(element.nomDuChamp) && this.profileService.profileMode==='PA'" mat-menu-item (click)="onDuplicateNode(element.id)">
<mat-icon style="color:#757575">filter_none</mat-icon>
<span class="text normal">{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.DUPLIQUER' | translate}}</span>
</button>
<!-- @Attributs-->
<mat-divider *ngIf="hasAttributes(element.nomDuChamp)" style="border-top-color:#E0E0E0;"></mat-divider>
<button *ngIf="hasAttributes(element.nomDuChamp);" (click)="onEditAttributesClick(element.id)"
<mat-divider *ngIf="hasAttributes(element.nomDuChamp) && this.profileService.profileMode==='PA'" style="border-top-color:#E0E0E0;"></mat-divider>
<button *ngIf="hasAttributes(element.nomDuChamp) && this.profileService.profileMode==='PA'" (click)="onEditAttributesClick(element.id)"
mat-menu-item>
<i class="vitamui-icon vitamui-icon-alternate_email_black_24dp" style="margin-right: 16px;
>>>>>>> feat/test
vertical-align: middle;
color:#757575;
font-size: 1.77em;">
......
......@@ -183,7 +183,7 @@ export class FileTreeMetadataComponent {
constructor(private fileService: FileService, private fileMetadataService: FileTreeMetadataService,
private sedaService: SedaService, private fb: FormBuilder, private notificationService: NotificationService,
private router: Router, private startupService: StartupService,
private profileService: ProfileService, private fileTreeService:FileTreeService, private metadataLanguageService: PastisPopupMetadataLanguageService,
public profileService: ProfileService, private fileTreeService:FileTreeService, private metadataLanguageService: PastisPopupMetadataLanguageService,
private translateService: TranslateService) {
this.config = {
......@@ -224,11 +224,11 @@ export class FileTreeMetadataComponent {
this.clickedNode = node;
// BreadCrumb for navigation through metadatas
if (node && node!==undefined) {
let breadCrumbNodeLabel: string = node.name ;
let breadCrumbNodeLabel: string = node.name;
this.fileService.tabRootNode.subscribe(tabRootNode => {
if (tabRootNode){
let tabLabel = (<any>nodeNameToLabel)[tabRootNode.name];
this.breadcrumbDataMetadata = [{ label: tabLabel, node: tabRootNode}];
this.breadcrumbDataMetadata = [{ label: this.onResolveName(tabLabel), node: tabRootNode}];
if (tabRootNode.name !== breadCrumbNodeLabel){
if(node.parent){
if (node.parent.name!==tabRootNode.name){
......@@ -237,7 +237,7 @@ export class FileTreeMetadataComponent {
this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: '...' } ]);
}
}
this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: node.parent.name, node: node.parent } ]);
this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: this.onResolveName(node.parent.name), node: node.parent } ]);
}
this.breadcrumbDataMetadata = this.breadcrumbDataMetadata.concat([ { label: breadCrumbNodeLabel } ]);
}
......@@ -247,8 +247,8 @@ export class FileTreeMetadataComponent {
}
});
// BreadCrump Top for navigation
this.profileModeLabel = this.profileService.profileMode==='PUA'?'Profil d\'Unité Archivistique':'Profil d\'Archivage';
this.breadcrumbDataTop = [{ label: 'Portail', url: this.startupService.getPortalUrl(), external: true},{ label: 'Créer et gérer un profil d\'archivage', url: '/'}, { label: this.profileModeLabel }];
this.profileModeLabel = this.profileService.profileMode==='PUA'?"PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PUA":"PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.PA";
this.breadcrumbDataTop = [{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.PORTAIL", url: this.startupService.getPortalUrl(), external: true},{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.CREER_ET_GERER_PROFIL", url: '/'}, { label: this.profileModeLabel }];
this._fileServiceSubscription = this.fileService.currentTree.subscribe(fileTree => {
if (fileTree) {
......
......@@ -3,7 +3,7 @@
<!-- Nested tree node-->
<mat-nested-tree-node *matTreeNodeDef="let node;when:hasNestedChild">
<div *ngIf="node.name === rootElementName && (activeTabIndex === 3 && !puaMode) " class="pastis-btn-container-add-ua">
<div *ngIf="node.name === rootElementName && (activeTabIndex === 3 && this.profileService.profileMode === 'PA') " class="pastis-btn-container-add-ua">
<button class="btn primary" (click)= addArchiveUnit(node)>
{{'PROFILE.EDIT_PROFILE.FILE_TREE.AJOUTER_UA' | translate}}
</button>
......@@ -15,7 +15,7 @@
>
<!--Root node name-->
<span *ngIf="node.name === rootElementName && !puaMode" class="pastis-tree-node-root-name">
<span *ngIf="node.name === rootElementName && this.profileService.profileMode === 'PA'" class="pastis-tree-node-root-name">
<span [ngStyle]="{'margin-left': calculateNodePosition(node) + 'px'}">
{{rootElementShowName}}
</span>
......@@ -51,7 +51,7 @@
tooltip="Ajouter une UA"
tooltip-class="pastis-tooltip-class">
<!--Button plus-->
<button class="pastis-btn-add-ua" *ngIf="!puaMode" (click)= "addArchiveUnit(node)">
<button class="pastis-btn-add-ua" *ngIf="this.profileService.profileMode === 'PA'" (click)= "addArchiveUnit(node)">
<i class="vitamui-icon vitamui-icon-add" style="color: var(--vitamui-primary);"></i>
<span class="pastis-btn-add-ua-text">{{'PROFILE.EDIT_PROFILE.FILE_TREE.AJOUTER_UA_ICON' | translate}}</span>
</button>
......@@ -60,14 +60,8 @@
</div>
<mat-divider class="pastis-divider"></mat-divider>
</span>
</mat-list-item>
<ul [hidden]="!fileTreeService.nestedTreeControl.isExpanded(node)" class="pastis-tree-ul">
<ng-container matTreeNodeOutlet></ng-container>
</ul>
......
......@@ -52,6 +52,7 @@ import { FileTreeService } from './file-tree.service';
import {DuplicateMetadataComponent} from "../../../user-actions/duplicate-metadata/duplicate-metadata.component";
import {LangChangeEvent, TranslateService} from "@ngx-translate/core";
import {environment} from "../../../../environments/environment";
import { ProfileService } from '../../../core/services/profile.service';
const FILE_TREE_TRANSLATE_PATH = 'PROFILE.EDIT_PROFILE.FILE_TREE';
......@@ -163,9 +164,9 @@ export class FileTreeComponent implements OnDestroy {
private _fileTreeServiceUpdateMedataTable: Subscription;
constructor(private fileService: FileService, private loggingService: NotificationService,
private fileMetadataService: FileTreeMetadataService,
private sedaService: SedaService, private sedaLanguageService: PastisPopupMetadataLanguageService, public fileTreeService:FileTreeService,
private translateService: TranslateService) { }
private fileMetadataService: FileTreeMetadataService, private sedaService: SedaService,
private sedaLanguageService: PastisPopupMetadataLanguageService, public fileTreeService:FileTreeService,
private translateService: TranslateService, public profileService: ProfileService) { }
ngOnInit() {
if(!this.isStandalone){
......
......@@ -7,7 +7,6 @@
<pastis-title-breadcrumb *ngIf="!isStandalone" class="breadcrumbTop"
[data]="breadcrumbDataTop"
(selected)="navigate($event)">
{{'PROFILE.LIST_PROFILE.CREER_GERER_PROFILE_ARCHIVAGE' | translate}}
</pastis-title-breadcrumb>
<vitamui-common-banner [searchbarPlaceholder]="'PROFILE.LIST_PROFILE.SEARCH_PLACEHOLDER' | translate"
......
......@@ -78,8 +78,6 @@ export class ListProfileComponent implements OnInit {
buttonIsClicked: boolean;
data = ["portail"]
search: string;
_uploadProfileSub: Subscription;
......@@ -99,7 +97,8 @@ export class ListProfileComponent implements OnInit {
private startupService: StartupService) { }
ngOnInit() {
this.breadcrumbDataTop = [{ label: 'Portail', url: this.startupService.getPortalUrl(), external: true},{ label: 'Créer et gérer un profil d\'archivage', url: '/'}];
this.breadcrumbDataTop = [{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.PORTAIL", url: this.startupService.getPortalUrl(), external: true},{ label: "PROFILE.EDIT_PROFILE.BREADCRUMB.CREER_ET_GERER_PROFIL", url: '/'}];
this.ngxLoader.startLoader('table-profiles'); // start non-master loader
this.profileService.getAllProfiles().subscribe(profileList => {
if (profileList) {
......
......@@ -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}}</span>
<span (click)="onClick(d, !last)">{{d.label | translate}}</span>
<i *ngIf="!last" class="material-icons px-2">trending_flat</i>
</ng-container>
</div>
......@@ -52,6 +52,7 @@ import {CenterMatmenuDirective} from "../profile/edit-profile/file-tree-metadata
import { PastisPopupMetadataLanguageComponent } from './pastis-popup-metadata-language/pastis-popup-metadata-language.component';
import { PastisBreadcrumbComponent } from './pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component';
import { PastisTitleBreadcrumbComponent } from './pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component';
import { TranslateModule } from '@ngx-translate/core';
@NgModule({
declarations: [
......@@ -70,7 +71,8 @@ import { PastisTitleBreadcrumbComponent } from './pastis-breadcrumb-components/p
TooltipModule,
PastisMaterialModule,
MatSlideToggleModule,
PortalModule
PortalModule,
TranslateModule
],
entryComponents: [PastisDialogConfirmComponent, PastisUnderConstructionComponent],
exports: [
......
......@@ -39,6 +39,10 @@
"NOM_PUA": "Name of the archival unit profile",
"NOM_PA": "Archive profile name",
"PROFILE_ID": "Username",
"BREADCRUMB":{
"PORTAIL": "Portal",
"CREER_ET_GERER_PROFIL": "Create and manage documentary profiles"
},
"FILE_TREE": {
"AJOUTER_UA": "ADD A UA",
"AJOUTER_UA_ICON": "ADD A UA",
......@@ -72,6 +76,8 @@
"POPUP_DUPLICATE_TITRE_TWO'": "its content and configuration (cardinalities and comments)"
},
"FILE_TREE_METADATA": {
"PUA": "Archiving Unit Profile",
"PA": "Archiving Profile",
"SEARCH_PLACEHOLDER": "Find metadata in the table",
"NOTIFICATION_AJOUT_METADONNEE": "ArchiveUnit metadata has been added",
"BOUTON_AJOUT_METADONNEE": "Add metadata",
......@@ -100,7 +106,6 @@
}
},
"LIST_PROFILE": {
"CREER_GERER_PROFILE_ARCHIVAGE": "create and manage archiving profiles",
"SEARCH_PLACEHOLDER": "Search for a profile by its title",
"CREER_NOUVEAU_PROFIL": "create a new profile",
"IMPORTER_PROFIL": "import a profile",
......
......@@ -40,6 +40,10 @@
"NOM_PUA": "Nom du profil d unité archivistique",
"NOM_PA": "Nom du profil d'archivage",
"PROFILE_ID": "Identifiant",
"BREADCRUMB":{
"PORTAIL": "Portail",
"CREER_ET_GERER_PROFIL": "Créer et gérer des profils documentaires"
},
"FILE_TREE": {
"AJOUTER_UA": "Ajouter une UA",
"AJOUTER_UA_ICON": "AJOUTER UNE UA",
......@@ -73,6 +77,8 @@
"POPUP_DUPLICATE_TITRE_TWO'": "son contenu et son paramétrage (cardinalités et commentaire)"
},
"FILE_TREE_METADATA": {
"PUA": "Profil d'Unité Archivistique",
"PA": "Profil d'Archivage",
"SEARCH_PLACEHOLDER": "Rechercher une métadonnée dans le tableau",
"NOTIFICATION_AJOUT_METADONNEE": "La métadonnée ArchiveUnit a été ajoutée",
"BOUTON_AJOUT_METADONNEE": "Ajouter une métadonnée",
......@@ -101,7 +107,6 @@
}
},
"LIST_PROFILE": {
"CREER_GERER_PROFILE_ARCHIVAGE": "créer et gérer des profils d’archivage",
"SEARCH_PLACEHOLDER": "Recherche un profil par son intitulé",
"CREER_NOUVEAU_PROFIL": "créer un nouveau profil",
"IMPORTER_PROFIL": "importer un profil",
......