Browse Source
Merge pull request #9592 from Dmitriymush/bug-fix/value-and-chart-card
Fixed value and chart card crash on empty colorProcessor type
pull/9611/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
1 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts
-
ui-ngx/src/app/shared/models/widget-settings.models.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, []] |
|
|
|
|
|
|
|
@ -161,6 +161,8 @@ export abstract class ColorProcessor { |
|
|
|
return new RangeColorProcessor(settings); |
|
|
|
case ColorType.function: |
|
|
|
return new FunctionColorProcessor(settings); |
|
|
|
default: |
|
|
|
return new ConstantColorProcessor(settings); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|