diff --git a/ui/src/shared/components/Layout.js b/ui/src/shared/components/Layout.js index e7ffcdd00e..96d503e529 100644 --- a/ui/src/shared/components/Layout.js +++ b/ui/src/shared/components/Layout.js @@ -6,33 +6,36 @@ import {buildQueriesForLayouts} from 'utils/influxql' import _ from 'lodash' -const getSource = (cell, source, sources) => { +const getSource = (cell, source, sources, defaultSource) => { const s = _.get(cell, ['queries', '0', 'source'], null) if (!s) { return source } - return sources.find(src => src.links.self === s) + return sources.find(src => src.links.self === s) || defaultSource } -const Layout = ({ - host, - cell, - cell: {h, axes, type}, - source, - sources, - onZoom, - templates, - timeRange, - isEditable, - onEditCell, - autoRefresh, - onDeleteCell, - synchronizer, - resizeCoords, - onCancelEditCell, - onSummonOverlayTechnologies, -}) => +const Layout = ( + { + host, + cell, + cell: {h, axes, type}, + source, + sources, + onZoom, + templates, + timeRange, + isEditable, + onEditCell, + autoRefresh, + onDeleteCell, + synchronizer, + resizeCoords, + onCancelEditCell, + onSummonOverlayTechnologies, + }, + {source: defaultSource} +) =>