diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-07-01 15:26:02 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-07-01 15:26:02 +0000 |
commit | 80e09ed0105343c90f3dac77aa7e297a294f3f5e (patch) | |
tree | f0f493e2171cf684c62d669fd559148dbb210ca5 /app/views | |
parent | d0d66799da181225e63d0c81d0a8389d1d45f177 (diff) | |
parent | 12413158fddf093e9b2cc8d00d66f8c6833a260c (diff) | |
download | gitlab-ce-80e09ed0105343c90f3dac77aa7e297a294f3f5e.tar.gz |
Merge branch 'divergence-graph-api-call' into 'master'
Fetch branches divergence graph data through API call
Closes #46139
See merge request gitlab-org/gitlab-ce!30068
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/branches/index.html.haml | 1 |
2 files changed, 3 insertions, 6 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index f97b259f8f2..dbff2115f50 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -1,11 +1,7 @@ - merged = local_assigns.fetch(:merged, false) - commit = @repository.commit(branch.dereferenced_target) -- diverging_commit_counts = Branches::DivergingCommitCountsService.new(@repository).call(branch) -- number_commits_distance = diverging_commit_counts[:distance] -- number_commits_behind = diverging_commit_counts[:behind] -- number_commits_ahead = diverging_commit_counts[:ahead] - merge_project = merge_request_source_project_for_project(@project) -%li{ class: "branch-item js-branch-#{branch.name}" } +%li{ class: "branch-item js-branch-item js-branch-#{branch.name}", data: { name: branch.name } } .branch-info .branch-title = sprite_icon('fork', size: 12) @@ -30,7 +26,7 @@ = s_('Branches|Cant find HEAD commit for this branch') - if branch.name != @repository.root_ref - .js-branch-divergence-graph{ data: { distance: number_commits_distance, ahead_count: number_commits_ahead, behind_count: number_commits_behind, default_branch: @repository.root_ref, max_commits: @max_commits } } + .js-branch-divergence-graph .controls.d-none.d-md-block< - if merge_project && create_mr_button?(@repository.root_ref, branch.name) diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index d270e461ac8..11340d12423 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -47,6 +47,7 @@ = render_if_exists 'projects/commits/mirror_status' + .js-branch-list{ data: { diverging_counts_endpoint: diverging_commit_counts_namespace_project_branches_path(@project.namespace, @project, format: :json) } } - if can?(current_user, :admin_project, @project) - project_settings_link = link_to s_('Branches|project settings'), project_protected_branches_path(@project) .row-content-block |