Verified Commit 8cb44085 authored by Alex ORLUC's avatar Alex ORLUC

FEAT #11642 TIME 2 add filter in folder menu + add var lang

parent 4c517c27
......@@ -184,6 +184,10 @@ export class FolderActionListComponent implements OnInit {
goTo(basket: any) {
this.router.navigate(['/basketList/users/' + this.headerService.user.id + '/groups/' + basket.groupId + '/baskets/' + basket.basketId], { queryParams: { chrono: '"' + this.contextMenuTitle + '"' } });
if (this.contextMenuTitle !== this.lang.undefined) {
this.router.navigate(['/basketList/users/' + this.headerService.user.id + '/groups/' + basket.groupId + '/baskets/' + basket.basketId], { queryParams: { chrono: '"' + this.contextMenuTitle + '"' } });
} else {
this.router.navigate(['/basketList/users/' + this.headerService.user.id + '/groups/' + basket.groupId + '/baskets/' + basket.basketId]);
}
}
}
......@@ -10,6 +10,9 @@
<span>{{lang.classifyIn}}</span>
</button>
<mat-menu #folders="matMenu" [class]="'folderListMenu'">
<plugin-autocomplete [labelPlaceholder]="lang.searchFolder" [size]="'small'"
[routeDatas]="['/rest/autocomplete/folders']" [targetSearchKey]="'idToDisplay'"
(triggerEvent)="classifyDocuments($event)"></plugin-autocomplete>
<button *ngIf="foldersList.length === 0" mat-menu-item class="noFolder" disabled>{{lang.noAvailableFolder}}</button>
<button mat-menu-item *ngFor="let folder of foldersList | sortBy : 'label'" class="labelFolder" (click)="classifyDocuments(folder)" [title]="folder.label"><i class="fa fa-users private" *ngIf="folder.public" title="{{lang.sharedFolder}}"></i> {{folder.label}}</button>
</mat-menu>
\ No newline at end of file
......@@ -59,7 +59,7 @@ export class FolderMenuComponent implements OnInit {
}
unclassifyDocuments(folder: any) {
this.dialogRef = this.dialog.open(ConfirmComponent, { autoFocus: false, disableClose: true, data: { title: this.lang.delete, msg: 'Voulez-vous enlever <b>' + this.resIds.length + '</b> document(s) du classement ?' } });
this.dialogRef = this.dialog.open(ConfirmComponent, { autoFocus: false, disableClose: true, data: { title: this.lang.delete, msg: this.lang.unclassifyQuestion + ' <b>' + this.resIds.length + '</b>&nbsp;' + this.lang.mailsInFolder + ' ?' } });
this.dialogRef.afterClosed().pipe(
filter((data: string) => data === 'ok'),
......
......@@ -1071,4 +1071,6 @@ export const LANG_EN = {
"classify" : "Classify",
"mailClassified" : "Mail(s) classified",
"noAvailableFolder" : "No available folder",
"unclassifyQuestion" : "Do you want to unclassify",
"mailsInFolder" : "mail(s) in folder",
};
......@@ -1108,4 +1108,6 @@ export const LANG_FR = {
"classify" : "Classer",
"mailClassified" : "Courrier(s) classé(s)",
"noAvailableFolder" : "Aucun dossier disponible",
"unclassifyQuestion" : "Voulez-vous retirer",
"mailsInFolder" : "élément(s) du dossier",
};
......@@ -1097,4 +1097,6 @@ export const LANG_NL = {
"classify" : "Classify", //_TO_TRANSLATE
"mailClassified" : "Mail(s) classified", //_TO_TRANSLATE
"noAvailableFolder" : "No available folder", //_TO_TRANSLATE
"unclassifyQuestion" : "Do you want to unclassify", //_TO_TRANSLATE
"mailsInFolder" : "mail(s) in folder", //_TO_TRANSLATE
};
<form>
<mat-form-field [class.smallInput]="size === 'small'" [appearance]="singleMode !== undefined ? 'standard' : 'outline'">
<mat-form-field [class.smallInput]="size === 'small'"
[appearance]="singleMode !== undefined ? 'standard' : 'outline'">
<mat-label *ngIf="singleMode !== undefined">{{placeholder}}</mat-label>
<mat-icon *ngIf="size === 'default'" color="primary" class="fa fa-search" matPrefix></mat-icon>
<input type="text" #autoCompleteInput [placeholder]="singleMode !== undefined ? '' : placeholder" aria-label="Number" matInput [formControl]="myControl"
[matAutocomplete]="auto" (click)="$event.stopPropagation()" (focus)="resetAutocomplete()" [required]="required">
<input type="text" #autoCompleteInput [placeholder]="singleMode !== undefined ? '' : placeholder"
aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto" (click)="$event.stopPropagation()"
(focus)="resetAutocomplete()" [required]="required">
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectOpt($event)">
<mat-optgroup [label]="optGroupLabel" *ngIf="options.length > 0 && !loading">
<ng-container *ngIf="options.length > 0 && !loading">
<mat-option *ngFor="let option of filteredOptions | async | sortBy: key" [value]="option">
<mat-icon *ngIf="type[option['type']]" class="autcompleteIcon fas {{type[option['type']]}}" color="primary"></mat-icon>&nbsp;<span color="primary">{{option[key]}}</span>&nbsp;<small>{{option[subInfoKey]}}</small>
<mat-icon *ngIf="type[option['type']]" class="autcompleteIcon fas {{type[option['type']]}}" color="primary">
</mat-icon>&nbsp;<span color="primary">{{option[key]}}</span>&nbsp;<small>{{option[subInfoKey]}}</small>
</mat-option>
</mat-optgroup>
<mat-option *ngIf="options.length === 0 && !loading" disabled [innerHTML]="listInfo">
</ng-container>
<mat-option *ngIf="options.length === 0 && !loading" [class.smallInputInfo]="size === 'small'" disabled
[innerHTML]="listInfo">
</mat-option>
<mat-option *ngIf="loading" disabled>
<mat-spinner diameter="20"></mat-spinner>
......
......@@ -33,4 +33,12 @@
padding : 0px;
padding-bottom: 5px;
}
}
.smallInputInfo {
font-size: 9px;
white-space: normal;
line-height: 13px;
display: table-cell;
vertical-align: middle;
}
\ No newline at end of file
Markdown is supported
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