From 47232a629bf79ef1b7a47c80696bc7bd1ed81473 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Wed, 19 Mar 2025 17:20:01 +0200 Subject: [PATCH] refactoring --- .../calculated-fields-table-config.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts index 37dc5d69e7..cc4a100b2b 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts @@ -263,18 +263,17 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig { + const arg = calculatedField.configuration.arguments[key]; + acc[key] = arg.refEntityId?.entityType === ArgumentEntityType.Tenant + ? { ...arg, refEntityId: { id: this.tenantId, entityType: ArgumentEntityType.Tenant } } + : arg; + return acc; + }, {}); + return { ...calculatedField, - configuration: { - ...calculatedField.configuration, - arguments: Object.keys(calculatedField.configuration.arguments).reduce((acc, key) => { - const arg = calculatedField.configuration.arguments[key]; - acc[key] = arg.refEntityId?.entityType === ArgumentEntityType.Tenant - ? { ...arg, refEntityId: { id: this.tenantId, entityType: ArgumentEntityType.Tenant } } - : arg; - return acc; - }, {}) - } + configuration: { ...calculatedField.configuration, arguments: updatedArguments } } }