Merge pull request #13156 from deaflynx/fix/external-id-delete-save-widget

Fix overwrite of externalId on save widget
This commit is contained in:
Igor Kulikov 2025-04-10 18:01:16 +03:00 committed by GitHub
commit 0cf9e48199
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -115,6 +115,7 @@ import { DataKeySettingsFunction } from '@home/components/widget/lib/settings/co
import { UtilsService } from '@core/services/utils.service'; import { UtilsService } from '@core/services/utils.service';
import { CompiledTbFunction } from '@shared/models/js-function.models'; import { CompiledTbFunction } from '@shared/models/js-function.models';
import { FormProperty } from '@shared/models/dynamic-form.models'; import { FormProperty } from '@shared/models/dynamic-form.models';
import { ExportableEntity } from '@shared/models/base-data';
export interface IWidgetAction { export interface IWidgetAction {
name: string; name: string;
@ -573,7 +574,7 @@ export interface IDynamicWidgetComponent {
[key: string]: any; [key: string]: any;
} }
export interface WidgetInfo extends WidgetTypeDescriptor, WidgetControllerDescriptor { export interface WidgetInfo extends WidgetTypeDescriptor, WidgetControllerDescriptor, ExportableEntity<WidgetTypeId> {
widgetName: string; widgetName: string;
fullFqn: string; fullFqn: string;
deprecated: boolean; deprecated: boolean;
@ -681,6 +682,7 @@ export const toWidgetInfo = (widgetTypeEntity: WidgetType): WidgetInfo => ({
fullFqn: fullWidgetTypeFqn(widgetTypeEntity), fullFqn: fullWidgetTypeFqn(widgetTypeEntity),
deprecated: widgetTypeEntity.deprecated, deprecated: widgetTypeEntity.deprecated,
scada: widgetTypeEntity.scada, scada: widgetTypeEntity.scada,
externalId: widgetTypeEntity.externalId,
type: widgetTypeEntity.descriptor.type, type: widgetTypeEntity.descriptor.type,
sizeX: widgetTypeEntity.descriptor.sizeX, sizeX: widgetTypeEntity.descriptor.sizeX,
sizeY: widgetTypeEntity.descriptor.sizeY, sizeY: widgetTypeEntity.descriptor.sizeY,
@ -736,6 +738,7 @@ export const toWidgetType = (widgetInfo: WidgetInfo, id: WidgetTypeId, tenantId:
name: widgetInfo.widgetName, name: widgetInfo.widgetName,
deprecated: widgetInfo.deprecated, deprecated: widgetInfo.deprecated,
scada: widgetInfo.scada, scada: widgetInfo.scada,
externalId: widgetInfo.externalId,
descriptor descriptor
}; };
}; };

View File

@ -206,7 +206,7 @@ export interface WidgetControllerDescriptor {
actionSources?: {[actionSourceId: string]: WidgetActionSource}; actionSources?: {[actionSourceId: string]: WidgetActionSource};
} }
export interface BaseWidgetType extends BaseData<WidgetTypeId>, HasTenantId, HasVersion { export interface BaseWidgetType extends BaseData<WidgetTypeId>, HasTenantId, HasVersion, ExportableEntity<WidgetTypeId> {
tenantId: TenantId; tenantId: TenantId;
fqn: string; fqn: string;
name: string; name: string;