mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
import { Form, ValidatorsEx } from '@app/framework';
|
|
import { EditPatternDto, PatternDto } from './../services/patterns.service';
|
|
|
|
export class EditPatternForm extends Form<FormGroup, EditPatternDto, PatternDto> {
|
|
constructor(formBuilder: FormBuilder) {
|
|
super(formBuilder.group({
|
|
name: ['',
|
|
[
|
|
Validators.required,
|
|
Validators.maxLength(100),
|
|
ValidatorsEx.pattern('[A-z0-9]+[A-z0-9\- ]*[A-z0-9]', 'Name can only contain letters, numbers, dashes and spaces.')
|
|
]
|
|
],
|
|
pattern: ['',
|
|
[
|
|
Validators.required
|
|
]
|
|
],
|
|
message: ['',
|
|
[
|
|
Validators.maxLength(1000)
|
|
]
|
|
]
|
|
}));
|
|
}
|
|
}
|