Reintroduces description property on Sections.

This commit is contained in:
Diamantis Tziotzios 2019-03-08 17:12:53 +02:00
parent b1ea68670a
commit 32d189af03
4 changed files with 26 additions and 24 deletions

View File

@ -22,6 +22,10 @@
<input matInput type="number" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.SECTION.FIELDS.ORDER' | translate}}"
formControlName="ordinal">
</mat-form-field>
<mat-form-field class="col-md-3">
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.SECTION.FIELDS.DESCRIPTION' | translate}}"
formControlName="description">
</mat-form-field>
<!-- <div class="col-md-6">
<label>Default Visibility</label>
<mat-radio-group formControlName="defaultVisibility" class="full-width">

View File

@ -5,44 +5,37 @@
<mat-panel-title>
<h6>{{form.get('numbering').value}} {{form.get('title').value}}</h6>
</mat-panel-title>
<mat-panel-description>
<h3 *ngIf="form.get('description').value">{{form.get('description').value}}</h3>
</mat-panel-description>
</mat-expansion-panel-header>
<div *ngFor="let compositeFieldFormGroup of form.get('compositeFields')['controls']; let i = index;"
class="col-12">
<mat-panel-description class="col-12">
<h6 *ngIf="form.get('description').value">{{form.get('description').value}}</h6>
</mat-panel-description>
<div *ngFor="let compositeFieldFormGroup of form.get('compositeFields')['controls']; let i = index;" class="col-12">
<!-- <div *ngIf="isElementVisible(compositeField)" class="row"> -->
<!-- *ngIf="this.visibilityRulesService.checkElementVisibility(compositeFieldFormGroup.get('id').value)" -->
<div class="row"
*ngIf="this.visibilityRulesService.checkElementVisibility(compositeFieldFormGroup.get('id').value) && this.visibilityRulesService.scanIfChildsOfCompositeFieldHasVisibleItems(compositeFieldFormGroup)">
<div class="row" *ngIf="this.visibilityRulesService.checkElementVisibility(compositeFieldFormGroup.get('id').value) && this.visibilityRulesService.scanIfChildsOfCompositeFieldHasVisibleItems(compositeFieldFormGroup)">
<div *ngIf="(compositeFieldFormGroup.get('multiplicity').value.max - 1) > (compositeFieldFormGroup.get('multiplicityItems').length)"
class="col-12">
<button mat-button color="primary" (click)="addMultipleField(i)"
[disabled]="compositeFieldFormGroup.disabled">
class="col-12">
<button mat-button color="primary" (click)="addMultipleField(i)" [disabled]="compositeFieldFormGroup.disabled">
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-ADD-ONE-FIELD' | translate}}
</button>
</div>
<app-form-composite-field class="align-self-center col-12" [form]="compositeFieldFormGroup"
[datasetProfileId]="datasetProfileId" [isChild]="false"></app-form-composite-field>
<app-form-composite-field class="align-self-center col-12" [form]="compositeFieldFormGroup" [datasetProfileId]="datasetProfileId"
[isChild]="false"></app-form-composite-field>
<div *ngIf="compositeFieldFormGroup" class="col-12">
<div class="row">
<div class="col-12"
*ngFor="let multipleCompositeFieldFormGroup of compositeFieldFormGroup.get('multiplicityItems')['controls']; let j = index">
<div class="col-12" *ngFor="let multipleCompositeFieldFormGroup of compositeFieldFormGroup.get('multiplicityItems')['controls']; let j = index">
<div class="styleBorder row">
<app-form-composite-field class=" align-self-center col"
[form]="multipleCompositeFieldFormGroup" [datasetProfileId]="datasetProfileId"
[isChild]="true"></app-form-composite-field>
<app-form-composite-field class=" align-self-center col" [form]="multipleCompositeFieldFormGroup" [datasetProfileId]="datasetProfileId"
[isChild]="true"></app-form-composite-field>
<div class="col-auto align-self-center">
<button mat-icon-button type="button" class="deleteBtn"
(click)="deleteMultipeFieldFromCompositeFormGroup(i,j);">
<button mat-icon-button type="button" class="deleteBtn" (click)="deleteMultipeFieldFromCompositeFormGroup(i,j);">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<mat-form-field *ngIf="compositeFieldFormGroup.get('hasCommentField').value" class="col-12"
[formGroup]="compositeFieldFormGroup">
<mat-form-field *ngIf="compositeFieldFormGroup.get('hasCommentField').value" class="col-12" [formGroup]="compositeFieldFormGroup">
<input matInput formControlName="commentFieldValue" placeholder="comment">
</mat-form-field>
<div class="col"></div>
@ -56,10 +49,10 @@
</div>
<div *ngIf="form.get('sections')" class="col-12">
<div *ngFor="let subSectionFormGroup of form.get('sections')['controls']; let j = index;" class="row">
<app-form-section class="col-12" [form]="subSectionFormGroup" [path]="path+'.'+(j+1)"
[pathName]="pathName+'.sections.'+j" [datasetProfileId]="datasetProfileId"></app-form-section>
<app-form-section class="col-12" [form]="subSectionFormGroup" [path]="path+'.'+(j+1)" [pathName]="pathName+'.sections.'+j"
[datasetProfileId]="datasetProfileId"></app-form-section>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>

View File

@ -8,3 +8,7 @@
border-radius: 0.5em;
margin-bottom: 0.5em;
}
.mat-expansion-panel-header-description{
padding-bottom: 18px;
color: black;
}

View File

@ -74,6 +74,7 @@
"TITLE": "Section Name",
"PAGE": "Page to appear",
"ORDER": "Order",
"DESCRIPTION": "Description",
"FIELDS-TITLE": "Fields",
"SUB-SECTIONS-TITLE": "Sub-Sections"
},