From 8d13785051dbe644df8c9c17ce963742f8974d81 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Mon, 23 Sep 2024 12:48:56 +0300 Subject: [PATCH] Refactored logic: Customer - Version Conflict - Export --- .../src/app/shared/import-export/import-export.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/shared/import-export/import-export.service.ts b/ui-ngx/src/app/shared/import-export/import-export.service.ts index 819a47778a..3963a81c1e 100644 --- a/ui-ngx/src/app/shared/import-export/import-export.service.ts +++ b/ui-ngx/src/app/shared/import-export/import-export.service.ts @@ -363,6 +363,7 @@ export class ImportExportService { public exportEntity(entityData: EntityInfoData | RuleChainMetaData): void { const id = (entityData as EntityInfoData).id ?? (entityData as RuleChainMetaData).ruleChainId; + let fileName = (entityData as EntityInfoData).name; let preparedData; switch (id.entityType) { case EntityType.DEVICE_PROFILE: @@ -389,13 +390,13 @@ export class ImportExportService { preparedData = this.prepareDashboardExport(entityData as Dashboard); break; case EntityType.CUSTOMER: - preparedData = this.prepareExport({...entityData, name: (entityData as Customer).title}); - (entityData as EntityInfoData).name = (entityData as Customer).title; + fileName = (entityData as Customer).title; + preparedData = this.prepareExport(entityData); break; default: preparedData = this.prepareExport(entityData); } - this.exportToPc(preparedData, (entityData as EntityInfoData).name); + this.exportToPc(preparedData, fileName); } private exportSelectedWidgetsBundle(widgetsBundle: WidgetsBundle): void {