|
|
@ -20,178 +20,125 @@ |
|
|
[disabled]="(isLoading$ | async)" |
|
|
[disabled]="(isLoading$ | async)" |
|
|
(click)="onEntityAction($event, 'open')" |
|
|
(click)="onEntityAction($event, 'open')" |
|
|
[class.!hidden]="isEdit || isDetailsPage"> |
|
|
[class.!hidden]="isEdit || isDetailsPage"> |
|
|
{{'common.open-details-page' | translate }} |
|
|
{{ 'common.open-details-page' | translate }} |
|
|
</button> |
|
|
</button> |
|
|
<button mat-raised-button color="primary" |
|
|
<button mat-raised-button color="primary" |
|
|
[disabled]="(isLoading$ | async)" |
|
|
[disabled]="(isLoading$ | async)" |
|
|
(click)="onEntityAction($event, 'export')" |
|
|
(click)="onEntityAction($event, 'export')" |
|
|
[class.!hidden]="isEdit"> |
|
|
[class.!hidden]="isEdit"> |
|
|
{{'action.export' | translate }} |
|
|
{{ 'action.export' | translate }} |
|
|
</button> |
|
|
</button> |
|
|
<button mat-raised-button color="primary" |
|
|
<button mat-raised-button color="primary" |
|
|
[disabled]="(isLoading$ | async)" |
|
|
[disabled]="(isLoading$ | async)" |
|
|
(click)="onEntityAction($event, 'delete')" |
|
|
(click)="onEntityAction($event, 'delete')" |
|
|
[class.!hidden]="hideDelete() || isEdit"> |
|
|
[class.!hidden]="hideDelete() || isEdit"> |
|
|
{{'action.delete' | translate }} |
|
|
{{ 'action.delete' | translate }} |
|
|
</button> |
|
|
</button> |
|
|
<!-- <div class="flex flex-row xs:flex-col">--> |
|
|
<!-- <div class="flex flex-row xs:flex-col">--> |
|
|
<!-- <button mat-raised-button--> |
|
|
<!-- <button mat-raised-button--> |
|
|
<!-- ngxClipboard--> |
|
|
<!-- ngxClipboard--> |
|
|
<!-- (cbOnSuccess)="onAssetProfileIdCopied($event)"--> |
|
|
<!-- (cbOnSuccess)="onAssetProfileIdCopied($event)"--> |
|
|
<!-- [cbContent]="entity?.id?.id"--> |
|
|
<!-- [cbContent]="entity?.id?.id"--> |
|
|
<!-- [class.!hidden]="isEdit">--> |
|
|
<!-- [class.!hidden]="isEdit">--> |
|
|
<!-- <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>--> |
|
|
<!-- <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>--> |
|
|
<!-- <span translate>asset-profile.copyId</span>--> |
|
|
<!-- <span translate>asset-profile.copyId</span>--> |
|
|
<!-- </button>--> |
|
|
<!-- </button>--> |
|
|
<!-- </div>--> |
|
|
<!-- </div>--> |
|
|
</div> |
|
|
</div> |
|
|
<div class="mat-padding flex flex-col"> |
|
|
<div class="mat-padding flex flex-1 flex-col" [formGroup]="entityForm"> |
|
|
<!-- <mat-form-field class="mat-block"--> |
|
|
<div class="tb-form-panel no-border no-padding"> |
|
|
<!-- [class.!hidden]="isEdit || !isAssignedToCustomer(entity)--> |
|
|
<div class="tb-form-panel no-gap"> |
|
|
<!-- || entity?.customerIsPublic || assetScope !== 'tenant'">--> |
|
|
<div class="tb-form-panel-title mb-4">{{ 'common.general' | translate }}</div> |
|
|
<!-- <mat-label translate>asset.assignedToCustomer</mat-label>--> |
|
|
<div class="flex items-center gap-2"> |
|
|
<!-- <input matInput disabled [ngModel]="entity?.customerTitle">--> |
|
|
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
<!-- </mat-form-field>--> |
|
|
<mat-label>{{ 'entity-field.title' | translate }}</mat-label> |
|
|
<!-- <div class="tb-small" style="padding-bottom: 10px; padding-left: 2px;"--> |
|
|
<input matInput maxlength="255" formControlName="name" required> |
|
|
<!-- [class.!hidden]="isEdit || !entity?.customerIsPublic || (assetScope !== 'customer' && assetScope !== 'tenant')">--> |
|
|
@if (entityForm.get('name').errors && entityForm.get('name').touched) { |
|
|
<!-- {{ 'asset.asset-public' | translate }}--> |
|
|
<mat-error> |
|
|
<!-- </div>--> |
|
|
@if (entityForm.get('name').hasError('required')) { |
|
|
<!-- <form [formGroup]="entityForm">--> |
|
|
{{ 'common.hint.title-required' | translate }} |
|
|
<!-- <fieldset [disabled]="(isLoading$ | async) || !isEdit">--> |
|
|
} @else if (entityForm.get('name').hasError('pattern')) { |
|
|
<!-- <mat-form-field class="mat-block">--> |
|
|
{{ 'common.hint.title-pattern' | translate }} |
|
|
<!-- <mat-label translate>asset.name</mat-label>--> |
|
|
} @else if (entityForm.get('name').hasError('maxlength')) { |
|
|
<!-- <input matInput formControlName="name" required>--> |
|
|
{{ 'common.hint.title-max-length' | translate }} |
|
|
<!-- <mat-error *ngIf="entityForm.get('name').hasError('required')">--> |
|
|
} |
|
|
<!-- {{ 'asset.name-required' | translate }}--> |
|
|
</mat-error> |
|
|
<!-- </mat-error>--> |
|
|
|
|
|
<!-- <mat-error *ngIf="entityForm.get('name').hasError('maxlength')">--> |
|
|
|
|
|
<!-- {{ 'asset.name-max-length' | translate }}--> |
|
|
|
|
|
<!-- </mat-error>--> |
|
|
|
|
|
<!-- </mat-form-field>--> |
|
|
|
|
|
<!-- <mat-form-field class="mat-block">--> |
|
|
|
|
|
<!-- <mat-label translate>asset.label</mat-label>--> |
|
|
|
|
|
<!-- <input matInput formControlName="label">--> |
|
|
|
|
|
<!-- <mat-error *ngIf="entityForm.get('label').hasError('maxlength')">--> |
|
|
|
|
|
<!-- {{ 'asset.label-max-length' | translate }}--> |
|
|
|
|
|
<!-- </mat-error>--> |
|
|
|
|
|
<!-- </mat-form-field>--> |
|
|
|
|
|
<!-- <tb-asset-profile-autocomplete--> |
|
|
|
|
|
<!-- [selectDefaultProfile]="isAdd"--> |
|
|
|
|
|
<!-- required--> |
|
|
|
|
|
<!-- formControlName="assetProfileId"--> |
|
|
|
|
|
<!-- [showDetailsPageLink]="true"--> |
|
|
|
|
|
<!-- (assetProfileUpdated)="onAssetProfileUpdated()">--> |
|
|
|
|
|
<!-- </tb-asset-profile-autocomplete>--> |
|
|
|
|
|
<!-- <tb-entity-autocomplete--> |
|
|
|
|
|
<!-- *ngIf="isAdd"--> |
|
|
|
|
|
<!-- useFullEntityId--> |
|
|
|
|
|
<!-- formControlName="customerId"--> |
|
|
|
|
|
<!-- labelText="asset.assign-to-customer"--> |
|
|
|
|
|
<!-- [entityType]="entityType.CUSTOMER">--> |
|
|
|
|
|
<!-- </tb-entity-autocomplete>--> |
|
|
|
|
|
<!-- <div formGroupName="additionalInfo">--> |
|
|
|
|
|
<!-- <mat-form-field class="mat-block">--> |
|
|
|
|
|
<!-- <mat-label translate>asset.description</mat-label>--> |
|
|
|
|
|
<!-- <textarea matInput formControlName="description" rows="2"></textarea>--> |
|
|
|
|
|
<!-- </mat-form-field>--> |
|
|
|
|
|
<!-- </div>--> |
|
|
|
|
|
<!-- </fieldset>--> |
|
|
|
|
|
<!-- </form>--> |
|
|
|
|
|
<div mat-dialog-content class="flex-1" [formGroup]="entityForm"> |
|
|
|
|
|
<div class="tb-form-panel no-border no-padding"> |
|
|
|
|
|
<div class="tb-form-panel no-gap"> |
|
|
|
|
|
<div class="tb-form-panel-title mb-4">{{ 'common.general' | translate }}</div> |
|
|
|
|
|
<div class="flex items-center gap-2"> |
|
|
|
|
|
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
|
|
<mat-label>{{ 'entity-field.title' | translate }}</mat-label> |
|
|
|
|
|
<input matInput maxlength="255" formControlName="name" required> |
|
|
|
|
|
@if (entityForm.get('name').errors && entityForm.get('name').touched) { |
|
|
|
|
|
<mat-error> |
|
|
|
|
|
@if (entityForm.get('name').hasError('required')) { |
|
|
|
|
|
{{ 'common.hint.title-required' | translate }} |
|
|
|
|
|
} @else if (entityForm.get('name').hasError('pattern')) { |
|
|
|
|
|
{{ 'common.hint.title-pattern' | translate }} |
|
|
|
|
|
} @else if (entityForm.get('name').hasError('maxlength')) { |
|
|
|
|
|
{{ 'common.hint.title-max-length' | translate }} |
|
|
|
|
|
} |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
} |
|
|
|
|
|
<mat-hint></mat-hint> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<tb-entity-debug-settings-button |
|
|
|
|
|
formControlName="debugSettings" |
|
|
|
|
|
style="margin-bottom: 22px" |
|
|
|
|
|
[entityType]="EntityType.CALCULATED_FIELD" |
|
|
|
|
|
[additionalActionConfig]="entitiesTableConfig.additionalDebugActionConfig" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<tb-entity-select formControlName="entityId" |
|
|
|
|
|
appearance="outline" |
|
|
|
|
|
[filterAllowedEntityTypes]="false" |
|
|
|
|
|
[allowedEntityTypes]="calculatedFieldsEntityTypeList" |
|
|
|
|
|
(entityChanged)="changeEntity($event)"> |
|
|
|
|
|
</tb-entity-select> |
|
|
|
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic"> |
|
|
|
|
|
<mat-label>{{ 'common.type' | translate }}</mat-label> |
|
|
|
|
|
<mat-select formControlName="type"> |
|
|
|
|
|
@for (type of fieldTypes; track type) { |
|
|
|
|
|
<mat-option [value]="type">{{ CalculatedFieldTypeTranslations.get(type).name | translate}}</mat-option> |
|
|
|
|
|
} |
|
|
|
|
|
</mat-select> |
|
|
|
|
|
@if (CalculatedFieldTypeTranslations.get(entityForm.get('type').value).hint) { |
|
|
|
|
|
<mat-hint>{{ CalculatedFieldTypeTranslations.get(entityForm.get('type').value).hint | translate }}</mat-hint> |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
<mat-hint></mat-hint> |
|
|
</mat-form-field> |
|
|
</mat-form-field> |
|
|
|
|
|
<tb-entity-debug-settings-button |
|
|
|
|
|
formControlName="debugSettings" |
|
|
|
|
|
style="margin-bottom: 22px" |
|
|
|
|
|
[entityType]="EntityType.CALCULATED_FIELD" |
|
|
|
|
|
[additionalActionConfig]="additionalDebugActionConfig" |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
@switch (entityForm.get('type').value) { |
|
|
<tb-entity-select formControlName="entityId" |
|
|
@case (CalculatedFieldType.GEOFENCING) { |
|
|
appearance="outline" |
|
|
<tb-geofencing-configuration formControlName="configuration" |
|
|
[filterAllowedEntityTypes]="false" |
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
[allowedEntityTypes]="calculatedFieldsEntityTypeList" |
|
|
[entityId]="entityId" |
|
|
(entityChanged)="changeEntity($event)"> |
|
|
[entityName]="entityName" |
|
|
</tb-entity-select> |
|
|
[ownerId]="ownerId" |
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic"> |
|
|
[tenantId]="tenantId" |
|
|
<mat-label>{{ 'common.type' | translate }}</mat-label> |
|
|
></tb-geofencing-configuration> |
|
|
<mat-select formControlName="type"> |
|
|
} |
|
|
@for (type of fieldTypes; track type) { |
|
|
@case (CalculatedFieldType.PROPAGATION) { |
|
|
<mat-option [value]="type">{{ CalculatedFieldTypeTranslations.get(type).name | translate }}</mat-option> |
|
|
<tb-propagation-configuration formControlName="configuration" |
|
|
} |
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
</mat-select> |
|
|
[entityId]="entityId" |
|
|
@if (CalculatedFieldTypeTranslations.get(entityForm.get('type').value).hint) { |
|
|
[entityName]="entityName" |
|
|
<mat-hint>{{ CalculatedFieldTypeTranslations.get(entityForm.get('type').value).hint | translate }}</mat-hint> |
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[ownerId]="ownerId" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-propagation-configuration> |
|
|
|
|
|
} |
|
|
|
|
|
@case (CalculatedFieldType.RELATED_ENTITIES_AGGREGATION) { |
|
|
|
|
|
<tb-related-entities-aggregation-component formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-related-entities-aggregation-component> |
|
|
|
|
|
} |
|
|
|
|
|
@case (CalculatedFieldType.ENTITY_AGGREGATION) { |
|
|
|
|
|
<tb-entity-aggregation-component formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
></tb-entity-aggregation-component> |
|
|
|
|
|
} |
|
|
|
|
|
@default { |
|
|
|
|
|
<tb-simple-configuration formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[ownerId]="ownerId" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[isScript]="entityForm.get('type').value === CalculatedFieldType.SCRIPT" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-simple-configuration> |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</mat-form-field> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
@switch (entityForm.get('type').value) { |
|
|
|
|
|
@case (CalculatedFieldType.GEOFENCING) { |
|
|
|
|
|
<tb-geofencing-configuration formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[ownerId]="ownerId" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
></tb-geofencing-configuration> |
|
|
|
|
|
} |
|
|
|
|
|
@case (CalculatedFieldType.PROPAGATION) { |
|
|
|
|
|
<tb-propagation-configuration formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[ownerId]="ownerId" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-propagation-configuration> |
|
|
|
|
|
} |
|
|
|
|
|
@case (CalculatedFieldType.RELATED_ENTITIES_AGGREGATION) { |
|
|
|
|
|
<tb-related-entities-aggregation-component formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-related-entities-aggregation-component> |
|
|
|
|
|
} |
|
|
|
|
|
@case (CalculatedFieldType.ENTITY_AGGREGATION) { |
|
|
|
|
|
<tb-entity-aggregation-component formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
></tb-entity-aggregation-component> |
|
|
|
|
|
} |
|
|
|
|
|
@default { |
|
|
|
|
|
<tb-simple-configuration formControlName="configuration" |
|
|
|
|
|
[class.tb-form-panel-disabled]="disabledConfiguration" |
|
|
|
|
|
[entityId]="entityId" |
|
|
|
|
|
[entityName]="entityName" |
|
|
|
|
|
[ownerId]="ownerId" |
|
|
|
|
|
[tenantId]="tenantId" |
|
|
|
|
|
[isScript]="entityForm.get('type').value === CalculatedFieldType.SCRIPT" |
|
|
|
|
|
[testScript]="onTestScript.bind(this)" |
|
|
|
|
|
></tb-simple-configuration> |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|