Chore: updates initial ExploreItemState in Explore reducer

This commit is contained in:
Lukas Siatka
2020-06-02 15:24:10 +02:00
parent c28c45f4d9
commit 6ecc4e83e7
@@ -12,6 +12,7 @@ import {
TimeZone, TimeZone,
toLegacyResponseData, toLegacyResponseData,
ExploreMode, ExploreMode,
LogsDedupStrategy,
} from '@grafana/data'; } from '@grafana/data';
import { RefreshPicker } from '@grafana/ui'; import { RefreshPicker } from '@grafana/ui';
import { LocationUpdate } from '@grafana/runtime'; import { LocationUpdate } from '@grafana/runtime';
@@ -69,6 +70,7 @@ import {
} from './actionTypes'; } from './actionTypes';
import { ResultProcessor } from '../utils/ResultProcessor'; import { ResultProcessor } from '../utils/ResultProcessor';
import { updateLocation } from '../../../core/actions'; import { updateLocation } from '../../../core/actions';
import { Emitter } from 'app/core/core';
export const DEFAULT_RANGE = { export const DEFAULT_RANGE = {
from: 'now-6h', from: 'now-6h',
@@ -105,7 +107,6 @@ export const makeExploreItemState = (): ExploreItemState => ({
to: null, to: null,
}, },
scanning: false, scanning: false,
scanRange: null,
showingGraph: true, showingGraph: true,
showingTable: true, showingTable: true,
loading: false, loading: false,
@@ -114,11 +115,16 @@ export const makeExploreItemState = (): ExploreItemState => ({
update: makeInitialUpdateState(), update: makeInitialUpdateState(),
latency: 0, latency: 0,
supportedModes: [], supportedModes: [],
mode: null, mode: (null as unknown) as ExploreMode,
isLive: false, isLive: false,
isPaused: false, isPaused: false,
urlReplaced: false, urlReplaced: false,
queryResponse: createEmptyQueryResponse(), queryResponse: createEmptyQueryResponse(),
tableResult: null,
graphResult: null,
logsResult: null,
dedupStrategy: LogsDedupStrategy.none,
eventBridge: (null as unknown) as Emitter,
}); });
export const createEmptyQueryResponse = (): PanelData => ({ export const createEmptyQueryResponse = (): PanelData => ({