aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.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/+my-account/my-account-video-playlists/my-account-video-playlist-create.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/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts20
1 files changed, 13 insertions, 7 deletions
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)