diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /lib/gitlab/url_builder.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'lib/gitlab/url_builder.rb')
-rw-r--r-- | lib/gitlab/url_builder.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb index ce59e10241e..f98c488bbe5 100644 --- a/lib/gitlab/url_builder.rb +++ b/lib/gitlab/url_builder.rb @@ -18,6 +18,8 @@ module Gitlab def build(object, **options) # Objects are sometimes wrapped in a BatchLoader instance case object.itself + when Board + board_url(object, **options) when ::Ci::Build instance.project_job_url(object.project, object, **options) when Commit @@ -52,6 +54,14 @@ module Gitlab end # rubocop:enable Metrics/CyclomaticComplexity + def board_url(board, **options) + if board.project_board? + instance.project_board_url(board.resource_parent, board, **options) + else + instance.group_board_url(board.resource_parent, board, **options) + end + end + def commit_url(commit, **options) return '' unless commit.project |