Commit 18dd298f authored by Alex ORLUC's avatar Alex ORLUC

FEAT #12222 TIME 0:35 add filter action list + indexingmodels list

parent 99fa8070
......@@ -164,4 +164,24 @@
::ng-deep.menuAction {
min-width: 350px !important;
}
.menuTitle {
display: flex;
padding-left: 20px;
align-items: center;
color: $primary;
font-weight: bold;
}
.smallInput {
padding: 10px;
::ng-deep.mat-form-field-wrapper {
padding-bottom: 0px;
}
}
.private {
padding-left: 50px;
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import { DocumentViewerComponent } from '../viewer/document-viewer.component';
import { ConfirmComponent } from '../../plugins/modal/confirm.component';
import { AddPrivateIndexingModelModalComponent } from './private-indexing-model/add-private-indexing-model-modal.component';
import { ActionsService } from '../actions/actions.service';
import { SortPipe } from '../../plugins/sorting.pipe';
@Component({
templateUrl: "indexation.component.html",
......@@ -25,7 +26,7 @@ import { ActionsService } from '../actions/actions.service';
'indexation.component.scss',
'indexing-form/indexing-form.component.scss'
],
providers: [NotificationService, AppService, ActionsService],
providers: [NotificationService, AppService, ActionsService, SortPipe],
})
export class IndexationComponent implements OnInit {
......@@ -69,7 +70,8 @@ export class IndexationComponent implements OnInit {
public viewContainerRef: ViewContainerRef,
public appService: AppService,
public actionService: ActionsService,
private router: Router
private router: Router,
private sortPipe: SortPipe
) {
_activatedRoute.queryParams.subscribe(
......@@ -98,6 +100,7 @@ export class IndexationComponent implements OnInit {
this.currentIndexingModel = this.indexingModels[0];
this.notify.error(this.lang.noDefaultIndexingModel);
}
this.loadIndexingModelsList();
}
if (this.appService.getViewMode()) {
......@@ -142,6 +145,20 @@ export class IndexationComponent implements OnInit {
});
}
loadIndexingModelsList() {
let tmpIndexingModels:any[] = this.sortPipe.transform(this.indexingModels.filter(elem => elem.master === null), 'label');
let privateTmpIndexingModels:any[] = this.sortPipe.transform(this.indexingModels.filter(elem => elem.master !== null), 'label');
this.indexingModels = [];
tmpIndexingModels.forEach(indexingModel => {
this.indexingModels.push(indexingModel);
privateTmpIndexingModels.forEach(privateIndexingModel => {
if (privateIndexingModel.master === indexingModel.id) {
this.indexingModels.push(privateIndexingModel);
}
});
});
}
onSubmit() {
if (this.indexingForm.isValidForm()) {
const formatdatas = this.formatDatas(this.indexingForm.getDatas());
......@@ -227,6 +244,7 @@ export class IndexationComponent implements OnInit {
tap((data) => {
this.indexingModels.push(data.indexingModel);
this.currentIndexingModel = this.indexingModels.filter(indexingModel => indexingModel.id === data.indexingModel.id)[0];
this.loadIndexingModelsList();
}),
catchError((err: any) => {
this.notify.handleErrors(err);
......
......@@ -49,8 +49,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-note-resume [resId]="currentResourceInformations.resId"
(goTo)="currentTool = 'notes'"></app-note-resume>
<app-note-resume [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'notes'">
</app-note-resume>
</div>
</div>
<div class="banner" [style.borderColor]="currentPriorityColor">
......@@ -70,8 +70,8 @@
<div class="title-divider"></div>
</div>
<div class="content">
<app-mail-resume [resId]="currentResourceInformations.resId"
(goTo)="currentTool = 'mails'"></app-mail-resume>
<app-mail-resume [resId]="currentResourceInformations.resId" (goTo)="currentTool = 'mails'">
</app-mail-resume>
</div>
</div>
</ng-container>
......@@ -107,9 +107,18 @@
</span>
<i class="fa fa-chevron-down menu-icon"></i></button>
<mat-menu #menu="matMenu" [class]="'menuForm menuAction'">
<button mat-menu-item disabled style="text-align:center;"
(click)="$event.stopPropagation();">{{lang.actions}}</button>
<ng-container *ngFor="let action of actionsList">
<div class="menuTitle">
<span>
{{lang.actions}}
</span>
<mat-form-field floatLabel="never" appearance="outline" class="smallInput"
(click)="$event.stopPropagation();">
<input matInput id="searchTerm" placeholder="{{lang.filterBy}}" #listFilter
autocomplete="off" (click)="$event.stopPropagation();"
(keydown)="$event.stopPropagation()">
</mat-form-field>
</div>
<ng-container *ngFor="let action of actionsList | filterList:listFilter.value:'label'">
<button *ngIf="showActionInCurrentCategory(action)" mat-menu-item (click)="selectAction(action)"
[title]="action.label" [class.listModels-menu-selected]="action.id === selectedAction.id">
<span style="flex:1;">{{action.label}}</span>
......@@ -153,17 +162,22 @@
</div>
<div class="content-item">
<div>{{lang.chronoNumberShort}} :</div>
<div class="content-item-value" [title]="'N° '+this.currentResourceInformations.resId">{{this.currentResourceInformations.chrono}}</div>
<div class="content-item-value" [title]="'N° '+this.currentResourceInformations.resId">
{{this.currentResourceInformations.chrono}}</div>
</div>
<div class="content-item">
<div>{{lang.senders}} :</div>
<div class="content-item-value">??? <i class="fas fa-circle"
style="color:#00CB55;font-size: 8px;"></i></div>
</div>
<div class="content-item" *ngIf="this.currentResourceInformations.processLimitDate !== undefined">
<div class="content-item"
*ngIf="this.currentResourceInformations.processLimitDate !== undefined">
<ng-container
*ngIf="this.currentResourceInformations.closingDate !== null; else elseLimitDate">
<div style="font-weight: bold;" [title]="this.currentResourceInformations.closingDate | fullDate">{{this.lang.closed}} {{this.lang.onRange}} {{this.currentResourceInformations.closingDate | timeAgo}}&nbsp;&nbsp;<i
<div style="font-weight: bold;"
[title]="this.currentResourceInformations.closingDate | fullDate">
{{this.lang.closed}} {{this.lang.onRange}}
{{this.currentResourceInformations.closingDate | timeAgo}}&nbsp;&nbsp;<i
class="fa fa-lock"></i></div>
</ng-container>
<ng-template #elseLimitDate>
......
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