2017-03-17 13:21:25 -04:00
|
|
|
import Vue from 'vue';
|
2021-12-10 22:13:45 -05:00
|
|
|
import { initIssuableSidebar } from '~/issuable';
|
2021-02-25 01:10:51 -05:00
|
|
|
import MergeConflictsResolverApp from './merge_conflict_resolver_app.vue';
|
2021-03-17 17:11:29 -04:00
|
|
|
import { createStore } from './store';
|
2016-09-28 06:12:13 -04:00
|
|
|
|
2018-02-27 17:53:49 -05:00
|
|
|
export default function initMergeConflicts() {
|
2016-10-05 21:49:43 -04:00
|
|
|
const conflictsEl = document.querySelector('#conflicts');
|
2016-09-28 06:12:13 -04:00
|
|
|
|
2021-03-17 17:11:29 -04:00
|
|
|
const {
|
|
|
|
sourceBranchPath,
|
|
|
|
mergeRequestPath,
|
|
|
|
conflictsPath,
|
|
|
|
resolveConflictsPath,
|
|
|
|
} = conflictsEl.dataset;
|
2021-02-25 01:10:51 -05:00
|
|
|
|
2017-07-26 06:13:35 -04:00
|
|
|
initIssuableSidebar();
|
|
|
|
|
2021-03-17 17:11:29 -04:00
|
|
|
const store = createStore();
|
|
|
|
|
2021-02-25 01:10:51 -05:00
|
|
|
return new Vue({
|
|
|
|
el: conflictsEl,
|
2021-03-17 17:11:29 -04:00
|
|
|
store,
|
2021-02-25 01:10:51 -05:00
|
|
|
provide: {
|
|
|
|
sourceBranchPath,
|
|
|
|
mergeRequestPath,
|
2021-03-17 17:11:29 -04:00
|
|
|
resolveConflictsPath,
|
2016-09-28 06:12:13 -04:00
|
|
|
},
|
|
|
|
created() {
|
2021-03-17 17:11:29 -04:00
|
|
|
store.dispatch('fetchConflictsData', conflictsPath);
|
2018-06-15 05:30:07 -04:00
|
|
|
},
|
2021-02-25 01:10:51 -05:00
|
|
|
render(createElement) {
|
|
|
|
return createElement(MergeConflictsResolverApp);
|
|
|
|
},
|
2017-01-10 17:54:56 -05:00
|
|
|
});
|
2018-02-27 17:53:49 -05:00
|
|
|
}
|