|
|
|
@ -4,9 +4,9 @@ |
|
|
|
{:code-style="max-height: 400px;"} |
|
|
|
<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup" |
|
|
|
(ngSubmit)="save()" class="edit-entity-form"> |
|
|
|
<mat-toolbar fxLayout="row" color="primary"> |
|
|
|
<mat-toolbar class="flex flex-row" color="primary"> |
|
|
|
<h2>Edit {{entityType.toLowerCase()}} {{entityName}}</h2> |
|
|
|
<span fxFlex></span> |
|
|
|
<span class="flex-1"></span> |
|
|
|
<button mat-icon-button (click)="cancel()" type="button"> |
|
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
|
</button> |
|
|
|
@ -14,57 +14,57 @@ |
|
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
|
|
|
</mat-progress-bar> |
|
|
|
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> |
|
|
|
<div mat-dialog-content fxLayout="column"> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<div mat-dialog-content class="flex flex-col"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Entity Name</mat-label> |
|
|
|
<input matInput formControlName="entityName" required readonly=""> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Entity Label</mat-label> |
|
|
|
<input matInput formControlName="entityLabel"> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Entity Type</mat-label> |
|
|
|
<input matInput formControlName="entityType" readonly> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Type</mat-label> |
|
|
|
<input matInput formControlName="type" readonly> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div formGroupName="attributes" fxLayout="column"> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<div formGroupName="attributes" class="flex flex-col"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Latitude</mat-label> |
|
|
|
<input type="number" step="any" matInput formControlName="latitude"> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Longitude</mat-label> |
|
|
|
<input type="number" step="any" matInput formControlName="longitude"> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Address</mat-label> |
|
|
|
<input matInput formControlName="address"> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Owner</mat-label> |
|
|
|
<input matInput formControlName="owner"> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<mat-form-field fxFlex class="mat-block"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block flex-1"> |
|
|
|
<mat-label>Integer Value</mat-label> |
|
|
|
<input type="number" step="1" matInput formControlName="number"> |
|
|
|
<mat-error *ngIf="editEntityFormGroup.get('attributes.number').hasError('pattern')"> |
|
|
|
Invalid integer value. |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
<div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex> |
|
|
|
<div class="boolean-value-input flex flex-1 flex-col items-start justify-center"> |
|
|
|
<label class="checkbox-label">Boolean Value</label> |
|
|
|
<mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;"> |
|
|
|
{{ (editEntityFormGroup.get('attributes.booleanValue').value ? "value.true" : "value.false") | translate }} |
|
|
|
@ -74,12 +74,12 @@ |
|
|
|
</div> |
|
|
|
<div class="relations-list old-relations"> |
|
|
|
<div class="mat-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">Relations</div> |
|
|
|
<div class="body" [fxShow]="oldRelations().length"> |
|
|
|
<div class="row" fxLayout="row" fxLayoutAlign="start center" formArrayName="oldRelations" |
|
|
|
<div class="body" [class.!hidden]="!oldRelations().length"> |
|
|
|
<div class="row flex flex-row items-center justify-start" formArrayName="oldRelations" |
|
|
|
*ngFor="let relation of oldRelations().controls; let i = index;"> |
|
|
|
<div [formGroupName]="i" class="mat-elevation-z2" fxFlex fxLayout="row" style="padding: 5px 0 5px 5px;"> |
|
|
|
<div fxFlex fxLayout="column"> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<div [formGroupName]="i" class="mat-elevation-z2 flex flex-1 flex-row" style="padding: 5px 0 5px 5px;"> |
|
|
|
<div class="flex flex-1 flex-col"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block" style="min-width: 100px;"> |
|
|
|
<mat-label>Direction</mat-label> |
|
|
|
<mat-select formControlName="direction" name="direction"> |
|
|
|
@ -92,20 +92,20 @@ |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
<tb-relation-type-autocomplete |
|
|
|
fxFlex class="mat-block" |
|
|
|
class="mat-block flex-1" |
|
|
|
formControlName="relationType" |
|
|
|
required="true"> |
|
|
|
</tb-relation-type-autocomplete> |
|
|
|
</div> |
|
|
|
<div fxLayout="row" fxLayout.xs="column"> |
|
|
|
<div class="flex flex-row xs:flex-col"> |
|
|
|
<tb-entity-select |
|
|
|
fxFlex class="mat-block" |
|
|
|
class="mat-block flex-1" |
|
|
|
required="true" |
|
|
|
formControlName="relatedEntity"> |
|
|
|
</tb-entity-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div fxLayout="column" fxLayoutAlign="center center"> |
|
|
|
<div class="flex flex-col items-center justify-center"> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
aria-label="Remove" |
|
|
|
type="button" |
|
|
|
@ -121,16 +121,16 @@ |
|
|
|
</div> |
|
|
|
<div class="relations-list"> |
|
|
|
<div class="mat-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">New Relations</div> |
|
|
|
<div class="body" [fxShow]="relations().length"> |
|
|
|
<div class="row" fxLayout="row" fxLayoutAlign="start center" formArrayName="relations" *ngFor="let relation of relations().controls; let i = index;"> |
|
|
|
<div [formGroupName]="i" class="mat-elevation-z2" fxFlex fxLayout="row" style="padding: 5px 0 5px 5px;"> |
|
|
|
<div fxFlex fxLayout="column"> |
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0"> |
|
|
|
<div class="body" [class.!hidden]="!relations().length"> |
|
|
|
<div class="row flex flex-row items-center justify-start" formArrayName="relations" *ngFor="let relation of relations().controls; let i = index;"> |
|
|
|
<div [formGroupName]="i" class="mat-elevation-z2 flex flex-1 flex-row" style="padding: 5px 0 5px 5px;"> |
|
|
|
<div class="flex flex-1 flex-col"> |
|
|
|
<div class="flex flex-row gap-2 xs:flex-col xs:gap-0"> |
|
|
|
<mat-form-field class="mat-block" style="min-width: 100px;"> |
|
|
|
<mat-label>Direction</mat-label> |
|
|
|
<mat-select formControlName="direction" name="direction"> |
|
|
|
<mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value"> |
|
|
|
{{ ("relation.search-direction." + direction.value) | translate}} |
|
|
|
{{ ("relation.search-direction." + direction.value) | translate}} |
|
|
|
</mat-option> |
|
|
|
</mat-select> |
|
|
|
<mat-error *ngIf="relation.get('direction').hasError('required')"> |
|
|
|
@ -138,20 +138,20 @@ |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
<tb-relation-type-autocomplete |
|
|
|
fxFlex class="mat-block" |
|
|
|
class="mat-block flex-1" |
|
|
|
formControlName="relationType" |
|
|
|
[required]="true"> |
|
|
|
</tb-relation-type-autocomplete> |
|
|
|
</div> |
|
|
|
<div fxLayout="row" fxLayout.xs="column"> |
|
|
|
<div class="flex flex-row xs:flex-col"> |
|
|
|
<tb-entity-select |
|
|
|
fxFlex class="mat-block" |
|
|
|
class="mat-block flex-1" |
|
|
|
[required]="true" |
|
|
|
formControlName="relatedEntity"> |
|
|
|
</tb-entity-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div fxLayout="column" fxLayoutAlign="center center"> |
|
|
|
<div class="flex flex-col items-center justify-center"> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
aria-label="Remove" |
|
|
|
type="button" |
|
|
|
@ -175,7 +175,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div mat-dialog-actions fxLayout="row" fxLayoutAlign="end center"> |
|
|
|
<div mat-dialog-actions class="flex flex-row items-center justify-end"> |
|
|
|
<button mat-button color="primary" |
|
|
|
type="button" |
|
|
|
[disabled]="(isLoading$ | async)" |
|
|
|
|