diff options
author | Phil Hughes <me@iamphill.com> | 2018-09-13 17:04:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-09-13 17:04:31 +0300 |
commit | c4009e643d3f7297d4eb53477ee7b71e25ac01bd (patch) | |
tree | eb83fa593fe89d6b82cf6b8f7966bc53b3667f73 | |
parent | 3784a37086b6fcbc5baf1117c2d506f3c1237f77 (diff) | |
parent | 06025e4a26be528c3def72fb0ae9d68140b20860 (diff) |
Merge branch '7573-show-click-to-expand-on-not-rendered-diffs' into 'master'
Display click to expand on collapsed diffs
Closes #51466
See merge request gitlab-org/gitlab-ce!21716
3 files changed, 19 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 940e06a75cc..bcbe374a90c 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -44,7 +44,7 @@ export default { }, showExpandMessage() { return ( - !this.isCollapsed && + this.isCollapsed || !this.file.highlightedDiffLines && !this.isLoadingCollapsedDiff && !this.file.tooLarge && diff --git a/changelogs/unreleased/7573-show-click-to-expand-on-not-rendered-diffs.yml b/changelogs/unreleased/7573-show-click-to-expand-on-not-rendered-diffs.yml new file mode 100644 index 00000000000..4611a1f1f29 --- /dev/null +++ b/changelogs/unreleased/7573-show-click-to-expand-on-not-rendered-diffs.yml @@ -0,0 +1,6 @@ +--- +title: Fix absent Click to Expand link on diffs not rendered on first load of Merge + Requests Changes tab +merge_request: 21716 +author: +type: fixed diff --git a/spec/javascripts/diffs/components/diff_file_spec.js b/spec/javascripts/diffs/components/diff_file_spec.js index 845fef23db6..2a52cd2b179 100644 --- a/spec/javascripts/diffs/components/diff_file_spec.js +++ b/spec/javascripts/diffs/components/diff_file_spec.js @@ -63,6 +63,18 @@ describe('DiffFile', () => { }); }); + it('should have collapsed text and link even before rendered', done => { + vm.file.renderIt = false; + vm.file.collapsed = true; + + vm.$nextTick(() => { + expect(vm.$el.innerText).toContain('This diff is collapsed'); + expect(vm.$el.querySelectorAll('.js-click-to-expand').length).toEqual(1); + + done(); + }); + }); + it('should have loading icon while loading a collapsed diffs', done => { vm.file.collapsed = true; vm.isLoadingCollapsedDiff = true; |