diff --git a/src/frontend/app/search/criteria-tool/criteria-tool.component.ts b/src/frontend/app/search/criteria-tool/criteria-tool.component.ts index c570c43cc15e22f4dc8e55e1d5eb2abbf86ad1f4..bd688077acda8d3594d59d26a1df2de755cd3ab1 100644 --- a/src/frontend/app/search/criteria-tool/criteria-tool.component.ts +++ b/src/frontend/app/search/criteria-tool/criteria-tool.component.ts @@ -457,6 +457,7 @@ export class CriteriaToolComponent implements OnInit { } set_attachment_type_field(elem: any) { + elem.values = []; return new Promise((resolve, reject) => { this.http.get('../rest/attachmentsTypes').pipe( tap((data: any) => { @@ -499,6 +500,7 @@ export class CriteriaToolComponent implements OnInit { } set_destination_field(elem: any) { + elem.values = []; return new Promise((resolve, reject) => { this.http.get(`../rest/indexingModels/entities`).pipe( tap((data: any) => { @@ -527,6 +529,7 @@ export class CriteriaToolComponent implements OnInit { } set_initiator_field(elem: any) { + elem.values = []; return new Promise((resolve, reject) => { this.http.get(`../rest/indexingModels/entities`).pipe( tap((data: any) => { diff --git a/src/frontend/app/search/result-list/search-result-list.component.html b/src/frontend/app/search/result-list/search-result-list.component.html index d0e62edf060ac2e8def3b14a9dc266eb641e86fc..a0c6085b11dcfc4978b030ac152510dc02b733ed 100644 --- a/src/frontend/app/search/result-list/search-result-list.component.html +++ b/src/frontend/app/search/result-list/search-result-list.component.html @@ -119,10 +119,12 @@ <ng-container *ngIf="row.closing_date == this.translate.instant('lang.undefined')"> <i class="fa fa-calendar" title="{{'lang.creationDate' | translate}}"></i> <span + [class.highlightResult]="data.displayValue.creationDateHighlighted" [innerHTML]="data.displayValue.creationDate | timeAgo" title='{{data.displayValue.creationDate | fullDate}}'></span> - <i class="fa fa-stopwatch" title="{{'lang.processLimitDate' | translate}}"></i> <span + [class.highlightResult]="data.displayValue.processLimitDateHighlighted" [innerHTML]="data.displayValue.processLimitDate | timeLimit" title='{{data.displayValue.processLimitDate | fullDate}}'></span> </ng-container> @@ -158,9 +160,9 @@ <mat-icon [ngClass]="[row.mailTracking === true ? 'fas fa-star' : 'far fa-star']" style="margin-bottom: 5px;"></mat-icon> </button> - <span style="cursor:pointer;" class="main-info-status" (click)="launch(row);"> + <span style="cursor:pointer;" [class.highlightResultIcon]="row.inStatus" class="main-info-status" (click)="launch(row);"> <mat-icon *ngIf="row.isLocked !== true" title="{{row.statusLabel}}" - [ngStyle]="{'color': row.priorityColor}" [class.highlightResult]="row.inStatus" style="width: 100%;" color="primary" + [ngStyle]="{'color': row.priorityColor}" style="width: 100%;" color="primary" class="{{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}} {{row.statusImage}} {{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}}-2x"> </mat-icon> <span *ngIf="row.confidentiality === 'Y'" @@ -186,25 +188,27 @@ [class.undefined]="row.subject == this.translate.instant('lang.undefined')" title="{{row.subject}}" [innerHTML]="row.subject | shorten: 150: '...'"></span> <span *ngIf="sidenavRight !== undefined" class="main-info-action"> - <button mat-icon-button title="{{'lang.notes' | translate}}" + <button mat-icon-button [class.highlightResultIcon]="row.inNotes" title="{{'lang.notes' | translate}}" (click)="$event.stopPropagation();togglePanel('note',row)" [class.noData]="row.countNotes == 0"> <mat-icon matBadgeHidden="{{row.countNotes == 0}}" fontSet="fas" - matBadge="{{row.countNotes}}" [class.highlightResult]="row.inNotes" fontIcon="fa-comments fa-2x" + matBadge="{{row.countNotes}}" fontIcon="fa-comments fa-2x" [color]="sidenavRight.opened && row.checked && currentMode == 'note' ? 'primary' : ''"> </mat-icon> </button> <button mat-icon-button title="{{'lang.attachments' | translate}}" + [class.highlightResultIcon]="row.inAttachments" (click)="$event.stopPropagation();togglePanel('attachment',row)" [class.noData]="row.countAttachments == 0"> <mat-icon matBadgeHidden="{{row.countAttachments == 0}}" fontSet="fas" - matBadge="{{row.countAttachments}}" [class.highlightResult]="row.inAttachments" fontIcon="fa-paperclip fa-2x" + matBadge="{{row.countAttachments}}" fontIcon="fa-paperclip fa-2x" [color]="sidenavRight.opened && row.checked && currentMode == 'attachment' ? 'primary' : ''"> </mat-icon> </button> <button mat-icon-button title="{{'lang.diffusionList' | translate}}" + [class.highlightResultIcon]="row.inDiffusions" (click)="$event.stopPropagation();togglePanel('diffusion',row)"> - <mat-icon fontSet="fas" fontIcon="fa-sitemap fa-2x" [class.highlightResult]="row.inDiffusions" + <mat-icon fontSet="fas" fontIcon="fa-sitemap fa-2x" [color]="sidenavRight.opened && row.checked && currentMode == 'diffusion' ? 'primary' : ''"> </mat-icon> </button> diff --git a/src/frontend/app/search/result-list/search-result-list.component.scss b/src/frontend/app/search/result-list/search-result-list.component.scss index 101229e3cbfc16815072ea260bad334836c263db..50d1994e4a14d6e3d0326c6f7908d24e661569d7 100644 --- a/src/frontend/app/search/result-list/search-result-list.component.scss +++ b/src/frontend/app/search/result-list/search-result-list.component.scss @@ -123,8 +123,8 @@ } .highlightResultIcon { - font-size: 25px; - color: #FFFF00; + border-radius: 20px; + background: #FF0; } .align_leftData { diff --git a/src/frontend/app/search/result-list/search-result-list.component.ts b/src/frontend/app/search/result-list/search-result-list.component.ts index c1e24c160dfe2f17658555f6c161acc306e83003..4e38ed4c5c99f2809940f829b45e20cec1b14c5a 100644 --- a/src/frontend/app/search/result-list/search-result-list.component.ts +++ b/src/frontend/app/search/result-list/search-result-list.component.ts @@ -402,6 +402,9 @@ export class SearchResultListComponent implements OnInit, OnDestroy { processPostData(data: any) { data.resources.forEach((element: any) => { + if (Object.keys(this.criteria).filter((crit) => crit.indexOf('role_') > -1).length > 0) { + element['inDiffusions'] = true; + } // Process main datas Object.keys(element).forEach((key) => { if (key === 'statusImage' && element[key] == null) { @@ -409,14 +412,21 @@ export class SearchResultListComponent implements OnInit, OnDestroy { } else if ((element[key] == null || element[key] === '') && ['closingDate', 'countAttachments', 'countNotes', 'display', 'mailTracking', 'hasDocument'].indexOf(key) === -1) { element[key] = this.translate.instant('lang.undefined'); } + + // HighLight data if (Object.keys(this.criteria).indexOf(key) > -1) { element[key] = this.highlightPipe.transform(element[key], this.criteria[key].values); } else if (['subject', 'chrono', 'resId'].indexOf(key) > -1 && Object.keys(this.criteria).indexOf('meta') > -1) { element[key] = this.highlightPipe.transform(element[key], this.criteria['meta'].values); } - - if (key === 'status' && !this.functions.empty(this.criteria[key])) { - element['inStatus'] = this.criteria[key].map((item: any) => item.label).indexOf(element[key]) > -1; + if (key === 'countAttachments' && Object.keys(this.criteria).indexOf('attachment_type') > -1) { + element['inAttachments'] = true; + } + if (key === 'countNotes' && Object.keys(this.criteria).indexOf('notes') > -1) { + element['inNotes'] = true; + } + if (key === 'statusLabel' && Object.keys(this.criteria).indexOf('status') > -1) { + element['inStatus'] = true; } }); // Process secondary datas @@ -510,12 +520,10 @@ export class SearchResultListComponent implements OnInit, OnDestroy { } key.label = key.displayLabel === undefined ? this.translate.instant('lang.' + key.value) : key.displayLabel; + // HighLight sub data key.displayValue = this.setHighLightData(key); }); - // element['inNotes'] = true; - // element['inNotes'] = true; - // element['inAttachments'] = true; element['checked'] = this.selectedRes.indexOf(element['resId']) !== -1; }); @@ -544,6 +552,13 @@ export class SearchResultListComponent implements OnInit, OnDestroy { data.displayValue = this.highlightPipe.transform(data.displayValue, val.label.replace(/ /g, '')); }); } + } else if (data.value === 'getCreationAndProcessLimitDates') { + if (Object.keys(this.criteria).indexOf('creationDate') > -1) { + data.displayValue.creationDateHighlighted = true; + } + if (Object.keys(this.criteria).indexOf('processLimitDate') > -1) { + data.displayValue.processLimitDateHighlighted = true; + } } else if (data.value.match(regex) !== null && Object.keys(this.criteria).indexOf(data.value) > -1) { if (Array.isArray(this.criteria[data.value].values)) { this.criteria[data.value].values.forEach((val: any) => {