Browse Source

Fixes

pull/12509/head
mpetrov 2 years ago
parent
commit
ff8a9309f4
  1. 4
      ui-ngx/src/app/modules/home/components/calculated-fields/components/arguments-table/calculated-field-arguments-table.component.html
  2. 6
      ui-ngx/src/app/modules/home/components/calculated-fields/components/panel/calculated-field-argument-panel.component.ts

4
ui-ngx/src/app/modules/home/components/calculated-fields/components/arguments-table/calculated-field-arguments-table.component.html

@ -28,7 +28,7 @@
<mat-form-field appearance="outline" class="tb-inline-field w-1/6" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="tb-inline-field w-1/6" subscriptSizing="dynamic">
<input matInput formControlName="argumentName" placeholder="{{ 'action.set' | translate }}"> <input matInput formControlName="argumentName" placeholder="{{ 'action.set' | translate }}">
</mat-form-field> </mat-form-field>
@if (group.get('refEntityId')?.get('id').value) { @if (group.get('refEntityId')?.get('id')?.value) {
<ng-container [formGroup]="group.get('refEntityId')"> <ng-container [formGroup]="group.get('refEntityId')">
<mat-form-field appearance="outline" class="tb-inline-field w-1/6" subscriptSizing="dynamic"> <mat-form-field appearance="outline" class="tb-inline-field w-1/6" subscriptSizing="dynamic">
<mat-select [value]="group.get('refEntityId').get('entityType').value" formControlName="entityType"> <mat-select [value]="group.get('refEntityId').get('entityType').value" formControlName="entityType">
@ -51,7 +51,7 @@
<mat-select [value]="'current'" [disabled]="true"> <mat-select [value]="'current'" [disabled]="true">
<mat-option [value]="'current'"> <mat-option [value]="'current'">
{{ {{
(group.get('refEntityId')?.get('entityType').value === ArgumentEntityType.Tenant (group.get('refEntityId')?.get('entityType')?.value === ArgumentEntityType.Tenant
? 'calculated-fields.argument-current-tenant' ? 'calculated-fields.argument-current-tenant'
: 'calculated-fields.argument-current') | translate : 'calculated-fields.argument-current') | translate
}} }}

6
ui-ngx/src/app/modules/home/components/calculated-fields/components/panel/calculated-field-argument-panel.component.ts

@ -119,7 +119,9 @@ export class CalculatedFieldArgumentPanelComponent extends PageComponent impleme
} }
saveArgument(): void { saveArgument(): void {
this.argumentsDataApplied.emit({ value: this.argumentFormGroup.value as CalculatedFieldArgumentValue, index: this.index }); const { refEntityId, ...restConfig } = this.argumentFormGroup.value;
const value = (refEntityId.entityType === ArgumentEntityType.Current ? restConfig : { refEntityId, ...restConfig }) as CalculatedFieldArgumentValue;
this.argumentsDataApplied.emit({ value, index: this.index });
} }
cancel(): void { cancel(): void {
@ -148,7 +150,7 @@ export class CalculatedFieldArgumentPanelComponent extends PageComponent impleme
}; };
break; break;
default: default:
entityId = this.argumentFormGroup.get('refEntityId').value as any; entityId = this.argumentFormGroup.get('refEntityId').value as unknown as EntityId;
} }
if (!onInit) { if (!onInit) {
this.argumentFormGroup.get('refEntityKey').get('key').setValue(''); this.argumentFormGroup.get('refEntityKey').get('key').setValue('');

Loading…
Cancel
Save