Mise à jour de l'interface de la liste des collaborateurs : ajout des checkboxes des BU et d'une barre de recherche
parent
35126aeec8
commit
0a70fb0dbb
@ -1,38 +1,65 @@ |
||||
<app-nav-menu></app-nav-menu> |
||||
<h1> Liste des collaborateurs </h1> |
||||
|
||||
<!-- Affichage de la liste des collaborateurs --> |
||||
<mat-table matSort [dataSource]="dataSource"> |
||||
<ng-container matColumnDef="agence"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Agence</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.businessUnit.nom }}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="collaborateur"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Collabotareur</mat-header-cell> |
||||
<!--Créer un lien vers les détails du collaborateur--> |
||||
<mat-cell *matCellDef="let row" [routerLink]="['/collaborateurs', row.id]">{{row.prenom}} {{row.nom}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="dateembauche"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Date embauche</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{row.dateArrivee | date:'dd/MM/yyyy'}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="referent"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.referent.prenom }} {{ row.referent.nom }}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> |
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> |
||||
</mat-table> |
||||
|
||||
<mat-paginator #paginator |
||||
[length] = "taille" |
||||
[pageIndex]="numPage-1" |
||||
[pageSize]="parPage" |
||||
[pageSizeOptions]="pageOption" |
||||
(page)="pageEvent = updatePageInfo($event)" |
||||
> |
||||
</mat-paginator> |
||||
<ng-container *ngIf="chargement"> |
||||
<mat-spinner></mat-spinner> |
||||
</ng-container> |
||||
|
||||
<ng-container *ngIf="!chargement"> |
||||
|
||||
|
||||
<!-- Barre de recherche --> |
||||
<mat-form-field> |
||||
<mat-label>Rechercher un collaborateur</mat-label> |
||||
<input matInput type="text" [(ngModel)]="search" (keyup)="setSearch()"> |
||||
<mat-button *ngIf="search" matSuffix mat-icon-button aria-label="Clear" (click)="resetSearch()"> |
||||
<mat-icon>close</mat-icon> |
||||
</mat-button> |
||||
</mat-form-field> |
||||
|
||||
<!--Checkboxes des BU--> |
||||
<ul> |
||||
<li *ngFor="let bu of bus"> |
||||
<mat-checkbox (change)="updateCheckbox($event.checked,bu)" [checked]="true"> {{bu.nom}}</mat-checkbox> |
||||
</li> |
||||
</ul> |
||||
|
||||
<!-- Affichage de la liste des collaborateurs --> |
||||
<mat-table matSort [dataSource]="dataSource"> |
||||
<ng-container matColumnDef="agence"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Agence</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{ row.businessUnit.nom }}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="collaborateur"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Collabotareur</mat-header-cell> |
||||
<!--Créer un lien vers les détails du collaborateur--> |
||||
<mat-cell *matCellDef="let row" [routerLink]="['/collaborateurs', row.id]">{{row.prenom}} {{row.nom}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="dateembauche"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Date embauche</mat-header-cell> |
||||
<mat-cell *matCellDef="let row">{{row.dateArrivee | date:'dd/MM/yyyy'}}</mat-cell> |
||||
</ng-container> |
||||
|
||||
<ng-container matColumnDef="referent"> |
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell> |
||||
<mat-cell *matCellDef="let row"> |
||||
<p *ngIf="row.referent">{{ row.referent.prenom }} {{ row.referent.nom }}</p> |
||||
<p *ngIf="!row.referent"> Aucun référent</p> |
||||
</mat-cell> |
||||
</ng-container> |
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> |
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> |
||||
</mat-table> |
||||
|
||||
<mat-paginator #paginator |
||||
[length] = "taille" |
||||
[pageIndex]="numPage-1" |
||||
[pageSize]="parPage" |
||||
[pageSizeOptions]="pageOption" |
||||
(page)="pageEvent = updatePageInfo($event)" |
||||
> |
||||
</mat-paginator> |
||||
</ng-container> |
||||
|
Loading…
Reference in new issue