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:
@@ -1,11 +1,11 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { translate } from "react-i18next";
|
||||
import {Link} from "react-router-dom";
|
||||
import {translate} from "react-i18next";
|
||||
import classNames from "classnames";
|
||||
import styled from "styled-components";
|
||||
import { binder, ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||
import {binder, ExtensionPoint} from "@scm-manager/ui-extensions";
|
||||
import type {Branch, Repository} from "@scm-manager/ui-types";
|
||||
import Icon from "./Icon";
|
||||
|
||||
type Props = {
|
||||
@@ -74,6 +74,11 @@ class Breadcrumb extends React.Component<Props> {
|
||||
t
|
||||
} = this.props;
|
||||
|
||||
let homeUrl = baseUrl + "/";
|
||||
if (revision) {
|
||||
homeUrl += encodeURIComponent(revision) + "/";
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="is-flex">
|
||||
@@ -83,7 +88,7 @@ class Breadcrumb extends React.Component<Props> {
|
||||
>
|
||||
<ul>
|
||||
<li>
|
||||
<Link to={baseUrl + "/" + revision + "/"}>
|
||||
<Link to={homeUrl}>
|
||||
<HomeIcon
|
||||
title={t("breadcrumb.home")}
|
||||
name="home"
|
||||
@@ -101,12 +106,13 @@ class Breadcrumb extends React.Component<Props> {
|
||||
props={{
|
||||
baseUrl,
|
||||
branch: branch ? branch : defaultBranch,
|
||||
revision: branches ? undefined : revision,
|
||||
path,
|
||||
isBranchUrl:
|
||||
branches &&
|
||||
branches.filter(
|
||||
b => b.name.replace("/", "%2F") === revision
|
||||
).length > 0,
|
||||
isBranchUrl: branches
|
||||
? branches.filter(
|
||||
b => b.name.replace("/", "%2F") === revision
|
||||
).length > 0
|
||||
: true,
|
||||
repository
|
||||
}}
|
||||
renderAll={true}
|
||||
|
||||
Reference in New Issue
Block a user