Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit 9d46a02

Browse files
author
Edmundo Alvarez
committed
Do not display streams without pipelines connected
Fixes Graylog2/graylog2-server#2322
1 parent 90c00f1 commit 9d46a02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/web/pipeline-connections/PipelineConnections.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ const PipelineConnections = React.createClass({
2727
this.props.onConnectionsChange(newConnection, callback);
2828
},
2929

30+
_isConnectionWithPipelines(connection) {
31+
return connection.pipeline_ids.length > 0;
32+
},
33+
3034
render() {
3135
// TODO: Sort this list by stream title
3236
const formattedConnections = this.props.connections
33-
.filter(c => this.state.filteredStreams.some(s => s.id === c.stream_id))
37+
.filter(c => this.state.filteredStreams.some(s => s.id === c.stream_id && this._isConnectionWithPipelines(c)))
3438
.map(c => {
3539
return (
3640
<Connection key={c.stream_id} stream={this.props.streams.filter(s => s.id === c.stream_id)[0]}
@@ -39,7 +43,7 @@ const PipelineConnections = React.createClass({
3943
);
4044
});
4145

42-
const filteredStreams = this.props.streams.filter(s => !this.props.connections.some(c => c.stream_id === s.id));
46+
const filteredStreams = this.props.streams.filter(s => !this.props.connections.some(c => c.stream_id === s.id && this._isConnectionWithPipelines(c)));
4347

4448
return (
4549
<div>

0 commit comments

Comments
 (0)