mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
always render breadcrumd
This commit is contained in:
@@ -74,6 +74,11 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
t
|
t
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
let homeUrl = baseUrl + "/";
|
||||||
|
if (revision) {
|
||||||
|
homeUrl += encodeURIComponent(revision) + "/";
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="is-flex">
|
<div className="is-flex">
|
||||||
@@ -83,7 +88,7 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
>
|
>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to={baseUrl + "/" + revision + "/"}>
|
<Link to={homeUrl}>
|
||||||
<HomeIcon
|
<HomeIcon
|
||||||
title={t("breadcrumb.home")}
|
title={t("breadcrumb.home")}
|
||||||
name="home"
|
name="home"
|
||||||
@@ -101,12 +106,13 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
props={{
|
props={{
|
||||||
baseUrl,
|
baseUrl,
|
||||||
branch: branch ? branch : defaultBranch,
|
branch: branch ? branch : defaultBranch,
|
||||||
|
revision: branches ? undefined : revision,
|
||||||
path,
|
path,
|
||||||
isBranchUrl:
|
isBranchUrl: branches
|
||||||
branches &&
|
? branches.filter(
|
||||||
branches.filter(
|
|
||||||
b => b.name.replace("/", "%2F") === revision
|
b => b.name.replace("/", "%2F") === revision
|
||||||
).length > 0,
|
).length > 0
|
||||||
|
: true,
|
||||||
repository
|
repository
|
||||||
}}
|
}}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
|
|||||||
@@ -4,12 +4,7 @@ import { connect } from "react-redux";
|
|||||||
import {withRouter} from "react-router-dom";
|
import {withRouter} from "react-router-dom";
|
||||||
import type {Branch, Repository} from "@scm-manager/ui-types";
|
import type {Branch, Repository} from "@scm-manager/ui-types";
|
||||||
import FileTree from "../components/FileTree";
|
import FileTree from "../components/FileTree";
|
||||||
import {
|
import {BranchSelector, Breadcrumb, ErrorNotification, Loading} from "@scm-manager/ui-components";
|
||||||
BranchSelector,
|
|
||||||
Breadcrumb,
|
|
||||||
ErrorNotification,
|
|
||||||
Loading
|
|
||||||
} from "@scm-manager/ui-components";
|
|
||||||
import {translate} from "react-i18next";
|
import {translate} from "react-i18next";
|
||||||
import {
|
import {
|
||||||
fetchBranches,
|
fetchBranches,
|
||||||
@@ -175,10 +170,10 @@ class Sources extends React.Component<Props, State> {
|
|||||||
const { revision, path, baseUrl, branches, repository } = this.props;
|
const { revision, path, baseUrl, branches, repository } = this.props;
|
||||||
const { selectedBranch } = this.state;
|
const { selectedBranch } = this.state;
|
||||||
|
|
||||||
if (revision) {
|
//TODO refactor
|
||||||
return (
|
return (
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
revision={encodeURIComponent(revision)}
|
revision={revision}
|
||||||
path={path}
|
path={path}
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
branch={selectedBranch}
|
branch={selectedBranch}
|
||||||
@@ -189,8 +184,6 @@ class Sources extends React.Component<Props, State> {
|
|||||||
repository={repository}
|
repository={repository}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user