aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-17 11:47:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-17 15:12:55 +0200
commit7ed1edbbe4ffbef28093e4f5630751cb652814e4 (patch)
tree831862165dbfce593447a517c2294a7a4c28d840 /client/src/app/+videos
parent1a95f0b9627f8016767a5a386620cbc3335d5f93 (diff)
downloadPeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.tar.gz
PeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.tar.zst
PeerTube-7ed1edbbe4ffbef28093e4f5630751cb652814e4.zip
We don't need services anymore for validators
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts10
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts38
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts6
3 files changed, 33 insertions, 21 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
index a90d04ce8..e48d16527 100644
--- a/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
@@ -1,6 +1,7 @@
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
3import { FormReactive, FormValidatorService, VideoCaptionsValidatorsService } from '@app/shared/shared-forms' 3import { VIDEO_CAPTION_FILE_VALIDATOR, VIDEO_CAPTION_LANGUAGE_VALIDATOR } from '@app/shared/form-validators/video-captions-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
4import { VideoCaptionEdit } from '@app/shared/shared-main' 5import { VideoCaptionEdit } from '@app/shared/shared-main'
5import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
6import { ServerConfig, VideoConstant } from '@shared/models' 7import { ServerConfig, VideoConstant } from '@shared/models'
@@ -27,8 +28,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
27 constructor ( 28 constructor (
28 protected formValidatorService: FormValidatorService, 29 protected formValidatorService: FormValidatorService,
29 private modalService: NgbModal, 30 private modalService: NgbModal,
30 private serverService: ServerService, 31 private serverService: ServerService
31 private videoCaptionsValidatorsService: VideoCaptionsValidatorsService
32 ) { 32 ) {
33 super() 33 super()
34 } 34 }
@@ -46,8 +46,8 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
46 .subscribe(languages => this.videoCaptionLanguages = languages) 46 .subscribe(languages => this.videoCaptionLanguages = languages)
47 47
48 this.buildForm({ 48 this.buildForm({
49 language: this.videoCaptionsValidatorsService.VIDEO_CAPTION_LANGUAGE, 49 language: VIDEO_CAPTION_LANGUAGE_VALIDATOR,
50 captionfile: this.videoCaptionsValidatorsService.VIDEO_CAPTION_FILE 50 captionfile: VIDEO_CAPTION_FILE_VALIDATOR
51 }) 51 })
52 } 52 }
53 53
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index 050b6d931..92d06aa12 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -4,7 +4,20 @@ import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular
4import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' 4import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
5import { ServerService } from '@app/core' 5import { ServerService } from '@app/core'
6import { removeElementFromArray } from '@app/helpers' 6import { removeElementFromArray } from '@app/helpers'
7import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem, VideoValidatorsService } from '@app/shared/shared-forms' 7import {
8 VIDEO_CATEGORY_VALIDATOR,
9 VIDEO_CHANNEL_VALIDATOR,
10 VIDEO_DESCRIPTION_VALIDATOR,
11 VIDEO_LANGUAGE_VALIDATOR,
12 VIDEO_LICENCE_VALIDATOR,
13 VIDEO_NAME_VALIDATOR,
14 VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR,
15 VIDEO_PRIVACY_VALIDATOR,
16 VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR,
17 VIDEO_SUPPORT_VALIDATOR,
18 VIDEO_TAGS_ARRAY_VALIDATOR
19} from '@app/shared/form-validators/video-validators'
20import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
8import { InstanceService } from '@app/shared/shared-instance' 21import { InstanceService } from '@app/shared/shared-instance'
9import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' 22import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
10import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' 23import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
@@ -57,7 +70,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
57 70
58 constructor ( 71 constructor (
59 private formValidatorService: FormValidatorService, 72 private formValidatorService: FormValidatorService,
60 private videoValidatorsService: VideoValidatorsService,
61 private videoService: VideoService, 73 private videoService: VideoService,
62 private serverService: ServerService, 74 private serverService: ServerService,
63 private instanceService: InstanceService, 75 private instanceService: InstanceService,
@@ -84,22 +96,22 @@ export class VideoEditComponent implements OnInit, OnDestroy {
84 tags: [] 96 tags: []
85 } 97 }
86 const obj: any = { 98 const obj: any = {
87 name: this.videoValidatorsService.VIDEO_NAME, 99 name: VIDEO_NAME_VALIDATOR,
88 privacy: this.videoValidatorsService.VIDEO_PRIVACY, 100 privacy: VIDEO_PRIVACY_VALIDATOR,
89 channelId: this.videoValidatorsService.VIDEO_CHANNEL, 101 channelId: VIDEO_CHANNEL_VALIDATOR,
90 nsfw: null, 102 nsfw: null,
91 commentsEnabled: null, 103 commentsEnabled: null,
92 downloadEnabled: null, 104 downloadEnabled: null,
93 waitTranscoding: null, 105 waitTranscoding: null,
94 category: this.videoValidatorsService.VIDEO_CATEGORY, 106 category: VIDEO_CATEGORY_VALIDATOR,
95 licence: this.videoValidatorsService.VIDEO_LICENCE, 107 licence: VIDEO_LICENCE_VALIDATOR,
96 language: this.videoValidatorsService.VIDEO_LANGUAGE, 108 language: VIDEO_LANGUAGE_VALIDATOR,
97 description: this.videoValidatorsService.VIDEO_DESCRIPTION, 109 description: VIDEO_DESCRIPTION_VALIDATOR,
98 tags: this.videoValidatorsService.VIDEO_TAGS_ARRAY, 110 tags: VIDEO_TAGS_ARRAY_VALIDATOR,
99 previewfile: null, 111 previewfile: null,
100 support: this.videoValidatorsService.VIDEO_SUPPORT, 112 support: VIDEO_SUPPORT_VALIDATOR,
101 schedulePublicationAt: this.videoValidatorsService.VIDEO_SCHEDULE_PUBLICATION_AT, 113 schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR,
102 originallyPublishedAt: this.videoValidatorsService.VIDEO_ORIGINALLY_PUBLISHED_AT 114 originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR
103 } 115 }
104 116
105 this.formValidatorService.updateForm( 117 this.formValidatorService.updateForm(
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 fa20ec3b9..c1d0032cc 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
@@ -2,7 +2,8 @@ import { Observable } from 'rxjs'
2import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'
3import { Router } from '@angular/router' 3import { Router } from '@angular/router'
4import { Notifier, User } from '@app/core' 4import { Notifier, User } from '@app/core'
5import { FormReactive, FormValidatorService, VideoCommentValidatorsService } from '@app/shared/shared-forms' 5import { VIDEO_COMMENT_TEXT_VALIDATOR } from '@app/shared/form-validators/video-comment-validators'
6import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { Video } from '@app/shared/shared-main' 7import { Video } from '@app/shared/shared-main'
7import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment' 8import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
8import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 9import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
@@ -33,7 +34,6 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
33 34
34 constructor ( 35 constructor (
35 protected formValidatorService: FormValidatorService, 36 protected formValidatorService: FormValidatorService,
36 private videoCommentValidatorsService: VideoCommentValidatorsService,
37 private notifier: Notifier, 37 private notifier: Notifier,
38 private videoCommentService: VideoCommentService, 38 private videoCommentService: VideoCommentService,
39 private modalService: NgbModal, 39 private modalService: NgbModal,
@@ -50,7 +50,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
50 50
51 ngOnInit () { 51 ngOnInit () {
52 this.buildForm({ 52 this.buildForm({
53 text: this.videoCommentValidatorsService.VIDEO_COMMENT_TEXT 53 text: VIDEO_COMMENT_TEXT_VALIDATOR
54 }) 54 })
55 55
56 if (this.user) { 56 if (this.user) {