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.
78 lines
3.6 KiB
78 lines
3.6 KiB
<form [formGroup]="editForm.form" (ngSubmit)="saveSchema()">
|
|
<div class="card mb-2">
|
|
<div class="card-header">{{ 'schemas.rules.title' | sqxTranslate }}</div>
|
|
|
|
<div class="card-body">
|
|
<div class="content">
|
|
<div class="mt-4" *ngIf="!isEditable && editForm.form.controls.length === 0">
|
|
{{ 'schemas.rules.empty' | sqxTranslate }}
|
|
</div>
|
|
|
|
<div class="form-group row no-gutters" *ngFor="let form of editForm.form.controls; let i = index" [formGroup]="form">
|
|
<div class="col col-action pr-1">
|
|
<sqx-control-errors for="action"></sqx-control-errors>
|
|
|
|
<select class="form-control" formControlName="action">
|
|
<option *ngFor="let fieldAction of fieldActions" [ngValue]="fieldAction">{{fieldAction}}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-3 pr-1">
|
|
<sqx-control-errors for="field"></sqx-control-errors>
|
|
|
|
<select class="form-control" formControlName="field">
|
|
<option *ngFor="let field of fieldNames" [ngValue]="field">{{field}}</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-auto pr-1">
|
|
<div class="label text-muted">{{ 'schemas.rules.when' | sqxTranslate }}</div>
|
|
</div>
|
|
|
|
<div class="col pr-1">
|
|
<sqx-control-errors for="condition"></sqx-control-errors>
|
|
|
|
<input type="text" class="form-control" formControlName="condition" placeholder="{{ 'schemas.rules.condition' | sqxTranslate }}">
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-text-danger" [disabled]="!isEditable"
|
|
(sqxConfirmClick)="editForm.remove(i)"
|
|
confirmTitle="i18n:schemas.deleteRuleConfirmTitle"
|
|
confirmText="i18n:schemas.deleteRuleConfirmText"
|
|
confirmRememberKey="deleteFieldRule">
|
|
<i class="icon-bin2"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row no-gutters" *ngIf="isEditable">
|
|
<div class="col col-action pr-1">
|
|
<div class="form-control preview">{{ 'schemas.rules.action' | sqxTranslate }}</div>
|
|
</div>
|
|
|
|
<div class="col-3 pr-1">
|
|
<div class="form-control preview">{{ 'common.field' | sqxTranslate }}</div>
|
|
</div>
|
|
|
|
<div class="col-auto pr-1">
|
|
<div class="label text-muted">{{ 'schemas.rules.when' | sqxTranslate }}</div>
|
|
</div>
|
|
|
|
<div class="col pr-1">
|
|
<div class="form-control preview">{{ 'schemas.rules.condition' | sqxTranslate }}</div>
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-success" (click)="add()">
|
|
<i class="icon-add"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer" *ngIf="isEditable">
|
|
<button type="submit" class="float-right btn btn-primary" [class.invisible]="!isEditable">{{ 'common.save' | sqxTranslate }}</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|