Commit be172d3e by David Kaltschmidt

Save state in URL and fix tests

parent 68c039b2
...@@ -6,26 +6,13 @@ import { ...@@ -6,26 +6,13 @@ import {
clearHistory, clearHistory,
hasNonEmptyQuery, hasNonEmptyQuery,
} from './explore'; } from './explore';
import { ExploreState } from 'app/types/explore'; import { ExploreUrlState } from 'app/types/explore';
import store from 'app/core/store'; import store from 'app/core/store';
const DEFAULT_EXPLORE_STATE: ExploreState = { const DEFAULT_EXPLORE_STATE: ExploreUrlState = {
datasource: null, datasource: null,
datasourceError: null, queries: [],
datasourceLoading: null,
datasourceMissing: false,
exploreDatasources: [],
graphInterval: 1000,
history: [],
initialQueries: [],
queryTransactions: [],
range: DEFAULT_RANGE, range: DEFAULT_RANGE,
showingGraph: true,
showingLogs: true,
showingTable: true,
supportsGraph: null,
supportsLogs: null,
supportsTable: null,
}; };
describe('state functions', () => { describe('state functions', () => {
...@@ -68,21 +55,19 @@ describe('state functions', () => { ...@@ -68,21 +55,19 @@ describe('state functions', () => {
it('returns url parameter value for a state object', () => { it('returns url parameter value for a state object', () => {
const state = { const state = {
...DEFAULT_EXPLORE_STATE, ...DEFAULT_EXPLORE_STATE,
initialDatasource: 'foo', datasource: 'foo',
range: { queries: [
from: 'now-5h',
to: 'now',
},
initialQueries: [
{ {
refId: '1',
expr: 'metric{test="a/b"}', expr: 'metric{test="a/b"}',
}, },
{ {
refId: '2',
expr: 'super{foo="x/z"}', expr: 'super{foo="x/z"}',
}, },
], ],
range: {
from: 'now-5h',
to: 'now',
},
}; };
expect(serializeStateToUrlParam(state)).toBe( expect(serializeStateToUrlParam(state)).toBe(
'{"datasource":"foo","queries":[{"expr":"metric{test=\\"a/b\\"}"},' + '{"datasource":"foo","queries":[{"expr":"metric{test=\\"a/b\\"}"},' +
...@@ -93,21 +78,19 @@ describe('state functions', () => { ...@@ -93,21 +78,19 @@ describe('state functions', () => {
it('returns url parameter value for a state object', () => { it('returns url parameter value for a state object', () => {
const state = { const state = {
...DEFAULT_EXPLORE_STATE, ...DEFAULT_EXPLORE_STATE,
initialDatasource: 'foo', datasource: 'foo',
range: { queries: [
from: 'now-5h',
to: 'now',
},
initialQueries: [
{ {
refId: '1',
expr: 'metric{test="a/b"}', expr: 'metric{test="a/b"}',
}, },
{ {
refId: '2',
expr: 'super{foo="x/z"}', expr: 'super{foo="x/z"}',
}, },
], ],
range: {
from: 'now-5h',
to: 'now',
},
}; };
expect(serializeStateToUrlParam(state, true)).toBe( expect(serializeStateToUrlParam(state, true)).toBe(
'["now-5h","now","foo",{"expr":"metric{test=\\"a/b\\"}"},{"expr":"super{foo=\\"x/z\\"}"}]' '["now-5h","now","foo",{"expr":"metric{test=\\"a/b\\"}"},{"expr":"super{foo=\\"x/z\\"}"}]'
...@@ -119,35 +102,24 @@ describe('state functions', () => { ...@@ -119,35 +102,24 @@ describe('state functions', () => {
it('can parse the serialized state into the original state', () => { it('can parse the serialized state into the original state', () => {
const state = { const state = {
...DEFAULT_EXPLORE_STATE, ...DEFAULT_EXPLORE_STATE,
initialDatasource: 'foo', datasource: 'foo',
range: { queries: [
from: 'now - 5h',
to: 'now',
},
initialQueries: [
{ {
refId: '1',
expr: 'metric{test="a/b"}', expr: 'metric{test="a/b"}',
}, },
{ {
refId: '2',
expr: 'super{foo="x/z"}', expr: 'super{foo="x/z"}',
}, },
], ],
range: {
from: 'now - 5h',
to: 'now',
},
}; };
const serialized = serializeStateToUrlParam(state); const serialized = serializeStateToUrlParam(state);
const parsed = parseUrlState(serialized); const parsed = parseUrlState(serialized);
// Account for datasource vs datasourceName expect(state).toMatchObject(parsed);
const { datasource, queries, ...rest } = parsed;
const resultState = {
...rest,
datasource: DEFAULT_EXPLORE_STATE.datasource,
initialDatasource: datasource,
initialQueries: queries,
};
expect(state).toMatchObject(resultState);
}); });
}); });
}); });
......
...@@ -142,7 +142,7 @@ export function buildQueryTransaction( ...@@ -142,7 +142,7 @@ export function buildQueryTransaction(
}; };
} }
const clearQueryKeys: ((query: DataQuery) => object) = ({ key, refId, ...rest }) => rest; export const clearQueryKeys: ((query: DataQuery) => object) = ({ key, refId, ...rest }) => rest;
export function parseUrlState(initial: string | undefined): ExploreUrlState { export function parseUrlState(initial: string | undefined): ExploreUrlState {
if (initial) { if (initial) {
...@@ -169,11 +169,6 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState { ...@@ -169,11 +169,6 @@ export function parseUrlState(initial: string | undefined): ExploreUrlState {
} }
export function serializeStateToUrlParam(urlState: ExploreUrlState, compact?: boolean): string { export function serializeStateToUrlParam(urlState: ExploreUrlState, compact?: boolean): string {
// const urlState: ExploreUrlState = {
// datasource: state.initialDatasource,
// queries: state.initialQueries.map(clearQueryKeys),
// range: state.range,
// };
if (compact) { if (compact) {
return JSON.stringify([urlState.range.from, urlState.range.to, urlState.datasource, ...urlState.queries]); return JSON.stringify([urlState.range.from, urlState.range.to, urlState.datasource, ...urlState.queries]);
} }
......
...@@ -13,6 +13,8 @@ import store from 'app/core/store'; ...@@ -13,6 +13,8 @@ import store from 'app/core/store';
import { LAST_USED_DATASOURCE_KEY, ensureQueries, DEFAULT_RANGE } from 'app/core/utils/explore'; import { LAST_USED_DATASOURCE_KEY, ensureQueries, DEFAULT_RANGE } from 'app/core/utils/explore';
import { DataSourcePicker } from 'app/core/components/Select/DataSourcePicker'; import { DataSourcePicker } from 'app/core/components/Select/DataSourcePicker';
import { Emitter } from 'app/core/utils/emitter'; import { Emitter } from 'app/core/utils/emitter';
import { LogsModel } from 'app/core/logs_model';
import TableModel from 'app/core/table_model';
import { import {
addQueryRow, addQueryRow,
...@@ -45,8 +47,6 @@ import Table from './Table'; ...@@ -45,8 +47,6 @@ import Table from './Table';
import ErrorBoundary from './ErrorBoundary'; import ErrorBoundary from './ErrorBoundary';
import { Alert } from './Error'; import { Alert } from './Error';
import TimePicker, { parseTime } from './TimePicker'; import TimePicker, { parseTime } from './TimePicker';
import { LogsModel } from 'app/core/logs_model';
import TableModel from 'app/core/table_model';
interface ExploreProps { interface ExploreProps {
StartPage?: any; StartPage?: any;
...@@ -74,6 +74,7 @@ interface ExploreProps { ...@@ -74,6 +74,7 @@ interface ExploreProps {
initialDatasource?: string; initialDatasource?: string;
initialQueries: DataQuery[]; initialQueries: DataQuery[];
initializeExplore: typeof initializeExplore; initializeExplore: typeof initializeExplore;
initialized: boolean;
logsHighlighterExpressions?: string[]; logsHighlighterExpressions?: string[];
logsResult?: LogsModel; logsResult?: LogsModel;
modifyQueries: typeof modifyQueries; modifyQueries: typeof modifyQueries;
...@@ -149,8 +150,9 @@ export class Explore extends React.PureComponent<ExploreProps> { ...@@ -149,8 +150,9 @@ export class Explore extends React.PureComponent<ExploreProps> {
} }
async componentDidMount() { async componentDidMount() {
const { exploreId, split, urlState } = this.props; const { exploreId, initialized, urlState } = this.props;
if (!split) { // Don't initialize on split, but need to initialize urlparameters when present
if (!initialized) {
// Load URL state and parse range // Load URL state and parse range
const { datasource, queries, range = DEFAULT_RANGE } = (urlState || {}) as ExploreUrlState; const { datasource, queries, range = DEFAULT_RANGE } = (urlState || {}) as ExploreUrlState;
const initialDatasource = datasource || store.get(LAST_USED_DATASOURCE_KEY); const initialDatasource = datasource || store.get(LAST_USED_DATASOURCE_KEY);
...@@ -277,11 +279,6 @@ export class Explore extends React.PureComponent<ExploreProps> { ...@@ -277,11 +279,6 @@ export class Explore extends React.PureComponent<ExploreProps> {
} }
}, 500); }, 500);
// saveState = () => {
// const { stateKey, onSaveState } = this.props;
// onSaveState(stateKey, this.cloneState());
// };
render() { render() {
const { const {
StartPage, StartPage,
...@@ -478,6 +475,7 @@ function mapStateToProps(state: StoreState, { exploreId }) { ...@@ -478,6 +475,7 @@ function mapStateToProps(state: StoreState, { exploreId }) {
graphResult, graphResult,
initialDatasource, initialDatasource,
initialQueries, initialQueries,
initialized,
history, history,
logsHighlighterExpressions, logsHighlighterExpressions,
logsResult, logsResult,
...@@ -504,6 +502,7 @@ function mapStateToProps(state: StoreState, { exploreId }) { ...@@ -504,6 +502,7 @@ function mapStateToProps(state: StoreState, { exploreId }) {
graphResult, graphResult,
initialDatasource, initialDatasource,
initialQueries, initialQueries,
initialized,
history, history,
logsHighlighterExpressions, logsHighlighterExpressions,
logsResult, logsResult,
......
...@@ -3,51 +3,56 @@ import { hot } from 'react-hot-loader'; ...@@ -3,51 +3,56 @@ import { hot } from 'react-hot-loader';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { updateLocation } from 'app/core/actions'; import { updateLocation } from 'app/core/actions';
// import { serializeStateToUrlParam, parseUrlState } from 'app/core/utils/explore';
import { StoreState } from 'app/types'; import { StoreState } from 'app/types';
import { ExploreId } from 'app/types/explore'; import { ExploreId, ExploreUrlState } from 'app/types/explore';
import { parseUrlState } from 'app/core/utils/explore';
import { initializeExploreSplit } from './state/actions';
import ErrorBoundary from './ErrorBoundary'; import ErrorBoundary from './ErrorBoundary';
import Explore from './Explore'; import Explore from './Explore';
interface WrapperProps { interface WrapperProps {
backendSrv?: any; initializeExploreSplit: typeof initializeExploreSplit;
datasourceSrv?: any;
split: boolean; split: boolean;
updateLocation: typeof updateLocation; updateLocation: typeof updateLocation;
// urlStates: { [key: string]: string }; urlStates: { [key: string]: string };
} }
export class Wrapper extends Component<WrapperProps> { export class Wrapper extends Component<WrapperProps> {
// urlStates: { [key: string]: string }; initialSplit: boolean;
urlStates: { [key: string]: ExploreUrlState };
constructor(props: WrapperProps) { constructor(props: WrapperProps) {
super(props); super(props);
// this.urlStates = props.urlStates; this.urlStates = {};
const { left, right } = props.urlStates;
if (props.urlStates.left) {
this.urlStates.leftState = parseUrlState(left);
}
if (props.urlStates.right) {
this.urlStates.rightState = parseUrlState(right);
this.initialSplit = true;
}
} }
// onSaveState = (key: string, state: ExploreState) => { componentDidMount() {
// const urlState = serializeStateToUrlParam(state, true); if (this.initialSplit) {
// this.urlStates[key] = urlState; this.props.initializeExploreSplit();
// this.props.updateLocation({ }
// query: this.urlStates, }
// });
// };
render() { render() {
const { split } = this.props; const { split } = this.props;
// State overrides for props from first Explore const { leftState, rightState } = this.urlStates;
// const urlStateLeft = parseUrlState(this.urlStates[STATE_KEY_LEFT]);
// const urlStateRight = parseUrlState(this.urlStates[STATE_KEY_RIGHT]);
return ( return (
<div className="explore-wrapper"> <div className="explore-wrapper">
<ErrorBoundary> <ErrorBoundary>
<Explore exploreId={ExploreId.left} /> <Explore exploreId={ExploreId.left} urlState={leftState} />
</ErrorBoundary> </ErrorBoundary>
{split && ( {split && (
<ErrorBoundary> <ErrorBoundary>
<Explore exploreId={ExploreId.right} /> <Explore exploreId={ExploreId.right} urlState={rightState} />
</ErrorBoundary> </ErrorBoundary>
)} )}
</div> </div>
...@@ -56,12 +61,13 @@ export class Wrapper extends Component<WrapperProps> { ...@@ -56,12 +61,13 @@ export class Wrapper extends Component<WrapperProps> {
} }
const mapStateToProps = (state: StoreState) => { const mapStateToProps = (state: StoreState) => {
// urlStates: state.location.query, const urlStates = state.location.query;
const { split } = state.explore; const { split } = state.explore;
return { split }; return { split, urlStates };
}; };
const mapDispatchToProps = { const mapDispatchToProps = {
initializeExploreSplit,
updateLocation, updateLocation,
}; };
......
...@@ -4,14 +4,17 @@ import { RawTimeRange, TimeRange } from '@grafana/ui'; ...@@ -4,14 +4,17 @@ import { RawTimeRange, TimeRange } from '@grafana/ui';
import { import {
LAST_USED_DATASOURCE_KEY, LAST_USED_DATASOURCE_KEY,
clearQueryKeys,
ensureQueries, ensureQueries,
generateEmptyQuery, generateEmptyQuery,
hasNonEmptyQuery, hasNonEmptyQuery,
makeTimeSeriesList, makeTimeSeriesList,
updateHistory, updateHistory,
buildQueryTransaction, buildQueryTransaction,
serializeStateToUrlParam,
} from 'app/core/utils/explore'; } from 'app/core/utils/explore';
import { updateLocation } from 'app/core/actions';
import store from 'app/core/store'; import store from 'app/core/store';
import { DataSourceSelectItem } from 'app/types/datasources'; import { DataSourceSelectItem } from 'app/types/datasources';
import { DataQuery, StoreState } from 'app/types'; import { DataQuery, StoreState } from 'app/types';
...@@ -25,6 +28,7 @@ import { ...@@ -25,6 +28,7 @@ import {
QueryTransaction, QueryTransaction,
QueryHint, QueryHint,
QueryHintGetter, QueryHintGetter,
ExploreUrlState,
} from 'app/types/explore'; } from 'app/types/explore';
import { Emitter } from 'app/core/core'; import { Emitter } from 'app/core/core';
import { ExploreItemState } from './reducers'; import { ExploreItemState } from './reducers';
...@@ -44,6 +48,7 @@ export enum ActionTypes { ...@@ -44,6 +48,7 @@ export enum ActionTypes {
ClickTableButton = 'CLICK_TABLE_BUTTON', ClickTableButton = 'CLICK_TABLE_BUTTON',
HighlightLogsExpression = 'HIGHLIGHT_LOGS_EXPRESSION', HighlightLogsExpression = 'HIGHLIGHT_LOGS_EXPRESSION',
InitializeExplore = 'INITIALIZE_EXPLORE', InitializeExplore = 'INITIALIZE_EXPLORE',
InitializeExploreSplit = 'INITIALIZE_EXPLORE_SPLIT',
LoadDatasourceFailure = 'LOAD_DATASOURCE_FAILURE', LoadDatasourceFailure = 'LOAD_DATASOURCE_FAILURE',
LoadDatasourceMissing = 'LOAD_DATASOURCE_MISSING', LoadDatasourceMissing = 'LOAD_DATASOURCE_MISSING',
LoadDatasourcePending = 'LOAD_DATASOURCE_PENDING', LoadDatasourcePending = 'LOAD_DATASOURCE_PENDING',
...@@ -58,6 +63,7 @@ export enum ActionTypes { ...@@ -58,6 +63,7 @@ export enum ActionTypes {
ScanRange = 'SCAN_RANGE', ScanRange = 'SCAN_RANGE',
ScanStart = 'SCAN_START', ScanStart = 'SCAN_START',
ScanStop = 'SCAN_STOP', ScanStop = 'SCAN_STOP',
StateSave = 'STATE_SAVE',
} }
export interface AddQueryRowAction { export interface AddQueryRowAction {
...@@ -123,6 +129,12 @@ export interface ClickTableButtonAction { ...@@ -123,6 +129,12 @@ export interface ClickTableButtonAction {
exploreId: ExploreId; exploreId: ExploreId;
} }
export interface HighlightLogsExpressionAction {
type: ActionTypes.HighlightLogsExpression;
exploreId: ExploreId;
expressions: string[];
}
export interface InitializeExploreAction { export interface InitializeExploreAction {
type: ActionTypes.InitializeExplore; type: ActionTypes.InitializeExplore;
exploreId: ExploreId; exploreId: ExploreId;
...@@ -134,10 +146,8 @@ export interface InitializeExploreAction { ...@@ -134,10 +146,8 @@ export interface InitializeExploreAction {
range: RawTimeRange; range: RawTimeRange;
} }
export interface HighlightLogsExpressionAction { export interface InitializeExploreSplitAction {
type: ActionTypes.HighlightLogsExpression; type: ActionTypes.InitializeExploreSplit;
exploreId: ExploreId;
expressions: string[];
} }
export interface LoadDatasourceFailureAction { export interface LoadDatasourceFailureAction {
...@@ -224,6 +234,10 @@ export interface ScanStopAction { ...@@ -224,6 +234,10 @@ export interface ScanStopAction {
exploreId: ExploreId; exploreId: ExploreId;
} }
export interface StateSaveAction {
type: ActionTypes.StateSave;
}
export type Action = export type Action =
| AddQueryRowAction | AddQueryRowAction
| ChangeQueryAction | ChangeQueryAction
...@@ -238,6 +252,7 @@ export type Action = ...@@ -238,6 +252,7 @@ export type Action =
| ClickTableButtonAction | ClickTableButtonAction
| HighlightLogsExpressionAction | HighlightLogsExpressionAction
| InitializeExploreAction | InitializeExploreAction
| InitializeExploreSplitAction
| LoadDatasourceFailureAction | LoadDatasourceFailureAction
| LoadDatasourceMissingAction | LoadDatasourceMissingAction
| LoadDatasourcePendingAction | LoadDatasourcePendingAction
...@@ -301,15 +316,14 @@ export function clickClear(exploreId: ExploreId): ThunkResult<void> { ...@@ -301,15 +316,14 @@ export function clickClear(exploreId: ExploreId): ThunkResult<void> {
return dispatch => { return dispatch => {
dispatch(scanStop(exploreId)); dispatch(scanStop(exploreId));
dispatch({ type: ActionTypes.ClickClear, exploreId }); dispatch({ type: ActionTypes.ClickClear, exploreId });
// TODO save state dispatch(stateSave());
}; };
} }
export function clickCloseSplit(): ThunkResult<void> { export function clickCloseSplit(): ThunkResult<void> {
return dispatch => { return dispatch => {
dispatch({ type: ActionTypes.ClickCloseSplit }); dispatch({ type: ActionTypes.ClickCloseSplit });
// When closing split, remove URL state for split part dispatch(stateSave());
// TODO save state
}; };
} }
...@@ -353,7 +367,7 @@ export function clickSplit(): ThunkResult<void> { ...@@ -353,7 +367,7 @@ export function clickSplit(): ThunkResult<void> {
initialQueries: leftState.modifiedQueries.slice(), initialQueries: leftState.modifiedQueries.slice(),
}; };
dispatch({ type: ActionTypes.ClickSplit, itemState }); dispatch({ type: ActionTypes.ClickSplit, itemState });
// TODO save state dispatch(stateSave());
}; };
} }
...@@ -412,6 +426,12 @@ export function initializeExplore( ...@@ -412,6 +426,12 @@ export function initializeExplore(
}; };
} }
export function initializeExploreSplit() {
return async dispatch => {
dispatch({ type: ActionTypes.InitializeExploreSplit });
};
}
export const loadDatasourceFailure = (exploreId: ExploreId, error: string): LoadDatasourceFailureAction => ({ export const loadDatasourceFailure = (exploreId: ExploreId, error: string): LoadDatasourceFailureAction => ({
type: ActionTypes.LoadDatasourceFailure, type: ActionTypes.LoadDatasourceFailure,
exploreId, exploreId,
...@@ -733,7 +753,7 @@ export function runQueries(exploreId: ExploreId) { ...@@ -733,7 +753,7 @@ export function runQueries(exploreId: ExploreId) {
if (showingLogs && supportsLogs) { if (showingLogs && supportsLogs) {
dispatch(runQueriesForType(exploreId, 'Logs', { interval, format: 'logs' })); dispatch(runQueriesForType(exploreId, 'Logs', { interval, format: 'logs' }));
} }
// TODO save state dispatch(stateSave());
}; };
} }
...@@ -792,3 +812,25 @@ export function scanStart(exploreId: ExploreId, scanner: RangeScanner): ThunkRes ...@@ -792,3 +812,25 @@ export function scanStart(exploreId: ExploreId, scanner: RangeScanner): ThunkRes
export function scanStop(exploreId: ExploreId): ScanStopAction { export function scanStop(exploreId: ExploreId): ScanStopAction {
return { type: ActionTypes.ScanStop, exploreId }; return { type: ActionTypes.ScanStop, exploreId };
} }
export function stateSave() {
return (dispatch, getState) => {
const { left, right, split } = getState().explore;
const urlStates: { [index: string]: string } = {};
const leftUrlState: ExploreUrlState = {
datasource: left.datasourceInstance.name,
queries: left.modifiedQueries.map(clearQueryKeys),
range: left.range,
};
urlStates.left = serializeStateToUrlParam(leftUrlState, true);
if (split) {
const rightUrlState: ExploreUrlState = {
datasource: right.datasourceInstance.name,
queries: right.modifiedQueries.map(clearQueryKeys),
range: right.range,
};
urlStates.right = serializeStateToUrlParam(rightUrlState, true);
}
dispatch(updateLocation({ query: urlStates }));
};
}
...@@ -36,6 +36,7 @@ export interface ExploreItemState { ...@@ -36,6 +36,7 @@ export interface ExploreItemState {
history: HistoryItem[]; history: HistoryItem[];
initialDatasource?: string; initialDatasource?: string;
initialQueries: DataQuery[]; initialQueries: DataQuery[];
initialized: boolean;
logsHighlighterExpressions?: string[]; logsHighlighterExpressions?: string[];
logsResult?: LogsModel; logsResult?: LogsModel;
modifiedQueries: DataQuery[]; modifiedQueries: DataQuery[];
...@@ -74,6 +75,7 @@ const makeExploreItemState = (): ExploreItemState => ({ ...@@ -74,6 +75,7 @@ const makeExploreItemState = (): ExploreItemState => ({
exploreDatasources: [], exploreDatasources: [],
history: [], history: [],
initialQueries: [], initialQueries: [],
initialized: false,
modifiedQueries: [], modifiedQueries: [],
queryTransactions: [], queryTransactions: [],
queryIntervals: { interval: '15s', intervalMs: DEFAULT_GRAPH_INTERVAL }, queryIntervals: { interval: '15s', intervalMs: DEFAULT_GRAPH_INTERVAL },
...@@ -89,7 +91,7 @@ const makeExploreItemState = (): ExploreItemState => ({ ...@@ -89,7 +91,7 @@ const makeExploreItemState = (): ExploreItemState => ({
}); });
const initialExploreState: ExploreState = { const initialExploreState: ExploreState = {
split: false, split: null,
left: makeExploreItemState(), left: makeExploreItemState(),
right: makeExploreItemState(), right: makeExploreItemState(),
}; };
...@@ -236,6 +238,7 @@ const itemReducer = (state, action: Action): ExploreItemState => { ...@@ -236,6 +238,7 @@ const itemReducer = (state, action: Action): ExploreItemState => {
range, range,
initialDatasource: action.datasource, initialDatasource: action.datasource,
initialQueries: action.queries, initialQueries: action.queries,
initialized: true,
modifiedQueries: action.queries.slice(), modifiedQueries: action.queries.slice(),
}; };
} }
...@@ -436,6 +439,13 @@ export const exploreReducer = (state = initialExploreState, action: Action): Exp ...@@ -436,6 +439,13 @@ export const exploreReducer = (state = initialExploreState, action: Action): Exp
right: action.itemState, right: action.itemState,
}; };
} }
case ActionTypes.InitializeExploreSplit: {
return {
...state,
split: true,
};
}
} }
const { exploreId } = action as any; const { exploreId } = action as any;
...@@ -447,6 +457,8 @@ export const exploreReducer = (state = initialExploreState, action: Action): Exp ...@@ -447,6 +457,8 @@ export const exploreReducer = (state = initialExploreState, action: Action): Exp
}; };
} }
console.error('Unhandled action', action.type);
return state; return state;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment