debian-mirror-gitlab/app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
2021-04-29 21:17:54 +05:30

35 lines
820 B
JavaScript

import Vue from 'vue';
import initIssuableSidebar from '../init_issuable_sidebar';
import MergeConflictsResolverApp from './merge_conflict_resolver_app.vue';
import { createStore } from './store';
export default function initMergeConflicts() {
const conflictsEl = document.querySelector('#conflicts');
const {
sourceBranchPath,
mergeRequestPath,
conflictsPath,
resolveConflictsPath,
} = conflictsEl.dataset;
initIssuableSidebar();
const store = createStore();
return new Vue({
el: conflictsEl,
store,
provide: {
sourceBranchPath,
mergeRequestPath,
resolveConflictsPath,
},
created() {
store.dispatch('fetchConflictsData', conflictsPath);
},
render(createElement) {
return createElement(MergeConflictsResolverApp);
},
});
}