From 7ed1edbbe4ffbef28093e4f5630751cb652814e4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Aug 2020 11:47:04 +0200 Subject: We don't need services anymore for validators --- .../my-account-video-playlist-create.component.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts') 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' import { Router } from '@angular/router' import { AuthService, Notifier, ServerService } from '@app/core' import { populateAsyncUserVideoChannels } from '@app/helpers' -import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' +import { + setPlaylistChannelValidator, + VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR, + VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR, + VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR, + VIDEO_PLAYLIST_PRIVACY_VALIDATOR +} from '@app/shared/form-validators/video-playlist-validators' +import { FormValidatorService } from '@app/shared/shared-forms' import { VideoPlaylistService } from '@app/shared/shared-video-playlist' import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' @@ -19,7 +26,6 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis constructor ( protected formValidatorService: FormValidatorService, private authService: AuthService, - private videoPlaylistValidatorsService: VideoPlaylistValidatorsService, private notifier: Notifier, private router: Router, private videoPlaylistService: VideoPlaylistService, @@ -30,15 +36,15 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis ngOnInit () { this.buildForm({ - displayName: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME, - privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY, - description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION, - videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID, + displayName: VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR, + privacy: VIDEO_PLAYLIST_PRIVACY_VALIDATOR, + description: VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR, + videoChannelId: VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR, thumbnailfile: null }) this.form.get('privacy').valueChanges.subscribe(privacy => { - this.videoPlaylistValidatorsService.setChannelValidator(this.form.get('videoChannelId'), privacy) + setPlaylistChannelValidator(this.form.get('videoChannelId'), privacy) }) populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) -- cgit v1.2.3