Browse Source
* Update example custom action to new Angular * Save settings to change type custom action * Revert changepull/2562/head
committed by
GitHub
4 changed files with 607 additions and 644 deletions
@ -1,349 +1,355 @@ |
|||||
<!--=======================================================================--> |
<!--=======================================================================--> |
||||
<!--=================== New TB 3.0 / Angular 8 Example =================--> |
|
||||
<!--=======================================================================--> |
|
||||
<!--<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"--> |
|
||||
<!-- class="edit-entity-form"--> |
|
||||
<!-- (ngSubmit)="save()" style="width: 600px;">--> |
|
||||
<!-- <mat-toolbar fxLayout="row" color="primary">--> |
|
||||
<!-- <h2>Edit {{entityType.toLowerCase()}} {{entityName}}</h2>--> |
|
||||
<!-- <span fxFlex></span>--> |
|
||||
<!-- <button mat-button mat-icon-button--> |
|
||||
<!-- (click)="cancel()"--> |
|
||||
<!-- type="button">--> |
|
||||
<!-- <mat-icon class="material-icons">close</mat-icon>--> |
|
||||
<!-- </button>--> |
|
||||
<!-- </mat-toolbar>--> |
|
||||
<!-- <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>--> |
|
||||
<!-- <div class="mat-padding" fxLayout="column">--> |
|
||||
<!-- <mat-form-field class="mat-block">--> |
|
||||
<!-- <mat-label>Entity name</mat-label>--> |
|
||||
<!-- <input matInput formControlName="entityName" required>--> |
|
||||
<!-- <mat-error *ngIf="editEntityFormGroup.get('entityName').hasError('required')">--> |
|
||||
<!-- Entity name required--> |
|
||||
<!-- </mat-error>--> |
|
||||
<!-- </mat-form-field>--> |
|
||||
<!-- </div> --> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div mat-dialog-actions fxLayout="row">--> |
|
||||
<!-- <span fxFlex></span>--> |
|
||||
<!-- <button mat-button mat-raised-button color="primary"--> |
|
||||
<!-- type="submit"--> |
|
||||
<!-- [disabled]="(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty">--> |
|
||||
<!-- {{ 'action.save' | translate }}--> |
|
||||
<!-- </button>--> |
|
||||
<!-- <button mat-button color="primary"--> |
|
||||
<!-- style="margin-right: 20px;"--> |
|
||||
<!-- type="button"--> |
|
||||
<!-- [disabled]="(isLoading$ | async)"--> |
|
||||
<!-- (click)="cancel()" cdkFocusInitial>--> |
|
||||
<!-- {{ 'action.cancel' | translate }}--> |
|
||||
<!-- </button>--> |
|
||||
<!-- </div>--> |
|
||||
<!--</form>--> |
|
||||
<!--=======================================================================--> |
|
||||
<!--===== There are two example templates: for edit and add entity =====--> |
<!--===== There are two example templates: for edit and add entity =====--> |
||||
<!--=======================================================================--> |
<!--=======================================================================--> |
||||
<!--======================== Edit entity example ========================--> |
<!--======================== Edit entity example ========================--> |
||||
<!--=======================================================================--> |
<!--=======================================================================--> |
||||
<!-- --> |
<!-- --> |
||||
<!--<md-dialog aria-label="Edit entity">--> |
<!--<form #editEntityForm="ngForm" [formGroup]="editEntityFormGroup"--> |
||||
<!-- <form name="editEntityForm" class="edit-entity-form" ng-submit="vm.save()">--> |
<!-- (ngSubmit)="save()" class="edit-entity-form">--> |
||||
<!-- <md-toolbar>--> |
<!-- <mat-toolbar fxLayout="row" color="primary">--> |
||||
<!-- <div class="md-toolbar-tools">--> |
<!-- <h2>Edit {{entityType.toLowerCase()}} {{entityName}}</h2>--> |
||||
<!-- <h2>Edit {{vm.entityType.toLowerCase()}} {{vm.entityName}}</h2>--> |
<!-- <span fxFlex></span>--> |
||||
<!-- <span flex></span>--> |
<!-- <button mat-icon-button (click)="cancel()" type="button">--> |
||||
<!-- <md-button class="md-icon-button" ng-click="vm.cancel()">--> |
<!-- <mat-icon class="material-icons">close</mat-icon>--> |
||||
<!-- <ng-md-icon icon="close" aria-label="Close"></ng-md-icon>--> |
<!-- </button>--> |
||||
<!-- </md-button>--> |
<!-- </mat-toolbar>--> |
||||
|
<!-- <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">--> |
||||
|
<!-- <mat-label>Entity Name</mat-label>--> |
||||
|
<!-- <input matInput formControlName="entityName" required readonly="">--> |
||||
|
<!-- </mat-form-field>--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <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">--> |
||||
|
<!-- <mat-label>Entity Type</mat-label>--> |
||||
|
<!-- <input matInput formControlName="entityType" readonly>--> |
||||
|
<!-- </mat-form-field>--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <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">--> |
||||
|
<!-- <mat-label>Latitude</mat-label>--> |
||||
|
<!-- <input type="number" step="any" matInput formControlName="latitude">--> |
||||
|
<!-- </mat-form-field>--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <mat-label>Longitude</mat-label>--> |
||||
|
<!-- <input type="number" step="any" matInput formControlName="longitude">--> |
||||
|
<!-- </mat-form-field>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </md-toolbar>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <md-dialog-content>--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- <div class="md-dialog-content">--> |
<!-- <mat-label>Address</mat-label>--> |
||||
<!-- <div layout="row">--> |
<!-- <input matInput formControlName="address">--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- </mat-form-field>--> |
||||
<!-- <label>Entity Name</label>--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- <input ng-model="vm.entityName" readonly>--> |
<!-- <mat-label>Owner</mat-label>--> |
||||
<!-- </md-input-container>--> |
<!-- <input matInput formControlName="owner">--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- </mat-form-field>--> |
||||
<!-- <label>Entity Type</label>--> |
<!-- </div>--> |
||||
<!-- <input ng-model="vm.entityType" readonly>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- </md-input-container>--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- <mat-label>Integer Value</mat-label>--> |
||||
<!-- <label>Type</label>--> |
<!-- <input type="number" step="1" matInput formControlName="number">--> |
||||
<!-- <input ng-model="vm.type" readonly>--> |
<!-- <mat-error *ngIf="editEntityFormGroup.get('attributes').get('number').hasError('pattern')">--> |
||||
<!-- </md-input-container>--> |
<!-- Invalid integer value.--> |
||||
<!-- </div>--> |
<!-- </mat-error>--> |
||||
<!-- <div layout="row">--> |
<!-- </mat-form-field>--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> |
||||
<!-- <label>Latitude</label>--> |
<!-- <label class="checkbox-label">Boolean Value</label>--> |
||||
<!-- <input name="latitude" type="number" step="any" ng-model="vm.attributes.latitude">--> |
<!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> |
||||
<!-- </md-input-container>--> |
<!-- {{ (editEntityFormGroup.get('attributes').get('booleanValue').value ? "value.true" : "value.false") | translate }}--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- </mat-checkbox>--> |
||||
<!-- <label>Longitude</label>--> |
|
||||
<!-- <input name="longitude" type="number" step="any" ng-model="vm.attributes.longitude">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="row">--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Address</label>--> |
|
||||
<!-- <input ng-model="vm.attributes.address">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Owner</label>--> |
|
||||
<!-- <input ng-model="vm.attributes.owner">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="row">--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Integer Value</label>--> |
|
||||
<!-- <input name="integerNumber" type="number" step="1" ng-pattern="/^-?[0-9]+$/" ng-model="vm.attributes.number">--> |
|
||||
<!-- <div ng-messages="editEntityForm.integerNumber.$error">--> |
|
||||
<!-- <div ng-message="pattern">Invalid integer value.</div>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- <div class="boolean-value-input" layout="column" layout-align="center start" flex>--> |
|
||||
<!-- <label class="checkbox-label">Boolean Value</label>--> |
|
||||
<!-- <md-checkbox ng-model="vm.attributes.booleanValue" style="margin-bottom: 40px;">--> |
|
||||
<!-- {{ (vm.attributes.booleanValue ? "value.true" : "value.false") | translate }}--> |
|
||||
<!-- </md-checkbox>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- <div class="relations-list old-relations">--> |
<!-- </div>--> |
||||
<!-- <div class="md-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">Relations</div>--> |
<!-- </div>--> |
||||
<!-- <div class="body" ng-show="vm.relations.length">--> |
<!-- <div class="relations-list old-relations">--> |
||||
<!-- <div class="row" layout="row" layout-align="start center" ng-repeat="relation in vm.relations track by $index">--> |
<!-- <div class="mat-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">Relations</div>--> |
||||
<!-- <div class="md-whiteframe-1dp" flex layout="row" style="padding-left: 5px; margin-bottom: 3px;">--> |
<!-- <div class="body" [fxShow]="oldRelations().length">--> |
||||
<!-- <div flex layout="column">--> |
<!-- <div class="row" fxLayout="row" fxLayoutAlign="start center" formArrayName="oldRelations" --> |
||||
<!-- <div layout="row">--> |
<!-- *ngFor="let relation of oldRelations().controls; let i = index;">--> |
||||
<!-- <md-input-container class="md-block" style="min-width: 100px;">--> |
<!-- <div [formGroupName]="i" class="mat-elevation-z2" fxFlex fxLayout="row" style="padding: 5px 0 5px 5px;">--> |
||||
<!-- <label>Direction</label>--> |
<!-- <div fxFlex fxLayout="column">--> |
||||
<!-- <md-select ng-disabled="true" required ng-model="relation.direction">--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <md-option ng-repeat="direction in vm.entitySearchDirection" ng-value="direction">--> |
<!-- <mat-form-field class="mat-block" style="min-width: 100px;">--> |
||||
<!-- {{ ("relation.search-direction." + direction) | translate}}--> |
<!-- <mat-label>Direction</mat-label>--> |
||||
<!-- </md-option>--> |
<!-- <mat-select formControlName="direction" name="direction">--> |
||||
<!-- </md-select>--> |
<!-- <mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">--> |
||||
<!-- </md-input-container>--> |
<!-- {{ ("relation.search-direction." + direction.value) | translate}}--> |
||||
<!-- <tb-relation-type-autocomplete ng-disabled="true" flex class="md-block"--> |
<!-- </mat-option>--> |
||||
<!-- the-form="editEntityForm"--> |
<!-- </mat-select>--> |
||||
<!-- ng-model="relation.relationType"--> |
<!-- <mat-error *ngIf="relation.get('direction').hasError('required')">--> |
||||
<!-- tb-required="true">--> |
<!-- Relation direction is required.--> |
||||
<!-- </tb-relation-type-autocomplete>--> |
<!-- </mat-error>--> |
||||
<!-- </div>--> |
<!-- </mat-form-field>--> |
||||
<!-- <div layout="row">--> |
<!-- <tb-relation-type-autocomplete--> |
||||
<!-- <tb-entity-select flex class="md-block"--> |
<!-- fxFlex class="mat-block"--> |
||||
<!-- the-form="editEntityForm"--> |
<!-- formControlName="relationType"--> |
||||
<!-- ng-disabled="true"--> |
<!-- required="true">--> |
||||
<!-- tb-required="true"--> |
<!-- </tb-relation-type-autocomplete>--> |
||||
<!-- ng-model="relation.relatedEntity">--> |
|
||||
<!-- </tb-entity-select>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="column" layout-align="center center">--> |
|
||||
<!-- <md-button class="md-icon-button md-primary" style="width: 40px; min-width: 40px;"--> |
|
||||
<!-- ng-click="vm.removeOldRelation($index,relation)" aria-label="Remove">--> |
|
||||
<!-- <md-tooltip md-direction="top">Remove relation</md-tooltip>--> |
|
||||
<!-- <md-icon aria-label="Remove" class="material-icons">--> |
|
||||
<!-- close--> |
|
||||
<!-- </md-icon>--> |
|
||||
<!-- </md-button>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
|
<!-- <div fxLayout="row" fxLayout.xs="column">--> |
||||
|
<!-- <tb-entity-select--> |
||||
|
<!-- fxFlex class="mat-block"--> |
||||
|
<!-- required="true"--> |
||||
|
<!-- formControlName="relatedEntity">--> |
||||
|
<!-- </tb-entity-select>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div fxLayout="column" fxLayoutAlign="center center">--> |
||||
|
<!-- <button mat-icon-button color="primary"--> |
||||
|
<!-- aria-label="Remove"--> |
||||
|
<!-- type="button"--> |
||||
|
<!-- (click)="removeOldRelation(i)"--> |
||||
|
<!-- matTooltip="Remove relation"--> |
||||
|
<!-- matTooltipPosition="above">--> |
||||
|
<!-- <mat-icon>close</mat-icon>--> |
||||
|
<!-- </button>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- <div class="relations-list">--> |
<!-- </div>--> |
||||
<!-- <div class="md-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">New Relations</div>--> |
<!-- </div>--> |
||||
<!-- <div class="body" ng-show="vm.newRelations.length">--> |
<!-- <div class="relations-list">--> |
||||
<!-- <div class="row" layout="row" layout-align="start center" ng-repeat="relation in vm.newRelations track by $index">--> |
<!-- <div class="mat-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">New Relations</div>--> |
||||
<!-- <div class="md-whiteframe-1dp" flex layout="row" style="padding-left: 5px; margin-bottom: 3px;">--> |
<!-- <div class="body" [fxShow]="relations().length">--> |
||||
<!-- <div flex layout="column">--> |
<!-- <div class="row" fxLayout="row" fxLayoutAlign="start center" formArrayName="relations" *ngFor="let relation of relations().controls; let i = index;">--> |
||||
<!-- <div layout="row">--> |
<!-- <div [formGroupName]="i" class="mat-elevation-z2" fxFlex fxLayout="row" style="padding: 5px 0 5px 5px;">--> |
||||
<!-- <md-input-container class="md-block" style="min-width: 100px;">--> |
<!-- <div fxFlex fxLayout="column">--> |
||||
<!-- <label>Direction</label>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <md-select name="direction" required ng-model="relation.direction">--> |
<!-- <mat-form-field class="mat-block" style="min-width: 100px;">--> |
||||
<!-- <md-option ng-repeat="direction in vm.entitySearchDirection" ng-value="direction">--> |
<!-- <mat-label>Direction</mat-label>--> |
||||
<!-- {{ ("relation.search-direction." + direction) | translate}}--> |
<!-- <mat-select formControlName="direction" name="direction">--> |
||||
<!-- </md-option>--> |
<!-- <mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">--> |
||||
<!-- </md-select>--> |
<!-- {{ ("relation.search-direction." + direction.value) | translate}}--> |
||||
<!-- <div ng-messages="editEntityForm.direction.$error">--> |
<!-- </mat-option>--> |
||||
<!-- <div ng-message="required">Relation direction is required.</div>--> |
<!-- </mat-select>--> |
||||
<!-- </div>--> |
<!-- <mat-error *ngIf="relation.get('direction').hasError('required')">--> |
||||
<!-- </md-input-container>--> |
<!-- Relation direction is required.--> |
||||
<!-- <tb-relation-type-autocomplete flex class="md-block"--> |
<!-- </mat-error>--> |
||||
<!-- the-form="editEntityForm"--> |
<!-- </mat-form-field>--> |
||||
<!-- ng-model="relation.relationType"--> |
<!-- <tb-relation-type-autocomplete--> |
||||
<!-- tb-required="true">--> |
<!-- fxFlex class="mat-block"--> |
||||
<!-- </tb-relation-type-autocomplete>--> |
<!-- formControlName="relationType"--> |
||||
<!-- </div>--> |
<!-- [required]="true">--> |
||||
<!-- <div layout="row">--> |
<!-- </tb-relation-type-autocomplete>--> |
||||
<!-- <tb-entity-select flex class="md-block"--> |
<!-- </div>--> |
||||
<!-- the-form="editEntityForm"--> |
<!-- <div fxLayout="row" fxLayout.xs="column">--> |
||||
<!-- tb-required="true"--> |
<!-- <tb-entity-select--> |
||||
<!-- ng-model="relation.relatedEntity">--> |
<!-- fxFlex class="mat-block"--> |
||||
<!-- </tb-entity-select>--> |
<!-- [required]="true"--> |
||||
<!-- </div>--> |
<!-- formControlName="relatedEntity">--> |
||||
<!-- </div>--> |
<!-- </tb-entity-select>--> |
||||
<!-- <div layout="column" layout-align="center center">--> |
|
||||
<!-- <md-button class="md-icon-button md-primary" style="width: 40px; min-width: 40px;"--> |
|
||||
<!-- ng-click="vm.removeRelation($index)" aria-label="Remove">--> |
|
||||
<!-- <md-tooltip md-direction="top">Remove relation</md-tooltip>--> |
|
||||
<!-- <md-icon aria-label="Remove" class="material-icons">--> |
|
||||
<!-- close--> |
|
||||
<!-- </md-icon>--> |
|
||||
<!-- </md-button>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
|
<!-- <div fxLayout="column" fxLayoutAlign="center center">--> |
||||
|
<!-- <button mat-icon-button color="primary"--> |
||||
|
<!-- aria-label="Remove"--> |
||||
|
<!-- type="button"--> |
||||
|
<!-- (click)="removeRelation(i)"--> |
||||
|
<!-- matTooltip="Remove relation"--> |
||||
|
<!-- matTooltipPosition="above">--> |
||||
|
<!-- <mat-icon>close</mat-icon>--> |
||||
|
<!-- </button>--> |
||||
|
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- <div>--> |
|
||||
<!-- <md-button class="md-primary md-raised" ng-click="vm.addRelation()" aria-label="Add">--> |
|
||||
<!-- <md-tooltip md-direction="top">Add Relation</md-tooltip>--> |
|
||||
<!-- Add--> |
|
||||
<!-- </md-button>--> |
|
||||
<!-- </div> --> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </md-dialog-content>--> |
<!-- <div>--> |
||||
<!-- <md-dialog-actions>--> |
<!-- <button mat-raised-button color="primary"--> |
||||
<!-- <md-button type="submit" ng-disabled="editEntityForm.$invalid || !editEntityForm.$dirty" class="md-raised md-primary">Save</md-button>--> |
<!-- type="button"--> |
||||
<!-- <md-button ng-click="vm.cancel()" class="md-primary">Cancel</md-button>--> |
<!-- (click)="addRelation()"--> |
||||
<!-- </md-dialog-actions>--> |
<!-- matTooltip="Add Relation"--> |
||||
<!-- </form>--> |
<!-- matTooltipPosition="above">--> |
||||
<!--</md-dialog>--> |
<!-- Add--> |
||||
|
<!-- </button>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">--> |
||||
|
<!-- <button mat-button mat-raised-button color="primary"--> |
||||
|
<!-- type="submit"--> |
||||
|
<!-- [disabled]="(isLoading$ | async) || editEntityForm.invalid || !editEntityForm.dirty">--> |
||||
|
<!-- Save--> |
||||
|
<!-- </button>--> |
||||
|
<!-- <button mat-button color="primary"--> |
||||
|
<!-- style="margin-right: 20px;"--> |
||||
|
<!-- type="button"--> |
||||
|
<!-- [disabled]="(isLoading$ | async)"--> |
||||
|
<!-- (click)="cancel()" cdkFocusInitial>--> |
||||
|
<!-- Cancel--> |
||||
|
<!-- </button>--> |
||||
|
<!-- </div>--> |
||||
|
<!--</form>--> |
||||
<!----> |
<!----> |
||||
<!--========================================================================--> |
<!--========================================================================--> |
||||
<!--========================= Add entity example =========================--> |
<!--========================= Add entity example =========================--> |
||||
<!--========================================================================--> |
<!--========================================================================--> |
||||
<!----> |
<!----> |
||||
<!--<md-dialog aria-label="Add entity">--> |
<!--<form #addEntityForm="ngForm" [formGroup]="addEntityFormGroup"--> |
||||
<!-- <form name="addEntityForm" class="add-entity-form" ng-submit="vm.save()">--> |
<!-- (ngSubmit)="save()" class="add-entity-form">--> |
||||
<!-- <md-toolbar>--> |
<!-- <mat-toolbar fxLayout="row" color="primary">--> |
||||
<!-- <div class="md-toolbar-tools">--> |
<!-- <h2>Add entity</h2>--> |
||||
<!-- <h2>Add entity</h2>--> |
<!-- <span fxFlex></span>--> |
||||
<!-- <span flex></span>--> |
<!-- <button mat-icon-button (click)="cancel()" type="button">--> |
||||
<!-- <md-button class="md-icon-button" ng-click="vm.cancel()">--> |
<!-- <mat-icon class="material-icons">close</mat-icon>--> |
||||
<!-- <ng-md-icon icon="close" aria-label="Close"></ng-md-icon>--> |
<!-- </button>--> |
||||
<!-- </md-button>--> |
<!-- </mat-toolbar>--> |
||||
|
<!-- <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">--> |
||||
|
<!-- <mat-label>Entity Name</mat-label>--> |
||||
|
<!-- <input matInput formControlName="entityName" required>--> |
||||
|
<!-- <mat-error *ngIf="addEntityFormGroup.get('entityName').hasError('required')">--> |
||||
|
<!-- Entity name is required.--> |
||||
|
<!-- </mat-error>--> |
||||
|
<!-- </mat-form-field>--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <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">--> |
||||
|
<!-- <tb-entity-type-select--> |
||||
|
<!-- class="mat-block"--> |
||||
|
<!-- formControlName="entityType"--> |
||||
|
<!-- [showLabel]="true"--> |
||||
|
<!-- [allowedEntityTypes]="allowedEntityTypes"--> |
||||
|
<!-- ></tb-entity-type-select>--> |
||||
|
<!-- <tb-entity-subtype-autocomplete--> |
||||
|
<!-- fxFlex *ngIf="addEntityFormGroup.get('entityType').value == 'ASSET'"--> |
||||
|
<!-- class="mat-block"--> |
||||
|
<!-- formControlName="type"--> |
||||
|
<!-- [required]="true"--> |
||||
|
<!-- [entityType]="'ASSET'"--> |
||||
|
<!-- ></tb-entity-subtype-autocomplete>--> |
||||
|
<!-- <tb-entity-subtype-autocomplete--> |
||||
|
<!-- fxFlex *ngIf="addEntityFormGroup.get('entityType').value != 'ASSET'"--> |
||||
|
<!-- class="mat-block"--> |
||||
|
<!-- formControlName="type"--> |
||||
|
<!-- [required]="true"--> |
||||
|
<!-- [entityType]="'DEVICE'"--> |
||||
|
<!-- ></tb-entity-subtype-autocomplete>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div formGroupName="attributes" fxLayout="column">--> |
||||
|
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <mat-label>Latitude</mat-label>--> |
||||
|
<!-- <input type="number" step="any" matInput formControlName="latitude">--> |
||||
|
<!-- </mat-form-field>--> |
||||
|
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
|
<!-- <mat-label>Longitude</mat-label>--> |
||||
|
<!-- <input type="number" step="any" matInput formControlName="longitude">--> |
||||
|
<!-- </mat-form-field>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </md-toolbar>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <md-dialog-content>--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- <div class="md-dialog-content">--> |
<!-- <mat-label>Address</mat-label>--> |
||||
<!-- <div layout="row">--> |
<!-- <input matInput formControlName="address">--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- </mat-form-field>--> |
||||
<!-- <label>Entity Name</label>--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- <input ng-model="vm.entityName" name=entityName required>--> |
<!-- <mat-label>Owner</mat-label>--> |
||||
<!-- <div ng-messages="addEntityForm.entityName.$error">--> |
<!-- <input matInput formControlName="owner">--> |
||||
<!-- <div ng-message="required">Entity name is required.</div>--> |
<!-- </mat-form-field>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </md-input-container>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <tb-entity-type-select class="md-block" style="min-width: 100px; width: 100px;"--> |
<!-- <mat-form-field fxFlex class="mat-block">--> |
||||
<!-- the-form="addEntityForm"--> |
<!-- <mat-label>Integer Value</mat-label>--> |
||||
<!-- tb-required="true"--> |
<!-- <input type="number" step="1" matInput formControlName="number">--> |
||||
<!-- allowed-entity-types="vm.allowedEntityTypes"--> |
<!-- <mat-error *ngIf="addEntityFormGroup.get('attributes').get('number').hasError('pattern')">--> |
||||
<!-- ng-model="vm.entityType">--> |
<!-- Invalid integer value.--> |
||||
<!-- </tb-entity-type-select>--> |
<!-- </mat-error>--> |
||||
<!-- <md-input-container flex class="md-block">--> |
<!-- </mat-form-field>--> |
||||
<!-- <label>Entity Subtype</label>--> |
<!-- <div class="boolean-value-input" fxLayout="column" fxLayoutAlign="center start" fxFlex>--> |
||||
<!-- <input ng-model="vm.type" name=type required>--> |
<!-- <label class="checkbox-label">Boolean Value</label>--> |
||||
<!-- <div ng-messages="addEntityForm.type.$error">--> |
<!-- <mat-checkbox formControlName="booleanValue" style="margin-bottom: 40px;">--> |
||||
<!-- <div ng-message="required">Entity subtype is required.</div>--> |
<!-- {{ (addEntityFormGroup.get('attributes').get('booleanValue').value ? "value.true" : "value.false") | translate }}--> |
||||
<!-- </div>--> |
<!-- </mat-checkbox>--> |
||||
<!-- </md-input-container>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="row">--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Latitude</label>--> |
|
||||
<!-- <input name="latitude" type="number" step="any" ng-model="vm.attributes.latitude">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Longitude</label>--> |
|
||||
<!-- <input name="longitude" type="number" step="any" ng-model="vm.attributes.longitude">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="row">--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Address</label>--> |
|
||||
<!-- <input ng-model="vm.attributes.address">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Owner</label>--> |
|
||||
<!-- <input ng-model="vm.attributes.owner">--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="row">--> |
|
||||
<!-- <md-input-container flex class="md-block">--> |
|
||||
<!-- <label>Integer Value</label>--> |
|
||||
<!-- <input name="integerNumber" type="number" step="1" ng-pattern="/^-?[0-9]+$/" ng-model="vm.attributes.number">--> |
|
||||
<!-- <div ng-messages="addEntityForm.integerNumber.$error">--> |
|
||||
<!-- <div ng-message="pattern">Invalid integer value.</div>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </md-input-container>--> |
|
||||
<!-- <div class="boolean-value-input" layout="column" layout-align="center start" flex>--> |
|
||||
<!-- <label class="checkbox-label">Boolean Value</label>--> |
|
||||
<!-- <md-checkbox ng-model="vm.attributes.booleanValue" style="margin-bottom: 40px;">--> |
|
||||
<!-- {{ (vm.attributes.booleanValue ? "value.true" : "value.false") | translate }}--> |
|
||||
<!-- </md-checkbox>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- <div class="relations-list">--> |
<!-- </div>--> |
||||
<!-- <div class="md-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">Relations</div>--> |
<!-- </div>--> |
||||
<!-- <div class="body" ng-show="vm.relations.length">--> |
<!-- <div class="relations-list">--> |
||||
<!-- <div class="row" layout="row" layout-align="start center" ng-repeat="relation in vm.relations track by $index">--> |
<!-- <div class="mat-body-1" style="padding-bottom: 10px; color: rgba(0,0,0,0.57);">Relations</div>--> |
||||
<!-- <div class="md-whiteframe-1dp" flex layout="row" style="padding-left: 5px;">--> |
<!-- <div class="body" [fxShow]="relations().length">--> |
||||
<!-- <div flex layout="column">--> |
<!-- <div class="row" fxLayout="row" fxLayoutAlign="start center" formArrayName="relations" *ngFor="let relation of relations().controls; let i = index;">--> |
||||
<!-- <div layout="row">--> |
<!-- <div [formGroupName]="i" class="mat-elevation-z2" fxFlex fxLayout="row" style="padding: 5px 0 5px 5px;">--> |
||||
<!-- <md-input-container class="md-block" style="min-width: 100px;">--> |
<!-- <div fxFlex fxLayout="column">--> |
||||
<!-- <label>Direction</label>--> |
<!-- <div fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column" fxLayoutGap.xs="0">--> |
||||
<!-- <md-select name="direction" required ng-model="relation.direction">--> |
<!-- <mat-form-field class="mat-block" style="min-width: 100px;">--> |
||||
<!-- <md-option ng-repeat="direction in vm.entitySearchDirection" ng-value="direction">--> |
<!-- <mat-label>Direction</mat-label>--> |
||||
<!-- {{ ("relation.search-direction." + direction) | translate}}--> |
<!-- <mat-select formControlName="direction" name="direction">--> |
||||
<!-- </md-option>--> |
<!-- <mat-option *ngFor="let direction of entitySearchDirection | keyvalue" [value]="direction.value">--> |
||||
<!-- </md-select>--> |
<!-- {{ ("relation.search-direction." + direction.value) | translate}}--> |
||||
<!-- <div ng-messages="addEntityForm.direction.$error">--> |
<!-- </mat-option>--> |
||||
<!-- <div ng-message="required">Relation direction is required.</div>--> |
<!-- </mat-select>--> |
||||
<!-- </div>--> |
<!-- <mat-error *ngIf="relation.get('direction').hasError('required')">--> |
||||
<!-- </md-input-container>--> |
<!-- Relation direction is required.--> |
||||
<!-- <tb-relation-type-autocomplete flex class="md-block"--> |
<!-- </mat-error>--> |
||||
<!-- the-form="addEntityForm"--> |
<!-- </mat-form-field>--> |
||||
<!-- ng-model="relation.relationType"--> |
<!-- <tb-relation-type-autocomplete--> |
||||
<!-- tb-required="true">--> |
<!-- fxFlex class="mat-block"--> |
||||
<!-- </tb-relation-type-autocomplete>--> |
<!-- formControlName="relationType"--> |
||||
<!-- </div>--> |
<!-- [required]="true">--> |
||||
<!-- <div layout="row">--> |
<!-- </tb-relation-type-autocomplete>--> |
||||
<!-- <tb-entity-select flex class="md-block"--> |
|
||||
<!-- the-form="addEntityForm"--> |
|
||||
<!-- tb-required="true"--> |
|
||||
<!-- ng-model="relation.relatedEntity">--> |
|
||||
<!-- </tb-entity-select>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- <div layout="column" layout-align="center center">--> |
|
||||
<!-- <md-button class="md-icon-button md-primary" style="width: 40px; min-width: 40px;"--> |
|
||||
<!-- ng-click="vm.removeRelation($index)" aria-label="Remove">--> |
|
||||
<!-- <md-tooltip md-direction="top">Remove relation</md-tooltip>--> |
|
||||
<!-- <md-icon aria-label="Remove" class="material-icons">--> |
|
||||
<!-- close--> |
|
||||
<!-- </md-icon>--> |
|
||||
<!-- </md-button>--> |
|
||||
<!-- </div>--> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
|
<!-- <div fxLayout="row" fxLayout.xs="column">--> |
||||
|
<!-- <tb-entity-select--> |
||||
|
<!-- fxFlex class="mat-block"--> |
||||
|
<!-- [required]="true"--> |
||||
|
<!-- formControlName="relatedEntity">--> |
||||
|
<!-- </tb-entity-select>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div fxLayout="column" fxLayoutAlign="center center">--> |
||||
|
<!-- <button mat-icon-button color="primary"--> |
||||
|
<!-- aria-label="Remove"--> |
||||
|
<!-- type="button"--> |
||||
|
<!-- (click)="removeRelation(i)"--> |
||||
|
<!-- matTooltip="Remove relation"--> |
||||
|
<!-- matTooltipPosition="above">--> |
||||
|
<!-- <mat-icon>close</mat-icon>--> |
||||
|
<!-- </button>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- <div>--> |
|
||||
<!-- <md-button class="md-primary md-raised" ng-click="vm.addRelation()" aria-label="Add">--> |
|
||||
<!-- <md-tooltip md-direction="top">Add Relation</md-tooltip>--> |
|
||||
<!-- Add--> |
|
||||
<!-- </md-button>--> |
|
||||
<!-- </div> --> |
|
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </div>--> |
<!-- </div>--> |
||||
<!-- </md-dialog-content>--> |
<!-- <div>--> |
||||
<!-- <md-dialog-actions>--> |
<!-- <button mat-raised-button color="primary"--> |
||||
<!-- <md-button type="submit" ng-disabled="addEntityForm.$invalid || !addEntityForm.$dirty" class="md-raised md-primary">Create</md-button>--> |
<!-- type="button"--> |
||||
<!-- <md-button ng-click="vm.cancel()" class="md-primary">Cancel</md-button>--> |
<!-- (click)="addRelation()"--> |
||||
<!-- </md-dialog-actions>--> |
<!-- matTooltip="Add Relation"--> |
||||
<!-- </form>--> |
<!-- matTooltipPosition="above">--> |
||||
<!--</md-dialog>--> |
<!-- Add--> |
||||
|
<!-- </button>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">--> |
||||
|
<!-- <button mat-button mat-raised-button color="primary"--> |
||||
|
<!-- type="submit"--> |
||||
|
<!-- [disabled]="(isLoading$ | async) || addEntityForm.invalid || !addEntityForm.dirty">--> |
||||
|
<!-- Create--> |
||||
|
<!-- </button>--> |
||||
|
<!-- <button mat-button color="primary"--> |
||||
|
<!-- style="margin-right: 20px;"--> |
||||
|
<!-- type="button"--> |
||||
|
<!-- [disabled]="(isLoading$ | async)"--> |
||||
|
<!-- (click)="cancel()" cdkFocusInitial>--> |
||||
|
<!-- Cancel--> |
||||
|
<!-- </button>--> |
||||
|
<!-- </div>--> |
||||
|
<!--</form>--> |
||||
|
|||||
Loading…
Reference in new issue