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
parent
commit
07eb8218fd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts
  2. 2
      ui-ngx/src/app/shared/models/widget-settings.models.ts

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

2
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);
}
}

Loading…
Cancel
Save