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

Commit e625d90

Browse files
author
Edmundo Alvarez
committed
Sort streams by title
1 parent 9d46a02 commit e625d90

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/web/pipeline-connections/PipelineConnections.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Row, Col } from 'react-bootstrap';
3+
import naturalSort from 'javascript-natural-sort';
34

45
import { EntityList, TypeAheadDataFilter } from 'components/common';
56
import Connection from './Connection';
@@ -32,9 +33,14 @@ const PipelineConnections = React.createClass({
3233
},
3334

3435
render() {
35-
// TODO: Sort this list by stream title
36+
const filteredStreamsMap = {};
37+
this.state.filteredStreams.forEach(s => {
38+
filteredStreamsMap[s.id] = s;
39+
});
40+
3641
const formattedConnections = this.props.connections
3742
.filter(c => this.state.filteredStreams.some(s => s.id === c.stream_id && this._isConnectionWithPipelines(c)))
43+
.sort((c1, c2) => naturalSort(filteredStreamsMap[c1.stream_id].title, filteredStreamsMap[c2.stream_id].title))
3844
.map(c => {
3945
return (
4046
<Connection key={c.stream_id} stream={this.props.streams.filter(s => s.id === c.stream_id)[0]}

0 commit comments

Comments
 (0)