diff --git a/scm-ui/public/locales/de/repos.json b/scm-ui/public/locales/de/repos.json index dc444f59ff..65f93e5045 100644 --- a/scm-ui/public/locales/de/repos.json +++ b/scm-ui/public/locales/de/repos.json @@ -43,6 +43,10 @@ "title": "Repository erstellen", "subtitle": "Erstellen eines neuen Repository" }, + "branchesOverview": { + "title": "Übersicht aller verfügbaren Branches", + "branches": "Branches" + }, "changesets": { "errorTitle": "Fehler", "errorSubtitle": "Changesets konnten nicht abgerufen werden", diff --git a/scm-ui/public/locales/en/repos.json b/scm-ui/public/locales/en/repos.json index d888d73c29..700fe20b9e 100644 --- a/scm-ui/public/locales/en/repos.json +++ b/scm-ui/public/locales/en/repos.json @@ -43,6 +43,10 @@ "title": "Create Repository", "subtitle": "Create a new repository" }, + "branchesOverview": { + "title": "Overview of all branches", + "branches": "Branches" + }, "changesets": { "errorTitle": "Error", "errorSubtitle": "Could not fetch changesets", diff --git a/scm-ui/src/repos/containers/BranchesOverview.js b/scm-ui/src/repos/containers/BranchesOverview.js index d13449eeb6..217aef7a4f 100644 --- a/scm-ui/src/repos/containers/BranchesOverview.js +++ b/scm-ui/src/repos/containers/BranchesOverview.js @@ -1,12 +1,21 @@ // @flow import React from "react"; -import {fetchBranches, getBranches, getFetchBranchesFailure, isFetchBranchesPending} from "../modules/branches"; -import {connect} from "react-redux"; -import type {Branch, Repository} from "@scm-manager/ui-types"; -import {compose} from "redux"; -import {translate} from "react-i18next"; -import {withRouter} from "react-router-dom"; -import {ErrorNotification, Loading} from "@scm-manager/ui-components"; +import { + fetchBranches, + getBranches, + getFetchBranchesFailure, + isFetchBranchesPending +} from "../modules/branches"; +import { connect } from "react-redux"; +import type { Branch, Repository } from "@scm-manager/ui-types"; +import { compose } from "redux"; +import { translate } from "react-i18next"; +import {Link, withRouter} from "react-router-dom"; +import { + ErrorNotification, + Loading, + Subtitle +} from "@scm-manager/ui-components"; type Props = { repository: Repository, @@ -24,19 +33,13 @@ type Props = { }; class BranchesOverview extends React.Component { componentDidMount() { - const { - fetchBranches, - repository - } = this.props; + const { fetchBranches, repository } = this.props; fetchBranches(repository); } render() { - const { - loading, - error, - } = this.props; + const { loading, error, t } = this.props; if (error) { return ; @@ -46,7 +49,19 @@ class BranchesOverview extends React.Component { return ; } - return <>{this.renderBranches()}; + return ( + <> + + + + + + + + {this.renderBranches()} +
{t("branchesOverview.branches")}
+ + ); } renderBranches() { @@ -55,11 +70,16 @@ class BranchesOverview extends React.Component { let branchesList = null; if (branches) { branchesList = ( -
    + <> {branches.map((branch, index) => { - return
  • {branch.name}
  • ; + const to = `../branch/${encodeURIComponent(branch.name)}/changesets/`; + return ( + + {branch.name} + + ); })} -
+ ); } return branchesList; @@ -84,7 +104,7 @@ const mapDispatchToProps = dispatch => { return { fetchBranches: (repository: Repository) => { dispatch(fetchBranches(repository)); - }, + } }; };