aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
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/+video-edit/shared/video-edit.component.ts
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/+video-edit/shared/video-edit.component.ts')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts38
1 files changed, 25 insertions, 13 deletions
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(