Fix issue with hidden SourceSelector

Previously, the SourceSelector would hide itself unless Chronograf was
connected to more than one source. This prevented a Chronograf instance
from selecting a dynamic source or creating flux queries when only
connected to one source.

In addition to fixing this issue, this commit removes the “Source:” text
from the TimeMachine controls, per the design spec.
enhancement/default-for-missing-annotations
Christopher Henn 2018-09-07 15:12:36 -07:00 committed by Chris Henn
parent 42b28205d2
commit 6e99afe5a4
1 changed files with 5 additions and 4 deletions

View File

@ -30,9 +30,12 @@ const SourceSelector: SFC<Props> = ({
isDynamicSourceSelected,
onSelectDynamicSource,
}) => {
return sources.length > 1 && queries.length ? (
if (!sources.length || !queries.length) {
return <div className="source-selector" />
}
return (
<div className="source-selector">
<h3>Source:</h3>
<SourceDropdown
service={service}
services={services}
@ -46,8 +49,6 @@ const SourceSelector: SFC<Props> = ({
onSelectDynamicSource={onSelectDynamicSource}
/>
</div>
) : (
<div className="source-selector" />
)
}