From d54851f8e21347da81a74b60bae0601d53184439 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed Date: Fri, 9 Aug 2019 10:41:00 +0200 Subject: [PATCH] Chore: strictNullChecks, ColoringEditor and time_region_manager (#18442) * Make swicth booleans non-optional --- .../app/plugins/panel/graph/time_region_manager.ts | 4 ++-- public/app/plugins/panel/singlestat2/types.ts | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/public/app/plugins/panel/graph/time_region_manager.ts b/public/app/plugins/panel/graph/time_region_manager.ts index f966b5f6c3c..4322d134106 100644 --- a/public/app/plugins/panel/graph/time_region_manager.ts +++ b/public/app/plugins/panel/graph/time_region_manager.ts @@ -4,8 +4,8 @@ import { GrafanaThemeType, getColorFromHexRgbOrName } from '@grafana/ui'; import { dateTime, DateTime, AbsoluteTimeRange } from '@grafana/data'; type TimeRegionColorDefinition = { - fill: string; - line: string; + fill: string | null; + line: string | null; }; export const colorModes: any = { diff --git a/public/app/plugins/panel/singlestat2/types.ts b/public/app/plugins/panel/singlestat2/types.ts index 99330343eb5..890036841fd 100644 --- a/public/app/plugins/panel/singlestat2/types.ts +++ b/public/app/plugins/panel/singlestat2/types.ts @@ -13,10 +13,10 @@ export interface SingleStatOptions extends SingleStatBaseOptions { prefixFontSize?: string; valueFontSize?: string; postfixFontSize?: string; - colorBackground?: boolean; - colorValue?: boolean; - colorPrefix?: boolean; - colorPostfix?: boolean; + colorBackground: boolean; + colorValue: boolean; + colorPrefix: boolean; + colorPostfix: boolean; sparkline: SparklineOptions; } @@ -44,4 +44,8 @@ export const defaults: SingleStatOptions = { }, fieldOptions: standardFieldDisplayOptions, orientation: VizOrientation.Auto, + colorBackground: false, + colorValue: false, + colorPrefix: false, + colorPostfix: false, };