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