-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refact: [admin/users] modifie la section utilisateur de l’espace admi…
…nistration * restructuration du module adminstration en fragments / widgets
- Loading branch information
1 parent
f6011a6
commit a5bcb4d
Showing
14 changed files
with
87 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...licaction/src/app/admin/components/users/user-status-badge/user-status-badge.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...caction/src/app/admin/widgets/user-management-wiget/user-management-widget.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<app-users-table | ||
(userUpdate)="updateUser($event)" | ||
(paginationChange)="updateUserPageable($event)" | ||
(paginationChange)="updatePagination($event)" | ||
[loading]="loading" | ||
[title]="title" | ||
[pageable]="pageable" | ||
[users]="pageable.content" | ||
[rowsPerPages]="pageable.rowsPerPages" | ||
[page]="pageable.number" | ||
[totalPage]="pageable.totalPages" | ||
></app-users-table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
frontend-implicaction/src/app/shared/components/paginator/paginator.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<nav> | ||
<ul class="pagination justify-content-center align-items-end m-0"> | ||
<li *ngIf="!pageable.first" class="page-item cursor-pointer"> | ||
<li *ngIf="!first" class="page-item cursor-pointer"> | ||
<span | ||
class="page-link" | ||
tabindex="-1" | ||
(click)="changePage(pageable.number - 1)" | ||
(click)="changePage(page - 1)" | ||
>‹ préc</span> | ||
</li> | ||
<ng-container *ngFor="let _ of [].constructor(pageable?.totalPages); let index = index"> | ||
<ng-container *ngFor="let _ of [].constructor(totalPages); let index = index"> | ||
<li | ||
class="page-item" | ||
(click)="changePage(index)" | ||
[ngClass]="{'disabled': (pageable.number === index), 'cursor-pointer': (pageable.number !== index)}" | ||
[ngClass]="{'disabled': (page === index), 'cursor-pointer': (page !== index)}" | ||
> | ||
<a class="page-link" [ngClass]="{'disabled': (pageable.number === index)}">{{index + 1}}</a> | ||
<a class="page-link" [ngClass]="{'disabled': (page === index)}">{{index + 1}}</a> | ||
</li> | ||
</ng-container> | ||
<li *ngIf="!pageable.last" class="page-item cursor-pointer"> | ||
<a class="page-link" (click)="changePage(pageable.number + 1)">suiv ›</a> | ||
<li *ngIf="!last" class="page-item cursor-pointer"> | ||
<a class="page-link" (click)="changePage(page + 1)">suiv ›</a> | ||
</li> | ||
</ul> | ||
</nav> |
23 changes: 17 additions & 6 deletions
23
frontend-implicaction/src/app/shared/components/paginator/paginator.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
import {ChangeDetectionStrategy, Component, EventEmitter, Input, Output} from '@angular/core'; | ||
import {Pageable} from "../../models/pageable"; | ||
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges} from '@angular/core'; | ||
import {PaginationUpdate} from "../../models/pagination-update"; | ||
|
||
@Component({ | ||
selector: 'app-paginator', | ||
templateUrl: './paginator.component.html', | ||
styleUrls: ['./paginator.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class PaginatorComponent { | ||
export class PaginatorComponent implements OnChanges { | ||
|
||
@Input() pageable: Pageable<any>; | ||
@Input() page: number; | ||
@Input() totalPages: number; | ||
|
||
@Output() pageChange = new EventEmitter<number>(); | ||
@Output() pageChange = new EventEmitter<PaginationUpdate>(); | ||
|
||
first: boolean; | ||
last: boolean; | ||
|
||
ngOnChanges(changes: SimpleChanges): void { | ||
if (changes.hasOwnProperty('page') || changes.hasOwnProperty('totalPages')) { | ||
this.first = !this.page | ||
this.last = this.page >= (this.totalPages - 1); | ||
} | ||
} | ||
|
||
changePage(page: number): void { | ||
this.pageChange.emit(page); | ||
this.pageChange.emit({page}); | ||
} | ||
} |
Oops, something went wrong.