Added extension point for author metadata

This commit is contained in:
Philipp Czora
2019-02-05 18:36:26 +01:00
parent d88dd579a4
commit 7fed62ff8a
2 changed files with 18 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
//@flow
import React from "react";
import type {Changeset} from "@scm-manager/ui-types";
import type { Changeset } from "@scm-manager/ui-types";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
type Props = {
changeset: Changeset
@@ -16,11 +17,24 @@ class ChangesetAuthor extends React.Component<Props> {
const { name } = changeset.author;
return (
<>
{name} {this.renderMail()}
{name} {this.renderMail()} {this.renderAuthorMetadataExtensionPoint()}
</>
);
}
renderAuthorMetadataExtensionPoint = () => {
const { changeset } = this.props;
return (
<ExtensionPoint
name="changesets.changeset.author.metadata"
props={{ changeset }}
renderAll={true}
>
asas
</ExtensionPoint>
);
};
renderMail() {
const { mail } = this.props.changeset.author;
if (mail) {