mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Debugging attempts
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
import type { Repository, Branch } from "@scm-manager/ui-types";
|
||||
import { Route, Switch, withRouter } from "react-router-dom";
|
||||
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||
import { Route, withRouter } from "react-router-dom";
|
||||
import Changesets from "./Changesets";
|
||||
import BranchSelector from "./BranchSelector";
|
||||
import { connect } from "react-redux";
|
||||
import { ErrorPage, Loading } from "@scm-manager/ui-components";
|
||||
import { Loading } from "@scm-manager/ui-components";
|
||||
import {
|
||||
fetchBranches,
|
||||
getBranches,
|
||||
@@ -35,13 +35,14 @@ type State = {
|
||||
selectedBranch?: Branch
|
||||
};
|
||||
|
||||
class BranchRoot extends React.PureComponent<Props, State> {
|
||||
class BranchRoot extends React.Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
console.log("BR did mount");
|
||||
this.props.fetchBranches(this.props.repository);
|
||||
}
|
||||
|
||||
@@ -75,23 +76,22 @@ class BranchRoot extends React.PureComponent<Props, State> {
|
||||
branchSelected = (branch: Branch) => {
|
||||
const url = this.matchedUrl();
|
||||
this.props.history.push(
|
||||
`${url}/${encodeURIComponent(branch.name)}/changesets/`
|
||||
`${url}/${encodeURIComponent(branch.name)}/changesets`
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
console.log("BR render");
|
||||
const { repository, match, branches, loading } = this.props;
|
||||
const url = this.stripEndingSlash(match.url);
|
||||
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
if (!repository || !branches) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<BranchSelector
|
||||
@@ -109,13 +109,11 @@ class BranchRoot extends React.PureComponent<Props, State> {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
fetchBranches: (repo: Repository) => {
|
||||
@@ -138,9 +136,9 @@ const mapStateToProps = (state: any, ownProps: Props) => {
|
||||
};
|
||||
|
||||
export default compose(
|
||||
withRouter,
|
||||
connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
),
|
||||
withRouter
|
||||
)
|
||||
)(BranchRoot);
|
||||
|
||||
Reference in New Issue
Block a user