aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-watch/comment')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-add.component.ts15
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts4
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.ts14
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.model.ts7
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.service.ts17
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.ts21
6 files changed, 31 insertions, 47 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
index e1a8f6260..79505c779 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
@@ -1,16 +1,13 @@
1import { Observable } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { Router } from '@angular/router' 3import { Router } from '@angular/router'
3import { Notifier } from '@app/core' 4import { Notifier, User } from '@app/core'
4import { Observable } from 'rxjs' 5import { FormReactive, FormValidatorService, VideoCommentValidatorsService } from '@app/shared/shared-forms'
5import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 6import { Video } from '@app/shared/shared-main'
6import { FormReactive } from '../../../shared' 7import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { User } from '../../../shared/users' 8import { VideoCommentCreate } from '@shared/models'
8import { Video } from '../../../shared/video/video.model'
9import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
10import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
11import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
12import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service'
13import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
14 11
15@Component({ 12@Component({
16 selector: 'my-video-comment-add', 13 selector: 'my-video-comment-add',
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
index 1566d7369..7c2aaeadd 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
@@ -1,5 +1,5 @@
1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '../../../../../../shared/models/videos/video-comment.model' 1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '@shared/models'
2import { VideoComment } from '@app/videos/+video-watch/comment/video-comment.model' 2import { VideoComment } from './video-comment.model'
3 3
4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel { 4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel {
5 comment: VideoComment 5 comment: VideoComment
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
index 868addd58..27846c1ad 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
@@ -1,15 +1,10 @@
1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
2import { User, UserRight } from '../../../../../../shared/models/users' 2import { MarkdownService, Notifier, UserService } from '@app/core'
3import { AuthService } from '@app/core/auth' 3import { AuthService } from '@app/core/auth'
4import { AccountService } from '@app/shared/account/account.service' 4import { Account, Actor, Video } from '@app/shared/shared-main'
5import { Video } from '@app/shared/video/video.model' 5import { User, UserRight } from '@shared/models'
6import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
6import { VideoComment } from './video-comment.model' 7import { VideoComment } from './video-comment.model'
7import { MarkdownService } from '@app/shared/renderer'
8import { Account } from '@app/shared/account/account.model'
9import { Notifier } from '@app/core'
10import { UserService } from '@app/shared'
11import { Actor } from '@app/shared/actor/actor.model'
12import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
13 8
14@Component({ 9@Component({
15 selector: 'my-video-comment', 10 selector: 'my-video-comment',
@@ -40,7 +35,6 @@ export class VideoCommentComponent implements OnInit, OnChanges {
40 constructor ( 35 constructor (
41 private markdownService: MarkdownService, 36 private markdownService: MarkdownService,
42 private authService: AuthService, 37 private authService: AuthService,
43 private accountService: AccountService,
44 private userService: UserService, 38 private userService: UserService,
45 private notifier: Notifier 39 private notifier: Notifier
46 ) {} 40 ) {}
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
index 171fc4acc..e85443196 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
@@ -1,7 +1,6 @@
1import { Account as AccountInterface } from '../../../../../../shared/models/actors' 1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { VideoComment as VideoCommentServerModel, VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 2import { Actor } from '@app/shared/shared-main'
3import { Actor } from '@app/shared/actor/actor.model' 3import { Account as AccountInterface, VideoComment as VideoCommentServerModel } from '@shared/models'
4import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
5 4
6export class VideoComment implements VideoCommentServerModel { 5export class VideoComment implements VideoCommentServerModel {
7 id: number 6 id: number
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
index 0b0715390..a73fb9ca8 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
@@ -1,20 +1,19 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { objectLineFeedToHtml } from '@app/shared/misc/utils' 5import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
5import { Observable } from 'rxjs' 6import { objectLineFeedToHtml } from '@app/helpers'
6import { FeedFormat, ResultList } from '../../../../../../shared/models'
7import { 7import {
8 FeedFormat,
9 ResultList,
8 VideoComment as VideoCommentServerModel, 10 VideoComment as VideoCommentServerModel,
9 VideoCommentCreate, 11 VideoCommentCreate,
10 VideoCommentThreadTree as VideoCommentThreadTreeServerModel 12 VideoCommentThreadTree as VideoCommentThreadTreeServerModel
11} from '../../../../../../shared/models/videos/video-comment.model' 13} from '@shared/models'
12import { environment } from '../../../../environments/environment' 14import { environment } from '../../../../environments/environment'
13import { RestExtractor, RestService } from '../../../shared/rest' 15import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
14import { ComponentPaginationLight } from '../../../shared/rest/component-pagination.model'
15import { CommentSortField } from '../../../shared/video/sort-field.type'
16import { VideoComment } from './video-comment.model' 16import { VideoComment } from './video-comment.model'
17import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
18 17
19@Injectable() 18@Injectable()
20export class VideoCommentService { 19export class VideoCommentService {
@@ -52,7 +51,7 @@ export class VideoCommentService {
52 getVideoCommentThreads (parameters: { 51 getVideoCommentThreads (parameters: {
53 videoId: number | string, 52 videoId: number | string,
54 componentPagination: ComponentPaginationLight, 53 componentPagination: ComponentPaginationLight,
55 sort: CommentSortField 54 sort: string
56 }): Observable<ResultList<VideoComment>> { 55 }): Observable<ResultList<VideoComment>> {
57 const { videoId, componentPagination, sort } = parameters 56 const { videoId, componentPagination, sort } = parameters
58 57
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
index bba9f1372..df0018ec6 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
@@ -1,18 +1,13 @@
1import { Subject, Subscription } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 3import { ActivatedRoute } from '@angular/router'
3import { ConfirmService, Notifier } from '@app/core' 4import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifier, User } from '@app/core'
4import { Subject, Subscription } from 'rxjs' 5import { HooksService } from '@app/core/plugins/hooks.service'
5import { AuthService } from '../../../core/auth' 6import { Syndication, VideoDetails } from '@app/shared/shared-main'
6import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' 7import { I18n } from '@ngx-translate/i18n-polyfill'
7import { User } from '../../../shared/users' 8import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
8import { CommentSortField } from '../../../shared/video/sort-field.type'
9import { VideoDetails } from '../../../shared/video/video-details.model'
10import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
11import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
12import { I18n } from '@ngx-translate/i18n-polyfill'
13import { Syndication } from '@app/shared/video/syndication.model'
14import { HooksService } from '@app/core/plugins/hooks.service'
15import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
16 11
17@Component({ 12@Component({
18 selector: 'my-video-comments', 13 selector: 'my-video-comments',
@@ -28,7 +23,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
28 23
29 comments: VideoComment[] = [] 24 comments: VideoComment[] = []
30 highlightedThread: VideoComment 25 highlightedThread: VideoComment
31 sort: CommentSortField = '-createdAt' 26 sort = '-createdAt'
32 componentPagination: ComponentPagination = { 27 componentPagination: ComponentPagination = {
33 currentPage: 1, 28 currentPage: 1,
34 itemsPerPage: 10, 29 itemsPerPage: 10,
@@ -154,7 +149,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
154 this.viewReplies(commentTree.comment.id) 149 this.viewReplies(commentTree.comment.id)
155 } 150 }
156 151
157 handleSortChange (sort: CommentSortField) { 152 handleSortChange (sort: string) {
158 if (this.sort === sort) return 153 if (this.sort === sort) return
159 154
160 this.sort = sort 155 this.sort = sort