diff --git a/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg b/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg index 37b3a199c6..fa273dc8ec 100644 --- a/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg +++ b/application/src/main/data/json/system/scada_symbols/bottom-right-elbow-connector-hp.svg @@ -250,5 +250,5 @@ } ] }]]> - + \ No newline at end of file diff --git a/application/src/main/data/upgrade/basic/schema_update.sql b/application/src/main/data/upgrade/basic/schema_update.sql index e91fbb823c..7cac30d9ff 100644 --- a/application/src/main/data/upgrade/basic/schema_update.sql +++ b/application/src/main/data/upgrade/basic/schema_update.sql @@ -26,7 +26,7 @@ SET configuration = ( 'latest', jsonb_build_object('type', 'SKIP'), 'webSockets', jsonb_build_object('type', 'ON_EVERY_MESSAGE'), 'calculatedFields', jsonb_build_object('type', 'ON_EVERY_MESSAGE') - ) + ) ) )::text, configuration_version = 1 @@ -40,7 +40,7 @@ SET configuration = ( || jsonb_build_object( 'processingSettings', jsonb_build_object( 'type', 'ON_EVERY_MESSAGE' - ) + ) ) )::text, configuration_version = 1 @@ -72,14 +72,14 @@ ALTER TABLE api_usage_state ADD COLUMN IF NOT EXISTS version BIGINT DEFAULT 1; UPDATE tenant_profile SET profile_data = profile_data || jsonb_build_object( - 'configuration', profile_data->'configuration' || jsonb_build_object( - 'maxCalculatedFieldsPerEntity', COALESCE(profile_data->'configuration'->>'maxCalculatedFieldsPerEntity', '5')::bigint, - 'maxArgumentsPerCF', COALESCE(profile_data->'configuration'->>'maxArgumentsPerCF', '10')::bigint, - 'maxDataPointsPerRollingArg', COALESCE(profile_data->'configuration'->>'maxDataPointsPerRollingArg', '1000')::bigint, - 'maxStateSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxStateSizeInKBytes', '32')::bigint, - 'maxSingleValueArgumentSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxSingleValueArgumentSizeInKBytes', '2')::bigint - ) - ) + 'configuration', profile_data->'configuration' || jsonb_build_object( + 'maxCalculatedFieldsPerEntity', COALESCE(profile_data->'configuration'->>'maxCalculatedFieldsPerEntity', '5')::bigint, + 'maxArgumentsPerCF', COALESCE(profile_data->'configuration'->>'maxArgumentsPerCF', '10')::bigint, + 'maxDataPointsPerRollingArg', COALESCE(profile_data->'configuration'->>'maxDataPointsPerRollingArg', '1000')::bigint, + 'maxStateSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxStateSizeInKBytes', '32')::bigint, + 'maxSingleValueArgumentSizeInKBytes', COALESCE(profile_data->'configuration'->>'maxSingleValueArgumentSizeInKBytes', '2')::bigint + ) + ) WHERE profile_data->'configuration'->>'maxCalculatedFieldsPerEntity' IS NULL; -- UPDATE TENANT PROFILE CALCULATED FIELD LIMITS END diff --git a/application/src/main/java/org/thingsboard/server/service/install/DefaultDatabaseSchemaSettingsService.java b/application/src/main/java/org/thingsboard/server/service/install/DefaultDatabaseSchemaSettingsService.java index a0012a6fb3..328bcf0e66 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/DefaultDatabaseSchemaSettingsService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/DefaultDatabaseSchemaSettingsService.java @@ -32,7 +32,7 @@ public class DefaultDatabaseSchemaSettingsService implements DatabaseSchemaSetti // This list should include all versions which are compatible for the upgrade. // The compatibility cycle usually breaks when we have some scripts written in Java that may not work after new release. - private static final List SUPPORTED_VERSIONS_FOR_UPGRADE = List.of("3.9.0", "3.9.1"); + private static final List SUPPORTED_VERSIONS_FOR_UPGRADE = List.of("3.9.0", "3.9.1", "4.0.0"); private final ProjectInfo projectInfo; private final JdbcTemplate jdbcTemplate; diff --git a/application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java b/application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java index 1b410e2607..48f2fdc620 100644 --- a/application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java +++ b/application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java @@ -259,9 +259,9 @@ public class DefaultNotificationCenter extends AbstractSubscriptionService imple int sent = stats.getTotalSent().get(); int errors = stats.getTotalErrors().get(); if (errors > 0) { - log.info("[{}][{}] Notification request processing finished in {} ms (sent: {}, errors: {})", ctx.getTenantId(), requestId, time, sent, errors); + log.debug("[{}][{}] Notification request processing finished in {} ms (sent: {}, errors: {})", ctx.getTenantId(), requestId, time, sent, errors); } else { - log.info("[{}][{}] Notification request processing finished in {} ms (sent: {})", ctx.getTenantId(), requestId, time, sent); + log.debug("[{}][{}] Notification request processing finished in {} ms (sent: {})", ctx.getTenantId(), requestId, time, sent); } updateRequestStats(ctx, requestId, stats); if (callback != null) { diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index abafd81e7c..d1910399f0 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -1600,13 +1600,13 @@ queue: # These notifications include RPC calls, lifecycle events, and new queue messages, # requiring minimal latency and swift processing. - key: max.poll.records - # Define the maximum number of records that can be polled from tb_edge.notifications. topics. + # Define the maximum number of records that can be polled from tb_edge.notifications.SERVICE_ID topics. value: "${TB_QUEUE_KAFKA_EDGE_HP_EVENTS_MAX_POLL_RECORDS:10}" tb_edge_event.notifications: # Properties for consumers targeting downlinks meant for specific edge topics. # Topic names are dynamically constructed using tenant and edge identifiers. - key: max.poll.records - # Define the maximum number of records that can be polled from tb_edge_event.notifications.. topics. + # Define the maximum number of records that can be polled from tb_edge_event.notifications.TENANT_ID.EDGE_ID topics. value: "${TB_QUEUE_KAFKA_EDGE_NOTIFICATIONS_MAX_POLL_RECORDS:10}" tb_housekeeper: # Consumer properties for Housekeeper tasks topic @@ -1861,10 +1861,10 @@ queue: # Topic name to notify edge service on entity updates, assignment, etc. topic: "${TB_QUEUE_EDGE_TOPIC:tb_edge}" # Topic prefix for high-priority edge notifications (rpc, lifecycle, new messages in queue) that require minimum latency and processing time. - # Each tb-core has its own topic: . + # Each tb-core has its own topic: PREFIX.SERVICE_ID notifications_topic: "${TB_QUEUE_EDGE_NOTIFICATIONS_TOPIC:tb_edge.notifications}" # Topic prefix for downlinks to be pushed to specific edge. - # Every edge has its own unique topic: .. + # Every edge has its own unique topic: PREFIX.TENANT_ID.EDGE_ID event_notifications_topic: "${TB_QUEUE_EDGE_EVENT_NOTIFICATIONS_TOPIC:tb_edge_event.notifications}" # Amount of partitions used by Edge services partitions: "${TB_QUEUE_EDGE_PARTITIONS:10}" diff --git a/msa/js-executor/package.json b/msa/js-executor/package.json index 350d6029f0..af8379d6c9 100644 --- a/msa/js-executor/package.json +++ b/msa/js-executor/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-js-executor", "private": true, - "version": "4.0.0", + "version": "4.0.1", "description": "ThingsBoard JavaScript Executor Microservice", "main": "server.ts", "bin": "server.js", diff --git a/msa/web-ui/package.json b/msa/web-ui/package.json index 3374112096..b356dee826 100644 --- a/msa/web-ui/package.json +++ b/msa/web-ui/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-web-ui", "private": true, - "version": "4.0.0", + "version": "4.0.1", "description": "ThingsBoard Web UI Microservice", "main": "server.ts", "bin": "server.js", diff --git a/ui-ngx/package.json b/ui-ngx/package.json index e927abe7b2..cc790a5eb5 100644 --- a/ui-ngx/package.json +++ b/ui-ngx/package.json @@ -1,6 +1,6 @@ { "name": "thingsboard", - "version": "4.0.0", + "version": "4.0.1", "scripts": { "ng": "ng", "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open", diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index c37cae599e..353727e006 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -137,6 +137,14 @@ export function isLiteralObject(value: any) { return (!!value) && (value.constructor === Object); } +export const isDate = (obj: any): boolean => { + return Object.prototype.toString.call(obj) === "[object Date]"; +} + +export const isFile = (obj: any): boolean => { + return Object.prototype.toString.call(obj) === "[object File]"; +} + export const formatValue = (value: any, dec?: number, units?: string, showZeroDecimals?: boolean): string | undefined => { if (isDefinedAndNotNull(value) && isNumeric(value) && (isDefinedAndNotNull(dec) || isNotEmptyStr(units) || Number(value).toString() === value)) { @@ -180,7 +188,7 @@ export function deleteNullProperties(obj: any) { delete obj[propName]; } else if (isObject(obj[propName])) { deleteNullProperties(obj[propName]); - } else if (obj[propName] instanceof Array) { + } else if (Array.isArray(obj[propName])) { (obj[propName] as any[]).forEach((elem) => { deleteNullProperties(elem); }); @@ -335,13 +343,11 @@ export function deepClone(target: T, ignoreFields?: string[]): T { if (isObservable(target)) { return target; } - if (target instanceof Date) { - return new Date(target.getTime()) as any; + if (isDate(target)) { + return new Date((target as Date).getTime()) as T; } - if (target instanceof Array) { - const cp = [] as any[]; - (target as any[]).forEach((v) => { cp.push(v); }); - return cp.map((n: any) => deepClone(n)) as any; + if (Array.isArray(target)) { + return (target as any[]).map((item) => deepClone(item)) as any; } if (typeof target === 'object') { const cp = {...(target as { [key: string]: any })} as { [key: string]: any }; @@ -752,7 +758,7 @@ export function sortObjectKeys(obj: T): T { } export function deepTrim(obj: T): T { - if (isNumber(obj) || isUndefined(obj) || isString(obj) || obj === null || obj instanceof File) { + if (isNumber(obj) || isUndefined(obj) || isString(obj) || obj === null || isFile(obj)) { return obj; } return Object.keys(obj).reduce((acc, curr) => { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarm-count-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarm-count-widget-settings.component.ts index 377909d122..f45fb7b12b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarm-count-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/alarm/alarm-count-widget-settings.component.ts @@ -40,7 +40,7 @@ export class AlarmCountWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return {...countDefaultSettings(true)}; + return countDefaultSettings(true); } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/action-button-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/action-button-widget-settings.component.ts index 53190b43c2..c4d64c0247 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/action-button-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/action-button-widget-settings.component.ts @@ -56,7 +56,7 @@ export class ActionButtonWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...actionButtonDefaultSettings}; + return actionButtonDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/command-button-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/command-button-widget-settings.component.ts index a0844787f5..070b044b9e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/command-button-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/command-button-widget-settings.component.ts @@ -54,7 +54,7 @@ export class CommandButtonWidgetSettingsComponent extends WidgetSettingsComponen } protected defaultSettings(): WidgetSettings { - return {...commandButtonDefaultSettings}; + return commandButtonDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/power-button-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/power-button-widget-settings.component.ts index 865eabcb81..16a513a033 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/power-button-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/power-button-widget-settings.component.ts @@ -61,7 +61,7 @@ export class PowerButtonWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...powerButtonDefaultSettings}; + return powerButtonDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts index 7825bcb636..7696e5d8f3 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts @@ -77,7 +77,7 @@ export class SegmentedButtonWidgetSettingsComponent extends WidgetSettingsCompon } protected defaultSettings(): WidgetSettings { - return {...segmentedButtonDefaultSettings}; + return segmentedButtonDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/toggle-button-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/toggle-button-widget-settings.component.ts index e2d1e78356..80812179e3 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/toggle-button-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/button/toggle-button-widget-settings.component.ts @@ -55,7 +55,7 @@ export class ToggleButtonWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...toggleButtonDefaultSettings}; + return toggleButtonDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-key-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-key-settings.component.ts index 9e8f81ba98..69ec02e381 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-key-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-key-settings.component.ts @@ -24,7 +24,6 @@ import { AggregatedValueCardKeyPosition, aggregatedValueCardKeyPositionTranslations } from '@home/components/widget/lib/cards/aggregated-value-card.models'; -import { constantColor } from '@shared/models/widget-settings.models'; @Component({ selector: 'tb-aggregated-value-card-key-settings', @@ -50,7 +49,7 @@ export class AggregatedValueCardKeySettingsComponent extends WidgetSettingsCompo } protected defaultSettings(): WidgetSettings { - return {...aggregatedValueCardDefaultKeySettings}; + return aggregatedValueCardDefaultKeySettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.ts index 40fc2ceab1..b143697384 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/aggregated-value-card-widget-settings.component.ts @@ -44,7 +44,7 @@ export class AggregatedValueCardWidgetSettingsComponent extends WidgetSettingsCo } protected defaultSettings(): WidgetSettings { - return {...aggregatedValueCardDefaultSettings}; + return aggregatedValueCardDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-card-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-card-widget-settings.component.ts index 7f1fc5a694..4fe2449283 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-card-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-card-widget-settings.component.ts @@ -40,7 +40,7 @@ export class LabelCardWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return {...labelCardWidgetDefaultSettings}; + return labelCardWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.ts index 1e68fafab4..60082c98b6 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/label-value-card-widget-settings.component.ts @@ -43,7 +43,7 @@ export class LabelValueCardWidgetSettingsComponent extends WidgetSettingsCompone } protected defaultSettings(): WidgetSettings { - return {...labelValueCardWidgetDefaultSettings}; + return labelValueCardWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/mobile-app-qr-code-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/mobile-app-qr-code-widget-settings.component.ts index 731a07d9e4..a6f431336d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/mobile-app-qr-code-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/mobile-app-qr-code-widget-settings.component.ts @@ -15,7 +15,7 @@ /// import { Component } from "@angular/core"; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; +import { UntypedFormBuilder, UntypedFormGroup } from "@angular/forms"; import { WidgetSettings, WidgetSettingsComponent } from "@shared/models/widget.models"; import { AppState } from '@core/core.state'; import { Store } from "@ngrx/store"; @@ -43,7 +43,7 @@ export class MobileAppQrCodeWidgetSettingsComponent extends WidgetSettingsCompon } protected defaultSettings(): WidgetSettings { - return {...mobileAppQrCodeWidgetDefaultSettings}; + return mobileAppQrCodeWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/progress-bar-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/progress-bar-widget-settings.component.ts index 32c1989a2c..a92a8454d3 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/progress-bar-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/progress-bar-widget-settings.component.ts @@ -57,7 +57,7 @@ export class ProgressBarWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...progressBarDefaultSettings}; + return progressBarDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/unread-notification-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/unread-notification-widget-settings.component.ts index d9a84619d2..b5499495e1 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/unread-notification-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/unread-notification-widget-settings.component.ts @@ -42,7 +42,7 @@ export class UnreadNotificationWidgetSettingsComponent extends WidgetSettingsCom } protected defaultSettings(): WidgetSettings { - return {...unreadNotificationDefaultSettings}; + return unreadNotificationDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-chart-card-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-chart-card-widget-settings.component.ts index 4d99271a3b..e7fa0e3a2c 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-chart-card-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/cards/value-chart-card-widget-settings.component.ts @@ -54,7 +54,7 @@ export class ValueChartCardWidgetSettingsComponent extends WidgetSettingsCompone } protected defaultSettings(): WidgetSettings { - return {...valueChartCardDefaultSettings}; + return valueChartCardDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts index 1c877d37ab..87eaf593e6 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts @@ -25,10 +25,10 @@ import { import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { formatValue, mergeDeep } from '@core/utils'; +import { formatValue } from '@core/utils'; import { DateFormatProcessor, DateFormatSettings } from '@shared/models/widget-settings.models'; import { - barChartWithLabelsDefaultSettings, BarChartWithLabelsWidgetSettings + barChartWithLabelsDefaultSettings } from '@home/components/widget/lib/chart/bar-chart-with-labels-widget.models'; @Component({ @@ -68,7 +68,7 @@ export class BarChartWithLabelsWidgetSettingsComponent extends WidgetSettingsCom } protected defaultSettings(): WidgetSettings { - return mergeDeep({} as BarChartWithLabelsWidgetSettings, barChartWithLabelsDefaultSettings); + return barChartWithLabelsDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/latest-chart-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/latest-chart-widget-settings.component.ts index e2fc48f317..1d7baebd33 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/latest-chart-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/latest-chart-widget-settings.component.ts @@ -29,9 +29,11 @@ import { } from '@shared/models/widget.models'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { - DoughnutLayout, doughnutLayoutImages, + DoughnutLayout, + doughnutLayoutImages, doughnutLayouts, - doughnutLayoutTranslations, horizontalDoughnutLayoutImages + doughnutLayoutTranslations, + horizontalDoughnutLayoutImages } from '@home/components/widget/lib/chart/doughnut-widget.models'; import { chartLabelPositions, @@ -44,7 +46,7 @@ import { pieChartLabelPositionTranslations } from '@home/components/widget/lib/chart/chart.models'; import { radarChartShapes, radarChartShapeTranslations } from '@home/components/widget/lib/chart/radar-chart.models'; -import { formatValue, isDefinedAndNotNull, mergeDeep } from '@core/utils'; +import { formatValue, isDefinedAndNotNull } from '@core/utils'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; @@ -116,7 +118,7 @@ export abstract class LatestChartWidgetSettingsComponent({} as S, this.defaultLatestChartSettings()); + return this.defaultLatestChartSettings(); } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts index 03be4b8283..ef9a9bcc71 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts @@ -25,11 +25,8 @@ import { import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { formatValue, mergeDeepIgnoreArray } from '@core/utils'; -import { - rangeChartDefaultSettings, - RangeChartWidgetSettings -} from '@home/components/widget/lib/chart/range-chart-widget.models'; +import { formatValue } from '@core/utils'; +import { rangeChartDefaultSettings } from '@home/components/widget/lib/chart/range-chart-widget.models'; import { DateFormatProcessor, DateFormatSettings } from '@shared/models/widget-settings.models'; import { lineSeriesStepTypes, @@ -99,7 +96,7 @@ export class RangeChartWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return mergeDeepIgnoreArray({} as RangeChartWidgetSettings, rangeChartDefaultSettings); + return rangeChartDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-key-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-key-settings.component.ts index ce3a9be1dc..4a322038c4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-key-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-key-settings.component.ts @@ -19,13 +19,16 @@ import { WidgetSettings, WidgetSettingsComponent } from '@shared/models/widget.m import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { isDefinedAndNotNull, mergeDeep } from '@core/utils'; +import { isDefinedAndNotNull } from '@core/utils'; import { timeSeriesChartKeyDefaultSettings, TimeSeriesChartKeySettings, TimeSeriesChartSeriesType, timeSeriesChartSeriesTypes, - timeSeriesChartSeriesTypeTranslations, TimeSeriesChartType, timeSeriesChartTypeTranslations, TimeSeriesChartYAxisId + timeSeriesChartSeriesTypeTranslations, + TimeSeriesChartType, + timeSeriesChartTypeTranslations, + TimeSeriesChartYAxisId } from '@home/components/widget/lib/chart/time-series-chart.models'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; import { TimeSeriesChartWidgetSettings } from '@home/components/widget/lib/chart/time-series-chart-widget.models'; @@ -79,8 +82,7 @@ export class TimeSeriesChartKeySettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return mergeDeep({} as TimeSeriesChartKeySettings, - timeSeriesChartKeyDefaultSettings); + return timeSeriesChartKeyDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.ts index 68d849fd0c..f56fb6260d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.ts @@ -26,11 +26,10 @@ import { import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { formatValue, isDefinedAndNotNull, mergeDeep } from '@core/utils'; +import { formatValue, isDefinedAndNotNull } from '@core/utils'; import { DateFormatProcessor, DateFormatSettings } from '@shared/models/widget-settings.models'; import { - timeSeriesChartWidgetDefaultSettings, - TimeSeriesChartWidgetSettings + timeSeriesChartWidgetDefaultSettings } from '@home/components/widget/lib/chart/time-series-chart-widget.models'; import { TimeSeriesChartKeySettings, @@ -120,7 +119,7 @@ export class TimeSeriesChartWidgetSettingsComponent extends WidgetSettingsCompon } protected defaultSettings(): WidgetSettings { - return mergeDeep({} as TimeSeriesChartWidgetSettings, timeSeriesChartWidgetDefaultSettings); + return timeSeriesChartWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts index e32670761d..4bd5140e25 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/single-switch-widget-settings.component.ts @@ -61,7 +61,7 @@ export class SingleSwitchWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...singleSwitchDefaultSettings}; + return singleSwitchDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slider-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slider-widget-settings.component.ts index 520c538961..40caf7a729 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slider-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/slider-widget-settings.component.ts @@ -67,7 +67,7 @@ export class SliderWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return {...sliderWidgetDefaultSettings}; + return sliderWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/value-stepper-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/value-stepper-widget-settings.component.ts index b0e3dc4bf6..c5bb26a2ec 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/value-stepper-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/control/value-stepper-widget-settings.component.ts @@ -72,7 +72,7 @@ export class ValueStepperWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...valueStepperDefaultSettings}; + return valueStepperDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/entity/entity-count-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/entity/entity-count-widget-settings.component.ts index 1a0b2c0c28..2db8e3b0af 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/entity/entity-count-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/entity/entity-count-widget-settings.component.ts @@ -40,7 +40,7 @@ export class EntityCountWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...countDefaultSettings(false)}; + return countDefaultSettings(false); } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/battery-level-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/battery-level-widget-settings.component.ts index c3aff122ab..a654d2270c 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/battery-level-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/battery-level-widget-settings.component.ts @@ -21,7 +21,8 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { formatValue } from '@core/utils'; import { - batteryLevelDefaultSettings, BatteryLevelLayout, + batteryLevelDefaultSettings, + BatteryLevelLayout, batteryLevelLayoutImages, batteryLevelLayouts, batteryLevelLayoutTranslations @@ -68,7 +69,7 @@ export class BatteryLevelWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...batteryLevelDefaultSettings}; + return batteryLevelDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/signal-strength-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/signal-strength-widget-settings.component.ts index dc27cca4c4..74def6f08d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/signal-strength-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/signal-strength-widget-settings.component.ts @@ -57,7 +57,7 @@ export class SignalStrengthWidgetSettingsComponent extends WidgetSettingsCompone } protected defaultSettings(): WidgetSettings { - return {...signalStrengthDefaultSettings}; + return signalStrengthDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/status-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/status-widget-settings.component.ts index ee66309c3c..ce0841bc4a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/status-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/indicator/status-widget-settings.component.ts @@ -64,7 +64,7 @@ export class StatusWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return {...statusWidgetDefaultSettings}; + return statusWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/map-widget-settings-legacy.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/map-widget-settings-legacy.component.ts index 8089313f18..879d4501b7 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/map-widget-settings-legacy.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/map-widget-settings-legacy.component.ts @@ -40,9 +40,7 @@ export class MapWidgetSettingsLegacyComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return { - ...defaultMapSettings - }; + return defaultMapSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/route-map-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/route-map-widget-settings.component.ts index 0819253feb..efa29fcc32 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/route-map-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/route-map-widget-settings.component.ts @@ -40,9 +40,7 @@ export class RouteMapWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return { - ...defaultMapSettings - }; + return defaultMapSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/trip-animation-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/trip-animation-widget-settings.component.ts index 85be370ada..e48143f859 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/trip-animation-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/legacy/trip-animation-widget-settings.component.ts @@ -57,9 +57,7 @@ export class TripAnimationWidgetSettingsComponent extends WidgetSettingsComponen } protected defaultSettings(): WidgetSettings { - return { - ...defaultTripAnimationSettings - }; + return defaultTripAnimationSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/map-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/map-widget-settings.component.ts index f301219045..89fb975f1f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/map-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/map/map-widget-settings.component.ts @@ -19,8 +19,8 @@ import { WidgetSettings, WidgetSettingsComponent } from '@shared/models/widget.m import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; -import { isDefinedAndNotNull, mergeDeepIgnoreArray } from '@core/utils'; -import { mapWidgetDefaultSettings, MapWidgetSettings } from '@home/components/widget/lib/maps/map-widget.models'; +import { isDefinedAndNotNull } from '@core/utils'; +import { mapWidgetDefaultSettings } from '@home/components/widget/lib/maps/map-widget.models'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; @Component({ @@ -53,7 +53,7 @@ export class MapWidgetSettingsComponent extends WidgetSettingsComponent { } protected defaultSettings(): WidgetSettings { - return mergeDeepIgnoreArray({} as MapWidgetSettings, mapWidgetDefaultSettings); + return mapWidgetDefaultSettings; } protected prepareInputSettings(settings: WidgetSettings): WidgetSettings { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/scada/scada-symbol-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/scada/scada-symbol-widget-settings.component.ts index 5859935bf5..612effb7f5 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/scada/scada-symbol-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/scada/scada-symbol-widget-settings.component.ts @@ -48,7 +48,7 @@ export class ScadaSymbolWidgetSettingsComponent extends WidgetSettingsComponent } protected defaultSettings(): WidgetSettings { - return {...scadaSymbolWidgetDefaultSettings}; + return scadaSymbolWidgetDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/weather/wind-speed-direction-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/weather/wind-speed-direction-widget-settings.component.ts index 41a794a47f..1b48bfd7c2 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/weather/wind-speed-direction-widget-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/weather/wind-speed-direction-widget-settings.component.ts @@ -70,7 +70,7 @@ export class WindSpeedDirectionWidgetSettingsComponent extends WidgetSettingsCom } protected defaultSettings(): WidgetSettings { - return {...windSpeedDirectionDefaultSettings}; + return windSpeedDirectionDefaultSettings; } protected onSettingsSet(settings: WidgetSettings) { diff --git a/ui-ngx/src/app/shared/components/popover.component.ts b/ui-ngx/src/app/shared/components/popover.component.ts index 6dc4dab12a..0627617241 100644 --- a/ui-ngx/src/app/shared/components/popover.component.ts +++ b/ui-ngx/src/app/shared/components/popover.component.ts @@ -472,7 +472,9 @@ export class TbPopoverComponent implements OnDestroy, OnInit { set tbOverlayStyle(value: { [klass: string]: any }) { this._tbOverlayStyle = value; - this.cdr.detectChanges(); + if (this.popover) { + this.cdr.detectChanges(); + } } get tbOverlayStyle(): { [klass: string]: any } { diff --git a/ui-ngx/src/app/shared/models/constants.ts b/ui-ngx/src/app/shared/models/constants.ts index 4dcb1f193b..e1306e577c 100644 --- a/ui-ngx/src/app/shared/models/constants.ts +++ b/ui-ngx/src/app/shared/models/constants.ts @@ -113,6 +113,7 @@ export const HelpLinks = { ruleNodeOriginatorTelemetry: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#originator-telemetry`, ruleNodeCustomerAttributes: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#customer-attributes`, ruleNodeCustomerDetails: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#customer-details`, + ruleNodeFetchDeviceCredentials: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#fetch-device-credentials`, ruleNodeDeviceAttributes: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#device-attributes`, ruleNodeRelatedAttributes: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#related-attributes`, ruleNodeTenantAttributes: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/enrichment-nodes/#tenant-attributes`, @@ -120,13 +121,14 @@ export const HelpLinks = { ruleNodeChangeOriginator: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/transformation-nodes/#change-originator`, ruleNodeTransformMsg: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/transformation-nodes/#script-transformation-node`, ruleNodeMsgToEmail: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/transformation-nodes/#to-email-node`, - ruleNodeAssignToCustomer: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/transformation-nodes/#assign-to-customer-node`, - ruleNodeUnassignFromCustomer: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/transformation-nodes/#unassign-from-customer-node`, + ruleNodeAssignToCustomer: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#assign-to-customer-node`, + ruleNodeUnassignFromCustomer: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#unassign-from-customer-node`, + ruleNodeCalculatedFields: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#calculated-fields-node`, ruleNodeClearAlarm: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#clear-alarm-node`, ruleNodeCreateAlarm: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#create-alarm-node`, ruleNodeCreateRelation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#create-relation-node`, ruleNodeDeleteRelation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#delete-relation-node`, - ruleNodeMsgDelay: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#delay-node`, + ruleNodeMsgDelay: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#delay-node-deprecated`, ruleNodeMsgGenerator: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#generator-node`, ruleNodeGpsGeofencingEvents: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#gps-geofencing-events-node`, ruleNodeLog: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/rule-engine-2-0/action-nodes/#log-node`, diff --git a/ui-ngx/src/app/shared/models/dynamic-form.models.ts b/ui-ngx/src/app/shared/models/dynamic-form.models.ts index d807e7b13b..4132eeff94 100644 --- a/ui-ngx/src/app/shared/models/dynamic-form.models.ts +++ b/ui-ngx/src/app/shared/models/dynamic-form.models.ts @@ -181,15 +181,15 @@ export const cleanupFormProperty = (property: FormProperty): FormProperty => { if (property.type !== FormPropertyType.textarea) { delete property.rows; } - if (property.type !== FormPropertyType.fieldset) { - delete property.properties; - } else if (property.properties?.length) { - property.properties = cleanupFormProperties(property.properties); - } if (property.type !== FormPropertyType.array) { delete property.arrayItemName; delete property.arrayItemType; } + if (property.type !== FormPropertyType.fieldset && property.arrayItemType !== FormPropertyType.fieldset) { + delete property.properties; + } else if (property.properties?.length) { + property.properties = cleanupFormProperties(property.properties); + } if (property.type !== FormPropertyType.select) { delete property.multiple; delete property.allowEmptyOption; diff --git a/ui-ngx/src/app/shared/models/rule-node.models.ts b/ui-ngx/src/app/shared/models/rule-node.models.ts index 32422a87e0..dff6e53654 100644 --- a/ui-ngx/src/app/shared/models/rule-node.models.ts +++ b/ui-ngx/src/app/shared/models/rule-node.models.ts @@ -469,6 +469,7 @@ const ruleNodeClazzHelpLinkMap = { 'org.thingsboard.rule.engine.metadata.TbGetTelemetryNode': 'ruleNodeOriginatorTelemetry', 'org.thingsboard.rule.engine.metadata.TbGetCustomerAttributeNode': 'ruleNodeCustomerAttributes', 'org.thingsboard.rule.engine.metadata.TbGetCustomerDetailsNode': 'ruleNodeCustomerDetails', + 'org.thingsboard.rule.engine.metadata.TbFetchDeviceCredentialsNode': 'ruleNodeFetchDeviceCredentials', 'org.thingsboard.rule.engine.metadata.TbGetDeviceAttrNode': 'ruleNodeDeviceAttributes', 'org.thingsboard.rule.engine.metadata.TbGetRelatedAttributeNode': 'ruleNodeRelatedAttributes', 'org.thingsboard.rule.engine.metadata.TbGetTenantAttributeNode': 'ruleNodeTenantAttributes', @@ -479,6 +480,7 @@ const ruleNodeClazzHelpLinkMap = { 'org.thingsboard.rule.engine.mail.TbMsgToEmailNode': 'ruleNodeMsgToEmail', 'org.thingsboard.rule.engine.action.TbAssignToCustomerNode': 'ruleNodeAssignToCustomer', 'org.thingsboard.rule.engine.action.TbUnassignFromCustomerNode': 'ruleNodeUnassignFromCustomer', + 'org.thingsboard.rule.engine.telemetry.TbCalculatedFieldsNode': 'ruleNodeCalculatedFields', 'org.thingsboard.rule.engine.action.TbClearAlarmNode': 'ruleNodeClearAlarm', 'org.thingsboard.rule.engine.action.TbCreateAlarmNode': 'ruleNodeCreateAlarm', 'org.thingsboard.rule.engine.action.TbCreateRelationNode': 'ruleNodeCreateRelation', diff --git a/ui-ngx/src/app/shared/models/widget.models.ts b/ui-ngx/src/app/shared/models/widget.models.ts index c55dcdee37..21d7927d16 100644 --- a/ui-ngx/src/app/shared/models/widget.models.ts +++ b/ui-ngx/src/app/shared/models/widget.models.ts @@ -37,17 +37,19 @@ import { AbstractControl, UntypedFormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { Dashboard } from '@shared/models/dashboard.models'; import { IAliasController } from '@core/api/widget-api.models'; -import { isNotEmptyStr, mergeDeepIgnoreArray } from '@core/utils'; +import { isNotEmptyStr, mergeDeep, mergeDeepIgnoreArray } from '@core/utils'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; import { ComponentStyle, Font, TimewindowStyle } from '@shared/models/widget-settings.models'; import { NULL_UUID } from '@shared/models/id/has-uuid'; import { EntityInfoData, HasTenantId, HasVersion } from '@shared/models/entity.models'; -import { DataKeysCallbacks, DataKeySettingsFunction } from '@home/components/widget/lib/settings/common/key/data-keys.component.models'; +import { + DataKeysCallbacks, + DataKeySettingsFunction +} from '@home/components/widget/lib/settings/common/key/data-keys.component.models'; import { WidgetConfigCallbacks } from '@home/components/widget/config/widget-config.component.models'; import { TbFunction } from '@shared/models/js-function.models'; import { FormProperty, jsonFormSchemaToFormProperties } from '@shared/models/dynamic-form.models'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { Device } from '@shared/models/device.models'; export enum widgetType { timeseries = 'timeseries', @@ -1000,9 +1002,9 @@ export abstract class WidgetSettingsComponent extends PageComponent implements set settings(value: WidgetSettings) { if (!value) { - this.settingsValue = this.defaultSettings(); + this.settingsValue = mergeDeep({}, this.defaultSettings()); } else { - this.settingsValue = mergeDeepIgnoreArray(this.defaultSettings(), value); + this.settingsValue = mergeDeepIgnoreArray({}, this.defaultSettings(), value); } if (!this.settingsSet) { this.settingsSet = true;