mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Added co-author to changeset
This commit is contained in:
committed by
René Pfeuffer
parent
e451bb618e
commit
a712c89f6a
@@ -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={{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user