aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-edit/shared')
-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
2 files changed, 30 insertions, 18 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(