From d405118360b7356d86cd570ceb665d38cc1c17f7 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 3 May 2020 16:20:19 +0200 Subject: [PATCH] Bind expanded rows to item ids instead of row number --- .../video-redundancies-list.component.html | 1 + .../video-abuse-list/video-abuse-list.component.html | 1 + .../video-blacklist-list/video-blacklist-list.component.html | 1 + client/src/app/+admin/system/jobs/jobs.component.html | 2 +- .../src/app/+admin/users/user-list/user-list.component.html | 1 + .../my-account-video-imports.component.html | 1 + client/src/app/shared/rest/rest-table.ts | 5 +++++ 7 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html index debde2f85..99d8719a3 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html @@ -14,6 +14,7 @@ diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html index bf989cb4e..bf73f9169 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html @@ -3,6 +3,7 @@ [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports" + (onPage)="onPage()" [expandedRowKeys]="expandedRows" >
diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html index f0e83dae9..b3f7789df 100644 --- a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html +++ b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.html @@ -3,6 +3,7 @@ [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blacklisted videos" + (onPage)="onPage()" [expandedRowKeys]="expandedRows" >
diff --git a/client/src/app/+admin/system/jobs/jobs.component.html b/client/src/app/+admin/system/jobs/jobs.component.html index 0e31db547..05d573163 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.html +++ b/client/src/app/+admin/system/jobs/jobs.component.html @@ -21,7 +21,7 @@ diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html index e7624f48f..94c59cb9a 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.html +++ b/client/src/app/+admin/users/user-list/user-list.component.html @@ -13,6 +13,7 @@ [(selection)]="selectedUsers" [showCurrentPageReport]="true" i18n-currentPageReportTemplate currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users" + (onPage)="onPage()" [expandedRowKeys]="expandedRows" >
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html index 4b1856b51..7d447cdb3 100644 --- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html +++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html @@ -1,6 +1,7 @@ diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts index 891fb7b2b..4dd0f5ff3 100644 --- a/client/src/app/shared/rest/rest-table.ts +++ b/client/src/app/shared/rest/rest-table.ts @@ -13,6 +13,7 @@ export abstract class RestTable { search: string rowsPerPageOptions = [ 10, 20, 50, 100 ] rowsPerPage = this.rowsPerPageOptions[0] + expandedRows = {} private searchStream: Subject @@ -73,6 +74,10 @@ export abstract class RestTable { this.searchStream.next(target.value) } + onPage () { + this.expandedRows = {} + } + protected abstract loadData (): void private getSortLocalStorageKey () {