From 9bcb655610575956a858ae6fdb1d00deef5f6ad8 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 8 Jan 2021 18:10:43 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/helpers/commits_helper.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/helpers/commits_helper.rb') diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 02d48386e31..e6e2b5b128b 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -110,8 +110,16 @@ module CommitsHelper end end - def revert_commit_link(commit, continue_to_path, btn_class: nil, has_tooltip: true) - commit_action_link('revert', commit, continue_to_path, btn_class: btn_class, has_tooltip: has_tooltip) + def revert_commit_link(commit, continue_to_path, btn_class: nil, pajamas: false) + return unless current_user + + action = 'revert' + + if pajamas && can_collaborate_with_project?(@project) + tag(:div, data: { display_text: action.capitalize }, class: "js-revert-commit-trigger") + else + commit_action_link(action, commit, continue_to_path, btn_class: btn_class, has_tooltip: false) + end end def cherry_pick_commit_link(commit, continue_to_path, btn_class: nil, has_tooltip: true) -- cgit v1.2.1