Add default uuid to defaultQueryConfig in case it's not supplied. Fix how a new query config is added if there is not one present in the DE.
parent
9478a28c06
commit
e522cd44f7
|
@ -21,6 +21,7 @@ import {setAutoRefresh} from 'shared/actions/app'
|
|||
import * as dataExplorerActionCreators from 'src/data_explorer/actions/view'
|
||||
import {writeLineProtocolAsync} from 'src/data_explorer/actions/view/write'
|
||||
import {buildRawText} from 'src/utils/influxql'
|
||||
import defaultQueryConfig from 'src/utils/defaultQueryConfig'
|
||||
|
||||
class DataExplorer extends Component {
|
||||
constructor(props) {
|
||||
|
@ -33,8 +34,9 @@ class DataExplorer extends Component {
|
|||
|
||||
getActiveQuery = () => {
|
||||
const {queryConfigs} = this.props
|
||||
|
||||
if (queryConfigs.length === 0) {
|
||||
this.props.queryConfigActions.addQuery()
|
||||
queryConfigs.push(defaultQueryConfig())
|
||||
}
|
||||
|
||||
return queryConfigs[0]
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import uuid from 'node-uuid'
|
||||
|
||||
import {NULL_STRING} from 'shared/constants/queryFillOptions'
|
||||
|
||||
const defaultQueryConfig = ({id, isKapacitorRule = false}) => {
|
||||
const defaultQueryConfig = (
|
||||
{id, isKapacitorRule = false} = {id: uuid.v4()}
|
||||
) => {
|
||||
const queryConfig = {
|
||||
id,
|
||||
database: null,
|
||||
|
|
Loading…
Reference in New Issue