From 4c9e9d2ee9899ba48b86eda18d44638a78587ac5 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 28 Jun 2020 16:20:23 +0200 Subject: align ownership change video list table with moderation tables --- .../my-account-ownership.component.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts') 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 @@ import { SortMeta } from 'primeng/api' import { Component, OnInit, ViewChild } from '@angular/core' import { Notifier, RestPagination, RestTable } from '@app/core' -import { Account, VideoOwnershipService } from '@app/shared/shared-main' +import { VideoOwnershipService, Actor, Video, Account } from '@app/shared/shared-main' import { VideoChangeOwnership } from '@shared/models' import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' +import { getAbsoluteAPIUrl } from '@app/helpers' @Component({ selector: 'my-account-ownership', - templateUrl: './my-account-ownership.component.html' + templateUrl: './my-account-ownership.component.html', + styleUrls: [ './my-account-ownership.component.scss' ] }) export class MyAccountOwnershipComponent extends RestTable implements OnInit { videoChangeOwnerships: VideoChangeOwnership[] = [] @@ -32,8 +34,8 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { return 'MyAccountOwnershipComponent' } - createByString (account: Account) { - return Account.CREATE_BY_STRING(account.name, account.host) + switchToDefaultAvatar ($event: Event) { + ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL() } openAcceptModal (videoChangeOwnership: VideoChangeOwnership) { @@ -56,7 +58,11 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { return this.videoOwnershipService.getOwnershipChanges(this.pagination, this.sort) .subscribe( resultList => { - this.videoChangeOwnerships = resultList.data + this.videoChangeOwnerships = resultList.data.map(change => ({ + ...change, + initiatorAccount: new Account(change.initiatorAccount), + nextOwnerAccount: new Account(change.nextOwnerAccount) + })) this.totalRecords = resultList.total }, -- cgit v1.2.3