From 0a9c769afe1ac64fd64585b91af562b3aa3d228b Mon Sep 17 00:00:00 2001 From: Dmitriymush Date: Thu, 9 Nov 2023 15:14:35 +0200 Subject: [PATCH] UI: added default value to colorSettings type and default case for colorProcessor --- .../lib/settings/common/color-settings-panel.component.ts | 2 +- ui-ngx/src/app/shared/models/widget-settings.models.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts index 26d838abc0..6ae04ec94e 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts @@ -65,7 +65,7 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit ngOnInit(): void { this.colorSettingsFormGroup = this.fb.group( { - type: [this.colorSettings?.type, []], + type: [this.colorSettings?.type || ColorType.constant, []], color: [this.colorSettings?.color, []], rangeList: [this.colorSettings?.rangeList, []], colorFunction: [this.colorSettings?.colorFunction, []] diff --git a/ui-ngx/src/app/shared/models/widget-settings.models.ts b/ui-ngx/src/app/shared/models/widget-settings.models.ts index 165a4369bc..27b32621aa 100644 --- a/ui-ngx/src/app/shared/models/widget-settings.models.ts +++ b/ui-ngx/src/app/shared/models/widget-settings.models.ts @@ -161,6 +161,8 @@ export abstract class ColorProcessor { return new RangeColorProcessor(settings); case ColorType.function: return new FunctionColorProcessor(settings); + default: + return new ConstantColorProcessor(settings); } }