aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts16
1 files changed, 3 insertions, 13 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index a615fd92c..332f757d7 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -1,6 +1,5 @@
1import { HttpEventType, HttpResponse } from '@angular/common/http' 1import { HttpEventType, HttpResponse } from '@angular/common/http'
2import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' 2import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
3import { FormBuilder, FormGroup } from '@angular/forms'
4import { Router } from '@angular/router' 3import { Router } from '@angular/router'
5import { UserService } from '@app/shared' 4import { UserService } from '@app/shared'
6import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' 5import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
@@ -11,11 +10,11 @@ import { Subscription } from 'rxjs'
11import { VideoPrivacy } from '../../../../../shared/models/videos' 10import { VideoPrivacy } from '../../../../../shared/models/videos'
12import { AuthService, ServerService } from '../../core' 11import { AuthService, ServerService } from '../../core'
13import { FormReactive } from '../../shared' 12import { FormReactive } from '../../shared'
14import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message'
15import { populateAsyncUserVideoChannels } from '../../shared/misc/utils' 13import { populateAsyncUserVideoChannels } from '../../shared/misc/utils'
16import { VideoEdit } from '../../shared/video/video-edit.model' 14import { VideoEdit } from '../../shared/video/video-edit.model'
17import { VideoService } from '../../shared/video/video.service' 15import { VideoService } from '../../shared/video/video.service'
18import { I18n } from '@ngx-translate/i18n-polyfill' 16import { I18n } from '@ngx-translate/i18n-polyfill'
17import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
19 18
20@Component({ 19@Component({
21 selector: 'my-videos-add', 20 selector: 'my-videos-add',
@@ -39,10 +38,6 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
39 } 38 }
40 videoFileName: string 39 videoFileName: string
41 40
42 form: FormGroup
43 formErrors: { [ id: string ]: string } = {}
44 validationMessages: ValidatorMessage = {}
45
46 userVideoChannels: { id: number, label: string, support: string }[] = [] 41 userVideoChannels: { id: number, label: string, support: string }[] = []
47 userVideoQuotaUsed = 0 42 userVideoQuotaUsed = 0
48 videoPrivacies = [] 43 videoPrivacies = []
@@ -50,7 +45,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
50 firstStepChannelId = 0 45 firstStepChannelId = 0
51 46
52 constructor ( 47 constructor (
53 private formBuilder: FormBuilder, 48 protected formValidatorService: FormValidatorService,
54 private router: Router, 49 private router: Router,
55 private notificationsService: NotificationsService, 50 private notificationsService: NotificationsService,
56 private authService: AuthService, 51 private authService: AuthService,
@@ -67,13 +62,8 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
67 return this.serverService.getConfig().video.file.extensions.join(',') 62 return this.serverService.getConfig().video.file.extensions.join(',')
68 } 63 }
69 64
70 buildForm () {
71 this.form = this.formBuilder.group({})
72 this.form.valueChanges.subscribe(data => this.onValueChanged(data))
73 }
74
75 ngOnInit () { 65 ngOnInit () {
76 this.buildForm() 66 this.buildForm({})
77 67
78 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) 68 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
79 .then(() => this.firstStepChannelId = this.userVideoChannels[0].id) 69 .then(() => this.firstStepChannelId = this.userVideoChannels[0].id)