Commit dd4ec063 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'fl-reduce-tech-debt' into 'master'

Removes unused imports and prettifies code

See merge request gitlab-org/gitlab-ce!19888
parents 59a2123d 4d61850c
/* eslint-disable new-cap, comma-dangle, no-new */
import $ from 'jquery'; import $ from 'jquery';
import Vue from 'vue'; import Vue from 'vue';
import Flash from '../flash'; import createFlash from '../flash';
import initIssuableSidebar from '../init_issuable_sidebar'; import initIssuableSidebar from '../init_issuable_sidebar';
import './merge_conflict_store'; import './merge_conflict_store';
import MergeConflictsService from './merge_conflict_service'; import MergeConflictsService from './merge_conflict_service';
import './mixins/line_conflict_utils';
import './mixins/line_conflict_actions';
import './components/diff_file_editor'; import './components/diff_file_editor';
import './components/inline_conflict_lines'; import './components/inline_conflict_lines';
import './components/parallel_conflict_lines'; import './components/parallel_conflict_lines';
...@@ -19,7 +15,7 @@ export default function initMergeConflicts() { ...@@ -19,7 +15,7 @@ export default function initMergeConflicts() {
const mergeConflictsStore = gl.mergeConflicts.mergeConflictsStore; const mergeConflictsStore = gl.mergeConflicts.mergeConflictsStore;
const mergeConflictsService = new MergeConflictsService({ const mergeConflictsService = new MergeConflictsService({
conflictsPath: conflictsEl.dataset.conflictsPath, conflictsPath: conflictsEl.dataset.conflictsPath,
resolveConflictsPath: conflictsEl.dataset.resolveConflictsPath resolveConflictsPath: conflictsEl.dataset.resolveConflictsPath,
}); });
initIssuableSidebar(); initIssuableSidebar();
...@@ -29,17 +25,26 @@ export default function initMergeConflicts() { ...@@ -29,17 +25,26 @@ export default function initMergeConflicts() {
components: { components: {
'diff-file-editor': gl.mergeConflicts.diffFileEditor, 'diff-file-editor': gl.mergeConflicts.diffFileEditor,
'inline-conflict-lines': gl.mergeConflicts.inlineConflictLines, 'inline-conflict-lines': gl.mergeConflicts.inlineConflictLines,
'parallel-conflict-lines': gl.mergeConflicts.parallelConflictLines 'parallel-conflict-lines': gl.mergeConflicts.parallelConflictLines,
}, },
data: mergeConflictsStore.state, data: mergeConflictsStore.state,
computed: { computed: {
conflictsCountText() { return mergeConflictsStore.getConflictsCountText(); }, conflictsCountText() {
readyToCommit() { return mergeConflictsStore.isReadyToCommit(); }, return mergeConflictsStore.getConflictsCountText();
commitButtonText() { return mergeConflictsStore.getCommitButtonText(); }, },
showDiffViewTypeSwitcher() { return mergeConflictsStore.fileTextTypePresent(); } readyToCommit() {
return mergeConflictsStore.isReadyToCommit();
},
commitButtonText() {
return mergeConflictsStore.getCommitButtonText();
},
showDiffViewTypeSwitcher() {
return mergeConflictsStore.fileTextTypePresent();
},
}, },
created() { created() {
mergeConflictsService.fetchConflictsData() mergeConflictsService
.fetchConflictsData()
.then(({ data }) => { .then(({ data }) => {
if (data.type === 'error') { if (data.type === 'error') {
mergeConflictsStore.setFailedRequest(data.message); mergeConflictsStore.setFailedRequest(data.message);
...@@ -87,9 +92,9 @@ export default function initMergeConflicts() { ...@@ -87,9 +92,9 @@ export default function initMergeConflicts() {
}) })
.catch(() => { .catch(() => {
mergeConflictsStore.setSubmitState(false); mergeConflictsStore.setSubmitState(false);
new Flash('Failed to save merge conflicts resolutions. Please try again!'); createFlash('Failed to save merge conflicts resolutions. Please try again!');
}); });
} },
} },
}); });
} }
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