mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 19:45:51 +01:00
Correct link to changeset
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import type { Changeset } from "@scm-manager/ui-types";
|
||||
import type { Changeset, Repository } from "@scm-manager/ui-types";
|
||||
import classNames from "classnames";
|
||||
import { translate, Interpolate } from "react-i18next";
|
||||
import ChangesetAvatar from "./ChangesetAvatar";
|
||||
import injectSheet from "react-jss";
|
||||
import { DateFromNow } from "@scm-manager/ui-components";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
const styles = {
|
||||
pointer: {
|
||||
@@ -20,6 +21,7 @@ const styles = {
|
||||
};
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
changeset: Changeset,
|
||||
t: any,
|
||||
classes: any
|
||||
@@ -27,7 +29,16 @@ type Props = {
|
||||
|
||||
class ChangesetRow extends React.Component<Props> {
|
||||
createLink = (changeset: Changeset) => {
|
||||
return <a href={`/repo/changeset/${changeset.id}`}>{changeset.id}</a>;
|
||||
const { repository } = this.props;
|
||||
return (
|
||||
<Link
|
||||
to={`/repo/${repository.namespace}/${repository.name}/changeset/${
|
||||
changeset.id
|
||||
}`}
|
||||
>
|
||||
{changeset.id}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
// @flow
|
||||
import ChangesetRow from "./ChangesetRow";
|
||||
import React from "react";
|
||||
import type { Changeset } from "@scm-manager/ui-types";
|
||||
import type { Changeset, Repository } from "@scm-manager/ui-types";
|
||||
import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
changesets: Changeset[]
|
||||
};
|
||||
|
||||
class ChangesetTable extends React.Component<Props> {
|
||||
render() {
|
||||
const { changesets } = this.props;
|
||||
const { repository, changesets } = this.props;
|
||||
const content = changesets.map((changeset, index) => {
|
||||
return <ChangesetRow key={index} changeset={changeset} />;
|
||||
return <ChangesetRow key={index} repository={repository} changeset={changeset} />;
|
||||
});
|
||||
return <div className={classNames("box")}>{content}</div>;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class Changesets extends React.Component<State, Props> {
|
||||
|
||||
renderTable = () => {
|
||||
const branch = this.props.match.params.branch;
|
||||
const { changesets, branchNames } = this.props;
|
||||
const { repository, changesets, branchNames } = this.props;
|
||||
|
||||
if (branchNames && branchNames.length > 0) {
|
||||
return (
|
||||
@@ -88,7 +88,7 @@ class Changesets extends React.Component<State, Props> {
|
||||
preselectedOption={branch}
|
||||
optionSelected={branch => this.branchChanged(branch)}
|
||||
/>
|
||||
<ChangesetTable changesets={changesets} />
|
||||
<ChangesetTable repository={repository} changesets={changesets} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user