mirror of https://github.com/Squidex/squidex.git
Browse Source
* Default value for array and components. * Fix form group. * Fix testspull/1025/head
committed by
GitHub
25 changed files with 228 additions and 25 deletions
@ -0,0 +1,14 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Domain.Apps.Core.Schemas; |
|||
|
|||
public enum ArrayCalculatedDefaultValue |
|||
{ |
|||
EmptyArray, |
|||
Null |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
<div [formGroup]="fieldForm"> |
|||
<div class="form-group row"> |
|||
<label class="col-3 col-form-label">{{ 'schemas.field.defaultValue' | sqxTranslate }}</label> |
|||
|
|||
<div class="col-3"> |
|||
<select class="form-select" formControlName="calculatedDefaultValue"> |
|||
<option *ngFor="let value of calculatedDefaultValues" [ngValue]="value">{{value}}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,2 @@ |
|||
@import 'mixins'; |
|||
@import 'vars'; |
|||
@ -0,0 +1,30 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|||
*/ |
|||
|
|||
import { Component, Input } from '@angular/core'; |
|||
import { UntypedFormGroup } from '@angular/forms'; |
|||
import { ArrayFieldPropertiesDto, FieldDto } from '@app/shared'; |
|||
|
|||
const CALCULATED_DEFAULT_VALUES: ReadonlyArray<string> = ['EmptyArray', 'Null']; |
|||
|
|||
@Component({ |
|||
selector: 'sqx-array-ui', |
|||
styleUrls: ['array-ui.component.scss'], |
|||
templateUrl: 'array-ui.component.html', |
|||
}) |
|||
export class ArrayUIComponent { |
|||
@Input({ required: true }) |
|||
public fieldForm!: UntypedFormGroup; |
|||
|
|||
@Input({ required: true }) |
|||
public field!: FieldDto; |
|||
|
|||
@Input({ required: true }) |
|||
public properties!: ArrayFieldPropertiesDto; |
|||
|
|||
public calculatedDefaultValues = CALCULATED_DEFAULT_VALUES; |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
<div [formGroup]="fieldForm"> |
|||
<div class="form-group row"> |
|||
<label class="col-3 col-form-label">{{ 'schemas.field.defaultValue' | sqxTranslate }}</label> |
|||
|
|||
<div class="col-3"> |
|||
<select class="form-select" formControlName="calculatedDefaultValue"> |
|||
<option *ngFor="let value of calculatedDefaultValues" [ngValue]="value">{{value}}</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
Loading…
Reference in new issue