summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-06-14 20:22:56 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-06-14 20:22:56 +0000
commitda6c3c4bcb733b235aa662a0d2cb7252053af3f7 (patch)
treee82f260eddf7a2d560855503dd92aacd9ba34b10
parent941cf7c3e794417e6a49c7d4dc3c7044b3051a81 (diff)
parentcf01719d6e5a511adae61cd10ef0f82228747c24 (diff)
downloadgitlab-ce-da6c3c4bcb733b235aa662a0d2cb7252053af3f7.tar.gz
Merge branch '47938-expand-diff' into 'master'
Resolve ""Click to expand" link in collapsed diffs should be blue" Closes #47938 See merge request gitlab-org/gitlab-ce!19867
-rw-r--r--app/assets/javascripts/single_file_diff.js2
-rw-r--r--app/assets/stylesheets/framework/blocks.scss1
-rw-r--r--app/views/projects/diffs/_collapsed.html.haml2
-rw-r--r--spec/features/projects/diffs/diff_show_spec.rb3
4 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js
index 1afff0dba38..ae27c676fa0 100644
--- a/app/assets/javascripts/single_file_diff.js
+++ b/app/assets/javascripts/single_file_diff.js
@@ -11,7 +11,7 @@ import syntaxHighlight from './syntax_highlight';
const WRAPPER = '<div class="diff-content"></div>';
const LOADING_HTML = '<i class="fa fa-spinner fa-spin"></i>';
const ERROR_HTML = '<div class="nothing-here-block"><i class="fa fa-warning"></i> Could not load diff</div>';
-const COLLAPSED_HTML = '<div class="nothing-here-block diff-collapsed">This diff is collapsed. <a class="click-to-expand">Click to expand it.</a></div>';
+const COLLAPSED_HTML = '<div class="nothing-here-block diff-collapsed">This diff is collapsed. <button class="click-to-expand btn btn-link">Click to expand it.</button></div>';
export default class SingleFileDiff {
constructor(file) {
diff --git a/app/assets/stylesheets/framework/blocks.scss b/app/assets/stylesheets/framework/blocks.scss
index c5be27f2d29..0de05548c68 100644
--- a/app/assets/stylesheets/framework/blocks.scss
+++ b/app/assets/stylesheets/framework/blocks.scss
@@ -16,6 +16,7 @@
.click-to-expand {
cursor: pointer;
+ vertical-align: initial;
}
}
}
diff --git a/app/views/projects/diffs/_collapsed.html.haml b/app/views/projects/diffs/_collapsed.html.haml
index 5762f4d86d7..9bd1255fe00 100644
--- a/app/views/projects/diffs/_collapsed.html.haml
+++ b/app/views/projects/diffs/_collapsed.html.haml
@@ -2,4 +2,4 @@
- url = url_for(safe_params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier))
.nothing-here-block.diff-collapsed{ data: { diff_for_path: url } }
This diff is collapsed.
- %a.click-to-expand Click to expand it.
+ %button.click-to-expand.btn.btn-link Click to expand it.
diff --git a/spec/features/projects/diffs/diff_show_spec.rb b/spec/features/projects/diffs/diff_show_spec.rb
index c1307ab640f..9bfcb1e816a 100644
--- a/spec/features/projects/diffs/diff_show_spec.rb
+++ b/spec/features/projects/diffs/diff_show_spec.rb
@@ -166,8 +166,7 @@ feature 'Diff file viewer', :js do
context 'expanding the diff' do
before do
- # We can't use `click_link` because the "link" doesn't have an `href`.
- find('a.click-to-expand').click
+ click_button 'Click to expand it.'
wait_for_requests
end