2019-07-07 11:18:12 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import RelatedMergeRequests from './components/related_merge_requests.vue';
|
|
|
|
import createStore from './store';
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
export function initRelatedMergeRequests() {
|
|
|
|
const el = document.querySelector('#js-related-merge-requests');
|
2019-07-07 11:18:12 +05:30
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
if (!el) {
|
|
|
|
return undefined;
|
2019-07-07 11:18:12 +05:30
|
|
|
}
|
2022-03-02 08:16:31 +05:30
|
|
|
|
|
|
|
const { endpoint, projectPath, projectNamespace } = el.dataset;
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
store: createStore(),
|
|
|
|
render: (createElement) =>
|
|
|
|
createElement(RelatedMergeRequests, {
|
|
|
|
props: { endpoint, projectNamespace, projectPath },
|
|
|
|
}),
|
|
|
|
});
|
2019-07-07 11:18:12 +05:30
|
|
|
}
|