2019-03-28 17:09:59 +01:00
|
|
|
// @flow
|
|
|
|
|
import React from "react";
|
2019-03-29 10:02:53 +01:00
|
|
|
import BranchDetailTable from "../components/BranchDetailTable";
|
2019-03-28 17:09:59 +01:00
|
|
|
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
|
|
|
|
import type { Repository, Branch } from "@scm-manager/ui-types";
|
2019-03-29 10:02:53 +01:00
|
|
|
import {connect} from "react-redux";
|
|
|
|
|
import {translate} from "react-i18next";
|
|
|
|
|
import {getBranch} from "../../modules/branches";
|
2019-03-28 17:09:59 +01:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
repository: Repository,
|
2019-03-29 10:02:53 +01:00
|
|
|
branch: Branch // TODO: get branch from props
|
2019-03-28 17:09:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class BranchView extends React.Component<Props> {
|
|
|
|
|
render() {
|
|
|
|
|
const { repository, branch } = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<BranchDetailTable repository={repository} branch={branch} />
|
|
|
|
|
<hr />
|
|
|
|
|
<div className="content">
|
|
|
|
|
<ExtensionPoint
|
|
|
|
|
name="repos.branch-details.information"
|
|
|
|
|
renderAll={true}
|
|
|
|
|
props={{ branch }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-29 10:02:53 +01:00
|
|
|
const mapStateToProps = (state, ownProps) => {
|
|
|
|
|
const { repository } = ownProps;
|
|
|
|
|
const branch = getBranch(state, repository, "VisualStudio"); // TODO: !!!
|
|
|
|
|
return {
|
|
|
|
|
repository,
|
|
|
|
|
branch
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|
mapStateToProps
|
|
|
|
|
)(translate("repos")(BranchView));
|