diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators')
18 files changed, 0 insertions, 947 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts deleted file mode 100644 index 56d30d6f9..000000000 --- a/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class AbuseValidatorsService { | ||
7 | readonly ABUSE_REASON: BuildFormValidator | ||
8 | readonly ABUSE_MODERATION_COMMENT: BuildFormValidator | ||
9 | readonly ABUSE_MESSAGE: BuildFormValidator | ||
10 | |||
11 | constructor () { | ||
12 | this.ABUSE_REASON = { | ||
13 | VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ], | ||
14 | MESSAGES: { | ||
15 | 'required': $localize`Report reason is required.`, | ||
16 | 'minlength': $localize`Report reason must be at least 2 characters long.`, | ||
17 | 'maxlength': $localize`Report reason cannot be more than 3000 characters long.` | ||
18 | } | ||
19 | } | ||
20 | |||
21 | this.ABUSE_MODERATION_COMMENT = { | ||
22 | VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ], | ||
23 | MESSAGES: { | ||
24 | 'required': $localize`Moderation comment is required.`, | ||
25 | 'minlength': $localize`Moderation comment must be at least 2 characters long.`, | ||
26 | 'maxlength': $localize`Moderation comment cannot be more than 3000 characters long.` | ||
27 | } | ||
28 | } | ||
29 | |||
30 | this.ABUSE_MESSAGE = { | ||
31 | VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ], | ||
32 | MESSAGES: { | ||
33 | 'required': $localize`Abuse message is required.`, | ||
34 | 'minlength': $localize`Abuse message must be at least 2 characters long.`, | ||
35 | 'maxlength': $localize`Abuse message cannot be more than 3000 characters long.` | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts deleted file mode 100644 index 6c7da833f..000000000 --- a/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { ValidatorFn, Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | import { validateHost } from './host' | ||
5 | |||
6 | @Injectable() | ||
7 | export class BatchDomainsValidatorsService { | ||
8 | readonly DOMAINS: BuildFormValidator | ||
9 | |||
10 | constructor () { | ||
11 | this.DOMAINS = { | ||
12 | VALIDATORS: [ Validators.required, this.validDomains, this.isHostsUnique ], | ||
13 | MESSAGES: { | ||
14 | 'required': $localize`Domain is required.`, | ||
15 | 'validDomains': $localize`Domains entered are invalid.`, | ||
16 | 'uniqueDomains': $localize`Domains entered contain duplicates.` | ||
17 | } | ||
18 | } | ||
19 | } | ||
20 | |||
21 | getNotEmptyHosts (hosts: string) { | ||
22 | return hosts | ||
23 | .split('\n') | ||
24 | .filter((host: string) => host && host.length !== 0) // Eject empty hosts | ||
25 | } | ||
26 | |||
27 | private validDomains: ValidatorFn = (control) => { | ||
28 | if (!control.value) return null | ||
29 | |||
30 | const newHostsErrors = [] | ||
31 | const hosts = this.getNotEmptyHosts(control.value) | ||
32 | |||
33 | for (const host of hosts) { | ||
34 | if (validateHost(host) === false) { | ||
35 | newHostsErrors.push($localize`${host} is not valid`) | ||
36 | } | ||
37 | } | ||
38 | |||
39 | /* Is not valid. */ | ||
40 | if (newHostsErrors.length !== 0) { | ||
41 | return { | ||
42 | 'validDomains': { | ||
43 | reason: 'invalid', | ||
44 | value: newHostsErrors.join('. ') + '.' | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | /* Is valid. */ | ||
50 | return null | ||
51 | } | ||
52 | |||
53 | private isHostsUnique: ValidatorFn = (control) => { | ||
54 | if (!control.value) return null | ||
55 | |||
56 | const hosts = this.getNotEmptyHosts(control.value) | ||
57 | |||
58 | if (hosts.every((host: string) => hosts.indexOf(host) === hosts.lastIndexOf(host))) { | ||
59 | return null | ||
60 | } else { | ||
61 | return { | ||
62 | 'uniqueDomains': { | ||
63 | reason: 'invalid' | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts deleted file mode 100644 index 862ff5470..000000000 --- a/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class CustomConfigValidatorsService { | ||
7 | readonly INSTANCE_NAME: BuildFormValidator | ||
8 | readonly INSTANCE_SHORT_DESCRIPTION: BuildFormValidator | ||
9 | readonly SERVICES_TWITTER_USERNAME: BuildFormValidator | ||
10 | readonly CACHE_PREVIEWS_SIZE: BuildFormValidator | ||
11 | readonly CACHE_CAPTIONS_SIZE: BuildFormValidator | ||
12 | readonly SIGNUP_LIMIT: BuildFormValidator | ||
13 | readonly ADMIN_EMAIL: BuildFormValidator | ||
14 | readonly TRANSCODING_THREADS: BuildFormValidator | ||
15 | readonly INDEX_URL: BuildFormValidator | ||
16 | readonly SEARCH_INDEX_URL: BuildFormValidator | ||
17 | |||
18 | constructor () { | ||
19 | this.INSTANCE_NAME = { | ||
20 | VALIDATORS: [ Validators.required ], | ||
21 | MESSAGES: { | ||
22 | 'required': $localize`Instance name is required.` | ||
23 | } | ||
24 | } | ||
25 | |||
26 | this.INSTANCE_SHORT_DESCRIPTION = { | ||
27 | VALIDATORS: [ Validators.max(250) ], | ||
28 | MESSAGES: { | ||
29 | 'max': $localize`Short description should not be longer than 250 characters.` | ||
30 | } | ||
31 | } | ||
32 | |||
33 | this.SERVICES_TWITTER_USERNAME = { | ||
34 | VALIDATORS: [ Validators.required ], | ||
35 | MESSAGES: { | ||
36 | 'required': $localize`Twitter username is required.` | ||
37 | } | ||
38 | } | ||
39 | |||
40 | this.CACHE_PREVIEWS_SIZE = { | ||
41 | VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], | ||
42 | MESSAGES: { | ||
43 | 'required': $localize`Previews cache size is required.`, | ||
44 | 'min': $localize`Previews cache size must be greater than 1.`, | ||
45 | 'pattern': $localize`Previews cache size must be a number.` | ||
46 | } | ||
47 | } | ||
48 | |||
49 | this.CACHE_CAPTIONS_SIZE = { | ||
50 | VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], | ||
51 | MESSAGES: { | ||
52 | 'required': $localize`Captions cache size is required.`, | ||
53 | 'min': $localize`Captions cache size must be greater than 1.`, | ||
54 | 'pattern': $localize`Captions cache size must be a number.` | ||
55 | } | ||
56 | } | ||
57 | |||
58 | this.SIGNUP_LIMIT = { | ||
59 | VALIDATORS: [ Validators.required, Validators.min(-1), Validators.pattern('-?[0-9]+') ], | ||
60 | MESSAGES: { | ||
61 | 'required': $localize`Signup limit is required.`, | ||
62 | 'min': $localize`Signup limit must be greater than 1.`, | ||
63 | 'pattern': $localize`Signup limit must be a number.` | ||
64 | } | ||
65 | } | ||
66 | |||
67 | this.ADMIN_EMAIL = { | ||
68 | VALIDATORS: [ Validators.required, Validators.email ], | ||
69 | MESSAGES: { | ||
70 | 'required': $localize`Admin email is required.`, | ||
71 | 'email': $localize`Admin email must be valid.` | ||
72 | } | ||
73 | } | ||
74 | |||
75 | this.TRANSCODING_THREADS = { | ||
76 | VALIDATORS: [ Validators.required, Validators.min(0) ], | ||
77 | MESSAGES: { | ||
78 | 'required': $localize`Transcoding threads is required.`, | ||
79 | 'min': $localize`Transcoding threads must be greater or equal to 0.` | ||
80 | } | ||
81 | } | ||
82 | |||
83 | this.INDEX_URL = { | ||
84 | VALIDATORS: [ Validators.pattern(/^https:\/\//) ], | ||
85 | MESSAGES: { | ||
86 | 'pattern': $localize`Index URL should be a URL` | ||
87 | } | ||
88 | } | ||
89 | |||
90 | this.SEARCH_INDEX_URL = { | ||
91 | VALIDATORS: [ Validators.pattern(/^https?:\/\//) ], | ||
92 | MESSAGES: { | ||
93 | 'pattern': $localize`Search index URL should be a URL` | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts b/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts deleted file mode 100644 index dec7d8d9a..000000000 --- a/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms' | ||
2 | import { Injectable } from '@angular/core' | ||
3 | import { FormReactiveErrors, FormReactiveValidationMessages } from '../form-reactive' | ||
4 | |||
5 | export type BuildFormValidator = { | ||
6 | VALIDATORS: ValidatorFn[], | ||
7 | MESSAGES: { [ name: string ]: string } | ||
8 | } | ||
9 | export type BuildFormArgument = { | ||
10 | [ id: string ]: BuildFormValidator | BuildFormArgument | ||
11 | } | ||
12 | export type BuildFormDefaultValues = { | ||
13 | [ name: string ]: string | string[] | BuildFormDefaultValues | ||
14 | } | ||
15 | |||
16 | @Injectable() | ||
17 | export class FormValidatorService { | ||
18 | |||
19 | constructor ( | ||
20 | private formBuilder: FormBuilder | ||
21 | ) {} | ||
22 | |||
23 | buildForm (obj: BuildFormArgument, defaultValues: BuildFormDefaultValues = {}) { | ||
24 | const formErrors: FormReactiveErrors = {} | ||
25 | const validationMessages: FormReactiveValidationMessages = {} | ||
26 | const group: { [key: string]: any } = {} | ||
27 | |||
28 | for (const name of Object.keys(obj)) { | ||
29 | formErrors[name] = '' | ||
30 | |||
31 | const field = obj[name] | ||
32 | if (this.isRecursiveField(field)) { | ||
33 | const result = this.buildForm(field as BuildFormArgument, defaultValues[name] as BuildFormDefaultValues) | ||
34 | group[name] = result.form | ||
35 | formErrors[name] = result.formErrors | ||
36 | validationMessages[name] = result.validationMessages | ||
37 | |||
38 | continue | ||
39 | } | ||
40 | |||
41 | if (field && field.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } | ||
42 | |||
43 | const defaultValue = defaultValues[name] || '' | ||
44 | |||
45 | if (field && field.VALIDATORS) group[name] = [ defaultValue, field.VALIDATORS ] | ||
46 | else group[name] = [ defaultValue ] | ||
47 | } | ||
48 | |||
49 | const form = this.formBuilder.group(group) | ||
50 | return { form, formErrors, validationMessages } | ||
51 | } | ||
52 | |||
53 | updateForm ( | ||
54 | form: FormGroup, | ||
55 | formErrors: FormReactiveErrors, | ||
56 | validationMessages: FormReactiveValidationMessages, | ||
57 | obj: BuildFormArgument, | ||
58 | defaultValues: BuildFormDefaultValues = {} | ||
59 | ) { | ||
60 | for (const name of Object.keys(obj)) { | ||
61 | formErrors[name] = '' | ||
62 | |||
63 | const field = obj[name] | ||
64 | if (this.isRecursiveField(field)) { | ||
65 | this.updateForm( | ||
66 | form[name], | ||
67 | formErrors[name] as FormReactiveErrors, | ||
68 | validationMessages[name] as FormReactiveValidationMessages, | ||
69 | obj[name] as BuildFormArgument, | ||
70 | defaultValues[name] as BuildFormDefaultValues | ||
71 | ) | ||
72 | continue | ||
73 | } | ||
74 | |||
75 | if (field && field.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } | ||
76 | |||
77 | const defaultValue = defaultValues[name] || '' | ||
78 | |||
79 | if (field && field.VALIDATORS) form.addControl(name, new FormControl(defaultValue, field.VALIDATORS as ValidatorFn[])) | ||
80 | else form.addControl(name, new FormControl(defaultValue)) | ||
81 | } | ||
82 | } | ||
83 | |||
84 | private isRecursiveField (field: any) { | ||
85 | return field && typeof field === 'object' && !field.MESSAGES && !field.VALIDATORS | ||
86 | } | ||
87 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/host.ts b/client/src/app/shared/shared-forms/form-validators/host.ts deleted file mode 100644 index c18a35f9b..000000000 --- a/client/src/app/shared/shared-forms/form-validators/host.ts +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | export function validateHost (value: string) { | ||
2 | // Thanks to http://stackoverflow.com/a/106223 | ||
3 | const HOST_REGEXP = new RegExp( | ||
4 | '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' | ||
5 | ) | ||
6 | |||
7 | return HOST_REGEXP.test(value) | ||
8 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/index.ts b/client/src/app/shared/shared-forms/form-validators/index.ts deleted file mode 100644 index b06a326ff..000000000 --- a/client/src/app/shared/shared-forms/form-validators/index.ts +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | export * from './abuse-validators.service' | ||
2 | export * from './batch-domains-validators.service' | ||
3 | export * from './custom-config-validators.service' | ||
4 | export * from './form-validator.service' | ||
5 | export * from './host' | ||
6 | export * from './instance-validators.service' | ||
7 | export * from './login-validators.service' | ||
8 | export * from './reset-password-validators.service' | ||
9 | export * from './user-validators.service' | ||
10 | export * from './video-accept-ownership-validators.service' | ||
11 | export * from './video-block-validators.service' | ||
12 | export * from './video-captions-validators.service' | ||
13 | export * from './video-change-ownership-validators.service' | ||
14 | export * from './video-channel-validators.service' | ||
15 | export * from './video-comment-validators.service' | ||
16 | export * from './video-playlist-validators.service' | ||
17 | export * from './video-validators.service' | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts deleted file mode 100644 index 3628f0b60..000000000 --- a/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class InstanceValidatorsService { | ||
7 | readonly FROM_EMAIL: BuildFormValidator | ||
8 | readonly FROM_NAME: BuildFormValidator | ||
9 | readonly SUBJECT: BuildFormValidator | ||
10 | readonly BODY: BuildFormValidator | ||
11 | |||
12 | constructor () { | ||
13 | |||
14 | this.FROM_EMAIL = { | ||
15 | VALIDATORS: [ Validators.required, Validators.email ], | ||
16 | MESSAGES: { | ||
17 | 'required': $localize`Email is required.`, | ||
18 | 'email': $localize`Email must be valid.` | ||
19 | } | ||
20 | } | ||
21 | |||
22 | this.FROM_NAME = { | ||
23 | VALIDATORS: [ | ||
24 | Validators.required, | ||
25 | Validators.minLength(1), | ||
26 | Validators.maxLength(120) | ||
27 | ], | ||
28 | MESSAGES: { | ||
29 | 'required': $localize`Your name is required.`, | ||
30 | 'minlength': $localize`Your name must be at least 1 character long.`, | ||
31 | 'maxlength': $localize`Your name cannot be more than 120 characters long.` | ||
32 | } | ||
33 | } | ||
34 | |||
35 | this.SUBJECT = { | ||
36 | VALIDATORS: [ | ||
37 | Validators.required, | ||
38 | Validators.minLength(1), | ||
39 | Validators.maxLength(120) | ||
40 | ], | ||
41 | MESSAGES: { | ||
42 | 'required': $localize`A subject is required.`, | ||
43 | 'minlength': $localize`The subject must be at least 1 character long.`, | ||
44 | 'maxlength': $localize`The subject cannot be more than 120 characters long.` | ||
45 | } | ||
46 | } | ||
47 | |||
48 | this.BODY = { | ||
49 | VALIDATORS: [ | ||
50 | Validators.required, | ||
51 | Validators.minLength(3), | ||
52 | Validators.maxLength(5000) | ||
53 | ], | ||
54 | MESSAGES: { | ||
55 | 'required': $localize`A message is required.`, | ||
56 | 'minlength': $localize`The message must be at least 3 characters long.`, | ||
57 | 'maxlength': $localize`The message cannot be more than 5000 characters long.` | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts deleted file mode 100644 index 67ea11f20..000000000 --- a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class LoginValidatorsService { | ||
7 | readonly LOGIN_USERNAME: BuildFormValidator | ||
8 | readonly LOGIN_PASSWORD: BuildFormValidator | ||
9 | |||
10 | constructor () { | ||
11 | this.LOGIN_USERNAME = { | ||
12 | VALIDATORS: [ | ||
13 | Validators.required | ||
14 | ], | ||
15 | MESSAGES: { | ||
16 | 'required': $localize`Username is required.` | ||
17 | } | ||
18 | } | ||
19 | |||
20 | this.LOGIN_PASSWORD = { | ||
21 | VALIDATORS: [ | ||
22 | Validators.required | ||
23 | ], | ||
24 | MESSAGES: { | ||
25 | 'required': $localize`Password is required.` | ||
26 | } | ||
27 | } | ||
28 | } | ||
29 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts deleted file mode 100644 index 3d0b4dd64..000000000 --- a/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class ResetPasswordValidatorsService { | ||
7 | readonly RESET_PASSWORD_CONFIRM: BuildFormValidator | ||
8 | |||
9 | constructor () { | ||
10 | this.RESET_PASSWORD_CONFIRM = { | ||
11 | VALIDATORS: [ | ||
12 | Validators.required | ||
13 | ], | ||
14 | MESSAGES: { | ||
15 | 'required': $localize`Confirmation of the password is required.` | ||
16 | } | ||
17 | } | ||
18 | } | ||
19 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts deleted file mode 100644 index 312fc9b1e..000000000 --- a/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts +++ /dev/null | |||
@@ -1,166 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class UserValidatorsService { | ||
7 | readonly USER_USERNAME: BuildFormValidator | ||
8 | readonly USER_CHANNEL_NAME: BuildFormValidator | ||
9 | readonly USER_EMAIL: BuildFormValidator | ||
10 | readonly USER_PASSWORD: BuildFormValidator | ||
11 | readonly USER_PASSWORD_OPTIONAL: BuildFormValidator | ||
12 | readonly USER_CONFIRM_PASSWORD: BuildFormValidator | ||
13 | readonly USER_VIDEO_QUOTA: BuildFormValidator | ||
14 | readonly USER_VIDEO_QUOTA_DAILY: BuildFormValidator | ||
15 | readonly USER_ROLE: BuildFormValidator | ||
16 | readonly USER_DISPLAY_NAME_REQUIRED: BuildFormValidator | ||
17 | readonly USER_DESCRIPTION: BuildFormValidator | ||
18 | readonly USER_TERMS: BuildFormValidator | ||
19 | |||
20 | readonly USER_BAN_REASON: BuildFormValidator | ||
21 | |||
22 | constructor () { | ||
23 | |||
24 | this.USER_USERNAME = { | ||
25 | VALIDATORS: [ | ||
26 | Validators.required, | ||
27 | Validators.minLength(1), | ||
28 | Validators.maxLength(50), | ||
29 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | ||
30 | ], | ||
31 | MESSAGES: { | ||
32 | 'required': $localize`Username is required.`, | ||
33 | 'minlength': $localize`Username must be at least 1 character long.`, | ||
34 | 'maxlength': $localize`Username cannot be more than 50 characters long.`, | ||
35 | 'pattern': $localize`Username should be lowercase alphanumeric; dots and underscores are allowed.` | ||
36 | } | ||
37 | } | ||
38 | |||
39 | this.USER_CHANNEL_NAME = { | ||
40 | VALIDATORS: [ | ||
41 | Validators.required, | ||
42 | Validators.minLength(1), | ||
43 | Validators.maxLength(50), | ||
44 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | ||
45 | ], | ||
46 | MESSAGES: { | ||
47 | 'required': $localize`Channel name is required.`, | ||
48 | 'minlength': $localize`Channel name must be at least 1 character long.`, | ||
49 | 'maxlength': $localize`Channel name cannot be more than 50 characters long.`, | ||
50 | 'pattern': $localize`Channel name should be lowercase alphanumeric; dots and underscores are allowed.` | ||
51 | } | ||
52 | } | ||
53 | |||
54 | this.USER_EMAIL = { | ||
55 | VALIDATORS: [ Validators.required, Validators.email ], | ||
56 | MESSAGES: { | ||
57 | 'required': $localize`Email is required.`, | ||
58 | 'email': $localize`Email must be valid.` | ||
59 | } | ||
60 | } | ||
61 | |||
62 | this.USER_PASSWORD = { | ||
63 | VALIDATORS: [ | ||
64 | Validators.required, | ||
65 | Validators.minLength(6), | ||
66 | Validators.maxLength(255) | ||
67 | ], | ||
68 | MESSAGES: { | ||
69 | 'required': $localize`Password is required.`, | ||
70 | 'minlength': $localize`Password must be at least 6 characters long.`, | ||
71 | 'maxlength': $localize`Password cannot be more than 255 characters long.` | ||
72 | } | ||
73 | } | ||
74 | |||
75 | this.USER_PASSWORD_OPTIONAL = { | ||
76 | VALIDATORS: [ | ||
77 | Validators.minLength(6), | ||
78 | Validators.maxLength(255) | ||
79 | ], | ||
80 | MESSAGES: { | ||
81 | 'minlength': $localize`Password must be at least 6 characters long.`, | ||
82 | 'maxlength': $localize`Password cannot be more than 255 characters long.` | ||
83 | } | ||
84 | } | ||
85 | |||
86 | this.USER_CONFIRM_PASSWORD = { | ||
87 | VALIDATORS: [], | ||
88 | MESSAGES: { | ||
89 | 'matchPassword': $localize`The new password and the confirmed password do not correspond.` | ||
90 | } | ||
91 | } | ||
92 | |||
93 | this.USER_VIDEO_QUOTA = { | ||
94 | VALIDATORS: [ Validators.required, Validators.min(-1) ], | ||
95 | MESSAGES: { | ||
96 | 'required': $localize`Video quota is required.`, | ||
97 | 'min': $localize`Quota must be greater than -1.` | ||
98 | } | ||
99 | } | ||
100 | this.USER_VIDEO_QUOTA_DAILY = { | ||
101 | VALIDATORS: [ Validators.required, Validators.min(-1) ], | ||
102 | MESSAGES: { | ||
103 | 'required': $localize`Daily upload limit is required.`, | ||
104 | 'min': $localize`Daily upload limit must be greater than -1.` | ||
105 | } | ||
106 | } | ||
107 | |||
108 | this.USER_ROLE = { | ||
109 | VALIDATORS: [ Validators.required ], | ||
110 | MESSAGES: { | ||
111 | 'required': $localize`User role is required.` | ||
112 | } | ||
113 | } | ||
114 | |||
115 | this.USER_DISPLAY_NAME_REQUIRED = this.getDisplayName(true) | ||
116 | |||
117 | this.USER_DESCRIPTION = { | ||
118 | VALIDATORS: [ | ||
119 | Validators.minLength(3), | ||
120 | Validators.maxLength(1000) | ||
121 | ], | ||
122 | MESSAGES: { | ||
123 | 'minlength': $localize`Description must be at least 3 characters long.`, | ||
124 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` | ||
125 | } | ||
126 | } | ||
127 | |||
128 | this.USER_TERMS = { | ||
129 | VALIDATORS: [ | ||
130 | Validators.requiredTrue | ||
131 | ], | ||
132 | MESSAGES: { | ||
133 | 'required': $localize`You must agree with the instance terms in order to register on it.` | ||
134 | } | ||
135 | } | ||
136 | |||
137 | this.USER_BAN_REASON = { | ||
138 | VALIDATORS: [ | ||
139 | Validators.minLength(3), | ||
140 | Validators.maxLength(250) | ||
141 | ], | ||
142 | MESSAGES: { | ||
143 | 'minlength': $localize`Ban reason must be at least 3 characters long.`, | ||
144 | 'maxlength': $localize`Ban reason cannot be more than 250 characters long.` | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | private getDisplayName (required: boolean) { | ||
150 | const control = { | ||
151 | VALIDATORS: [ | ||
152 | Validators.minLength(1), | ||
153 | Validators.maxLength(120) | ||
154 | ], | ||
155 | MESSAGES: { | ||
156 | 'required': $localize`Display name is required.`, | ||
157 | 'minlength': $localize`Display name must be at least 1 character long.`, | ||
158 | 'maxlength': $localize`Display name cannot be more than 50 characters long.` | ||
159 | } | ||
160 | } | ||
161 | |||
162 | if (required) control.VALIDATORS.push(Validators.required) | ||
163 | |||
164 | return control | ||
165 | } | ||
166 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts deleted file mode 100644 index aed9e9cdd..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoAcceptOwnershipValidatorsService { | ||
7 | readonly CHANNEL: BuildFormValidator | ||
8 | |||
9 | constructor () { | ||
10 | this.CHANNEL = { | ||
11 | VALIDATORS: [ Validators.required ], | ||
12 | MESSAGES: { | ||
13 | 'required': $localize`The channel is required.` | ||
14 | } | ||
15 | } | ||
16 | } | ||
17 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts deleted file mode 100644 index bce1880dc..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoBlockValidatorsService { | ||
7 | readonly VIDEO_BLOCK_REASON: BuildFormValidator | ||
8 | |||
9 | constructor () { | ||
10 | this.VIDEO_BLOCK_REASON = { | ||
11 | VALIDATORS: [ Validators.minLength(2), Validators.maxLength(300) ], | ||
12 | MESSAGES: { | ||
13 | 'minlength': $localize`Block reason must be at least 2 characters long.`, | ||
14 | 'maxlength': $localize`Block reason cannot be more than 300 characters long.` | ||
15 | } | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts deleted file mode 100644 index 7e90264e5..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoCaptionsValidatorsService { | ||
7 | readonly VIDEO_CAPTION_LANGUAGE: BuildFormValidator | ||
8 | readonly VIDEO_CAPTION_FILE: BuildFormValidator | ||
9 | |||
10 | constructor () { | ||
11 | |||
12 | this.VIDEO_CAPTION_LANGUAGE = { | ||
13 | VALIDATORS: [ Validators.required ], | ||
14 | MESSAGES: { | ||
15 | 'required': $localize`Video caption language is required.` | ||
16 | } | ||
17 | } | ||
18 | |||
19 | this.VIDEO_CAPTION_FILE = { | ||
20 | VALIDATORS: [ Validators.required ], | ||
21 | MESSAGES: { | ||
22 | 'required': $localize`Video caption file is required.` | ||
23 | } | ||
24 | } | ||
25 | } | ||
26 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts deleted file mode 100644 index 8c809a0d5..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { AbstractControl, ValidationErrors, Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoChangeOwnershipValidatorsService { | ||
7 | readonly USERNAME: BuildFormValidator | ||
8 | |||
9 | constructor () { | ||
10 | this.USERNAME = { | ||
11 | VALIDATORS: [ Validators.required, this.localAccountValidator ], | ||
12 | MESSAGES: { | ||
13 | 'required': $localize`The username is required.`, | ||
14 | 'localAccountOnly': $localize`You can only transfer ownership to a local account` | ||
15 | } | ||
16 | } | ||
17 | } | ||
18 | |||
19 | localAccountValidator (control: AbstractControl): ValidationErrors { | ||
20 | if (control.value.includes('@')) { | ||
21 | return { 'localAccountOnly': true } | ||
22 | } | ||
23 | |||
24 | return null | ||
25 | } | ||
26 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts deleted file mode 100644 index 3e7444196..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoChannelValidatorsService { | ||
7 | readonly VIDEO_CHANNEL_NAME: BuildFormValidator | ||
8 | readonly VIDEO_CHANNEL_DISPLAY_NAME: BuildFormValidator | ||
9 | readonly VIDEO_CHANNEL_DESCRIPTION: BuildFormValidator | ||
10 | readonly VIDEO_CHANNEL_SUPPORT: BuildFormValidator | ||
11 | |||
12 | constructor () { | ||
13 | this.VIDEO_CHANNEL_NAME = { | ||
14 | VALIDATORS: [ | ||
15 | Validators.required, | ||
16 | Validators.minLength(1), | ||
17 | Validators.maxLength(50), | ||
18 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | ||
19 | ], | ||
20 | MESSAGES: { | ||
21 | 'required': $localize`Name is required.`, | ||
22 | 'minlength': $localize`Name must be at least 1 character long.`, | ||
23 | 'maxlength': $localize`Name cannot be more than 50 characters long.`, | ||
24 | 'pattern': $localize`Name should be lowercase alphanumeric; dots and underscores are allowed.` | ||
25 | } | ||
26 | } | ||
27 | |||
28 | this.VIDEO_CHANNEL_DISPLAY_NAME = { | ||
29 | VALIDATORS: [ | ||
30 | Validators.required, | ||
31 | Validators.minLength(1), | ||
32 | Validators.maxLength(50) | ||
33 | ], | ||
34 | MESSAGES: { | ||
35 | 'required': $localize`Display name is required.`, | ||
36 | 'minlength': $localize`Display name must be at least 1 character long.`, | ||
37 | 'maxlength': $localize`Display name cannot be more than 50 characters long.` | ||
38 | } | ||
39 | } | ||
40 | |||
41 | this.VIDEO_CHANNEL_DESCRIPTION = { | ||
42 | VALIDATORS: [ | ||
43 | Validators.minLength(3), | ||
44 | Validators.maxLength(1000) | ||
45 | ], | ||
46 | MESSAGES: { | ||
47 | 'minlength': $localize`Description must be at least 3 characters long.`, | ||
48 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` | ||
49 | } | ||
50 | } | ||
51 | |||
52 | this.VIDEO_CHANNEL_SUPPORT = { | ||
53 | VALIDATORS: [ | ||
54 | Validators.minLength(3), | ||
55 | Validators.maxLength(1000) | ||
56 | ], | ||
57 | MESSAGES: { | ||
58 | 'minlength': $localize`Support text must be at least 3 characters long.`, | ||
59 | 'maxlength': $localize`Support text cannot be more than 1000 characters long` | ||
60 | } | ||
61 | } | ||
62 | } | ||
63 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts deleted file mode 100644 index 18e7ae264..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoCommentValidatorsService { | ||
7 | readonly VIDEO_COMMENT_TEXT: BuildFormValidator | ||
8 | |||
9 | constructor () { | ||
10 | this.VIDEO_COMMENT_TEXT = { | ||
11 | VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ], | ||
12 | MESSAGES: { | ||
13 | 'required': $localize`Comment is required.`, | ||
14 | 'minlength': $localize`Comment must be at least 2 characters long.`, | ||
15 | 'maxlength': $localize`Comment cannot be more than 3000 characters long.` | ||
16 | } | ||
17 | } | ||
18 | } | ||
19 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts deleted file mode 100644 index 3b45a40fd..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { AbstractControl, Validators } from '@angular/forms' | ||
3 | import { VideoPlaylistPrivacy } from '@shared/models' | ||
4 | import { BuildFormValidator } from './form-validator.service' | ||
5 | |||
6 | @Injectable() | ||
7 | export class VideoPlaylistValidatorsService { | ||
8 | readonly VIDEO_PLAYLIST_DISPLAY_NAME: BuildFormValidator | ||
9 | readonly VIDEO_PLAYLIST_PRIVACY: BuildFormValidator | ||
10 | readonly VIDEO_PLAYLIST_DESCRIPTION: BuildFormValidator | ||
11 | readonly VIDEO_PLAYLIST_CHANNEL_ID: BuildFormValidator | ||
12 | |||
13 | constructor () { | ||
14 | this.VIDEO_PLAYLIST_DISPLAY_NAME = { | ||
15 | VALIDATORS: [ | ||
16 | Validators.required, | ||
17 | Validators.minLength(1), | ||
18 | Validators.maxLength(120) | ||
19 | ], | ||
20 | MESSAGES: { | ||
21 | 'required': $localize`Display name is required.`, | ||
22 | 'minlength': $localize`Display name must be at least 1 character long.`, | ||
23 | 'maxlength': $localize`Display name cannot be more than 120 characters long.` | ||
24 | } | ||
25 | } | ||
26 | |||
27 | this.VIDEO_PLAYLIST_PRIVACY = { | ||
28 | VALIDATORS: [ | ||
29 | Validators.required | ||
30 | ], | ||
31 | MESSAGES: { | ||
32 | 'required': $localize`Privacy is required.` | ||
33 | } | ||
34 | } | ||
35 | |||
36 | this.VIDEO_PLAYLIST_DESCRIPTION = { | ||
37 | VALIDATORS: [ | ||
38 | Validators.minLength(3), | ||
39 | Validators.maxLength(1000) | ||
40 | ], | ||
41 | MESSAGES: { | ||
42 | 'minlength': $localize`Description must be at least 3 characters long.`, | ||
43 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` | ||
44 | } | ||
45 | } | ||
46 | |||
47 | this.VIDEO_PLAYLIST_CHANNEL_ID = { | ||
48 | VALIDATORS: [ ], | ||
49 | MESSAGES: { | ||
50 | 'required': $localize`The channel is required when the playlist is public.` | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | |||
55 | setChannelValidator (channelControl: AbstractControl, privacy: VideoPlaylistPrivacy) { | ||
56 | if (privacy.toString() === VideoPlaylistPrivacy.PUBLIC.toString()) { | ||
57 | channelControl.setValidators([ Validators.required ]) | ||
58 | } else { | ||
59 | channelControl.setValidators(null) | ||
60 | } | ||
61 | |||
62 | channelControl.markAsDirty() | ||
63 | channelControl.updateValueAndValidity() | ||
64 | } | ||
65 | } | ||
diff --git a/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts deleted file mode 100644 index 8119c1ae7..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { AbstractControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoValidatorsService { | ||
7 | readonly VIDEO_NAME: BuildFormValidator | ||
8 | readonly VIDEO_PRIVACY: BuildFormValidator | ||
9 | readonly VIDEO_CATEGORY: BuildFormValidator | ||
10 | readonly VIDEO_LICENCE: BuildFormValidator | ||
11 | readonly VIDEO_LANGUAGE: BuildFormValidator | ||
12 | readonly VIDEO_IMAGE: BuildFormValidator | ||
13 | readonly VIDEO_CHANNEL: BuildFormValidator | ||
14 | readonly VIDEO_DESCRIPTION: BuildFormValidator | ||
15 | readonly VIDEO_TAGS_ARRAY: BuildFormValidator | ||
16 | readonly VIDEO_TAG: BuildFormValidator | ||
17 | readonly VIDEO_SUPPORT: BuildFormValidator | ||
18 | readonly VIDEO_SCHEDULE_PUBLICATION_AT: BuildFormValidator | ||
19 | readonly VIDEO_ORIGINALLY_PUBLISHED_AT: BuildFormValidator | ||
20 | |||
21 | constructor () { | ||
22 | |||
23 | this.VIDEO_NAME = { | ||
24 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], | ||
25 | MESSAGES: { | ||
26 | 'required': $localize`Video name is required.`, | ||
27 | 'minlength': $localize`Video name must be at least 3 characters long.`, | ||
28 | 'maxlength': $localize`Video name cannot be more than 120 characters long.` | ||
29 | } | ||
30 | } | ||
31 | |||
32 | this.VIDEO_PRIVACY = { | ||
33 | VALIDATORS: [ Validators.required ], | ||
34 | MESSAGES: { | ||
35 | 'required': $localize`Video privacy is required.` | ||
36 | } | ||
37 | } | ||
38 | |||
39 | this.VIDEO_CATEGORY = { | ||
40 | VALIDATORS: [ ], | ||
41 | MESSAGES: {} | ||
42 | } | ||
43 | |||
44 | this.VIDEO_LICENCE = { | ||
45 | VALIDATORS: [ ], | ||
46 | MESSAGES: {} | ||
47 | } | ||
48 | |||
49 | this.VIDEO_LANGUAGE = { | ||
50 | VALIDATORS: [ ], | ||
51 | MESSAGES: {} | ||
52 | } | ||
53 | |||
54 | this.VIDEO_IMAGE = { | ||
55 | VALIDATORS: [ ], | ||
56 | MESSAGES: {} | ||
57 | } | ||
58 | |||
59 | this.VIDEO_CHANNEL = { | ||
60 | VALIDATORS: [ Validators.required ], | ||
61 | MESSAGES: { | ||
62 | 'required': $localize`Video channel is required.` | ||
63 | } | ||
64 | } | ||
65 | |||
66 | this.VIDEO_DESCRIPTION = { | ||
67 | VALIDATORS: [ Validators.minLength(3), Validators.maxLength(10000) ], | ||
68 | MESSAGES: { | ||
69 | 'minlength': $localize`Video description must be at least 3 characters long.`, | ||
70 | 'maxlength': $localize`Video description cannot be more than 10000 characters long.` | ||
71 | } | ||
72 | } | ||
73 | |||
74 | this.VIDEO_TAG = { | ||
75 | VALIDATORS: [ Validators.minLength(2), Validators.maxLength(30) ], | ||
76 | MESSAGES: { | ||
77 | 'minlength': $localize`A tag should be more than 2 characters long.`, | ||
78 | 'maxlength': $localize`A tag should be less than 30 characters long.` | ||
79 | } | ||
80 | } | ||
81 | |||
82 | this.VIDEO_TAGS_ARRAY = { | ||
83 | VALIDATORS: [ Validators.maxLength(5), this.arrayTagLengthValidator() ], | ||
84 | MESSAGES: { | ||
85 | 'maxlength': $localize`A maximum of 5 tags can be used on a video.`, | ||
86 | 'arrayTagLength': $localize`A tag should be more than 2, and less than 30 characters long.` | ||
87 | } | ||
88 | } | ||
89 | |||
90 | this.VIDEO_SUPPORT = { | ||
91 | VALIDATORS: [ Validators.minLength(3), Validators.maxLength(1000) ], | ||
92 | MESSAGES: { | ||
93 | 'minlength': $localize`Video support must be at least 3 characters long.`, | ||
94 | 'maxlength': $localize`Video support cannot be more than 1000 characters long.` | ||
95 | } | ||
96 | } | ||
97 | |||
98 | this.VIDEO_SCHEDULE_PUBLICATION_AT = { | ||
99 | VALIDATORS: [ ], | ||
100 | MESSAGES: { | ||
101 | 'required': $localize`A date is required to schedule video update.` | ||
102 | } | ||
103 | } | ||
104 | |||
105 | this.VIDEO_ORIGINALLY_PUBLISHED_AT = { | ||
106 | VALIDATORS: [ ], | ||
107 | MESSAGES: {} | ||
108 | } | ||
109 | } | ||
110 | |||
111 | arrayTagLengthValidator (min = 2, max = 30): ValidatorFn { | ||
112 | return (control: AbstractControl): ValidationErrors => { | ||
113 | const array = control.value as Array<string> | ||
114 | |||
115 | if (array.every(e => e.length > min && e.length < max)) { | ||
116 | return null | ||
117 | } | ||
118 | |||
119 | return { 'arrayTagLength': true } | ||
120 | } | ||
121 | } | ||
122 | } | ||