diff options
author | Simon Knox <psimyn@gmail.com> | 2018-03-06 15:36:32 +1100 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2018-03-06 15:36:32 +1100 |
commit | c7ff05ff7d402084baf356ac2b56a8d26ddbc6ed (patch) | |
tree | 7ba5652494d4c93c0f6ff882e043aa549b9e49d2 | |
parent | 7ae760a164514ab18455842a1dc4041a55de1bcf (diff) | |
download | gitlab-ce-c7ff05ff7d402084baf356ac2b56a8d26ddbc6ed.tar.gz |
better display of placeholder and error message
3 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/behaviors/toggler_behavior.js b/app/assets/javascripts/behaviors/toggler_behavior.js index 4c48a5bcd64..0650540038b 100644 --- a/app/assets/javascripts/behaviors/toggler_behavior.js +++ b/app/assets/javascripts/behaviors/toggler_behavior.js @@ -54,8 +54,12 @@ $(() => { renderDiffContent($container, data); }) .catch(() => { - $container.find('.line_content').html( - $(`<div>${__('Unable to load the diff. Try refreshing the page')}</div>`), + $container.find('.diff-content').html( + $(` + <div class="nothing-here-block"> + ${__('Unable to load the diff')} <a href="${url}">Try again</a>? + </div> + `), ); }); } diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index 6f6948b78e3..e9589213f80 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -8,7 +8,7 @@ .discussion.js-toggle-container{ data: { discussion_id: discussion.id } } .discussion-header .discussion-actions - %button.note-action-button.discussion-toggle-button.js-toggle-button.js-toggle-lazy-diff{ type: "button" } + %button.note-action-button.discussion-toggle-button.js-toggle-button{ type: "button", class: ("js-toggle-lazy-diff" unless expanded) } - if expanded = icon("chevron-up") - else diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index 3e83a549682..b4ad4b64d8e 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -108,6 +108,7 @@ describe 'Merge request > User resolves diff notes and discussions', :js do it 'shows resolved discussion when toggled' do find(".timeline-content .discussion[data-discussion-id='#{note.discussion_id}'] .discussion-toggle-button").click + expect(page.find(".line-holder-placeholder")).to be_visible expect(page.find(".timeline-content #note_#{note.id}")).to be_visible end end |