diff --git a/src/frontend/app/list/basket-list.component.html b/src/frontend/app/list/basket-list.component.html index 6b5f5ad5e31b0838446a87c8c668272d43795b07..c3d41115d68a50d823aa57483ed4c390aac85c46 100644 --- a/src/frontend/app/list/basket-list.component.html +++ b/src/frontend/app/list/basket-list.component.html @@ -28,33 +28,23 @@ <ng-container matColumnDef="res_id"> <td mat-cell *matCellDef="let row" class="resultContainer" [class.resultContainer-mobile]="mobileMode"> <!-- Secondary Info Line --> - <mat-toolbar *ngIf="displayedSecondaryData.length > 0"> - <div class="resultCol {{data.class}}" *ngFor="let data of displayedSecondaryData"> - <span *ngIf="data.id == 'status_label'"> - <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" - title="{{row.status_label}} ({{row.status_id}})"></mat-icon><br /> - </span> - <span *ngIf="data.id == 'alt_identifier'"> - <span *ngIf="row[data.id] == lang.undefined && row.barcode != null" style="color: rgba(0,0,0,0.4);font-size: 90%;"><i - class="fas fa-barcode"></i> {{row.barcode}}</span> - <span *ngIf="row[data.id] != lang.undefined" style="color: rgba(0,0,0,0.4);font-size: 90%;cursor: crosshair;" - (click)="$event.stopPropagation();filterThis(row[data.id])">{{row[data.id]}}</span> - </span> - <ng-container *ngIf="data.id == 'date'"> - <i class="fa fa-calendar" title="{{lang.creationDate}}"></i> {{row.creation_date + <mat-toolbar *ngIf="row.display.length > 0"> + <div class="resultCol" style="flex:1" [class]="data.cssClasses.join(' ')" *ngFor="let data of row.display"> + <ng-container *ngIf="data.value == 'getCreationAndProcessLimitDates'"> + <i class="fa fa-calendar" title="{{lang.creationDate}}"></i> {{data.displayValue[0] | timeAgo}} - <i class="fa fa-stopwatch" title="{{lang.processLimitDate}}"></i> <span - [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span> + [innerHTML]="data.displayValue[1] | timeLimit" title='{{data.displayValue[1] | date : "le dd/MM/y à HH:mm"}}'></span> </ng-container> <ng-container *ngIf="data.icon != ''"> - <i class="{{data.icon}}"></i> + <i class="fa {{data.icon}}" title="{{data.label}}"></i> </ng-container> - <ng-container *ngIf="data.id == 'category_id'"> - <span *ngIf="!lang[row.category_id]" style="opacity: 0.5" title="id: {{row.category_id}}">_UNDEFINED</span> - <span *ngIf="lang[row.category_id]" title="{{row[data.id]}}">{{lang[row.category_id]}}</span> + <ng-container *ngIf="data.value == 'getCategory'"> + <span *ngIf="!lang[data.displayValue]" style="opacity: 0.5" title="id: {{data.displayValue}}">_UNDEFINED</span> + <span *ngIf="lang[data.displayValue]">{{lang[data.displayValue]}}</span> </ng-container> - <ng-container *ngIf="data.id != 'status_label' && data.id != 'date' && data.id != 'category_id'"> - <span [class.undefined]="row[data.id] == lang.undefined" title="{{row[data.id]}}" >{{row[data.id] | shorten: 150: '...'}}</span> + <ng-container *ngIf="data.value != 'getCategory' && data.value != 'getCreationAndProcessLimitDates'"> + <span *ngIf="lang[row.category_id]">{{data.displayValue}}</span> </ng-container> </div> </mat-toolbar> @@ -63,32 +53,18 @@ <div *ngIf="!mobileMode" class="checkThis"> <mat-checkbox color="primary" [checked]="row.checked" (change)="toggleRes($event,row.res_id)" (click)="$event.stopPropagation();"></mat-checkbox> </div> - <div class="resultCol {{data.class}}" *ngFor="let data of displayedMainData"> - <span *ngIf="data.id == 'alt_identifier'"> - <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" - title="{{row.status_label}} ({{row.status_id}})" style="cursor: crosshair;" + <div class="resultCol" [class]="data.cssClasses.join(' ')" *ngFor="let data of displayedMainData"> + <span *ngIf="data.value == 'alt_identifier'"> + <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}} {{row.statusImage}} {{row.statusImage.charAt(0)}}{{row.statusImage.charAt(1)}}-2x" + title="{{row.statusLabel}}" style="cursor: crosshair;" (click)="$event.stopPropagation();filterThis(row.status_label)"></mat-icon><br /> - <span *ngIf="row[data.id] == lang.undefined && row.barcode != null" style="color: rgba(0,0,0,0.4);font-size: 90%;"><i + <span *ngIf="row[data.value] == lang.undefined && row.barcode != null" style="color: rgba(0,0,0,0.4);font-size: 90%;"><i class="fas fa-barcode"></i> {{row.barcode}}</span> - <span *ngIf="row[data.id] != lang.undefined" style="color: rgba(0,0,0,0.4);font-size: 90%;cursor: crosshair;" - (click)="$event.stopPropagation();filterThis(row[data.id])">{{row[data.id]}}</span> + <span *ngIf="row[data.value] != lang.undefined" style="color: rgba(0,0,0,0.4);font-size: 90%;cursor: crosshair;" + (click)="$event.stopPropagation();filterThis(row[data.value])">{{row[data.value]}}</span> </span> - <ng-container *ngIf="data.id == 'date'"> - <i class="fa fa-calendar" title="{{lang.creationDate}}"></i> {{row.creation_date - | timeAgo}} - <i class="fa fa-stopwatch" title="{{lang.processLimitDate}}"></i> <span - [innerHTML]="row.process_limit_date | timeLimit" *ngIf="row.process_limit_date != null" - title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span> - </ng-container> - <ng-container *ngIf="data.icon != ''"> - <i class="{{data.icon}}"></i> - - </ng-container> - <ng-container *ngIf="data.id == 'category_id'"> - <span *ngIf="!lang[row.category_id]" style="opacity: 0.5" title="id: {{row.category_id}}">_UNDEFINED</span> - <span *ngIf="lang[row.category_id]" title="{{row[data.id]}}">{{lang[row.category_id]}}</span> - </ng-container> - <ng-container *ngIf="data.id != 'status_label' && data.id != 'date' && data.id != 'category_id' && data.id != 'alt_identifier'"> - <span [class.undefined]="row[data.id] == lang.undefined" title="{{row[data.id]}}" >{{row[data.id] | shorten: 150: '...'}}</span> + <ng-container *ngIf="data.value != 'alt_identifier'"> + <span [class.undefined]="row[data.value] == lang.undefined" title="{{row[data.value]}}" >{{row[data.value] | shorten: 150: '...'}}</span> </ng-container> </div> <mat-button-toggle-group #group="matButtonToggleGroup" class="actions" multiple> diff --git a/src/frontend/app/list/basket-list.component.scss b/src/frontend/app/list/basket-list.component.scss index 8cf1c77020fcac9d5128ac9ea26044c64f4526e0..49028127e344145eaeae080f0061612ff00aefe4 100644 --- a/src/frontend/app/list/basket-list.component.scss +++ b/src/frontend/app/list/basket-list.component.scss @@ -99,22 +99,34 @@ mat-toolbar { background: #F99830; } -.smallFontData { - font-size: 10px; -} - -.centerData { +.align_centerData { text-align: center; -} - -.rightData { + } + + .align_rightData { text-align: right; -} - -.softColorData { - color: #666; -} + } + + .boldFontData { + font-weight: bold; + } + + .bigFontData { + font-size: 14px; + } + + .smallFontData { + font-size: 10px; + } + + .normalData { + flex: 1; + } -.longData { + .chronoData { + width: 150px; + } + + .longData { flex: 3; -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/frontend/app/list/basket-list.component.ts b/src/frontend/app/list/basket-list.component.ts index 15271195f32184291b7e95d16c4d44fefc5e16ab..47e09b00480ade8e453131d621f250c3ecbfdd6d 100755 --- a/src/frontend/app/list/basket-list.component.ts +++ b/src/frontend/app/list/basket-list.component.ts @@ -49,50 +49,17 @@ export class BasketListComponent implements OnInit { displayedMainData: any = [ { - 'id': 'alt_identifier', - 'class': 'softColorData centerData', + 'value': 'alt_identifier', + 'cssClasses': ['softColorData', 'align_centerData', 'chronoData'], 'icon': '' }, { - 'id': 'subject', - 'class': 'longData', + 'value': 'subject', + 'cssClasses': ['longData'], 'icon': '' } ]; - - //displayedSecondaryData: any = []; - displayedSecondaryData: any = [ - { - 'id': 'priority_label', - 'class': '', - 'icon': '' - }, - { - 'id': 'category_id', - 'class': '', - 'icon': '' - }, - { - 'id': 'doctype_label', - 'class': '', - 'icon': 'fa fa-file' - }, - { - 'id': 'senders', - 'class': '', - 'icon': '' - }, - { - 'id': 'recipients', - 'class': '', - 'icon': '' - }, - { - 'id': 'date', - 'class': 'rightData', - 'icon': '' - }, - ]; + displayedSecondaryData: any = []; resultListDatabase: ResultListHttpDao | null; data: any; @@ -251,20 +218,33 @@ export class BasketListComponent implements OnInit { } processPostData(data: any) { + this.displayedSecondaryData = []; data.resources.forEach((element: any) => { Object.keys(element).forEach((key) => { - if ((element[key] == null || element[key] == '') && ['process_limit_date', 'creation_date', 'closing_date', 'countAttachments', 'countNotes'].indexOf(key) === -1) { + if (key == 'statusImage' && element[key] == null) { + element[key] = 'fa-question undefined'; + } else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display'].indexOf(key) === -1) { element[key] = this.lang.undefined; - } else if (["senders", "recipients"].indexOf(key) > 0) { - if (element[key].length > 1) { - element[key] = this.lang.isMulticontact; + } + }); + element.display.forEach((key: any) => { + if ((key.displayValue == null || key.displayValue == '') && ['getCreationAndProcessLimitDates'].indexOf(key.value) === -1) { + key.displayValue = this.lang.undefined; + + } else if (["getSenders", "getRecipients"].indexOf(key.value) > 0) { + if (key.displayValue.length > 1) { + key.displayValue = this.lang.isMulticontact; } else { - element[key] = element[key][0]; + key.displayValue = key.displayValue[0]; } - } else if (key == 'status_icon' && element[key] == null) { - element[key] = 'fa-question undefined'; + } else if(key.value == 'getCreationAndProcessLimitDates') { + key.icon = ''; + key.displayValue = [ + '2019-02-10', + '2019-02-13' + ] } - + key.label = this.lang[key.value]; }); if (this.selectedRes.indexOf(element['res_id']) === -1) {