information-system-gui/src/main/webapp/app/facet-composer/facet-composer.component.html

111 lines
5.0 KiB
HTML

<h3 mat-dialog-title>FacetComposer: New {{titleType}} ({{titlePath}})</h3>
<!-- myForm inizio form globale -->
<mat-dialog-content>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<h2>{{typeSpec.name}}</h2>
</mat-panel-title>
<mat-panel-description>
<!--la descrizione è lunga e non posso metterla qua-->
</mat-panel-description>
</mat-expansion-panel-header>
<p> {{typeSpec.description}} </p>
</mat-expansion-panel>
<div [formGroup]="myForm">
<div formArrayName="facets">
<div [formGroupName] ="ind" *ngFor="let fct of facetArray.controls; let ind=index;" style="border: 3px solid rgb(72, 157, 202); padding: 10px; margin: 5px;">
<p><b>facet {{ind}}</b></p>
<mat-form-field appearance="outline" >
<input matInput formControlName="name" [style.width.px]="300" id="{{typeSpec.facetSpecs[ind].name}}" type="text" [readonly]="true" style="font-size: larger; font-weight: 700;" />
</mat-form-field>
<mat-form-field>
<mat-label for="relation" >occurr. min</mat-label>
<input matInput formControlName="min" id="min" type="text" readonly="true"/>
</mat-form-field>
<mat-form-field>
<mat-label for="relation" >occurr. max</mat-label>
<input matInput formControlName="max" id="max" type="text" readonly="true"/>
</mat-form-field>
<div style="border: 1px solid rgb(202, 202, 202); padding: 10px; margin: 5px;">
<textarea matInput formControlName="description" [readonly]="true">{{typeSpec.facetSpecs[ind].description}}</textarea>
</div>
<mat-form-field style="padding-top: 24px; padding-bottom: 24px;">
<mat-label for="relation" >relation</mat-label>
<mat-select formControlName="relation" value="typeSpec.facetSpecs[ind].relation" >
<mat-option *ngFor="let item of typeSpec.facetSpecs[ind].relationOptions" [value]="item" >
{{item}}
</mat-option>
</mat-select>
</mat-form-field>
<!-- OK SO FAR -->
<div formArrayName="properties" style="border: 1px solid rgb(159, 204, 217); padding: 10px; margin: 5px;">
<div [formGroupName] ="i" *ngFor="let y of getPropertiesArray(ind).controls; let i=index;">
<mat-form-field>
<mat-label>{{typeSpec.facetSpecs[ind].guiProps[i].label}}</mat-label>
<input matInput formControlName="{{typeSpec.facetSpecs[ind].guiProps[i].name}}" id="{{typeSpec.facetSpecs[ind].guiProps[i].name}}"
type="{{typeSpec.facetSpecs[ind].guiProps[i].type}}"/>
</mat-form-field>
</div>
</div>
<div style="padding-top: 20px; padding-bottom: 8px; margin: 5px;">
<button mat-icon-button color="primary" [disabled]="typeSpec.facetSpecs[ind].min==='1'"
(click)="removeFacet(ind)" matTooltip="remove" matTooltipClass="tableTooltip"
matTooltipPosition="above"><mat-icon>delete_outline</mat-icon></button>
</div>
</div>
<div style="padding-top: 20px; padding-bottom: 8px; margin: 5px;">
<!--
<button mat-icon-button color="primary"
(click)="addFacet(typeSpec.facetSpecs[0].name+'_'+typeSpec.facetSpecs[0].relation)" matTooltip="add new" matTooltipClass="tableTooltip"
matTooltipPosition="above"><mat-icon>add</mat-icon>add new facet</button>
-->
<!--
<button style="padding: 5px; margin-left:5px;" mat-raised-button color="primary" (click)="addFacet(typeSpec.facetSpecs[0].name+'_'+typeSpec.facetSpecs[0].relation)">
<mat-icon>add</mat-icon><span> Add Facet </span>
</button>
-->
<h3>Add new Facet:</h3>
<div style="padding-top: 24px; padding-bottom: 24px;">
<mat-form-field appearance="outline" [style.width.px]="250">
<mat-label for="selFacet" >Available Facet Types</mat-label>
<!--<select #teams (change)="onSelected(teams.value)">-->
<mat-select #selFacet (change)="onSelectNewFacet(selFacet.value)">
<mat-option *ngFor="let item of addableFacets" [value]="item">
{{item}}
</mat-option>
</mat-select>
</mat-form-field>
<button mat-icon-button color="primary" matTooltip="add new facet"
matTooltipClass="tableTooltip" [matTooltipPosition]="'right'" (click)="addFacet(selectedFacet)">
<mat-icon>add</mat-icon></button>
</div>
</div>
</div>
</div>
<!-- <button mat-button (click)="doAction()">Save Form</button> -->
<!--</form>-->
<!--fine form esterna-->
<b>Form's Value:</b>
{{ myForm.value | json }}
<br />
<b>Form is Valid ? :</b>
{{ myForm.valid }}
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button type="submit">Submit</button>
<button mat-button (click)="close()">Cancel</button>
</mat-dialog-actions>