From 457bb213b273a9b206cc5654eb085cede4e916ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 Jan 2019 16:05:40 +0100 Subject: Refactor how we use icons Inject them in an angular component so we can easily change their color --- shared/models/actors/actor.model.ts | 2 +- shared/models/users/user-notification.model.ts | 30 +++++++++++--------------- shared/models/videos/video.model.ts | 4 ++-- 3 files changed, 16 insertions(+), 20 deletions(-) (limited to 'shared') diff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.ts index 6b3b1b47c..a3953874d 100644 --- a/shared/models/actors/actor.model.ts +++ b/shared/models/actors/actor.model.ts @@ -10,5 +10,5 @@ export interface Actor { followersCount: number createdAt: Date | string updatedAt: Date | string - avatar: Avatar + avatar?: Avatar } diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts index f41b6f534..eaeb422df 100644 --- a/shared/models/users/user-notification.model.ts +++ b/shared/models/users/user-notification.model.ts @@ -22,16 +22,22 @@ export interface VideoInfo { name: string } +export interface ActorInfo { + id: number + displayName: string + name: string + avatar?: { + path: string + } +} + export interface UserNotification { id: number type: UserNotificationType read: boolean video?: VideoInfo & { - channel: { - id: number - displayName: string - } + channel: ActorInfo } videoImport?: { @@ -45,10 +51,7 @@ export interface UserNotification { comment?: { id: number threadId: number - account: { - id: number - displayName: string - } + account: ActorInfo video: VideoInfo } @@ -62,18 +65,11 @@ export interface UserNotification { video: VideoInfo } - account?: { - id: number - displayName: string - name: string - } + account?: ActorInfo actorFollow?: { id: number - follower: { - name: string - displayName: string - } + follower: ActorInfo following: { type: 'account' | 'channel' name: string diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 4a9fa58b1..022876a0b 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts @@ -24,7 +24,7 @@ export interface VideoChannelAttribute { displayName: string url: string host: string - avatar: Avatar + avatar?: Avatar } export interface AccountAttribute { @@ -34,7 +34,7 @@ export interface AccountAttribute { displayName: string url: string host: string - avatar: Avatar + avatar?: Avatar } export interface Video { -- cgit v1.2.3