summaryrefslogtreecommitdiff
path: root/app/views/projects/branches
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-06-24 14:40:18 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-06-24 14:40:18 +0000
commitf53b05cfde5aeac73a7c81a2fe951b5642338ae0 (patch)
tree4b6d41b4b4ef6acd7db04988615fdeffa6345e4b /app/views/projects/branches
parent108c3cf16bed5733ffae086fb62c226961356560 (diff)
parent039117deacf730286d6e1b0b6bc116d62c3b9c31 (diff)
downloadgitlab-ce-f53b05cfde5aeac73a7c81a2fe951b5642338ae0.tar.gz
Merge branch 'divergence-graph-fe-rendering' into 'master'
Render branch divergence graph with Vue See merge request gitlab-org/gitlab-ce!29743
Diffstat (limited to 'app/views/projects/branches')
-rw-r--r--app/views/projects/branches/_branch.html.haml19
1 files changed, 1 insertions, 18 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 33f449287b6..3638334d61c 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -1,6 +1,5 @@
- merged = local_assigns.fetch(:merged, false)
- commit = @repository.commit(branch.dereferenced_target)
-- bar_graph_width_factor = @max_commits > 0 ? 100.0/@max_commits : 0
- diverging_commit_counts = @repository.diverging_commit_counts(branch)
- number_commits_distance = diverging_commit_counts[:distance]
- number_commits_behind = diverging_commit_counts[:behind]
@@ -31,23 +30,7 @@
= s_('Branches|Cant find HEAD commit for this branch')
- if branch.name != @repository.root_ref
- - if number_commits_distance.nil?
- .divergence-graph.d-none.d-md-block{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind),
- default_branch: @repository.root_ref,
- number_commits_ahead: diverging_count_label(number_commits_ahead) } }
- .graph-side
- .bar.bar-behind{ style: "width: #{number_commits_behind * bar_graph_width_factor}%" }
- %span.count.count-behind= diverging_count_label(number_commits_behind)
- .graph-separator
- .graph-side
- .bar.bar-ahead{ style: "width: #{number_commits_ahead * bar_graph_width_factor}%" }
- %span.count.count-ahead= diverging_count_label(number_commits_ahead)
- - else
- .divergence-graph.d-none.d-md-block{ title: s_('More than %{number_commits_distance} commits different with %{default_branch}') % { number_commits_distance: diverging_count_label(number_commits_distance),
- default_branch: @repository.root_ref} }
- .graph-side.full
- .bar{ style: "width: #{number_commits_distance * bar_graph_width_factor}%" }
- %span.count= diverging_count_label(number_commits_distance)
+ .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 } }
.controls.d-none.d-md-block<
- if merge_project && create_mr_button?(@repository.root_ref, branch.name)