diff --git a/src/Squidex/app/features/schemas/declarations.ts b/src/Squidex/app/features/schemas/declarations.ts index 34608bd13..cf20ea5a8 100644 --- a/src/Squidex/app/features/schemas/declarations.ts +++ b/src/Squidex/app/features/schemas/declarations.ts @@ -5,6 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ +export * from './pages/schema/types/array-validation.component'; export * from './pages/schema/types/assets-ui.component'; export * from './pages/schema/types/assets-validation.component'; export * from './pages/schema/types/boolean-ui.component'; diff --git a/src/Squidex/app/features/schemas/module.ts b/src/Squidex/app/features/schemas/module.ts index 71eb88cf7..cb332a012 100644 --- a/src/Squidex/app/features/schemas/module.ts +++ b/src/Squidex/app/features/schemas/module.ts @@ -16,6 +16,7 @@ import { } from '@app/shared'; import { + ArrayValidationComponent, AssetsUIComponent, AssetsValidationComponent, BooleanUIComponent, @@ -81,6 +82,7 @@ const routes: Routes = [ SchemaMustExistGuard ], declarations: [ + ArrayValidationComponent, AssetsUIComponent, AssetsValidationComponent, BooleanUIComponent, diff --git a/src/Squidex/app/features/schemas/pages/schema/forms/field-form-validation.component.ts b/src/Squidex/app/features/schemas/pages/schema/forms/field-form-validation.component.ts index fd0ba685a..2beb7174a 100644 --- a/src/Squidex/app/features/schemas/pages/schema/forms/field-form-validation.component.ts +++ b/src/Squidex/app/features/schemas/pages/schema/forms/field-form-validation.component.ts @@ -14,6 +14,9 @@ import { FieldDto, PatternDto } from '@app/shared'; selector: 'sqx-field-form-validation', template: ` + + + diff --git a/src/Squidex/app/features/schemas/pages/schema/forms/field-form.component.ts b/src/Squidex/app/features/schemas/pages/schema/forms/field-form.component.ts index 7a5cd7b09..c6403885b 100644 --- a/src/Squidex/app/features/schemas/pages/schema/forms/field-form.component.ts +++ b/src/Squidex/app/features/schemas/pages/schema/forms/field-form.component.ts @@ -21,7 +21,7 @@ import { FieldDto, PatternDto } from '@app/shared'; - diff --git a/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.html b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.html new file mode 100644 index 000000000..852ce60e8 --- /dev/null +++ b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.html @@ -0,0 +1,25 @@ +
+
+
+
+ + +
+
+
+ +
+ + +
+ + + +
+
+ +
+
+
\ No newline at end of file diff --git a/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.scss b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.scss new file mode 100644 index 000000000..04dcbf5de --- /dev/null +++ b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.scss @@ -0,0 +1,16 @@ +@import '_vars'; +@import '_mixins'; + +.minmax { + &-col { + position: relative; + } + + &-label { + @include absolute(0, -.2rem, auto, auto); + } +} + +.form-group { + margin-top: .5rem; +} \ No newline at end of file diff --git a/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.ts b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.ts new file mode 100644 index 000000000..1d175cd12 --- /dev/null +++ b/src/Squidex/app/features/schemas/pages/schema/types/array-validation.component.ts @@ -0,0 +1,44 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { Component, Input, OnInit } from '@angular/core'; +import { FormControl, FormGroup } from '@angular/forms'; + +import { + ArrayFieldPropertiesDto, + FieldDto, + SchemaTagConverter +} from '@app/shared'; + +@Component({ + selector: 'sqx-array-validation', + styleUrls: ['array-validation.component.scss'], + templateUrl: 'array-validation.component.html' +}) +export class ArrayValidationComponent implements OnInit { + @Input() + public editForm: FormGroup; + + @Input() + public field: FieldDto; + + @Input() + public properties: ArrayFieldPropertiesDto; + + constructor( + public readonly schemasSource: SchemaTagConverter + ) { + } + + public ngOnInit() { + this.editForm.setControl('maxItems', + new FormControl(this.properties.maxItems)); + + this.editForm.setControl('minItems', + new FormControl(this.properties.minItems)); + } +} \ No newline at end of file diff --git a/src/Squidex/app/features/schemas/pages/schema/types/assets-ui.component.html b/src/Squidex/app/features/schemas/pages/schema/types/assets-ui.component.html index 3dfd24fa9..8cb337b24 100644 --- a/src/Squidex/app/features/schemas/pages/schema/types/assets-ui.component.html +++ b/src/Squidex/app/features/schemas/pages/schema/types/assets-ui.component.html @@ -1,6 +1,6 @@
-
+
diff --git a/src/Squidex/app/features/schemas/pages/schema/types/geolocation-validation.component.html b/src/Squidex/app/features/schemas/pages/schema/types/geolocation-validation.component.html index 5765052d1..59faed83b 100644 --- a/src/Squidex/app/features/schemas/pages/schema/types/geolocation-validation.component.html +++ b/src/Squidex/app/features/schemas/pages/schema/types/geolocation-validation.component.html @@ -1,6 +1,6 @@
-
+