2017-08-17 22:00:37 +05:30
|
|
|
import Vue from 'vue';
|
2022-01-26 12:08:38 +05:30
|
|
|
import { initIssuableSidebar } from '~/issuable';
|
2021-04-17 20:07:23 +05:30
|
|
|
import MergeConflictsResolverApp from './merge_conflict_resolver_app.vue';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { createStore } from './store';
|
2016-11-03 12:29:30 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
export default function initMergeConflicts() {
|
2016-11-03 12:29:30 +05:30
|
|
|
const conflictsEl = document.querySelector('#conflicts');
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
const {
|
|
|
|
sourceBranchPath,
|
|
|
|
mergeRequestPath,
|
|
|
|
conflictsPath,
|
|
|
|
resolveConflictsPath,
|
|
|
|
} = conflictsEl.dataset;
|
2021-04-17 20:07:23 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
initIssuableSidebar();
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
const store = createStore();
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
return new Vue({
|
|
|
|
el: conflictsEl,
|
2021-04-29 21:17:54 +05:30
|
|
|
store,
|
2021-04-17 20:07:23 +05:30
|
|
|
provide: {
|
|
|
|
sourceBranchPath,
|
|
|
|
mergeRequestPath,
|
2021-04-29 21:17:54 +05:30
|
|
|
resolveConflictsPath,
|
2016-11-03 12:29:30 +05:30
|
|
|
},
|
|
|
|
created() {
|
2021-04-29 21:17:54 +05:30
|
|
|
store.dispatch('fetchConflictsData', conflictsPath);
|
2018-11-08 19:23:39 +05:30
|
|
|
},
|
2021-04-17 20:07:23 +05:30
|
|
|
render(createElement) {
|
|
|
|
return createElement(MergeConflictsResolverApp);
|
|
|
|
},
|
2017-08-17 22:00:37 +05:30
|
|
|
});
|
2018-03-27 19:54:05 +05:30
|
|
|
}
|