diff --git a/web/src/screens/repo/screens/builds/index.js b/web/src/screens/repo/screens/builds/index.js index a6ebb867d..303493a40 100644 --- a/web/src/screens/repo/screens/builds/index.js +++ b/web/src/screens/repo/screens/builds/index.js @@ -28,6 +28,7 @@ export default class Main extends Component { super(props, context); this.fetchNextBuildPage = this.fetchNextBuildPage.bind(this); + this.selectBranch = this.selectBranch.bind(this) } componentWillMount() { @@ -40,7 +41,8 @@ export default class Main extends Component { (nextProps.builds !== undefined && this.props.builds !== nextProps.builds) || this.props.error !== nextProps.error || - this.props.loaded !== nextProps.loaded + this.props.loaded !== nextProps.loaded || + this.state.branch !== nextState.branch ); } @@ -79,8 +81,15 @@ export default class Main extends Component { ); } + selectBranch(branch) { + this.setState({ + branch: branch, + }); + } + render() { const { repo, builds, loaded, error } = this.props; + const { branch } = this.state; const list = Object.values(builds || {}); function renderBuild(build) { @@ -91,6 +100,10 @@ export default class Main extends Component { ); } + const filterBranch = (build) => { + return !branch || build.branch === branch; + } + if (error) { return