mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
fix show diff in git format for svn repo
This commit is contained in:
@@ -12,7 +12,7 @@ import AvatarImage from "./AvatarImage";
|
||||
import classNames from "classnames";
|
||||
import ChangesetId from "./ChangesetId";
|
||||
import type {Tag} from "@scm-manager/ui-types";
|
||||
import DiffView from "../../containers/DiffView";
|
||||
import ScmDiff from "../../containers/ScmDiff";
|
||||
|
||||
const styles = {
|
||||
spacing: {
|
||||
@@ -29,56 +29,59 @@ type Props = {
|
||||
|
||||
class ChangesetDetails extends React.Component<Props> {
|
||||
render() {
|
||||
const { changeset, repository, classes } = this.props;
|
||||
const {changeset, repository, classes} = this.props;
|
||||
|
||||
const description = parseDescription(changeset.description);
|
||||
|
||||
const id = (
|
||||
<ChangesetId repository={repository} changeset={changeset} link={false} />
|
||||
<ChangesetId repository={repository} changeset={changeset} link={false}/>
|
||||
);
|
||||
const date = <DateFromNow date={changeset.date} />;
|
||||
const date = <DateFromNow date={changeset.date}/>;
|
||||
|
||||
return (
|
||||
<div className="content">
|
||||
<h4>{description.title}</h4>
|
||||
<article className="media">
|
||||
<AvatarWrapper>
|
||||
<p className={classNames("image", "is-64x64", classes.spacing)}>
|
||||
<AvatarImage changeset={changeset} />
|
||||
</p>
|
||||
</AvatarWrapper>
|
||||
<div className="media-content">
|
||||
<p>
|
||||
<ChangesetAuthor changeset={changeset} />
|
||||
</p>
|
||||
<p>
|
||||
<Interpolate
|
||||
i18nKey="changesets.changeset.summary"
|
||||
id={id}
|
||||
time={date}
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div className="media-right">{this.renderTags()}</div>
|
||||
</article>
|
||||
<p>
|
||||
{description.message.split("\n").map((item, key) => {
|
||||
return (
|
||||
<span key={key}>
|
||||
<div>
|
||||
<div className="content">
|
||||
<h4>{description.title}</h4>
|
||||
<article className="media">
|
||||
<AvatarWrapper>
|
||||
<p className={classNames("image", "is-64x64", classes.spacing)}>
|
||||
<AvatarImage changeset={changeset}/>
|
||||
</p>
|
||||
</AvatarWrapper>
|
||||
<div className="media-content">
|
||||
<p>
|
||||
<ChangesetAuthor changeset={changeset}/>
|
||||
</p>
|
||||
<p>
|
||||
<Interpolate
|
||||
i18nKey="changesets.changeset.summary"
|
||||
id={id}
|
||||
time={date}
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div className="media-right">{this.renderTags()}</div>
|
||||
</article>
|
||||
<p>
|
||||
{description.message.split("\n").map((item, key) => {
|
||||
return (
|
||||
<span key={key}>
|
||||
{item}
|
||||
<br />
|
||||
<br/>
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</p>
|
||||
|
||||
<DiffView changeset={changeset} sideBySide={false} />
|
||||
);
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<ScmDiff changeset={changeset} sideBySide={false}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
getTags = () => {
|
||||
const { changeset } = this.props;
|
||||
const {changeset} = this.props;
|
||||
return changeset._embedded.tags || [];
|
||||
};
|
||||
|
||||
@@ -88,7 +91,7 @@ class ChangesetDetails extends React.Component<Props> {
|
||||
return (
|
||||
<div className="level-item">
|
||||
{tags.map((tag: Tag) => {
|
||||
return <ChangesetTag key={tag.name} tag={tag} />;
|
||||
return <ChangesetTag key={tag.name} tag={tag}/>;
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -5,16 +5,17 @@ export type Description = {
|
||||
};
|
||||
|
||||
export function parseDescription(description: string): Description {
|
||||
const lineBreak = description.indexOf("\n");
|
||||
|
||||
let title;
|
||||
let title = "";
|
||||
let message = "";
|
||||
|
||||
if (lineBreak > 0) {
|
||||
title = description.substring(0, lineBreak);
|
||||
message = description.substring(lineBreak + 1);
|
||||
} else {
|
||||
title = description;
|
||||
if (description != null) {
|
||||
const lineBreak = description.indexOf("\n");
|
||||
if (lineBreak > 0) {
|
||||
title = description.substring(0, lineBreak);
|
||||
message = description.substring(lineBreak + 1);
|
||||
} else {
|
||||
title = description;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user