From a79f7fdd94596183674438c3a61216f5208b5171 Mon Sep 17 00:00:00 2001 From: Hunter Trujillo Date: Thu, 5 Oct 2017 12:02:03 -0600 Subject: [PATCH] Fix PR change requests. --- ui/src/data_explorer/containers/DataExplorer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/data_explorer/containers/DataExplorer.js b/ui/src/data_explorer/containers/DataExplorer.js index 421609c88..5e579ef6d 100644 --- a/ui/src/data_explorer/containers/DataExplorer.js +++ b/ui/src/data_explorer/containers/DataExplorer.js @@ -39,7 +39,8 @@ class DataExplorer extends Component { } componentDidMount() { - const {query} = queryString.parse(window.location.search) + const {router} = this.props + const {query} = queryString.parse(router.location.search) if (query && query.length) { const qc = this.props.queryConfigs[0] this.props.queryConfigActions.editRawText(qc.id, query) @@ -49,11 +50,11 @@ class DataExplorer extends Component { componentWillReceiveProps(nextProps) { const {router} = this.props const {queryConfigs, timeRange} = nextProps - const query = buildRawText(queryConfigs[0], timeRange) + const query = buildRawText(_.get(queryConfigs, ['0'], ''), timeRange) const qsCurrent = queryString.parse(router.location.search) if (query.length && qsCurrent.query !== query) { const qsNew = queryString.stringify({query}) - router.push(`${window.location.pathname}?${qsNew}`) + router.push(`${router.location.pathname}?${qsNew}`) } }