Merge pull request #9592 from Dmitriymush/bug-fix/value-and-chart-card

Fixed value and chart card crash on empty colorProcessor type
This commit is contained in:
Igor Kulikov 2023-11-10 17:37:44 +02:00 committed by GitHub
commit 07eb8218fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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, []]

View File

@ -161,6 +161,8 @@ export abstract class ColorProcessor {
return new RangeColorProcessor(settings);
case ColorType.function:
return new FunctionColorProcessor(settings);
default:
return new ConstantColorProcessor(settings);
}
}