From e6492b2de61e5eef5ea9bc1bf19463c065f3f41d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Dec 2021 15:37:42 +0100 Subject: Remove unnecessary onPage event on admin tables --- .../followers-list/followers-list.component.html | 2 +- .../following-list/following-list.component.html | 2 +- .../video-redundancies-list.component.html | 2 +- .../instance-account-blocklist.component.html | 2 +- .../video-block-list/video-block-list.component.html | 2 +- .../video-comment-list.component.html | 3 +-- .../users/user-list/user-list.component.html | 2 +- .../+admin/overview/videos/video-list.component.html | 5 ++--- .../src/app/+admin/system/jobs/jobs.component.html | 4 ++-- .../my-video-imports/my-video-imports.component.html | 2 +- client/src/app/core/rest/rest-table.ts | 20 ++++---------------- .../abuse-list-table.component.html | 2 +- .../account-blocklist.component.html | 2 +- .../server-blocklist.component.html | 2 +- 14 files changed, 19 insertions(+), 33 deletions(-) diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html index 08459634d..1df7bb164 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.html +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html @@ -5,7 +5,7 @@ diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html index e3a3a8320..feade0c26 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html @@ -1,6 +1,6 @@
diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html index f9ab36f4a..9bf23c21a 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html +++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.html @@ -13,8 +13,7 @@ [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} comments" - (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" - [(selection)]="selectedComments" + [expandedRowKeys]="expandedRows" [(selection)]="selectedComments" >
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.html b/client/src/app/+admin/overview/users/user-list/user-list.component.html index d0cf21b73..7eb89fea1 100644 --- a/client/src/app/+admin/overview/users/user-list/user-list.component.html +++ b/client/src/app/+admin/overview/users/user-list/user-list.component.html @@ -9,7 +9,7 @@ [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users" - (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" + [expandedRowKeys]="expandedRows" >
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html index d1b1a527e..121bc502c 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.html +++ b/client/src/app/+admin/overview/videos/video-list.component.html @@ -5,12 +5,11 @@
diff --git a/client/src/app/+admin/system/jobs/jobs.component.html b/client/src/app/+admin/system/jobs/jobs.component.html index b68179a41..638d2380a 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.html +++ b/client/src/app/+admin/system/jobs/jobs.component.html @@ -34,10 +34,10 @@ diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html index 3897eb162..bd29b11c8 100644 --- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html +++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html @@ -8,7 +8,7 @@ [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} imports" - (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" + [expandedRowKeys]="expandedRows" > diff --git a/client/src/app/core/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts index a5b48f10c..d8b039187 100644 --- a/client/src/app/core/rest/rest-table.ts +++ b/client/src/app/core/rest/rest-table.ts @@ -47,11 +47,15 @@ export abstract class RestTable { field: event.sortField } + this.rowsPerPage = event.rows + this.pagination = { start: event.first, count: this.rowsPerPage } + this.expandedRows = {} + this.reloadData() this.saveSort() } @@ -60,22 +64,6 @@ export abstract class RestTable { peertubeLocalStorage.setItem(this.getSortLocalStorageKey(), JSON.stringify(this.sort)) } - onPage (event: { first: number, rows: number }) { - logger('On page %o.', event) - - if (this.rowsPerPage !== event.rows) { - this.rowsPerPage = event.rows - this.pagination = { - start: event.first, - count: this.rowsPerPage - } - - this.reloadData() - } - - this.expandedRows = {} - } - onSearch (search: string) { this.search = search this.reloadData() diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html index 0d75a21d7..07cc73461 100644 --- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html +++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html @@ -4,7 +4,7 @@ [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports" - (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" + [expandedRowKeys]="expandedRows" >
diff --git a/client/src/app/shared/shared-moderation/account-blocklist.component.html b/client/src/app/shared/shared-moderation/account-blocklist.component.html index a9fac0810..637abcb51 100644 --- a/client/src/app/shared/shared-moderation/account-blocklist.component.html +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.html @@ -5,7 +5,7 @@ diff --git a/client/src/app/shared/shared-moderation/server-blocklist.component.html b/client/src/app/shared/shared-moderation/server-blocklist.component.html index c6d29bb21..1a320e9a4 100644 --- a/client/src/app/shared/shared-moderation/server-blocklist.component.html +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.html @@ -5,7 +5,7 @@