diff --git a/src/frontend/app/administration/history/batch/history-batch-administration.component.html b/src/frontend/app/administration/history/batch/history-batch-administration.component.html index 80d5b84422c1634703d99d6e470457382d94b686..36a8ce8c3e15ff52c30000c217fc864eae183102 100755 --- a/src/frontend/app/administration/history/batch/history-batch-administration.component.html +++ b/src/frontend/app/administration/history/batch/history-batch-administration.component.html @@ -118,6 +118,11 @@ <mat-paginator [length]="resultsLength" [pageSize]="10" [hidePageSize]="resultsLength === 0" [pageSizeOptions]="[10, 25, 50, 100, 150]" (page)="handlePageEvent($event)"> </mat-paginator> + <app-set-page + [paginator]="paginator" + [currentPage]="currentPage" + [pageLength]="pageLength"> + </app-set-page> <!--<app-select-page [class.noResult]="resultsLength === 0" [paginator]="paginatorHistoryList"></app-select-page>--> </span> </div> diff --git a/src/frontend/app/administration/history/batch/history-batch-administration.component.scss b/src/frontend/app/administration/history/batch/history-batch-administration.component.scss index 7fd5429d5694074ee54b15d33f97d3e536be1532..7003aaaf3cf61e24910c481f96bbec4a6e5fd2c0 100644 --- a/src/frontend/app/administration/history/batch/history-batch-administration.component.scss +++ b/src/frontend/app/administration/history/batch/history-batch-administration.component.scss @@ -76,4 +76,10 @@ background-color: white; bottom: 0; padding-right: 20px; +} + +.table-head-tool { + ::ng-deep .mat-paginator-range-actions { + margin-left: -60px; + } } \ No newline at end of file diff --git a/src/frontend/app/administration/history/batch/history-batch-administration.component.ts b/src/frontend/app/administration/history/batch/history-batch-administration.component.ts index 6c162984fb4620223a3d5d86787fdcac00c11bac..5b5058c8848d38bf8b8beb3de7264b0738bd4f41 100644 --- a/src/frontend/app/administration/history/batch/history-batch-administration.component.ts +++ b/src/frontend/app/administration/history/batch/history-batch-administration.component.ts @@ -61,6 +61,7 @@ export class HistoryBatchAdministrationComponent implements OnInit { resultsLength = 0; searchHistory = new UntypedFormControl(); + currentPage = new UntypedFormControl(); startDateFilter: any = ''; endDateFilter: any = ''; filterUrl: string = ''; @@ -81,6 +82,7 @@ export class HistoryBatchAdministrationComponent implements OnInit { subMenus: any[] = []; pageSize: number = 10; + pageLength: number = 0; private destroy$ = new Subject<boolean>(); @@ -153,6 +155,8 @@ export class HistoryBatchAdministrationComponent implements OnInit { this.isLoadingResults = false; data = this.processPostData(data); this.resultsLength = data.count; + this.currentPage.setValue(this.paginator.pageIndex + 1); + this.pageLength = Math.ceil(this.resultsLength / this.pageSize); this.headerService.setHeader(this.translate.instant('lang.administration') + ' ' + this.translate.instant('lang.historyBatch').toLowerCase(), '', ''); return data.history; }), diff --git a/src/frontend/app/app-common.module.ts b/src/frontend/app/app-common.module.ts index 0e340fe3811938a856ebd67c913100d04b52f536..566397d6766df2ce5ab592cc9f6b1dfa42c9772b 100755 --- a/src/frontend/app/app-common.module.ts +++ b/src/frontend/app/app-common.module.ts @@ -94,6 +94,7 @@ import { SelectPageComponent } from '@plugins/list/select-page/select-page.compo import { MailEditorComponent } from '@plugins/mail-editor/mail-editor.component'; import { SelectWithFilterComponent } from '@plugins/select-with-filter/select-with-filter.component'; import { FilterComponent } from '@plugins/select-with-filter/filter/filter.component'; +import { SetPageComponent } from '@plugins/list/set-page/set-page/set-page.component'; @NgModule({ @@ -163,6 +164,7 @@ import { FilterComponent } from '@plugins/select-with-filter/filter/filter.compo InputCorrespondentGroupComponent, MailSignaturesAdministrationComponent, SelectPageComponent, + SetPageComponent, MailEditorComponent, SelectWithFilterComponent, FilterComponent @@ -223,6 +225,7 @@ import { FilterComponent } from '@plugins/select-with-filter/filter/filter.compo ColorGithubModule, MailSignaturesAdministrationComponent, SelectPageComponent, + SetPageComponent, MailEditorComponent, SelectWithFilterComponent, FilterComponent diff --git a/src/frontend/app/history/history.component.html b/src/frontend/app/history/history.component.html index b01cf1b77f8b2eae612150b91f495f16528be510..e13d92d3926020d7b368bb331d39ab72e1de77e0 100755 --- a/src/frontend/app/history/history.component.html +++ b/src/frontend/app/history/history.component.html @@ -44,10 +44,15 @@ </button> <div class="table-head-tool"> <span style="position: relative;"> - <mat-paginator [length]="resultsLength" [hidePageSize]="resultsLength === 0" - [pageSizeOptions]="[10, 25, 50, 100, 150]" (page)="handlePageEvent($event)"> + <mat-paginator #paginatorHistoryList [length]="resultsLength" [hidePageSize]="resultsLength === 0" + [pageSizeOptions]="[10, 25, 50, 100, 150]" (page)="handlePageEvent($event)"> </mat-paginator> - <!--<app-select-page [class.noResult]="resultsLength === 0" [paginator]="paginatorHistoryList"></app-select-page>--> + <app-set-page + [paginator]="paginator" + [currentPage]="currentPage" + [pageLength]="pageLength"> + </app-set-page> + <!-- <app-select-page [class.noResult]="resultsLength === 0" [paginator]="paginatorHistoryList"></app-select-page> --> </span> </div> </div> diff --git a/src/frontend/app/history/history.component.scss b/src/frontend/app/history/history.component.scss index 610630749ae8e5e1a48fbda2bc4711351cab28a4..080c1f341b3e56ad59c767bf30a9eded51b4450f 100644 --- a/src/frontend/app/history/history.component.scss +++ b/src/frontend/app/history/history.component.scss @@ -79,4 +79,10 @@ background-color: white; bottom: 0; padding-right: 20px; +} + +.table-head-tool { + ::ng-deep .mat-paginator-range-actions { + margin-left: -60px; + } } \ No newline at end of file diff --git a/src/frontend/app/history/history.component.ts b/src/frontend/app/history/history.component.ts index f4e216d6283df1263374409cb3a1bf0373a5b2f5..02375ba3c5c039180f92f6e46f68f7f6dbe8feea 100644 --- a/src/frontend/app/history/history.component.ts +++ b/src/frontend/app/history/history.component.ts @@ -44,6 +44,7 @@ export class HistoryComponent implements OnInit { resultsLength = 0; searchHistory = new UntypedFormControl(); + currentPage = new UntypedFormControl(); startDateFilter: any = ''; endDateFilter: any = ''; filterUrl: string = ''; @@ -62,6 +63,7 @@ export class HistoryComponent implements OnInit { loadingFilters: boolean = true; pageSize: number = 10; + pageLength: number = 0; private destroy$ = new Subject<boolean>(); @@ -135,6 +137,8 @@ export class HistoryComponent implements OnInit { this.isLoadingResults = false; data = this.processPostData(data); this.resultsLength = data.count; + this.pageLength = Math.ceil(this.resultsLength / this.pageSize); + this.currentPage.setValue(this.paginator.pageIndex + 1); return data.history; }), catchError((err: any) => { diff --git a/src/frontend/service/functions.service.ts b/src/frontend/service/functions.service.ts index f93fb8fbe9caa8167c7b375eaadc8e8ba1b3724f..ac24e16ae0ec3222cd704822b017588c9739653d 100644 --- a/src/frontend/service/functions.service.ts +++ b/src/frontend/service/functions.service.ts @@ -18,7 +18,7 @@ export class FunctionsService { private datePipe: DatePipe ) { } - empty(value: any) { + empty(value: any): boolean { if (value === null || value === undefined) { return true; @@ -35,10 +35,19 @@ export class FunctionsService { } } - isDate(value: any) { + isDate(value: any): boolean { return value instanceof Date && !isNaN(value.valueOf()); } + isNumber(evt: any): boolean { + evt = (evt) ? evt : window.event; + const charCode = (evt.which) ? evt.which : evt.keyCode; + if (charCode > 31 && (charCode < 48 || charCode > 57)) { + return false; + } + return true; + } + formatFrenchDateToTechnicalDate(date: string) { if (!this.empty(date)) { let arrDate = date.split('-'); diff --git a/src/lang/lang-fr.json b/src/lang/lang-fr.json index a7478f145b8ffed4fdb5c56ac8aecdc157c2e1d2..ffe4ca9f219f781b7d3ef36fe7f3837447c7a2d3 100644 --- a/src/lang/lang-fr.json +++ b/src/lang/lang-fr.json @@ -2747,5 +2747,8 @@ "keepCopyForRedirection": "Garder les rôles en copie existants", "keepCopyForRedirectionDesc": "Permet de garder les utilisateurs en copie", "keepDestForRedirection": "Mettre en copie l'attributaire actuel ", - "keepDestForRedirectionDesc": "Permet de garder l'attributaire actuel en copie" + "keepDestForRedirectionDesc": "Permet de garder l'attributaire actuel en copie", + "updateWorkflowWarning": "La modification du circuit de visa peut entraîner l'apparition ou la disparition de certaines actions.", + "migrationProcessing": "<b>L'application n'est pas accessible en raison d'une migration en cours.</b> <br> La page sera rechargée après cette opération.", + "pageNotFound": "La page n'existe pas" }