Commit 50181499 authored by winh's avatar winh

Link to commit author user page from pipelines (!11100)

parent b1645ab9
...@@ -62,10 +62,12 @@ export default { ...@@ -62,10 +62,12 @@ export default {
commitAuthor() { commitAuthor() {
let commitAuthorInformation; let commitAuthorInformation;
if (!this.pipeline || !this.pipeline.commit) {
return null;
}
// 1. person who is an author of a commit might be a GitLab user // 1. person who is an author of a commit might be a GitLab user
if (this.pipeline && if (this.pipeline.commit.author) {
this.pipeline.commit &&
this.pipeline.commit.author) {
// 2. if person who is an author of a commit is a GitLab user // 2. if person who is an author of a commit is a GitLab user
// he/she can have a GitLab avatar // he/she can have a GitLab avatar
if (this.pipeline.commit.author.avatar_url) { if (this.pipeline.commit.author.avatar_url) {
...@@ -77,11 +79,8 @@ export default { ...@@ -77,11 +79,8 @@ export default {
avatar_url: this.pipeline.commit.author_gravatar_url, avatar_url: this.pipeline.commit.author_gravatar_url,
}); });
} }
} // 4. If committer is not a GitLab User he/she can have a Gravatar
} else {
// 4. If committer is not a GitLab User he/she can have a Gravatar
if (this.pipeline &&
this.pipeline.commit) {
commitAuthorInformation = { commitAuthorInformation = {
avatar_url: this.pipeline.commit.author_gravatar_url, avatar_url: this.pipeline.commit.author_gravatar_url,
web_url: `mailto:${this.pipeline.commit.author_email}`, web_url: `mailto:${this.pipeline.commit.author_email}`,
......
---
title: Link to commit author user page from pipelines
merge_request: 11100
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment