From c32b3fe6dc0ddee6a3d5ac51253bba0791cc24ac Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Wed, 3 Apr 2019 16:28:54 +0200 Subject: [PATCH] added create branch redirect --- .../repos/branches/containers/BranchRoot.js | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/scm-ui/src/repos/branches/containers/BranchRoot.js b/scm-ui/src/repos/branches/containers/BranchRoot.js index 22b7011968..f1570735e2 100644 --- a/scm-ui/src/repos/branches/containers/BranchRoot.js +++ b/scm-ui/src/repos/branches/containers/BranchRoot.js @@ -12,7 +12,6 @@ import { isFetchBranchPending } from "../modules/branches"; import { ErrorPage, Loading } from "@scm-manager/ui-components"; -import CreateBranch from "./CreateBranch"; import type { History } from "history"; type Props = { @@ -26,6 +25,7 @@ type Props = { t: string => string, history: History, match: any, + location: any, // dispatch functions fetchBranch: (repository: Repository, branchName: string) => void @@ -50,9 +50,23 @@ class BranchRoot extends React.Component { }; render() { - const { repository, branch, loading, error, t } = this.props; + const { + repository, + branch, + loading, + error, + t, + match, + location + } = this.props; + + const url = this.matchedUrl(); if (error) { + if(location.search.indexOf("?create=true") > -1) { + return ; + } + return ( { return ; } - const url = this.matchedUrl(); - return ( - ( - - )} - /> } + component={() => ( + + )} /> );