Commit a3859bf5 authored by Valery Sizov's avatar Valery Sizov

Resolved conflicts

parent fd0fd602
...@@ -16,32 +16,6 @@ const defaults = { ...@@ -16,32 +16,6 @@ const defaults = {
class BlobForkSuggestion { class BlobForkSuggestion {
constructor(options) { constructor(options) {
this.elementMap = Object.assign({}, defaults, options); this.elementMap = Object.assign({}, defaults, options);
<<<<<<< HEAD
this.onClickWrapper = this.onClick.bind(this);
document.addEventListener('click', this.onClickWrapper);
}
showSuggestionSection(forkPath, action = 'edit') {
[].forEach.call(this.elementMap.suggestionSections, (suggestionSection) => {
suggestionSection.classList.remove('hidden');
});
[].forEach.call(this.elementMap.forkButtons, (forkButton) => {
forkButton.setAttribute('href', forkPath);
});
[].forEach.call(this.elementMap.actionTextPieces, (actionTextPiece) => {
// eslint-disable-next-line no-param-reassign
actionTextPiece.textContent = action;
});
}
hideSuggestionSection() {
[].forEach.call(this.elementMap.suggestionSections, (suggestionSection) => {
suggestionSection.classList.add('hidden');
});
=======
this.onOpenButtonClick = this.onOpenButtonClick.bind(this); this.onOpenButtonClick = this.onOpenButtonClick.bind(this);
this.onCancelButtonClick = this.onCancelButtonClick.bind(this); this.onCancelButtonClick = this.onCancelButtonClick.bind(this);
} }
...@@ -80,7 +54,6 @@ class BlobForkSuggestion { ...@@ -80,7 +54,6 @@ class BlobForkSuggestion {
destroy() { destroy() {
$(this.elementMap.openButtons).off('click', this.onOpenButtonClick); $(this.elementMap.openButtons).off('click', this.onOpenButtonClick);
$(this.elementMap.cancelButtons).off('click', this.onCancelButtonClick); $(this.elementMap.cancelButtons).off('click', this.onCancelButtonClick);
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af
} }
onClick(e) { onClick(e) {
......
...@@ -103,12 +103,8 @@ const ShortcutsBlob = require('./shortcuts_blob'); ...@@ -103,12 +103,8 @@ const ShortcutsBlob = require('./shortcuts_blob');
cancelButtons: document.querySelectorAll('.js-cancel-fork-suggestion-button'), cancelButtons: document.querySelectorAll('.js-cancel-fork-suggestion-button'),
suggestionSections: document.querySelectorAll('.js-file-fork-suggestion-section'), suggestionSections: document.querySelectorAll('.js-file-fork-suggestion-section'),
actionTextPieces: document.querySelectorAll('.js-file-fork-suggestion-section-action'), actionTextPieces: document.querySelectorAll('.js-file-fork-suggestion-section-action'),
<<<<<<< HEAD
});
=======
}) })
.init(); .init();
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af
} }
switch (page) { switch (page) {
......
...@@ -18,13 +18,8 @@ feature 'Groups > Audit Events', js: true, feature: true do ...@@ -18,13 +18,8 @@ feature 'Groups > Audit Events', js: true, feature: true do
group_member = group.members.find_by(user_id: pete) group_member = group.members.find_by(user_id: pete)
page.within "#group_member_#{group_member.id}" do page.within "#group_member_#{group_member.id}" do
<<<<<<< HEAD:spec/features/groups/audit_events.rb
click_button('Developer')
click_link('Master')
=======
click_button 'Developer' click_button 'Developer'
click_link 'Master' click_link 'Master'
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af:spec/features/groups/audit_events_spec.rb
end end
# This is to avoid a Capybara::Poltergeist::MouseEventFailed error # This is to avoid a Capybara::Poltergeist::MouseEventFailed error
......
...@@ -46,13 +46,8 @@ feature 'Projects > Audit Events', js: true, feature: true do ...@@ -46,13 +46,8 @@ feature 'Projects > Audit Events', js: true, feature: true do
project_member = project.project_member(pete) project_member = project.project_member(pete)
page.within "#project_member_#{project_member.id}" do page.within "#project_member_#{project_member.id}" do
<<<<<<< HEAD:spec/features/projects/audit_events.rb
click_button('Developer')
click_link('Reporter')
=======
click_button 'Developer' click_button 'Developer'
click_link 'Master' click_link 'Master'
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af:spec/features/projects/audit_events_spec.rb
end end
# This is to avoid a Capybara::Poltergeist::MouseEventFailed error # This is to avoid a Capybara::Poltergeist::MouseEventFailed error
......
...@@ -3,22 +3,6 @@ import BlobForkSuggestion from '~/blob/blob_fork_suggestion'; ...@@ -3,22 +3,6 @@ import BlobForkSuggestion from '~/blob/blob_fork_suggestion';
describe('BlobForkSuggestion', () => { describe('BlobForkSuggestion', () => {
let blobForkSuggestion; let blobForkSuggestion;
<<<<<<< HEAD
const openButtons = [document.createElement('div')];
const forkButtons = [document.createElement('a')];
const cancelButtons = [document.createElement('div')];
const suggestionSections = [document.createElement('div')];
const actionTextPieces = [document.createElement('div')];
beforeEach(() => {
blobForkSuggestion = new BlobForkSuggestion({
openButtons,
forkButtons,
cancelButtons,
suggestionSections,
actionTextPieces,
});
=======
const openButton = document.createElement('div'); const openButton = document.createElement('div');
const forkButton = document.createElement('a'); const forkButton = document.createElement('a');
const cancelButton = document.createElement('div'); const cancelButton = document.createElement('div');
...@@ -34,7 +18,6 @@ describe('BlobForkSuggestion', () => { ...@@ -34,7 +18,6 @@ describe('BlobForkSuggestion', () => {
actionTextPieces: actionTextPiece, actionTextPieces: actionTextPiece,
}) })
.init(); .init();
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af
}); });
afterEach(() => { afterEach(() => {
...@@ -43,23 +26,13 @@ describe('BlobForkSuggestion', () => { ...@@ -43,23 +26,13 @@ describe('BlobForkSuggestion', () => {
it('showSuggestionSection', () => { it('showSuggestionSection', () => {
blobForkSuggestion.showSuggestionSection('/foo', 'foo'); blobForkSuggestion.showSuggestionSection('/foo', 'foo');
<<<<<<< HEAD
expect(suggestionSections[0].classList.contains('hidden')).toEqual(false);
expect(forkButtons[0].getAttribute('href')).toEqual('/foo');
expect(actionTextPieces[0].textContent).toEqual('foo');
=======
expect(suggestionSection.classList.contains('hidden')).toEqual(false); expect(suggestionSection.classList.contains('hidden')).toEqual(false);
expect(forkButton.getAttribute('href')).toEqual('/foo'); expect(forkButton.getAttribute('href')).toEqual('/foo');
expect(actionTextPiece.textContent).toEqual('foo'); expect(actionTextPiece.textContent).toEqual('foo');
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af
}); });
it('hideSuggestionSection', () => { it('hideSuggestionSection', () => {
blobForkSuggestion.hideSuggestionSection(); blobForkSuggestion.hideSuggestionSection();
<<<<<<< HEAD
expect(suggestionSections[0].classList.contains('hidden')).toEqual(true);
=======
expect(suggestionSection.classList.contains('hidden')).toEqual(true); expect(suggestionSection.classList.contains('hidden')).toEqual(true);
>>>>>>> 847790478f8d85607eacedcdb693cfcd25c415af
}); });
}); });
Markdown is supported
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