diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/helpers/diff_helper.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r-- | app/helpers/diff_helper.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 40d7eab584c..ca5fe38576e 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -183,9 +183,9 @@ module DiffHelper def diff_file_changed_icon_color(diff_file) if diff_file.deleted_file? - "cred" + "danger" elsif diff_file.new_file? - "cgreen" + "success" end end @@ -248,6 +248,23 @@ module DiffHelper toggle_whitespace_link(url, options) end + def diff_files_data(diff_files) + diffs_map = diff_files.map do |f| + { + href: "##{hexdigest(f.file_path)}", + title: f.new_path, + name: f.file_path, + path: diff_file_path_text(f), + icon: diff_file_changed_icon(f), + iconColor: "#{diff_file_changed_icon_color(f)}", + added: f.added_lines, + removed: f.removed_lines + } + end + + diffs_map.to_json + end + def hide_whitespace? params[:w] == '1' end |