diff options
Diffstat (limited to 'app/helpers/merge_requests_helper.rb')
-rw-r--r-- | app/helpers/merge_requests_helper.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 4581da4a063..45ded6e35d8 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -256,6 +256,26 @@ module MergeRequestsHelper def moved_mr_sidebar_enabled? Feature.enabled?(:moved_mr_sidebar, @project) && defined?(@merge_request) end + + def sticky_header_data + data = { + iid: @merge_request.iid, + projectPath: @project.full_path, + title: markdown_field(@merge_request, :title), + isFluidLayout: fluid_layout.to_s, + tabs: [ + ['show', _('Overview'), project_merge_request_path(@project, @merge_request), @merge_request.related_notes.user.count], + ['commits', _('Commits'), commits_project_merge_request_path(@project, @merge_request), @commits_count], + ['diffs', _('Changes'), diffs_project_merge_request_path(@project, @merge_request), @diffs_count] + ] + } + + if @project.builds_enabled? + data[:tabs].insert(2, ['pipelines', _('Pipelines'), pipelines_project_merge_request_path(@project, @merge_request), @number_of_pipelines]) + end + + data + end end MergeRequestsHelper.prepend_mod_with('MergeRequestsHelper') |