committed by
GitHub
114 changed files with 2197 additions and 559 deletions
@ -0,0 +1,112 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||
|
///
|
||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
/// you may not use this file except in compliance with the License.
|
||||
|
/// You may obtain a copy of the License at
|
||||
|
///
|
||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
///
|
||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
/// See the License for the specific language governing permissions and
|
||||
|
/// limitations under the License.
|
||||
|
///
|
||||
|
|
||||
|
import { DestroyRef, inject, Injectable } from '@angular/core'; |
||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
||||
|
import { pairwise, switchMap } from 'rxjs/operators'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
import { |
||||
|
CalculatedField, |
||||
|
CalculatedFieldConfiguration, |
||||
|
CalculatedFieldEventArguments, |
||||
|
CalculatedFieldType, |
||||
|
OutputStrategyType |
||||
|
} from '@shared/models/calculated-field.models'; |
||||
|
import { oneSpaceInsideRegex } from '@shared/models/regex.constants'; |
||||
|
import { isDefined } from '@core/utils'; |
||||
|
import { CalculatedFieldsService } from '@core/http/calculated-fields.service'; |
||||
|
import { CalculatedFieldsTableEntity } from '@home/components/calculated-fields/calculated-fields-table-config'; |
||||
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
||||
|
|
||||
|
@Injectable({ providedIn: 'root' }) |
||||
|
export class CalculatedFieldFormService { |
||||
|
private fb = inject(FormBuilder); |
||||
|
private calculatedFieldsService = inject(CalculatedFieldsService); |
||||
|
|
||||
|
buildForm(): FormGroup { |
||||
|
return this.fb.group({ |
||||
|
name: ['', [Validators.required, Validators.pattern(oneSpaceInsideRegex), Validators.maxLength(255)]], |
||||
|
entityId: [null, Validators.required], |
||||
|
type: [CalculatedFieldType.SIMPLE], |
||||
|
debugSettings: [], |
||||
|
configuration: this.fb.control<CalculatedFieldConfiguration>({} as CalculatedFieldConfiguration), |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
buildAlarmRuleForm(): FormGroup { |
||||
|
return this.fb.group({ |
||||
|
name: ['', [Validators.required, Validators.pattern(oneSpaceInsideRegex), Validators.maxLength(255)]], |
||||
|
entityId: [null, Validators.required], |
||||
|
type: [CalculatedFieldType.ALARM], |
||||
|
debugSettings: [], |
||||
|
configuration: this.fb.group({ |
||||
|
type: [CalculatedFieldType.ALARM], |
||||
|
arguments: this.fb.control({}, Validators.required), |
||||
|
propagate: [false], |
||||
|
propagateToOwner: [false], |
||||
|
propagateToTenant: [false], |
||||
|
propagateRelationTypes: [null], |
||||
|
createRules: [null, Validators.required], |
||||
|
clearRule: [null], |
||||
|
}), |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
setupTypeChange(form: FormGroup, destroyRef: DestroyRef, isEditActive?: () => boolean): void { |
||||
|
form.get('type').valueChanges.pipe( |
||||
|
pairwise(), |
||||
|
takeUntilDestroyed(destroyRef) |
||||
|
).subscribe(([prevType, nextType]) => { |
||||
|
const shouldCheck = isEditActive ? isEditActive() : true; |
||||
|
if (shouldCheck) { |
||||
|
if (![CalculatedFieldType.SIMPLE, CalculatedFieldType.SCRIPT].includes(prevType) || |
||||
|
![CalculatedFieldType.SIMPLE, CalculatedFieldType.SCRIPT].includes(nextType)) { |
||||
|
form.get('configuration').setValue({} as CalculatedFieldConfiguration, { emitEvent: false }); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
prepareConfig(configuration: CalculatedFieldConfiguration): CalculatedFieldConfiguration { |
||||
|
const config = configuration || ({} as CalculatedFieldConfiguration); |
||||
|
if (config.type !== CalculatedFieldType.ALARM) { |
||||
|
if (isDefined(config?.output) && !config?.output?.strategy) { |
||||
|
config.output.strategy = { type: OutputStrategyType.RULE_CHAIN }; |
||||
|
} |
||||
|
} |
||||
|
return config; |
||||
|
} |
||||
|
|
||||
|
testScript( |
||||
|
calculatedFieldId: string, |
||||
|
formValue: CalculatedField, |
||||
|
testDialogFn: (calculatedField: CalculatedFieldsTableEntity, argumentsObj?: CalculatedFieldEventArguments, openCalculatedFieldEdit?: boolean, expression?: string) => Observable<string>, |
||||
|
destroyRef: DestroyRef, |
||||
|
expression?: string, |
||||
|
): Observable<string> { |
||||
|
if (calculatedFieldId) { |
||||
|
return this.calculatedFieldsService.getLatestCalculatedFieldDebugEvent(calculatedFieldId, {ignoreLoading: true}) |
||||
|
.pipe( |
||||
|
switchMap(event => { |
||||
|
const args = event?.arguments ? JSON.parse(event.arguments) : null; |
||||
|
return testDialogFn(formValue, args, false, expression); |
||||
|
}), |
||||
|
takeUntilDestroyed(destroyRef) |
||||
|
); |
||||
|
} |
||||
|
return testDialogFn(formValue, null, false, expression); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,159 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2025 The Thingsboard Authors |
||||
|
|
||||
|
Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
you may not use this file except in compliance with the License. |
||||
|
You may obtain a copy of the License at |
||||
|
|
||||
|
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
|
||||
|
Unless required by applicable law or agreed to in writing, software |
||||
|
distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
See the License for the specific language governing permissions and |
||||
|
limitations under the License. |
||||
|
|
||||
|
--> |
||||
|
<div class="tb-details-buttons xs:flex xs:flex-col" *ngIf="!standalone"> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'open')" |
||||
|
[class.!hidden]="isEdit || isDetailsPage"> |
||||
|
{{ 'common.open-details-page' | translate }} |
||||
|
</button> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'export')" |
||||
|
[class.!hidden]="isEdit"> |
||||
|
{{ 'action.export' | translate }} |
||||
|
</button> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'delete')" |
||||
|
[class.!hidden]="hideDelete() || isEdit"> |
||||
|
{{ 'action.delete' | translate }} |
||||
|
</button> |
||||
|
</div> |
||||
|
<div class="mat-padding flex flex-1 flex-col" [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]="additionalDebugActionConfig" |
||||
|
/> |
||||
|
</div> |
||||
|
<tb-entity-select formControlName="entityId" |
||||
|
appearance="outline" |
||||
|
required |
||||
|
entityTypeLabel="{{ 'entity.entity-type' | translate }}" |
||||
|
[filterAllowedEntityTypes]="false" |
||||
|
[allowedEntityTypes]="calculatedFieldsEntityTypeList" |
||||
|
(entityChanged)="changeEntity($event)"> |
||||
|
</tb-entity-select> |
||||
|
</div> |
||||
|
<ng-container formGroupName="configuration"> |
||||
|
<div class="tb-form-panel" [class.disabled]="!isEditValue"> |
||||
|
<div class="tb-form-panel-title tb-required">{{ 'calculated-fields.arguments' | translate }}</div> |
||||
|
<tb-calculated-field-arguments-table formControlName="arguments" |
||||
|
[entityId]="entityId" |
||||
|
[tenantId]="tenantId" |
||||
|
[ownerId]="ownerId" |
||||
|
[watchKeyChange]="true" |
||||
|
[entityName]="entityName"/> |
||||
|
</div> |
||||
|
<div class="tb-form-panel" [class.disabled]="!isEditValue"> |
||||
|
<div class="tb-form-panel-title">{{ 'alarm-rule.create-conditions' | translate }}</div> |
||||
|
<div class="flex flex-1 flex-col"> |
||||
|
<tb-create-cf-alarm-rules formControlName="createRules" [arguments]="arguments" [testScript]="onTestScript.bind(this)"> |
||||
|
</tb-create-cf-alarm-rules> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="tb-form-panel" [class.disabled]="!isEditValue"> |
||||
|
<div class="tb-form-panel-title">{{ 'alarm-rule.clear-condition' | translate }}</div> |
||||
|
<div class="flex flex-row items-center justify-start gap-2 pb-2" |
||||
|
[class.!hidden]="!configFormGroup.get('clearRule').value"> |
||||
|
<div class="clear-alarm-rule flex flex-1 flex-row"> |
||||
|
<tb-cf-alarm-rule formControlName="clearRule" class="flex-1" [arguments]="arguments" [testScript]="onTestScript.bind(this)" isClearCondition> |
||||
|
</tb-cf-alarm-rule> |
||||
|
</div> |
||||
|
<button mat-icon-button |
||||
|
class="button-icon" |
||||
|
type="button" |
||||
|
(click)="removeClearAlarmRule()" |
||||
|
matTooltip="{{ 'action.remove' | translate }}" |
||||
|
matTooltipPosition="above"> |
||||
|
<mat-icon>delete</mat-icon> |
||||
|
</button> |
||||
|
</div> |
||||
|
<div *ngIf="!configFormGroup.get('clearRule').value"> |
||||
|
<span translate class="tb-prompt flex items-center justify-center text-base">alarm-rule.no-clear-alarm-rule</span> |
||||
|
</div> |
||||
|
<div [class.!hidden]="configFormGroup.get('clearRule').value"> |
||||
|
<button mat-stroked-button color="primary" |
||||
|
[disabled]="!isEditValue" |
||||
|
type="button" |
||||
|
(click)="addClearAlarmRule()"> |
||||
|
{{ 'alarm-rule.add-clear-alarm-rule' | translate }} |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="tb-form-panel no-gap"> |
||||
|
<mat-expansion-panel class="tb-settings" [expanded]="false"> |
||||
|
<mat-expansion-panel-header [class.tb-disabled]="!isEditValue"> |
||||
|
{{ 'alarm-rule.advanced-settings' | translate }} |
||||
|
</mat-expansion-panel-header> |
||||
|
<ng-template matExpansionPanelContent> |
||||
|
<div class="tb-form-panel stroked no-padding no-gap"> |
||||
|
<div class="tb-form-row no-border"> |
||||
|
<mat-slide-toggle class="mat-slide margin" formControlName="propagate"> |
||||
|
{{ 'alarm-rule.propagate-alarm' | translate }} |
||||
|
</mat-slide-toggle> |
||||
|
</div> |
||||
|
@if (configFormGroup.get('propagate').value) { |
||||
|
<tb-string-items-list appearance="outline" |
||||
|
class="flex flex-1 px-4" |
||||
|
label="{{ 'alarm-rule.alarm-rule-relation-types-list' | translate }}" |
||||
|
placeholder="{{ 'alarm-rule.alarm-rule-relation-types-list' | translate }}" |
||||
|
hint="{{ 'alarm-rule.alarm-rule-relation-types-list-hint' | translate }}" |
||||
|
[predefinedValues]="predefinedTypeValues" |
||||
|
formControlName="propagateRelationTypes"> |
||||
|
</tb-string-items-list> |
||||
|
} |
||||
|
</div> |
||||
|
<div class="tb-form-row"> |
||||
|
<mat-slide-toggle class="mat-slide margin" formControlName="propagateToOwner"> |
||||
|
{{ 'alarm-rule.propagate-alarm-to-owner' | translate }} |
||||
|
</mat-slide-toggle> |
||||
|
</div> |
||||
|
<div class="tb-form-row"> |
||||
|
<mat-slide-toggle class="mat-slide margin" formControlName="propagateToTenant"> |
||||
|
{{ 'alarm-rule.propagate-alarm-to-tenant' | translate }} |
||||
|
</mat-slide-toggle> |
||||
|
</div> |
||||
|
</ng-template> |
||||
|
</mat-expansion-panel> |
||||
|
</div> |
||||
|
</ng-container> |
||||
|
</div> |
||||
|
</div> |
||||
@ -0,0 +1,175 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||
|
///
|
||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
/// you may not use this file except in compliance with the License.
|
||||
|
/// You may obtain a copy of the License at
|
||||
|
///
|
||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
///
|
||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
/// See the License for the specific language governing permissions and
|
||||
|
/// limitations under the License.
|
||||
|
///
|
||||
|
|
||||
|
import { ChangeDetectorRef, Component, DestroyRef, inject, Inject, Input } from '@angular/core'; |
||||
|
import { Store } from '@ngrx/store'; |
||||
|
import { AppState } from '@core/core.state'; |
||||
|
import { EntityComponent } from '@home/components/entity/entity.component'; |
||||
|
import { FormBuilder, FormGroup } from '@angular/forms'; |
||||
|
import { EntityType } from '@shared/models/entity-type.models'; |
||||
|
import { TranslateService } from '@ngx-translate/core'; |
||||
|
import { |
||||
|
CalculatedFieldArgument, |
||||
|
CalculatedFieldConfiguration, |
||||
|
CalculatedFieldInfo, |
||||
|
calculatedFieldsEntityTypeList, |
||||
|
CalculatedFieldType |
||||
|
} from '@shared/models/calculated-field.models'; |
||||
|
import { EntityId } from '@shared/models/id/entity-id'; |
||||
|
import { BaseData } from '@shared/models/base-data'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
||||
|
import { |
||||
|
CalculatedFieldsTableConfig, |
||||
|
CalculatedFieldsTableEntity |
||||
|
} from '@home/components/calculated-fields/calculated-fields-table-config'; |
||||
|
import { TenantId } from '@shared/models/id/tenant-id'; |
||||
|
import { StringItemsOption } from '@shared/components/string-items-list.component'; |
||||
|
import { RelationTypes } from '@shared/models/relation.models'; |
||||
|
import { AlarmRule, AlarmRuleConditionType, AlarmRuleExpressionType } from '@shared/models/alarm-rule.models'; |
||||
|
import { CalculatedFieldFormService } from '@core/services/calculated-field-form.service'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-alarm-rules', |
||||
|
templateUrl: './alarm-rules.component.html', |
||||
|
styleUrls: [] |
||||
|
}) |
||||
|
export class AlarmRulesComponent extends EntityComponent<CalculatedFieldsTableEntity> { |
||||
|
|
||||
|
@Input() |
||||
|
standalone = false; |
||||
|
|
||||
|
@Input() |
||||
|
entityName: string; |
||||
|
|
||||
|
readonly ownerId = new TenantId(getCurrentAuthUser(this.store).tenantId); |
||||
|
readonly tenantId = getCurrentAuthUser(this.store).tenantId; |
||||
|
readonly EntityType = EntityType; |
||||
|
readonly calculatedFieldsEntityTypeList = calculatedFieldsEntityTypeList; |
||||
|
readonly CalculatedFieldType = CalculatedFieldType; |
||||
|
|
||||
|
private cfFormService = inject(CalculatedFieldFormService); |
||||
|
private destroyRef = inject(DestroyRef); |
||||
|
|
||||
|
constructor(protected store: Store<AppState>, |
||||
|
protected translate: TranslateService, |
||||
|
@Inject('entity') protected entityValue: CalculatedFieldInfo, |
||||
|
@Inject('entitiesTableConfig') protected entitiesTableConfigValue: CalculatedFieldsTableConfig, |
||||
|
protected fb: FormBuilder, |
||||
|
protected cd: ChangeDetectorRef) { |
||||
|
super(store, fb, entityValue, entitiesTableConfigValue, cd); |
||||
|
} |
||||
|
|
||||
|
hideDelete() { |
||||
|
if (this.entitiesTableConfig) { |
||||
|
return !this.entitiesTableConfig.deleteEnabled(this.entity); |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
additionalDebugActionConfig = { |
||||
|
...this.entitiesTableConfig.additionalDebugActionConfig, |
||||
|
action: () => this.entitiesTableConfig.additionalDebugActionConfig.action( |
||||
|
{ id: this.entity.id, ...this.entityFormValue() }, false, |
||||
|
(expression) => { |
||||
|
if (expression) { |
||||
|
this.entityForm.get('configuration').setValue({...this.entityFormValue().configuration, expression}); |
||||
|
this.entityForm.get('configuration').markAsDirty(); |
||||
|
} |
||||
|
}), |
||||
|
}; |
||||
|
|
||||
|
get entityId(): EntityId { |
||||
|
return this.entityForm.get('entityId').value; |
||||
|
} |
||||
|
|
||||
|
get entitiesTableConfig(): CalculatedFieldsTableConfig { |
||||
|
return this.entitiesTableConfigValue; |
||||
|
} |
||||
|
|
||||
|
changeEntity(entity: BaseData<EntityId>): void { |
||||
|
this.entityName = entity?.name; |
||||
|
} |
||||
|
|
||||
|
buildForm(_entity?: CalculatedFieldInfo): FormGroup { |
||||
|
return inject(CalculatedFieldFormService).buildAlarmRuleForm(); |
||||
|
} |
||||
|
|
||||
|
updateForm(entity: CalculatedFieldInfo) { |
||||
|
const { configuration = {} as CalculatedFieldConfiguration, type = CalculatedFieldType.ALARM, debugSettings = { failuresEnabled: true, allEnabled: true }, entityId = this.entityId, ...value } = entity ?? {}; |
||||
|
setTimeout(() => { |
||||
|
this.entityForm.patchValue({ configuration, debugSettings, entityId, ...value }, {emitEvent: false}); |
||||
|
}); |
||||
|
if (!entityId) { |
||||
|
this.entityForm.get('configuration').disable({emitEvent: false}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
onTestScript(expression?: string): Observable<string> { |
||||
|
return this.cfFormService.testScript( |
||||
|
this.entity?.id?.id, |
||||
|
this.entityFormValue(), |
||||
|
this.entitiesTableConfig.getTestScriptDialog.bind(this.entitiesTableConfig), |
||||
|
this.destroyRef, |
||||
|
expression |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
updateFormState() { |
||||
|
if (this.entityForm) { |
||||
|
if (this.isEditValue) { |
||||
|
this.entityForm.enable({emitEvent: false}); |
||||
|
this.entityForm.get('entityId').disable({emitEvent: false}); |
||||
|
} else { |
||||
|
this.entityForm.disable({emitEvent: false}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
get arguments(): Record<string, CalculatedFieldArgument> { |
||||
|
return this.entityForm.get('configuration.arguments').value; |
||||
|
} |
||||
|
|
||||
|
get predefinedTypeValues(): StringItemsOption[] { |
||||
|
return RelationTypes.map(type => ({ |
||||
|
name: type, |
||||
|
value: type |
||||
|
})); |
||||
|
} |
||||
|
|
||||
|
get configFormGroup(): FormGroup { |
||||
|
return this.entityForm.get('configuration') as FormGroup; |
||||
|
} |
||||
|
|
||||
|
public removeClearAlarmRule() { |
||||
|
this.configFormGroup.patchValue({clearRule: null}); |
||||
|
this.entityForm.markAsDirty(); |
||||
|
} |
||||
|
|
||||
|
public addClearAlarmRule() { |
||||
|
const clearAlarmRule: AlarmRule = { |
||||
|
condition: { |
||||
|
type: AlarmRuleConditionType.SIMPLE, |
||||
|
expression: { |
||||
|
type: AlarmRuleExpressionType.SIMPLE |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
this.configFormGroup.patchValue({clearRule: clearAlarmRule}); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,136 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2025 The Thingsboard Authors |
||||
|
|
||||
|
Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
you may not use this file except in compliance with the License. |
||||
|
You may obtain a copy of the License at |
||||
|
|
||||
|
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
|
||||
|
Unless required by applicable law or agreed to in writing, software |
||||
|
distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
See the License for the specific language governing permissions and |
||||
|
limitations under the License. |
||||
|
|
||||
|
--> |
||||
|
<div class="tb-details-buttons xs:flex xs:flex-col" *ngIf="!standalone"> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'open')" |
||||
|
[class.!hidden]="isEdit || isDetailsPage"> |
||||
|
{{ 'common.open-details-page' | translate }} |
||||
|
</button> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'export')" |
||||
|
[class.!hidden]="isEdit"> |
||||
|
{{ 'action.export' | translate }} |
||||
|
</button> |
||||
|
<button mat-raised-button color="primary" |
||||
|
[disabled]="(isLoading$ | async)" |
||||
|
(click)="onEntityAction($event, 'delete')" |
||||
|
[class.!hidden]="hideDelete() || isEdit"> |
||||
|
{{ 'action.delete' | translate }} |
||||
|
</button> |
||||
|
</div> |
||||
|
<div class="mat-padding flex flex-1 flex-col" [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]="additionalDebugActionConfig" |
||||
|
/> |
||||
|
</div> |
||||
|
<tb-entity-select formControlName="entityId" |
||||
|
appearance="outline" |
||||
|
required |
||||
|
entityTypeLabel="{{ 'entity.entity-type' | translate }}" |
||||
|
[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-form-field> |
||||
|
</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> |
||||
@ -0,0 +1,52 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2025 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
:host ::ng-deep { |
||||
|
.tbel-script-lang-chip { |
||||
|
line-height: 20px; |
||||
|
font-size: 14px; |
||||
|
font-weight: 500; |
||||
|
color: white; |
||||
|
border-radius: 100px; |
||||
|
width: 70px; |
||||
|
min-width: 70px; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
margin-top: 2px; |
||||
|
margin-right: 4px; |
||||
|
} |
||||
|
|
||||
|
.tb-js-func { |
||||
|
.ace_tb { |
||||
|
&.ace_calculated-field { |
||||
|
&-ctx { |
||||
|
color: #C52F00; |
||||
|
} |
||||
|
&-args { |
||||
|
color: #185F2A; |
||||
|
} |
||||
|
&-key { |
||||
|
color: #c24c1a; |
||||
|
} |
||||
|
&-time-window, &-values, &-func, &-value, &-ts, &-latestTs { |
||||
|
color: #7214D0; |
||||
|
} |
||||
|
&-start-ts, &-end-ts { |
||||
|
color: #2CAA00; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,145 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||
|
///
|
||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
/// you may not use this file except in compliance with the License.
|
||||
|
/// You may obtain a copy of the License at
|
||||
|
///
|
||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
///
|
||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
/// See the License for the specific language governing permissions and
|
||||
|
/// limitations under the License.
|
||||
|
///
|
||||
|
|
||||
|
import { ChangeDetectorRef, Component, DestroyRef, inject, Inject, Input } from '@angular/core'; |
||||
|
import { Store } from '@ngrx/store'; |
||||
|
import { AppState } from '@core/core.state'; |
||||
|
import { EntityComponent } from '../../components/entity/entity.component'; |
||||
|
import { FormBuilder, FormGroup } from '@angular/forms'; |
||||
|
import { EntityType } from '@shared/models/entity-type.models'; |
||||
|
import { TranslateService } from '@ngx-translate/core'; |
||||
|
import { |
||||
|
CalculatedFieldConfiguration, |
||||
|
CalculatedFieldInfo, |
||||
|
calculatedFieldsEntityTypeList, |
||||
|
CalculatedFieldType, |
||||
|
calculatedFieldTypes, |
||||
|
CalculatedFieldTypeTranslations |
||||
|
} from '@shared/models/calculated-field.models'; |
||||
|
import { EntityId } from '@shared/models/id/entity-id'; |
||||
|
import { BaseData } from '@shared/models/base-data'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
||||
|
import { |
||||
|
CalculatedFieldsTableConfig, |
||||
|
CalculatedFieldsTableEntity |
||||
|
} from '@home/components/calculated-fields/calculated-fields-table-config'; |
||||
|
import { TenantId } from '@shared/models/id/tenant-id'; |
||||
|
import { CalculatedFieldFormService } from '@core/services/calculated-field-form.service'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-calculated-field', |
||||
|
templateUrl: './calculated-field.component.html', |
||||
|
styleUrls: ['./calculated-field.component.scss'] |
||||
|
}) |
||||
|
export class CalculatedFieldComponent extends EntityComponent<CalculatedFieldsTableEntity> { |
||||
|
|
||||
|
@Input() |
||||
|
standalone = false; |
||||
|
|
||||
|
@Input() |
||||
|
entityName: string; |
||||
|
|
||||
|
disabledConfiguration = false; |
||||
|
|
||||
|
readonly ownerId = new TenantId(getCurrentAuthUser(this.store).tenantId); |
||||
|
readonly tenantId = getCurrentAuthUser(this.store).tenantId; |
||||
|
readonly EntityType = EntityType; |
||||
|
readonly calculatedFieldsEntityTypeList = calculatedFieldsEntityTypeList; |
||||
|
readonly CalculatedFieldType = CalculatedFieldType; |
||||
|
readonly fieldTypes = calculatedFieldTypes; |
||||
|
readonly CalculatedFieldTypeTranslations = CalculatedFieldTypeTranslations; |
||||
|
|
||||
|
private cfFormService = inject(CalculatedFieldFormService); |
||||
|
private destroyRef = inject(DestroyRef); |
||||
|
|
||||
|
constructor(protected store: Store<AppState>, |
||||
|
protected translate: TranslateService, |
||||
|
@Inject('entity') protected entityValue: CalculatedFieldInfo, |
||||
|
@Inject('entitiesTableConfig') protected entitiesTableConfigValue: CalculatedFieldsTableConfig, |
||||
|
protected fb: FormBuilder, |
||||
|
protected cd: ChangeDetectorRef) { |
||||
|
super(store, fb, entityValue, entitiesTableConfigValue, cd); |
||||
|
} |
||||
|
|
||||
|
hideDelete() { |
||||
|
if (this.entitiesTableConfig) { |
||||
|
return !this.entitiesTableConfig.deleteEnabled(this.entity); |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
additionalDebugActionConfig = { |
||||
|
...this.entitiesTableConfig.additionalDebugActionConfig, |
||||
|
action: () => this.entitiesTableConfig.additionalDebugActionConfig.action( |
||||
|
{ id: this.entity.id, ...this.entityFormValue() }, false, |
||||
|
(expression) => { |
||||
|
if (expression) { |
||||
|
this.entityForm.get('configuration').setValue({...this.entityFormValue().configuration, expression}); |
||||
|
this.entityForm.get('configuration').markAsDirty(); |
||||
|
} |
||||
|
}), |
||||
|
}; |
||||
|
|
||||
|
get entityId(): EntityId { |
||||
|
return this.entityForm.get('entityId').value; |
||||
|
} |
||||
|
|
||||
|
get entitiesTableConfig(): CalculatedFieldsTableConfig { |
||||
|
return this.entitiesTableConfigValue; |
||||
|
} |
||||
|
|
||||
|
changeEntity(entity: BaseData<EntityId>): void { |
||||
|
this.entityName = entity?.name; |
||||
|
} |
||||
|
|
||||
|
buildForm(_entity?: CalculatedFieldInfo): FormGroup { |
||||
|
const form = inject(CalculatedFieldFormService).buildForm(); |
||||
|
inject(CalculatedFieldFormService).setupTypeChange(form, inject(DestroyRef), () => this.isEditValue); |
||||
|
return form; |
||||
|
} |
||||
|
|
||||
|
updateForm(entity: CalculatedFieldInfo) { |
||||
|
const { configuration = {} as CalculatedFieldConfiguration, type = CalculatedFieldType.SIMPLE, debugSettings = { failuresEnabled: true, allEnabled: true }, entityId = this.entityId, ...value } = entity ?? {}; |
||||
|
const preparedConfig = this.cfFormService.prepareConfig(configuration); |
||||
|
this.entityForm.patchValue({ type }, {emitEvent: false, onlySelf: true}); |
||||
|
setTimeout(() => { |
||||
|
this.entityForm.patchValue({ configuration: preparedConfig, debugSettings, entityId, ...value }, {emitEvent: false}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
onTestScript(expression?: string): Observable<string> { |
||||
|
return this.cfFormService.testScript( |
||||
|
this.entity?.id?.id, |
||||
|
this.entityFormValue(), |
||||
|
this.entitiesTableConfig.getTestScriptDialog.bind(this.entitiesTableConfig), |
||||
|
this.destroyRef, |
||||
|
expression |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
updateFormState() { |
||||
|
if (this.entityForm) { |
||||
|
if (this.isEditValue) { |
||||
|
this.entityForm.enable({emitEvent: false}); |
||||
|
this.entityForm.get('entityId').disable({emitEvent: false}); |
||||
|
} else { |
||||
|
this.entityForm.disable({emitEvent: false}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2025 The Thingsboard Authors |
||||
|
|
||||
|
Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
you may not use this file except in compliance with the License. |
||||
|
You may obtain a copy of the License at |
||||
|
|
||||
|
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
|
||||
|
Unless required by applicable law or agreed to in writing, software |
||||
|
distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
See the License for the specific language governing permissions and |
||||
|
limitations under the License. |
||||
|
|
||||
|
--> |
||||
|
@if (entity) { |
||||
|
<mat-tab label="{{ 'calculated-fields.events' | translate }}" #eventsTab="matTab"> |
||||
|
<tb-event-table [defaultEventType]="DebugEventType.DEBUG_CALCULATED_FIELD" |
||||
|
[disabledEventTypes]="[EventType.LC_EVENT, EventType.ERROR, EventType.STATS]" |
||||
|
[debugEventTypes]="[DebugEventType.DEBUG_CALCULATED_FIELD]" |
||||
|
[active]="eventsTab.isActive" |
||||
|
[tenantId]="entity.tenantId.id" |
||||
|
[entityId]="entity.id" |
||||
|
[disableDebugEventAction]="debugActionDisabled" |
||||
|
(debugEventSelected)="onDebugEventSelected($event)" |
||||
|
></tb-event-table> |
||||
|
</mat-tab> |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||
|
///
|
||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
/// you may not use this file except in compliance with the License.
|
||||
|
/// You may obtain a copy of the License at
|
||||
|
///
|
||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
///
|
||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
/// See the License for the specific language governing permissions and
|
||||
|
/// limitations under the License.
|
||||
|
///
|
||||
|
|
||||
|
import { Component } from '@angular/core'; |
||||
|
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component'; |
||||
|
import { CalculatedFieldEventBody, DebugEventType, EventType } from '@shared/models/event.models'; |
||||
|
import type { |
||||
|
CalculatedFieldsTableConfig, |
||||
|
CalculatedFieldsTableEntity |
||||
|
} from '@home/components/calculated-fields/calculated-fields-table-config'; |
||||
|
import { debugCfActionEnabled } from '@shared/models/calculated-field.models'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-alarm-rules-tabs', |
||||
|
templateUrl: './alarm-rules-tabs.component.html', |
||||
|
styleUrls: [] |
||||
|
}) |
||||
|
export class AlarmRulesTabsComponent extends EntityTabsComponent<CalculatedFieldsTableEntity> { |
||||
|
|
||||
|
readonly DebugEventType = DebugEventType; |
||||
|
readonly EventType = EventType; |
||||
|
|
||||
|
constructor() { |
||||
|
super(); |
||||
|
} |
||||
|
|
||||
|
get debugActionDisabled(): boolean { |
||||
|
return !debugCfActionEnabled(this.entity); |
||||
|
}; |
||||
|
|
||||
|
onDebugEventSelected(event: CalculatedFieldEventBody) { |
||||
|
(this.entitiesTableConfig as CalculatedFieldsTableConfig).getTestScriptDialog(this.entity, JSON.parse(event.arguments)) |
||||
|
.subscribe((expression) => { |
||||
|
}); |
||||
|
}; |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2025 The Thingsboard Authors |
||||
|
|
||||
|
Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
you may not use this file except in compliance with the License. |
||||
|
You may obtain a copy of the License at |
||||
|
|
||||
|
http://www.apache.org/licenses/LICENSE-2.0 |
||||
|
|
||||
|
Unless required by applicable law or agreed to in writing, software |
||||
|
distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
See the License for the specific language governing permissions and |
||||
|
limitations under the License. |
||||
|
|
||||
|
--> |
||||
|
@if (entity) { |
||||
|
<mat-tab label="{{ 'calculated-fields.events' | translate }}" #eventsTab="matTab"> |
||||
|
<tb-event-table [defaultEventType]="DebugEventType.DEBUG_CALCULATED_FIELD" |
||||
|
[disabledEventTypes]="[EventType.LC_EVENT, EventType.ERROR, EventType.STATS]" |
||||
|
[debugEventTypes]="[DebugEventType.DEBUG_CALCULATED_FIELD]" |
||||
|
[active]="eventsTab.isActive" |
||||
|
[tenantId]="entity.tenantId.id" |
||||
|
[entityId]="entity.id" |
||||
|
[disableDebugEventAction]="debugActionDisabled" |
||||
|
(debugEventSelected)="onDebugEventSelected($event)" |
||||
|
></tb-event-table> |
||||
|
</mat-tab> |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
///
|
||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||
|
///
|
||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
/// you may not use this file except in compliance with the License.
|
||||
|
/// You may obtain a copy of the License at
|
||||
|
///
|
||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
///
|
||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
/// See the License for the specific language governing permissions and
|
||||
|
/// limitations under the License.
|
||||
|
///
|
||||
|
|
||||
|
import { Component } from '@angular/core'; |
||||
|
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component'; |
||||
|
import { CalculatedFieldEventBody, DebugEventType, EventType } from '@shared/models/event.models'; |
||||
|
import type { |
||||
|
CalculatedFieldsTableConfig, |
||||
|
CalculatedFieldsTableEntity |
||||
|
} from '@home/components/calculated-fields/calculated-fields-table-config'; |
||||
|
import { debugCfActionEnabled } from '@shared/models/calculated-field.models'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'tb-calculated-fields-tabs', |
||||
|
templateUrl: './calculated-fields-tabs.component.html', |
||||
|
styleUrls: [] |
||||
|
}) |
||||
|
export class CalculatedFieldsTabsComponent extends EntityTabsComponent<CalculatedFieldsTableEntity> { |
||||
|
|
||||
|
readonly DebugEventType = DebugEventType; |
||||
|
readonly EventType = EventType; |
||||
|
|
||||
|
constructor() { |
||||
|
super(); |
||||
|
} |
||||
|
|
||||
|
get debugActionDisabled(): boolean { |
||||
|
return !debugCfActionEnabled(this.entity); |
||||
|
}; |
||||
|
|
||||
|
onDebugEventSelected(event: CalculatedFieldEventBody) { |
||||
|
(this.entitiesTableConfig as CalculatedFieldsTableConfig).getTestScriptDialog(this.entity, JSON.parse(event.arguments), false) |
||||
|
.subscribe((expression) => { |
||||
|
(this.entitiesTableConfig as CalculatedFieldsTableConfig).getTable(); |
||||
|
const entityDetailsPanel = this.entitiesTableConfig.getTable().entityDetailsPanel; |
||||
|
entityDetailsPanel.onToggleEditMode(true); |
||||
|
entityDetailsPanel.selectedTab = 0; |
||||
|
setTimeout(() => { |
||||
|
entityDetailsPanel.detailsForm.get('configuration').setValue({...this.entity.configuration, expression}); |
||||
|
entityDetailsPanel.detailsForm.get('configuration').markAsDirty(); |
||||
|
}); |
||||
|
}); |
||||
|
}; |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue