mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
corrected path link
This commit is contained in:
@@ -5,6 +5,7 @@ import injectSheet from "react-jss";
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
revision: string,
|
||||||
path: string,
|
path: string,
|
||||||
baseUrl: string,
|
baseUrl: string,
|
||||||
classes: any
|
classes: any
|
||||||
@@ -18,7 +19,7 @@ const styles = {
|
|||||||
|
|
||||||
class Breadcrumb extends React.Component<Props> {
|
class Breadcrumb extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { path, baseUrl, classes } = this.props;
|
const { revision, path, baseUrl, classes } = this.props;
|
||||||
|
|
||||||
if (path) {
|
if (path) {
|
||||||
const paths = path.split("/");
|
const paths = path.split("/");
|
||||||
@@ -31,6 +32,7 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
>
|
>
|
||||||
<ul>
|
<ul>
|
||||||
{paths.map((path, index) => {
|
{paths.map((path, index) => {
|
||||||
|
const currPath = paths.slice(0, index + 1).join("/");
|
||||||
if (paths.length - 1 === index) {
|
if (paths.length - 1 === index) {
|
||||||
return (
|
return (
|
||||||
<li className="is-active" key={index}>
|
<li className="is-active" key={index}>
|
||||||
@@ -42,7 +44,9 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<Link to={baseUrl + "/" + path}>{path}</Link>
|
<Link to={baseUrl + "/" + revision + "/" + currPath}>
|
||||||
|
{path}
|
||||||
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ 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 { ErrorNotification, Loading, BranchSelector, Breadcrumb } from "@scm-manager/ui-components";
|
import {
|
||||||
|
ErrorNotification,
|
||||||
|
Loading,
|
||||||
|
BranchSelector,
|
||||||
|
Breadcrumb
|
||||||
|
} from "@scm-manager/ui-components";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
fetchBranches,
|
fetchBranches,
|
||||||
@@ -94,7 +99,7 @@ class Sources extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<div className="panel">
|
<div className="panel">
|
||||||
{this.renderBranchSelector()}
|
{this.renderBranchSelector()}
|
||||||
<Breadcrumb path={path} baseUrl={baseUrl} />
|
<Breadcrumb revision={revision} path={path} baseUrl={baseUrl} />
|
||||||
<FileTree
|
<FileTree
|
||||||
repository={repository}
|
repository={repository}
|
||||||
revision={revision}
|
revision={revision}
|
||||||
|
|||||||
Reference in New Issue
Block a user