aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-06-28 16:20:23 +0200
committerRigel Kent <sendmemail@rigelk.eu>2020-06-28 16:20:23 +0200
commit4c9e9d2ee9899ba48b86eda18d44638a78587ac5 (patch)
tree06395596d7dfdf6c9a93d0dbb5683ab3e26cf1fe /client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
parentafa4456c1a52b1dde78aa2ffb7b89000e6212392 (diff)
downloadPeerTube-4c9e9d2ee9899ba48b86eda18d44638a78587ac5.tar.gz
PeerTube-4c9e9d2ee9899ba48b86eda18d44638a78587ac5.tar.zst
PeerTube-4c9e9d2ee9899ba48b86eda18d44638a78587ac5.zip
align ownership change video list table with moderation tables
Diffstat (limited to 'client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
index 5167732c2..98360dfb3 100644
--- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
@@ -1,13 +1,15 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { Component, OnInit, ViewChild } from '@angular/core' 2import { Component, OnInit, ViewChild } from '@angular/core'
3import { Notifier, RestPagination, RestTable } from '@app/core' 3import { Notifier, RestPagination, RestTable } from '@app/core'
4import { Account, VideoOwnershipService } from '@app/shared/shared-main' 4import { VideoOwnershipService, Actor, Video, Account } from '@app/shared/shared-main'
5import { VideoChangeOwnership } from '@shared/models' 5import { VideoChangeOwnership } from '@shared/models'
6import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' 6import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component'
7import { getAbsoluteAPIUrl } from '@app/helpers'
7 8
8@Component({ 9@Component({
9 selector: 'my-account-ownership', 10 selector: 'my-account-ownership',
10 templateUrl: './my-account-ownership.component.html' 11 templateUrl: './my-account-ownership.component.html',
12 styleUrls: [ './my-account-ownership.component.scss' ]
11}) 13})
12export class MyAccountOwnershipComponent extends RestTable implements OnInit { 14export class MyAccountOwnershipComponent extends RestTable implements OnInit {
13 videoChangeOwnerships: VideoChangeOwnership[] = [] 15 videoChangeOwnerships: VideoChangeOwnership[] = []
@@ -32,8 +34,8 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
32 return 'MyAccountOwnershipComponent' 34 return 'MyAccountOwnershipComponent'
33 } 35 }
34 36
35 createByString (account: Account) { 37 switchToDefaultAvatar ($event: Event) {
36 return Account.CREATE_BY_STRING(account.name, account.host) 38 ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
37 } 39 }
38 40
39 openAcceptModal (videoChangeOwnership: VideoChangeOwnership) { 41 openAcceptModal (videoChangeOwnership: VideoChangeOwnership) {
@@ -56,7 +58,11 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit {
56 return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort) 58 return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort)
57 .subscribe( 59 .subscribe(
58 resultList => { 60 resultList => {
59 this.videoChangeOwnerships = resultList.data 61 this.videoChangeOwnerships = resultList.data.map(change => ({
62 ...change,
63 initiatorAccount: new Account(change.initiatorAccount),
64 nextOwnerAccount: new Account(change.nextOwnerAccount)
65 }))
60 this.totalRecords = resultList.total 66 this.totalRecords = resultList.total
61 }, 67 },
62 68