diff --git a/src/frontend/app/linkedResource/linked-resource-list.component.html b/src/frontend/app/linkedResource/linked-resource-list.component.html index 82b50597d07f9261030c8cabbc0c5abbc876239f..65c5d7ef4aeee20361684b50b0db3102f79d2897 100644 --- a/src/frontend/app/linkedResource/linked-resource-list.component.html +++ b/src/frontend/app/linkedResource/linked-resource-list.component.html @@ -22,10 +22,10 @@ <span title="{{lang[row.categoryId]}}">{{lang[row.categoryId]}}</span> </span> - <span class="sub-info-data col-md-4 text-center"> + <span class="sub-info-data col-md-4 text-center senders" (click)="openContact(row,'senders')"> <i class="fas fa-user" title="{{lang.contact}}"></i> - <span [title]="'Pierre BRUNEL'">Pierre BRUNEL</span> + <span [title]="row.senders">{{row.senders}}</span> </span> <span class="sub-info-data col-md-4 text-right"> <i class="fas fa-calendar" title="{{lang.creationDate}}"></i> diff --git a/src/frontend/app/linkedResource/linked-resource-list.component.scss b/src/frontend/app/linkedResource/linked-resource-list.component.scss index 0c8c819bb583cbe009f2f5f159588c259dc27f97..2c528905f0df5ab4eea3c7e0f75ef3d379a50c76 100644 --- a/src/frontend/app/linkedResource/linked-resource-list.component.scss +++ b/src/frontend/app/linkedResource/linked-resource-list.component.scss @@ -38,4 +38,11 @@ color: red; font-weight: bold; opacity: 0.6; +} + +.senders { + cursor: pointer; + &:hover { + color: $primary + } } \ No newline at end of file diff --git a/src/frontend/app/linkedResource/linked-resource-list.component.ts b/src/frontend/app/linkedResource/linked-resource-list.component.ts index 548ee9564565977cb02eac18eb7899e5206f28b3..4275c7831ec49d4cfa1249bcfe36c42e4efd5549 100644 --- a/src/frontend/app/linkedResource/linked-resource-list.component.ts +++ b/src/frontend/app/linkedResource/linked-resource-list.component.ts @@ -12,6 +12,7 @@ import { ConfirmComponent } from '../../plugins/modal/confirm.component'; import { MatDialog } from '@angular/material'; import { LinkResourceModalComponent } from './linkResourceModal/link-resource-modal.component'; import { FunctionsService } from '../../service/functions.service'; +import { ContactsListModalComponent } from '../contact/list/modal/contacts-list-modal.component'; declare function $j(selector: any): any; @@ -80,6 +81,14 @@ export class LinkedResourceListComponent implements OnInit { } else if (this.functions.empty(linkeRes[key]) && ['senders', 'recipients', 'attachments', 'hasDocument', 'confidentiality', 'visaCircuit'].indexOf(key) === -1) { linkeRes[key] = this.lang.undefined; } + + if (key === 'senders' && linkeRes[key].length > 1) { + if (linkeRes[key].length > 1) { + linkeRes[key] = linkeRes[key].length + ' ' + this.lang.contacts; + } else { + linkeRes[key] = linkeRes[key][0]; + } + } }); }); @@ -141,4 +150,8 @@ export class LinkedResourceListComponent implements OnInit { }) ).subscribe(); } + + openContact(row: any, mode: string) { + this.dialog.open(ContactsListModalComponent, { data: { title: `${row.chrono} - ${row.subject}`, mode: mode, resId: row.resId } }); + } }