WIP send along entire source object

pull/10616/head
Andrew Watkins 2017-09-29 16:41:30 -07:00
parent a2583c820b
commit 581f1a01ca
3 changed files with 6 additions and 7 deletions

View File

@ -25,9 +25,8 @@ class CellEditorOverlay extends Component {
const {cell: {name, type, queries, axes}, sources} = props
let source = _.get(queries, ['0', 'source'], props.source.links.self)
source = sources.find(s => s.links.self === source)
source = source && source.links.self
let source = _.get(queries, ['0', 'source'], null)
source = sources.find(s => s.links.self === source) || props.source
const queriesWorkingDraft = _.cloneDeep(
queries.map(({queryConfig}) => ({
@ -149,7 +148,7 @@ class CellEditorOverlay extends Component {
return {
queryConfig: q,
query,
source: q.source,
source: q.source.links.self,
}
})
@ -209,7 +208,7 @@ class CellEditorOverlay extends Component {
handleSetQuerySource = source => {
const queriesWorkingDraft = this.state.queriesWorkingDraft.map(q => ({
..._.cloneDeep(q),
source: source.links.self,
source,
}))
this.setState({queriesWorkingDraft})

View File

@ -43,7 +43,7 @@ class DisplayOptions extends Component {
return (defaultSource && defaultSource.text) || 'No source selected'
}
const selected = sources.find(s => s.links.self === query.source)
const selected = sources.find(s => s.links.self === query.source.links.self)
return (selected && selected.text) || 'No source selected'
}

View File

@ -10,7 +10,7 @@ const buildQueries = (proxy, queryConfigs, timeRange) => {
const queries = statements.filter(s => s.text !== null).map(s => {
let queryProxy = ''
if (s.queryConfig.source) {
queryProxy = `${s.queryConfig.source}/proxy`
queryProxy = `${s.queryConfig.source.links.proxy}`
}
return {