- {{ 'entity.version-conflict.link' | translate:
- { entityType: (entityTypeTranslations.get(entityId.entityType).type | translate) }
- }}
+ {{ 'entity.version-conflict.link' | translate:{ entityType: entityTypeLabel | translate } }}
{{ 'entity.link' | translate }}.
diff --git a/ui-ngx/src/app/shared/components/dialog/entity-conflict-dialog/entity-conflict-dialog.component.ts b/ui-ngx/src/app/shared/components/dialog/entity-conflict-dialog/entity-conflict-dialog.component.ts
index b4f34ed232..e522fa6c8f 100644
--- a/ui-ngx/src/app/shared/components/dialog/entity-conflict-dialog/entity-conflict-dialog.component.ts
+++ b/ui-ngx/src/app/shared/components/dialog/entity-conflict-dialog/entity-conflict-dialog.component.ts
@@ -42,8 +42,10 @@ interface EntityConflictDialogData {
export class EntityConflictDialogComponent {
entityId: EntityId;
+ entityTypeLabel: string;
readonly entityTypeTranslations = entityTypeTranslations;
+ private readonly defaultEntityLabel = 'entity.entity';
constructor(
@Inject(MAT_DIALOG_DATA) public data: EntityConflictDialogData,
@@ -51,6 +53,9 @@ export class EntityConflictDialogComponent {
private importExportService: ImportExportService,
) {
this.entityId = (data.entity as EntityInfoData).id ?? (data.entity as RuleChainMetaData).ruleChainId;
+ this.entityTypeLabel = entityTypeTranslations.has(this.entityId.entityType)
+ ? (entityTypeTranslations.get(this.entityId.entityType).type)
+ : this.defaultEntityLabel;
}
onCancel(): void {
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 5f246873d7..819a47778a 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
@@ -55,11 +55,7 @@ import { EntityType } from '@shared/models/entity-type.models';
import { UtilsService } from '@core/services/utils.service';
import { WidgetService } from '@core/http/widget.service';
import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
-import {
- EntityInfoData,
- ImportEntitiesResultInfo,
- ImportEntityData
-} from '@shared/models/entity.models';
+import { EntityInfoData, ImportEntitiesResultInfo, ImportEntityData } from '@shared/models/entity.models';
import { RequestConfig } from '@core/http/http-utils';
import { RuleChain, RuleChainImport, RuleChainMetaData, RuleChainType } from '@shared/models/rule-chain.models';
import { RuleChainService } from '@core/http/rule-chain.service';
@@ -85,6 +81,7 @@ import { selectUserSettingsProperty } from '@core/auth/auth.selectors';
import { ActionPreferencesPutUserSettings } from '@core/auth/auth.actions';
import { ExportableEntity } from '@shared/models/base-data';
import { EntityId } from '@shared/models/id/entity-id';
+import { Customer } from '@shared/models/customer.model';
export type editMissingAliasesFunction = (widgets: Array
, isSingleWidget: boolean,
customTitle: string, missingEntityAliases: EntityAliases) => Observable;
@@ -391,6 +388,10 @@ export class ImportExportService {
case EntityType.DASHBOARD:
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;
+ break;
default:
preparedData = this.prepareExport(entityData);
}