diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-17 11:47:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-08-17 15:12:55 +0200 |
commit | 7ed1edbbe4ffbef28093e4f5630751cb652814e4 (patch) | |
tree | 831862165dbfce593447a517c2294a7a4c28d840 /client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts | |
parent | 1a95f0b9627f8016767a5a386620cbc3335d5f93 (diff) | |
download | PeerTube-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.ts | 20 |
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' | |||
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | 3 | import { AuthService, Notifier, ServerService } from '@app/core' |
4 | import { populateAsyncUserVideoChannels } from '@app/helpers' | 4 | import { populateAsyncUserVideoChannels } from '@app/helpers' |
5 | import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' | 5 | import { |
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' | ||
12 | import { FormValidatorService } from '@app/shared/shared-forms' | ||
6 | import { VideoPlaylistService } from '@app/shared/shared-video-playlist' | 13 | import { VideoPlaylistService } from '@app/shared/shared-video-playlist' |
7 | import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' | 14 | import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' |
8 | import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' | 15 | import { 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) |