aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account
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/+my-account
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/+my-account')
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts17
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts14
-rw-r--r--client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts6
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts20
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts20
-rw-r--r--client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts6
9 files changed, 67 insertions, 46 deletions
diff --git a/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts
index 5c438c3bf..e2ea87fb8 100644
--- a/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts
@@ -1,7 +1,13 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' 4import {
5 VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
6 VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
7 VIDEO_CHANNEL_NAME_VALIDATOR,
8 VIDEO_CHANNEL_SUPPORT_VALIDATOR
9} from '@app/shared/form-validators/video-channel-validators'
10import { FormValidatorService } from '@app/shared/shared-forms'
5import { VideoChannelService } from '@app/shared/shared-main' 11import { VideoChannelService } from '@app/shared/shared-main'
6import { VideoChannelCreate } from '@shared/models' 12import { VideoChannelCreate } from '@shared/models'
7import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' 13import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
@@ -17,7 +23,6 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE
17 constructor ( 23 constructor (
18 protected formValidatorService: FormValidatorService, 24 protected formValidatorService: FormValidatorService,
19 private authService: AuthService, 25 private authService: AuthService,
20 private videoChannelValidatorsService: VideoChannelValidatorsService,
21 private notifier: Notifier, 26 private notifier: Notifier,
22 private router: Router, 27 private router: Router,
23 private videoChannelService: VideoChannelService 28 private videoChannelService: VideoChannelService
@@ -31,10 +36,10 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE
31 36
32 ngOnInit () { 37 ngOnInit () {
33 this.buildForm({ 38 this.buildForm({
34 name: this.videoChannelValidatorsService.VIDEO_CHANNEL_NAME, 39 name: VIDEO_CHANNEL_NAME_VALIDATOR,
35 'display-name': this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME, 40 'display-name': VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
36 description: this.videoChannelValidatorsService.VIDEO_CHANNEL_DESCRIPTION, 41 description: VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
37 support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT 42 support: VIDEO_CHANNEL_SUPPORT_VALIDATOR
38 }) 43 })
39 } 44 }
40 45
diff --git a/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts
index 485521dcc..01659b8da 100644
--- a/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts
@@ -2,7 +2,12 @@ import { Subscription } from 'rxjs'
2import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, Notifier, ServerService } from '@app/core' 4import { AuthService, Notifier, ServerService } from '@app/core'
5import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' 5import {
6 VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
7 VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
8 VIDEO_CHANNEL_SUPPORT_VALIDATOR
9} from '@app/shared/form-validators/video-channel-validators'
10import { FormValidatorService } from '@app/shared/shared-forms'
6import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' 11import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
7import { ServerConfig, VideoChannelUpdate } from '@shared/models' 12import { ServerConfig, VideoChannelUpdate } from '@shared/models'
8import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' 13import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
@@ -23,7 +28,6 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
23 constructor ( 28 constructor (
24 protected formValidatorService: FormValidatorService, 29 protected formValidatorService: FormValidatorService,
25 private authService: AuthService, 30 private authService: AuthService,
26 private videoChannelValidatorsService: VideoChannelValidatorsService,
27 private notifier: Notifier, 31 private notifier: Notifier,
28 private router: Router, 32 private router: Router,
29 private route: ActivatedRoute, 33 private route: ActivatedRoute,
@@ -39,9 +43,9 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
39 .subscribe(config => this.serverConfig = config) 43 .subscribe(config => this.serverConfig = config)
40 44
41 this.buildForm({ 45 this.buildForm({
42 'display-name': this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME, 46 'display-name': VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
43 description: this.videoChannelValidatorsService.VIDEO_CHANNEL_DESCRIPTION, 47 description: VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
44 support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT, 48 support: VIDEO_CHANNEL_SUPPORT_VALIDATOR,
45 bulkVideosSupportUpdate: null 49 bulkVideosSupportUpdate: null
46 }) 50 })
47 51
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
index 3bfffe2da..4c4436755 100644
--- a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
@@ -1,6 +1,7 @@
1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { AuthService, Notifier } from '@app/core' 2import { AuthService, Notifier } from '@app/core'
3import { FormReactive, FormValidatorService, VideoAcceptOwnershipValidatorsService } from '@app/shared/shared-forms' 3import { OWNERSHIP_CHANGE_CHANNEL_VALIDATOR } from '@app/shared/form-validators/video-ownership-change-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
4import { VideoChannelService, VideoOwnershipService } from '@app/shared/shared-main' 5import { VideoChannelService, VideoOwnershipService } from '@app/shared/shared-main'
5import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6import { VideoChangeOwnership, VideoChannel } from '@shared/models' 7import { VideoChangeOwnership, VideoChannel } from '@shared/models'
@@ -23,7 +24,6 @@ export class MyAccountAcceptOwnershipComponent extends FormReactive implements O
23 24
24 constructor ( 25 constructor (
25 protected formValidatorService: FormValidatorService, 26 protected formValidatorService: FormValidatorService,
26 private videoChangeOwnershipValidatorsService: VideoAcceptOwnershipValidatorsService,
27 private videoOwnershipService: VideoOwnershipService, 27 private videoOwnershipService: VideoOwnershipService,
28 private notifier: Notifier, 28 private notifier: Notifier,
29 private authService: AuthService, 29 private authService: AuthService,
@@ -40,7 +40,7 @@ export class MyAccountAcceptOwnershipComponent extends FormReactive implements O
40 .subscribe(videoChannels => this.videoChannels = videoChannels.data) 40 .subscribe(videoChannels => this.videoChannels = videoChannels.data)
41 41
42 this.buildForm({ 42 this.buildForm({
43 channel: this.videoChangeOwnershipValidatorsService.CHANNEL 43 channel: OWNERSHIP_CHANGE_CHANNEL_VALIDATOR
44 }) 44 })
45 } 45 }
46 46
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
index 396936ef3..b2b7849c2 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
@@ -2,7 +2,8 @@ import { forkJoin } from 'rxjs'
2import { tap } from 'rxjs/operators' 2import { tap } from 'rxjs/operators'
3import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
4import { AuthService, ServerService, UserService } from '@app/core' 4import { AuthService, ServerService, UserService } from '@app/core'
5import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 5import { USER_EMAIL_VALIDATOR, USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
6import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { User } from '@shared/models' 7import { User } from '@shared/models'
7 8
8@Component({ 9@Component({
@@ -17,18 +18,17 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
17 18
18 constructor ( 19 constructor (
19 protected formValidatorService: FormValidatorService, 20 protected formValidatorService: FormValidatorService,
20 private userValidatorsService: UserValidatorsService,
21 private authService: AuthService, 21 private authService: AuthService,
22 private userService: UserService, 22 private userService: UserService,
23 private serverService: ServerService 23 private serverService: ServerService
24 ) { 24 ) {
25 super() 25 super()
26 } 26 }
27 27
28 ngOnInit () { 28 ngOnInit () {
29 this.buildForm({ 29 this.buildForm({
30 'new-email': this.userValidatorsService.USER_EMAIL, 30 'new-email': USER_EMAIL_VALIDATOR,
31 'password': this.userValidatorsService.USER_PASSWORD 31 'password': USER_PASSWORD_VALIDATOR
32 }) 32 })
33 33
34 this.user = this.authService.getUser() 34 this.user = this.authService.getUser()
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
index 91fe4ec72..ba68bab32 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
@@ -1,7 +1,8 @@
1import { filter } from 'rxjs/operators' 1import { filter } from 'rxjs/operators'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { AuthService, Notifier, UserService } from '@app/core' 3import { AuthService, Notifier, UserService } from '@app/core'
4import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 4import { USER_CONFIRM_PASSWORD_VALIDATOR, USER_PASSWORD_VALIDATOR } from '@app/shared/form-validators/user-validators'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { User } from '@shared/models' 6import { User } from '@shared/models'
6 7
7@Component({ 8@Component({
@@ -15,7 +16,6 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
15 16
16 constructor ( 17 constructor (
17 protected formValidatorService: FormValidatorService, 18 protected formValidatorService: FormValidatorService,
18 private userValidatorsService: UserValidatorsService,
19 private notifier: Notifier, 19 private notifier: Notifier,
20 private authService: AuthService, 20 private authService: AuthService,
21 private userService: UserService 21 private userService: UserService
@@ -25,9 +25,9 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
25 25
26 ngOnInit () { 26 ngOnInit () {
27 this.buildForm({ 27 this.buildForm({
28 'current-password': this.userValidatorsService.USER_PASSWORD, 28 'current-password': USER_PASSWORD_VALIDATOR,
29 'new-password': this.userValidatorsService.USER_PASSWORD, 29 'new-password': USER_PASSWORD_VALIDATOR,
30 'new-confirmed-password': this.userValidatorsService.USER_CONFIRM_PASSWORD 30 'new-confirmed-password': USER_CONFIRM_PASSWORD_VALIDATOR
31 }) 31 })
32 32
33 this.user = this.authService.getUser() 33 this.user = this.authService.getUser()
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
index ed0984bf7..000a2c0ac 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
@@ -1,7 +1,8 @@
1import { Subject } from 'rxjs' 1import { Subject } from 'rxjs'
2import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
3import { Notifier, User, UserService } from '@app/core' 3import { Notifier, User, UserService } from '@app/core'
4import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 4import { USER_DESCRIPTION_VALIDATOR, USER_DISPLAY_NAME_REQUIRED_VALIDATOR } from '@app/shared/form-validators/user-validators'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5 6
6@Component({ 7@Component({
7 selector: 'my-account-profile', 8 selector: 'my-account-profile',
@@ -16,17 +17,16 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
16 17
17 constructor ( 18 constructor (
18 protected formValidatorService: FormValidatorService, 19 protected formValidatorService: FormValidatorService,
19 private userValidatorsService: UserValidatorsService,
20 private notifier: Notifier, 20 private notifier: Notifier,
21 private userService: UserService 21 private userService: UserService
22 ) { 22 ) {
23 super() 23 super()
24 } 24 }
25 25
26 ngOnInit () { 26 ngOnInit () {
27 this.buildForm({ 27 this.buildForm({
28 'display-name': this.userValidatorsService.USER_DISPLAY_NAME_REQUIRED, 28 'display-name': USER_DISPLAY_NAME_REQUIRED_VALIDATOR,
29 description: this.userValidatorsService.USER_DESCRIPTION 29 description: USER_DESCRIPTION_VALIDATOR
30 }) 30 })
31 31
32 this.userInformationLoaded.subscribe(() => { 32 this.userInformationLoaded.subscribe(() => {
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
index 5427dc3a0..7a80aaa92 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
@@ -2,7 +2,14 @@ import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 3import { AuthService, Notifier, ServerService } from '@app/core'
4import { populateAsyncUserVideoChannels } from '@app/helpers' 4import { populateAsyncUserVideoChannels } from '@app/helpers'
5import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' 5import {
6 setPlaylistChannelValidator,
7 VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR,
8 VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,
9 VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
10 VIDEO_PLAYLIST_PRIVACY_VALIDATOR
11} from '@app/shared/form-validators/video-playlist-validators'
12import { FormValidatorService } from '@app/shared/shared-forms'
6import { VideoPlaylistService } from '@app/shared/shared-video-playlist' 13import { VideoPlaylistService } from '@app/shared/shared-video-playlist'
7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' 14import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model'
8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' 15import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model'
@@ -19,7 +26,6 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
19 constructor ( 26 constructor (
20 protected formValidatorService: FormValidatorService, 27 protected formValidatorService: FormValidatorService,
21 private authService: AuthService, 28 private authService: AuthService,
22 private videoPlaylistValidatorsService: VideoPlaylistValidatorsService,
23 private notifier: Notifier, 29 private notifier: Notifier,
24 private router: Router, 30 private router: Router,
25 private videoPlaylistService: VideoPlaylistService, 31 private videoPlaylistService: VideoPlaylistService,
@@ -30,15 +36,15 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
30 36
31 ngOnInit () { 37 ngOnInit () {
32 this.buildForm({ 38 this.buildForm({
33 displayName: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME, 39 displayName: VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
34 privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY, 40 privacy: VIDEO_PLAYLIST_PRIVACY_VALIDATOR,
35 description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION, 41 description: VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,
36 videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID, 42 videoChannelId: VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR,
37 thumbnailfile: null 43 thumbnailfile: null
38 }) 44 })
39 45
40 this.form.get('privacy').valueChanges.subscribe(privacy => { 46 this.form.get('privacy').valueChanges.subscribe(privacy => {
41 this.videoPlaylistValidatorsService.setChannelValidator(this.form.get('videoChannelId'), privacy) 47 setPlaylistChannelValidator(this.form.get('videoChannelId'), privacy)
42 }) 48 })
43 49
44 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) 50 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
index 149d0d94f..fefc6d607 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
@@ -4,7 +4,14 @@ import { Component, OnDestroy, OnInit } from '@angular/core'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { AuthService, Notifier, ServerService } from '@app/core' 5import { AuthService, Notifier, ServerService } from '@app/core'
6import { populateAsyncUserVideoChannels } from '@app/helpers' 6import { populateAsyncUserVideoChannels } from '@app/helpers'
7import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' 7import {
8 setPlaylistChannelValidator,
9 VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR,
10 VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,
11 VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
12 VIDEO_PLAYLIST_PRIVACY_VALIDATOR
13} from '@app/shared/form-validators/video-playlist-validators'
14import { FormValidatorService } from '@app/shared/shared-forms'
8import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 15import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
9import { VideoPlaylistUpdate } from '@shared/models' 16import { VideoPlaylistUpdate } from '@shared/models'
10import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' 17import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
@@ -23,7 +30,6 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis
23 constructor ( 30 constructor (
24 protected formValidatorService: FormValidatorService, 31 protected formValidatorService: FormValidatorService,
25 private authService: AuthService, 32 private authService: AuthService,
26 private videoPlaylistValidatorsService: VideoPlaylistValidatorsService,
27 private notifier: Notifier, 33 private notifier: Notifier,
28 private router: Router, 34 private router: Router,
29 private route: ActivatedRoute, 35 private route: ActivatedRoute,
@@ -35,15 +41,15 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis
35 41
36 ngOnInit () { 42 ngOnInit () {
37 this.buildForm({ 43 this.buildForm({
38 displayName: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME, 44 displayName: VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
39 privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY, 45 privacy: VIDEO_PLAYLIST_PRIVACY_VALIDATOR,
40 description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION, 46 description: VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,
41 videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID, 47 videoChannelId: VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR,
42 thumbnailfile: null 48 thumbnailfile: null
43 }) 49 })
44 50
45 this.form.get('privacy').valueChanges.subscribe(privacy => { 51 this.form.get('privacy').valueChanges.subscribe(privacy => {
46 this.videoPlaylistValidatorsService.setChannelValidator(this.form.get('videoChannelId'), privacy) 52 setPlaylistChannelValidator(this.form.get('videoChannelId'), privacy)
47 }) 53 })
48 54
49 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) 55 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
index edd691694..84237dee1 100644
--- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
@@ -1,6 +1,7 @@
1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { Notifier, UserService } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { FormReactive, FormValidatorService, VideoChangeOwnershipValidatorsService } from '@app/shared/shared-forms' 3import { OWNERSHIP_CHANGE_USERNAME_VALIDATOR } from '@app/shared/form-validators/video-ownership-change-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
4import { Video, VideoOwnershipService } from '@app/shared/shared-main' 5import { Video, VideoOwnershipService } from '@app/shared/shared-main'
5import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6 7
@@ -20,7 +21,6 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni
20 21
21 constructor ( 22 constructor (
22 protected formValidatorService: FormValidatorService, 23 protected formValidatorService: FormValidatorService,
23 private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService,
24 private videoOwnershipService: VideoOwnershipService, 24 private videoOwnershipService: VideoOwnershipService,
25 private notifier: Notifier, 25 private notifier: Notifier,
26 private userService: UserService, 26 private userService: UserService,
@@ -31,7 +31,7 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni
31 31
32 ngOnInit () { 32 ngOnInit () {
33 this.buildForm({ 33 this.buildForm({
34 username: this.videoChangeOwnershipValidatorsService.USERNAME 34 username: OWNERSHIP_CHANGE_USERNAME_VALIDATOR
35 }) 35 })
36 this.usernamePropositions = [] 36 this.usernamePropositions = []
37 } 37 }