Added co-author to changeset

This commit is contained in:
Andrzej Polit
2020-05-28 11:16:03 +02:00
committed by René Pfeuffer
parent e451bb618e
commit a712c89f6a
2 changed files with 19 additions and 0 deletions

View File

@@ -53,11 +53,23 @@ class ChangesetAuthor extends React.Component<Props> {
);
}
checkIfCoAuthorsExists() {
console.log(this.props.changeset.trailerPersons.filter(p => p.trailerType === "Co-authored-by").length > 0);
return this.props.changeset.trailerPersons.filter(p => p.trailerType === "Co-authored-by").length > 0;
}
renderCoAuthors() {
const { t } = this.props;
return <>{t("changeset.author.prefix")}</>;
}
withExtensionPoint(child: any) {
const { t } = this.props;
return (
<>
{t("changeset.author.prefix")} {child}
{this.checkIfCoAuthorsExists() ? this.renderCoAuthors() : null}
<ExtensionPoint
name="changesets.author.suffix"
props={{

View File

@@ -34,6 +34,7 @@ export type Changeset = Collection & {
mail?: string;
};
description: string;
trailerPersons: TrailerPerson[];
_links: Links;
_embedded: {
tags?: Tag[];
@@ -42,6 +43,12 @@ export type Changeset = Collection & {
};
};
export type TrailerPerson = {
name: string;
mail: string;
trailerType: string;
};
export type ParentChangeset = {
id: string;
_links: Links;