From 50181499bf21d8cc691896fe446e7435ad627be2 Mon Sep 17 00:00:00 2001 From: winh Date: Tue, 9 May 2017 12:33:24 +0200 Subject: Link to commit author user page from pipelines (!11100) --- .../vue_shared/components/pipelines_table_row.js | 15 +++++++-------- changelogs/unreleased/winh-pipeline-author-link.yml | 4 ++++ 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 changelogs/unreleased/winh-pipeline-author-link.yml diff --git a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js index fbae85c85f6..7ac7ceaa4e5 100644 --- a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js +++ b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js @@ -62,10 +62,12 @@ export default { commitAuthor() { let commitAuthorInformation; + if (!this.pipeline || !this.pipeline.commit) { + return null; + } + // 1. person who is an author of a commit might be a GitLab user - if (this.pipeline && - this.pipeline.commit && - this.pipeline.commit.author) { + if (this.pipeline.commit.author) { // 2. if person who is an author of a commit is a GitLab user // he/she can have a GitLab avatar if (this.pipeline.commit.author.avatar_url) { @@ -77,11 +79,8 @@ export default { avatar_url: this.pipeline.commit.author_gravatar_url, }); } - } - - // 4. If committer is not a GitLab User he/she can have a Gravatar - if (this.pipeline && - this.pipeline.commit) { + // 4. If committer is not a GitLab User he/she can have a Gravatar + } else { commitAuthorInformation = { avatar_url: this.pipeline.commit.author_gravatar_url, web_url: `mailto:${this.pipeline.commit.author_email}`, diff --git a/changelogs/unreleased/winh-pipeline-author-link.yml b/changelogs/unreleased/winh-pipeline-author-link.yml new file mode 100644 index 00000000000..1b903d1e357 --- /dev/null +++ b/changelogs/unreleased/winh-pipeline-author-link.yml @@ -0,0 +1,4 @@ +--- +title: Link to commit author user page from pipelines +merge_request: 11100 +author: -- cgit v1.2.1