Commit 1f72515b authored by Tim Zallmann's avatar Tim Zallmann
Browse files

Merge branch 'dispatcher-race-condition-fix' into 'master'

Fix race condition with dispatcher.js

See merge request !13377
......@@ -42,6 +42,10 @@
$components.each(function () {
const $this = $(this);
const noteId = $this.attr(':note-id');
const discussionId = $this.attr(':discussion-id');
if ($this.is('comment-and-resolve-btn') && !discussionId) return;
const tmp = Vue.extend({
template: $this.get(0).outerHTML
});
......
......@@ -644,7 +644,7 @@
return Dispatcher;
})();
$(function() {
$(window).on('load', function() {
new Dispatcher();
});
}).call(window);
......@@ -132,4 +132,6 @@
import './project_show';
import './project_variables';
import './projects_list';
import './syntax_highlight';
import './render_math';
import './render_gfm';
......@@ -135,5 +137,4 @@
import './render_gfm';
import './render_math';
import './right_sidebar';
import './search';
import './search_autocomplete';
......@@ -141,7 +142,6 @@
import './star';
import './subscription';
import './subscription_select';
import './syntax_highlight';
import './dispatcher';
......
......@@ -11,7 +11,5 @@
return this;
};
$(document).on('ready load', function() {
return $('body').renderGFM();
});
$(() => $('body').renderGFM());
}).call(window);
......@@ -2,7 +2,7 @@
def version_status_badge
if Rails.env.production? && current_application_settings.version_check_enabled
image_url = VersionCheck.new.url
image_tag image_url, class: 'js-version-status-badge', lazy: false
image_tag image_url, class: 'js-version-status-badge'
end
end
end
......@@ -4,8 +4,8 @@
= link_to 'Close merge request', merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, class: "btn btn-nr btn-comment btn-close close-mr-link js-note-target-close", title: "Close merge request", data: { original_text: "Close merge request", alternative_text: "Comment & close merge request"}
- if @merge_request.reopenable?
= link_to 'Reopen merge request', merge_request_path(@merge_request, merge_request: { state_event: :reopen }), method: :put, class: "btn btn-nr btn-comment btn-reopen reopen-mr-link js-note-target-close js-note-target-reopen", title: "Reopen merge request", data: { original_text: "Reopen merge request", alternative_text: "Comment & reopen merge request"}
%comment-and-resolve-btn{ "inline-template" => true, ":discussion-id" => "" }
%button.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button{ "v-if" => "showButton", type: "submit", data: { project_path: "#{project_path(@merge_request.project)}" } }
{{ buttonText }}
%comment-and-resolve-btn{ "inline-template" => true }
%button.btn.btn-nr.btn-default.append-right-10.js-comment-resolve-button{ "v-if" => "showButton", type: "submit", data: { project_path: "#{project_path(@merge_request.project)}" } }
{{ buttonText }}
#notes= render "shared/notes/notes_with_form", :autocomplete => true
......@@ -28,8 +28,7 @@
end
click_button 'Commit conflict resolution'
wait_for_requests
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
......@@ -32,7 +31,9 @@
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
wait_for_requests
click_on 'Changes'
wait_for_requests
......@@ -69,7 +70,7 @@
end
click_button 'Commit conflict resolution'
wait_for_requests
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
......@@ -73,6 +74,8 @@
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
wait_for_requests
click_on 'Changes'
wait_for_requests
......@@ -140,9 +143,8 @@
end
click_button 'Commit conflict resolution'
wait_for_requests
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
......@@ -144,8 +146,10 @@
expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff
wait_for_requests
click_on 'Changes'
wait_for_requests
click_link 'Expand all'
......
......@@ -23,7 +23,7 @@
end
it 'should have a js prefixed css class' do
expect(@image_tag).to match(/class="js-version-status-badge"/)
expect(@image_tag).to match(/class="js-version-status-badge lazy"/)
end
it 'should have a VersionCheck url as the src' do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment