From f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 16 Nov 2020 11:55:17 +0100 Subject: Add admin view to manage comments --- .../app/shared/shared-video-comment/video-comment.model.ts | 11 +++++++++-- .../app/shared/shared-video-comment/video-comment.service.ts | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-video-comment') diff --git a/client/src/app/shared/shared-video-comment/video-comment.model.ts b/client/src/app/shared/shared-video-comment/video-comment.model.ts index 1589091e5..eeee397af 100644 --- a/client/src/app/shared/shared-video-comment/video-comment.model.ts +++ b/client/src/app/shared/shared-video-comment/video-comment.model.ts @@ -59,12 +59,14 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel { createdAt: Date | string updatedAt: Date | string - account: AccountInterface + account: AccountInterface & { localUrl?: string } + localUrl: string video: { id: number uuid: string name: string + localUrl: string } by: string @@ -85,14 +87,19 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel { this.video = { id: hash.video.id, uuid: hash.video.uuid, - name: hash.video.name + name: hash.video.name, + localUrl: '/videos/watch/' + hash.video.uuid } + this.localUrl = this.video.localUrl + ';threadId=' + this.threadId + this.account = hash.account if (this.account) { this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) + + this.account.localUrl = '/accounts/' + this.by } } } diff --git a/client/src/app/shared/shared-video-comment/video-comment.service.ts b/client/src/app/shared/shared-video-comment/video-comment.service.ts index e318e069d..1ab996a76 100644 --- a/client/src/app/shared/shared-video-comment/video-comment.service.ts +++ b/client/src/app/shared/shared-video-comment/video-comment.service.ts @@ -19,8 +19,9 @@ import { SortMeta } from 'primeng/api' @Injectable() export class VideoCommentService { + static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.' + private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' - private static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.' constructor ( private authHttp: HttpClient, @@ -56,7 +57,7 @@ export class VideoCommentService { search?: string }): Observable> { const { pagination, sort, search } = options - const url = VideoCommentService.BASE_VIDEO_URL + '/comments' + const url = VideoCommentService.BASE_VIDEO_URL + 'comments' let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) @@ -172,7 +173,7 @@ export class VideoCommentService { private buildParamsFromSearch (search: string, params: HttpParams) { const filters = this.restService.parseQueryStringFilter(search, { - state: { + isLocal: { prefix: 'local:', isBoolean: true, handler: v => { -- cgit v1.2.3