added defaultBranch to Branches type, changed ui-bundler version for better testing experience in intellij, corrected fetchBranch functionality, wrote reducer for single branch and unit tests

This commit is contained in:
Florian Scholdei
2019-04-02 17:31:32 +02:00
parent e736add3fd
commit 7c61efb20b
7 changed files with 112 additions and 76 deletions

View File

@@ -19,7 +19,7 @@ const styles = {
};
class BranchRow extends React.Component<Props> {
renderLink(to: string, label: string, defaultBranch: boolean) {
renderLink(to: string, label: string, defaultBranch?: boolean) {
const { classes } = this.props;
let showLabel = null;
@@ -36,11 +36,11 @@ class BranchRow extends React.Component<Props> {
render() {
const { baseUrl, branch } = this.props;
const to = `${baseUrl}/${encodeURIComponent(branch.name)}/info`;
return (
<tr>
<td>{this.renderLink(to, branch.name, branch.defaultBranch)}</td>
</tr>
);
return (
<tr>
<td>{this.renderLink(to, branch.name, branch.defaultBranch)}</td>
</tr>
);
}
}