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) { withExtensionPoint(child: any) {
const { t } = this.props; const { t } = this.props;
return ( return (
<> <>
{t("changeset.author.prefix")} {child} {t("changeset.author.prefix")} {child}
{this.checkIfCoAuthorsExists() ? this.renderCoAuthors() : null}
<ExtensionPoint <ExtensionPoint
name="changesets.author.suffix" name="changesets.author.suffix"
props={{ props={{

View File

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