2019-01-18 18:03:45 +01:00
|
|
|
<div class="row">
|
2019-01-29 17:34:19 +01:00
|
|
|
<h4 *ngIf="isComposite" style="font-weight: bold" class="col-auto">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.TITLE'
|
|
|
|
| translate}}</h4>
|
|
|
|
<h4 *ngIf="!isComposite" style="font-weight: bold" class="col-auto">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.SIMPLE-FIELD-TITLE'
|
|
|
|
| translate}}</h4>
|
|
|
|
<mat-checkbox class="col-auto" [(ngModel)]="isComposite" (ngModelChange)="onIsCompositeChange(isComposite)">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMPOSITE-CHECKBOX'
|
|
|
|
| translate}}</mat-checkbox>
|
|
|
|
<mat-checkbox class="col-auto" [(ngModel)]="isMultiplicityEnabled" (ngModelChange)="onIsMultiplicityEnabledChange(isMultiplicityEnabled)">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-CHECKBOX'
|
|
|
|
| translate}}</mat-checkbox>
|
|
|
|
<mat-checkbox class="col" [formControl]="this.form.get('hasCommentField')">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMMENT-CHECKBOX'
|
|
|
|
| translate}}</mat-checkbox>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<mat-form-field *ngIf="isComposite" class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput type="string" placeholder="Id" [formControl]="form.get('id')" required>
|
|
|
|
<mat-error *ngIf="form.get('id').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
2019-02-04 17:10:22 +01:00
|
|
|
<mat-error *ngIf="form.get('id').hasError('pattern')">{{'GENERAL.VALIDATION.PATTERN-_' | translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field *ngIf="isComposite" class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMPOSITE-TITLE' | translate}}"
|
|
|
|
[formControl]="this.form.get('title')">
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field *ngIf="!isComposite" class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.FIELD-TITLE' | translate}}"
|
|
|
|
[formControl]="this.form.get('title')">
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field *ngIf="isMultiplicityEnabled" class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MIN' | translate}}"
|
|
|
|
type="number" [formControl]="form.get('multiplicity').get('min')" required>
|
|
|
|
<mat-error *ngIf="form.get('multiplicity').get('min').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
|
|
|
translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field *ngIf="isMultiplicityEnabled" class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-MAX' | translate}}"
|
|
|
|
type="number" [formControl]="this.form.get('multiplicity').get('max')" required>
|
|
|
|
<mat-error *ngIf="form.get('multiplicity').get('max').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' |
|
|
|
|
translate}}</mat-error>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="col">
|
2019-01-29 17:34:19 +01:00
|
|
|
<input matInput type="number" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.ORDER' | translate}}"
|
|
|
|
[formControl]="this.form.get('ordinal')">
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<mat-form-field class="col-md-6">
|
2019-01-29 17:34:19 +01:00
|
|
|
<textarea matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}}"
|
|
|
|
[formControl]="this.form.get('description')"></textarea>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="col-md-6">
|
2019-01-29 17:34:19 +01:00
|
|
|
<textarea matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}}"
|
|
|
|
[formControl]="this.form.get('extendedDescription')"></textarea>
|
2019-01-18 18:03:45 +01:00
|
|
|
</mat-form-field>
|
2019-01-29 17:34:19 +01:00
|
|
|
<app-dataset-profile-editor-field-component class="col-12" *ngIf="!isComposite" [form]="form.get('fields').get(''+0)"
|
2019-02-01 09:29:00 +01:00
|
|
|
[showOrdinal]="false" [indexPath]="indexPath + 'f' + 0"></app-dataset-profile-editor-field-component>
|
2019-01-18 18:03:45 +01:00
|
|
|
</div>
|
|
|
|
<div *ngIf="isComposite" class="row">
|
2019-01-29 17:34:19 +01:00
|
|
|
<h4 style="font-weight: bold" class="col-12">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.SUB-FIELDS-TITLE' |
|
|
|
|
translate}}</h4>
|
2019-01-18 18:03:45 +01:00
|
|
|
<div class="col-12">
|
|
|
|
<mat-expansion-panel *ngFor="let field of form.get('fields')['controls'] let i=index;" #panel>
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
<mat-panel-title>{{i + 1}}. {{getFieldTile(field, i)}}</mat-panel-title>
|
2019-01-31 11:29:35 +01:00
|
|
|
<div class="row">
|
2019-02-01 09:29:00 +01:00
|
|
|
<button mat-icon-button type="button" class="deleteBtn col-auto" (click)="DeleteField(i);">
|
2019-01-31 11:29:35 +01:00
|
|
|
<mat-icon>delete</mat-icon>
|
2019-01-18 18:03:45 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
<div id="{{indexPath + 'f' + i}}" *ngIf="panel.expanded">
|
|
|
|
<app-dataset-profile-editor-field-component [form]="form.get('fields').get(''+i)" [indexPath]="indexPath + 'f' + i"></app-dataset-profile-editor-field-component>
|
|
|
|
</div>
|
|
|
|
</mat-expansion-panel>
|
|
|
|
</div>
|
2019-01-29 17:34:19 +01:00
|
|
|
<div class="col-12"><button mat-button class="full-width" (click)="addNewField()">{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.ACTIONS.ADD-CHILD-FIELD'
|
|
|
|
| translate}}</button></div>
|
|
|
|
</div>
|