From 40ab9910ed9966e4e92e05c98b6ec358a7644b2e Mon Sep 17 00:00:00 2001 From: Marlene Simondant <msimondant@grandlyon.com> Date: Tue, 18 Mar 2025 15:15:57 +0100 Subject: [PATCH] Update table following refining --- .../orientations-table.component.html | 16 ++++++++++++---- .../orientations-table.component.scss | 2 +- .../orientations-table.component.ts | 7 +++++++ 3 files changed, 20 insertions(+), 5 deletions(-) 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 e944670a5..3c4e3afcc 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 3b5f331b8..1fe2db390 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 3584a1017..d86227e1e 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 } }); -- GitLab