Chore: Remove several instances of non-strict null usage (#20563)

This commit is contained in:
kay delaney
2019-11-26 09:01:32 +00:00
committed by GitHub
parent 665079dc8c
commit 514f2beafc
29 changed files with 88 additions and 86 deletions

View File

@@ -83,7 +83,7 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => ({
}));
interface Props {
isOpen: boolean;
isOpen?: boolean;
label: string;
loading?: boolean;
collapsible?: boolean;

View File

@@ -14,7 +14,7 @@ export interface GraphProps {
children?: JSX.Element | JSX.Element[];
series: GraphSeriesXY[];
timeRange: TimeRange; // NOTE: we should aim to make `time` a property of the axis, not force it for all graphs
timeZone: TimeZone; // NOTE: we should aim to make `time` a property of the axis, not force it for all graphs
timeZone?: TimeZone; // NOTE: we should aim to make `time` a property of the axis, not force it for all graphs
showLines?: boolean;
showPoints?: boolean;
showBars?: boolean;
@@ -246,7 +246,7 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
label: 'Datetime',
ticks: ticks,
timeformat: timeFormat(ticks, min, max),
timezone: timeZone ? timeZone : DefaultTimeZone,
timezone: timeZone ?? DefaultTimeZone,
},
yaxes,
grid: {

View File

@@ -16,7 +16,7 @@ export interface Props extends Themeable {
logRows?: LogRowModel[];
deduplicatedRows?: LogRowModel[];
dedupStrategy: LogsDedupStrategy;
highlighterExpressions: string[];
highlighterExpressions?: string[];
showTime: boolean;
timeZone: TimeZone;
rowLimit?: number;

View File

@@ -37,7 +37,7 @@ export interface Props {
export class RefreshPickerBase extends PureComponent<Props> {
static offOption = { label: 'Off', value: '' };
static liveOption = { label: 'Live', value: 'LIVE' };
static isLive = (refreshInterval: string): boolean => refreshInterval === RefreshPicker.liveOption.value;
static isLive = (refreshInterval?: string): boolean => refreshInterval === RefreshPicker.liveOption.value;
constructor(props: Props) {
super(props);