Changed handling of changeset description extension point

This commit is contained in:
Philipp Czora
2019-01-16 16:25:18 +01:00
parent 0864a31a97
commit c1fb6bab53
2 changed files with 39 additions and 21 deletions

View File

@@ -3,15 +3,16 @@ import React from "react";
import type { Changeset, Repository, Tag } from "@scm-manager/ui-types"; import type { Changeset, Repository, Tag } from "@scm-manager/ui-types";
import classNames from "classnames"; import classNames from "classnames";
import {Interpolate, translate} from "react-i18next"; import { Interpolate, translate } from "react-i18next";
import ChangesetId from "./ChangesetId"; import ChangesetId from "./ChangesetId";
import injectSheet from "react-jss"; import injectSheet from "react-jss";
import {DateFromNow} from "../.."; import { DateFromNow } from "../..";
import ChangesetAuthor from "./ChangesetAuthor"; import ChangesetAuthor from "./ChangesetAuthor";
import ChangesetTag from "./ChangesetTag"; import ChangesetTag from "./ChangesetTag";
import {parseDescription} from "./changesets"; import { parseDescription } from "./changesets";
import {AvatarWrapper, AvatarImage} from "../../avatar"; import { AvatarWrapper, AvatarImage } from "../../avatar";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
const styles = { const styles = {
pointer: { pointer: {
@@ -64,7 +65,15 @@ class ChangesetRow extends React.Component<Props> {
<div className={classNames("media-content", classes.withOverflow)}> <div className={classNames("media-content", classes.withOverflow)}>
<div className="content"> <div className="content">
<p className="is-ellipsis-overflow"> <p className="is-ellipsis-overflow">
<strong>{description.title}</strong> <strong>
<ExtensionPoint
name="changesets.changeset.description"
props={{ changeset, value: description.title }}
renderAll={true}
>
{description.title}
</ExtensionPoint>
</strong>
<br /> <br />
<Interpolate <Interpolate
i18nKey="changesets.changeset.summary" i18nKey="changesets.changeset.summary"

View File

@@ -46,7 +46,15 @@ class ChangesetDetails extends React.Component<Props> {
return ( return (
<div> <div>
<div className="content"> <div className="content">
<h4>{description.title}</h4> <h4>
<ExtensionPoint
name="changesets.changeset.description"
props={{ changeset, value: description.title }}
renderAll={true}
>
{description.title}
</ExtensionPoint>
</h4>
<article className="media"> <article className="media">
<AvatarWrapper> <AvatarWrapper>
<p className={classNames("image", "is-64x64", classes.spacing)}> <p className={classNames("image", "is-64x64", classes.spacing)}>
@@ -67,22 +75,23 @@ class ChangesetDetails extends React.Component<Props> {
</div> </div>
<div className="media-right">{this.renderTags()}</div> <div className="media-right">{this.renderTags()}</div>
</article> </article>
<ExtensionPoint
name="changesets.changeset.description"
props={{ changeset, description }}
renderAll={true}
>
<p> <p>
{description.message.split("\n").map((item, key) => { {description.message.split("\n").map((item, key) => {
return ( return (
<span key={key}> <span key={key}>
<ExtensionPoint
name="changesets.changeset.description"
props={{ changeset, value: item }}
renderAll={true}
>
{item} {item}
</ExtensionPoint>
<br /> <br />
</span> </span>
); );
})} })}
</p> </p>
</ExtensionPoint>
</div> </div>
<div> <div>
<ChangesetDiff changeset={changeset} /> <ChangesetDiff changeset={changeset} />