diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-17 14:42:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-18 08:35:06 +0200 |
commit | 9df52d660feb722404be00a50f3c8a612bec1c15 (patch) | |
tree | dde52880fa012874d24c60f64eb596b0a789cc8b /client/src/app/shared/form-validators/video-playlist-validators.ts | |
parent | adb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff) | |
download | PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip |
Migrate client to eslint
Diffstat (limited to 'client/src/app/shared/form-validators/video-playlist-validators.ts')
-rw-r--r-- | client/src/app/shared/form-validators/video-playlist-validators.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/app/shared/form-validators/video-playlist-validators.ts b/client/src/app/shared/form-validators/video-playlist-validators.ts index 7e3d29458..63af637a3 100644 --- a/client/src/app/shared/form-validators/video-playlist-validators.ts +++ b/client/src/app/shared/form-validators/video-playlist-validators.ts | |||
@@ -9,9 +9,9 @@ export const VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR: BuildFormValidator = { | |||
9 | Validators.maxLength(120) | 9 | Validators.maxLength(120) |
10 | ], | 10 | ], |
11 | MESSAGES: { | 11 | MESSAGES: { |
12 | 'required': $localize`Display name is required.`, | 12 | required: $localize`Display name is required.`, |
13 | 'minlength': $localize`Display name must be at least 1 character long.`, | 13 | minlength: $localize`Display name must be at least 1 character long.`, |
14 | 'maxlength': $localize`Display name cannot be more than 120 characters long.` | 14 | maxlength: $localize`Display name cannot be more than 120 characters long.` |
15 | } | 15 | } |
16 | } | 16 | } |
17 | 17 | ||
@@ -20,7 +20,7 @@ export const VIDEO_PLAYLIST_PRIVACY_VALIDATOR: BuildFormValidator = { | |||
20 | Validators.required | 20 | Validators.required |
21 | ], | 21 | ], |
22 | MESSAGES: { | 22 | MESSAGES: { |
23 | 'required': $localize`Privacy is required.` | 23 | required: $localize`Privacy is required.` |
24 | } | 24 | } |
25 | } | 25 | } |
26 | 26 | ||
@@ -30,21 +30,21 @@ export const VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR: BuildFormValidator = { | |||
30 | Validators.maxLength(1000) | 30 | Validators.maxLength(1000) |
31 | ], | 31 | ], |
32 | MESSAGES: { | 32 | MESSAGES: { |
33 | 'minlength': $localize`Description must be at least 3 characters long.`, | 33 | minlength: $localize`Description must be at least 3 characters long.`, |
34 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` | 34 | maxlength: $localize`Description cannot be more than 1000 characters long.` |
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | export const VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR: BuildFormValidator = { | 38 | export const VIDEO_PLAYLIST_CHANNEL_ID_VALIDATOR: BuildFormValidator = { |
39 | VALIDATORS: [], | 39 | VALIDATORS: [], |
40 | MESSAGES: { | 40 | MESSAGES: { |
41 | 'required': $localize`The channel is required when the playlist is public.` | 41 | required: $localize`The channel is required when the playlist is public.` |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | export function setPlaylistChannelValidator (channelControl: AbstractControl, privacy: VideoPlaylistPrivacy) { | 45 | export function setPlaylistChannelValidator (channelControl: AbstractControl, privacy: VideoPlaylistPrivacy) { |
46 | if (privacy.toString() === VideoPlaylistPrivacy.PUBLIC.toString()) { | 46 | if (privacy.toString() === VideoPlaylistPrivacy.PUBLIC.toString()) { |
47 | channelControl.setValidators([Validators.required]) | 47 | channelControl.setValidators([ Validators.required ]) |
48 | } else { | 48 | } else { |
49 | channelControl.setValidators(null) | 49 | channelControl.setValidators(null) |
50 | } | 50 | } |