mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
addHistory
This commit is contained in:
@@ -29,13 +29,14 @@ import Permissions from "../permissions/containers/Permissions";
|
||||
import type { History } from "history";
|
||||
import EditNavLink from "../components/EditNavLink";
|
||||
|
||||
import FileHistory from "../sources/containers/FileHistory";
|
||||
import BranchRoot from "./ChangesetsRoot";
|
||||
import ChangesetView from "./ChangesetView";
|
||||
import PermissionsNavLink from "../components/PermissionsNavLink";
|
||||
import Sources from "../sources/containers/Sources";
|
||||
import RepositoryNavLink from "../components/RepositoryNavLink";
|
||||
import { getRepositoriesLink } from "../../modules/indexResource";
|
||||
import {ExtensionPoint} from "@scm-manager/ui-extensions";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
|
||||
type Props = {
|
||||
namespace: string,
|
||||
@@ -152,6 +153,15 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
<Sources repository={repository} baseUrl={`${url}/sources`} />
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/history/:revision/:path*`}
|
||||
render={() => (
|
||||
<FileHistory
|
||||
repository={repository}
|
||||
baseUrl={`${url}/history`}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path={`${url}/changesets`}
|
||||
render={() => (
|
||||
@@ -172,9 +182,10 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<ExtensionPoint name="repository.route"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
<ExtensionPoint
|
||||
name="repository.route"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
</Switch>
|
||||
</div>
|
||||
@@ -197,9 +208,10 @@ class RepositoryRoot extends React.Component<Props> {
|
||||
label={t("repository-root.sources")}
|
||||
activeOnlyWhenExact={false}
|
||||
/>
|
||||
<ExtensionPoint name="repository.navigation"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
<ExtensionPoint
|
||||
name="repository.navigation"
|
||||
props={extensionProps}
|
||||
renderAll={true}
|
||||
/>
|
||||
<PermissionsNavLink
|
||||
permissionUrl={`${url}/permissions`}
|
||||
|
||||
@@ -95,18 +95,19 @@ class Content extends React.Component<Props, State> {
|
||||
<span className={classes.pointer} onClick={this.toggleCollapse}>
|
||||
<article className="media">
|
||||
<div className="media-left">
|
||||
<i className={classNames("fa", icon)}/>
|
||||
<i className={classNames("fa", icon)} />
|
||||
</div>
|
||||
<div className="media-content">
|
||||
<div className="content">{file.name}</div>
|
||||
</div>
|
||||
<p className="media-right">
|
||||
<a className="is-hidden-mobile" href="#">
|
||||
<a href="#">
|
||||
<span className="icon is-medium">
|
||||
<i className="fas fa-history"></i>
|
||||
</span>
|
||||
|
||||
{t("sources.content.historyLink")}
|
||||
<i className="fas fa-history" />
|
||||
</span>
|
||||
<span className="is-hidden-mobile">
|
||||
{t("sources.content.historyLink")}
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
36
scm-ui/src/repos/sources/containers/FileHistory.js
Normal file
36
scm-ui/src/repos/sources/containers/FileHistory.js
Normal file
@@ -0,0 +1,36 @@
|
||||
//@flow
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import type { File, Repository } from "@scm-manager/ui-types";
|
||||
import {
|
||||
DateFromNow,
|
||||
ErrorNotification,
|
||||
Loading
|
||||
} from "@scm-manager/ui-components";
|
||||
import { connect } from "react-redux";
|
||||
import ImageViewer from "../components/content/ImageViewer";
|
||||
import SourcecodeViewer from "../components/content/SourcecodeViewer";
|
||||
import DownloadViewer from "../components/content/DownloadViewer";
|
||||
import FileSize from "../components/FileSize";
|
||||
import injectSheet from "react-jss";
|
||||
import classNames from "classnames";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
import { getContentType } from "./contentType";
|
||||
|
||||
type Props = {
|
||||
classes: any,
|
||||
t: string => string
|
||||
};
|
||||
|
||||
class FileHistory extends React.Component<Props> {
|
||||
componentDidMount() {}
|
||||
|
||||
render() {
|
||||
return "History";
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: any, ownProps: Props) => {};
|
||||
|
||||
export default connect(mapStateToProps)(translate("repos")(FileHistory));
|
||||
Reference in New Issue
Block a user