aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-comment
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-16 11:55:17 +0100
committerChocobozzz <me@florianbigard.com>2020-11-16 13:48:58 +0100
commitf1273314593a4a7dc7ec9594ce0c6c3ae8f62b34 (patch)
treecf1f3949e64a24a820833950d7b2bbf9ccd40013 /client/src/app/shared/shared-video-comment
parent0f8d00e3144060270d7fe603865fccaf18649c47 (diff)
downloadPeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.gz
PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.zst
PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.zip
Add admin view to manage comments
Diffstat (limited to 'client/src/app/shared/shared-video-comment')
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.model.ts11
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.service.ts7
2 files changed, 13 insertions, 5 deletions
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 {
59 createdAt: Date | string 59 createdAt: Date | string
60 updatedAt: Date | string 60 updatedAt: Date | string
61 61
62 account: AccountInterface 62 account: AccountInterface & { localUrl?: string }
63 localUrl: string
63 64
64 video: { 65 video: {
65 id: number 66 id: number
66 uuid: string 67 uuid: string
67 name: string 68 name: string
69 localUrl: string
68 } 70 }
69 71
70 by: string 72 by: string
@@ -85,14 +87,19 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel {
85 this.video = { 87 this.video = {
86 id: hash.video.id, 88 id: hash.video.id,
87 uuid: hash.video.uuid, 89 uuid: hash.video.uuid,
88 name: hash.video.name 90 name: hash.video.name,
91 localUrl: '/videos/watch/' + hash.video.uuid
89 } 92 }
90 93
94 this.localUrl = this.video.localUrl + ';threadId=' + this.threadId
95
91 this.account = hash.account 96 this.account = hash.account
92 97
93 if (this.account) { 98 if (this.account) {
94 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) 99 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
95 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) 100 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
101
102 this.account.localUrl = '/accounts/' + this.by
96 } 103 }
97 } 104 }
98} 105}
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'
19 19
20@Injectable() 20@Injectable()
21export class VideoCommentService { 21export class VideoCommentService {
22 static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.'
23
22 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' 24 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/'
23 private static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.'
24 25
25 constructor ( 26 constructor (
26 private authHttp: HttpClient, 27 private authHttp: HttpClient,
@@ -56,7 +57,7 @@ export class VideoCommentService {
56 search?: string 57 search?: string
57 }): Observable<ResultList<VideoCommentAdmin>> { 58 }): Observable<ResultList<VideoCommentAdmin>> {
58 const { pagination, sort, search } = options 59 const { pagination, sort, search } = options
59 const url = VideoCommentService.BASE_VIDEO_URL + '/comments' 60 const url = VideoCommentService.BASE_VIDEO_URL + 'comments'
60 61
61 let params = new HttpParams() 62 let params = new HttpParams()
62 params = this.restService.addRestGetParams(params, pagination, sort) 63 params = this.restService.addRestGetParams(params, pagination, sort)
@@ -172,7 +173,7 @@ export class VideoCommentService {
172 173
173 private buildParamsFromSearch (search: string, params: HttpParams) { 174 private buildParamsFromSearch (search: string, params: HttpParams) {
174 const filters = this.restService.parseQueryStringFilter(search, { 175 const filters = this.restService.parseQueryStringFilter(search, {
175 state: { 176 isLocal: {
176 prefix: 'local:', 177 prefix: 'local:',
177 isBoolean: true, 178 isBoolean: true,
178 handler: v => { 179 handler: v => {