diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.html b/src/app/profile/dashboard/orientations-table/orientations-table.component.html index e944670a57153315fc211fa7e9714ed987137389..3c4e3afcc898eb58da7c8e424dc8e59f2798864b 100644 --- a/src/app/profile/dashboard/orientations-table/orientations-table.component.html +++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.html @@ -13,8 +13,8 @@ class="row" tabindex="0" [ngClass]="{ - new: this.orientationService.daysAgo(orientation.createdAt) <= 14 && orientation.status === 'new', - urgent: this.orientationService.daysAgo(orientation.createdAt) > 14 && orientation.status === 'new', + new: !isUrgent(orientation) && orientation.status === 'new', + urgent: isUrgent(orientation), }" [attr.aria-label]=" 'Ouvrir l orientation de ' + orientation.personOriented.name + ' ' + orientation.personOriented.surname @@ -84,9 +84,17 @@ *ngIf="orientation.status" [label]="this.orientationService.getTagProperty('status', orientation.status, 'label')" [size]="'small'" - [color]="this.orientationService.getTagProperty('status', orientation.status, 'color')" + [color]=" + isUrgent(orientation) + ? 'orange' + : this.orientationService.getTagProperty('status', orientation.status, 'color') + " [iconFolder]="'tags'" - [iconName]="this.orientationService.getTagProperty('status', orientation.status, 'icon')" + [iconName]=" + isUrgent(orientation) + ? 'warning' + : this.orientationService.getTagProperty('status', orientation.status, 'icon') + " /> </div> <div> diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.scss b/src/app/profile/dashboard/orientations-table/orientations-table.component.scss index 3b5f331b856ac6adc8be914d55cbff21d405cdad..1fe2db390d4fa4264f4460f5106a592bdfd435fd 100644 --- a/src/app/profile/dashboard/orientations-table/orientations-table.component.scss +++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.scss @@ -36,7 +36,7 @@ } } &.urgent { - border-color: $red-dark; + border-color: $orange; } &:hover { border-color: $grey-1; diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts index 3584a101709f6fee910e5b60a791f1046180b035..d86227e1e9b35b0d90a291eb252ceaec7288e102 100644 --- a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts +++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts @@ -16,6 +16,13 @@ export class OrientationsTableComponent { @Input() orientations: any[]; @Input() from: string; + public isUrgent(orientation): boolean { + return ( + this.orientationService.daysAgo(orientation.updatedAt) > 14 && + (orientation.status === 'new' || orientation.status === 'waiting') + ); + } + public navigateToDetails(event: Event, orientationId: string): void { event.preventDefault(); this.router.navigate(['/profil/details-orientation', orientationId], { queryParams: { from: this.from } });