2019-12-26 22:10:19 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import ContributorsGraphs from './components/contributors.vue';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { createStore } from './stores';
|
2019-12-26 22:10:19 +05:30
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.querySelector('.js-contributors-graph');
|
|
|
|
|
|
|
|
if (!el) return null;
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
const { projectGraphPath, projectBranch, defaultBranch, projectId, commitsPath } = el.dataset;
|
2021-04-29 21:17:54 +05:30
|
|
|
const store = createStore(defaultBranch);
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
store,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(ContributorsGraphs, {
|
|
|
|
props: {
|
2021-04-29 21:17:54 +05:30
|
|
|
endpoint: projectGraphPath,
|
|
|
|
branch: projectBranch,
|
2023-04-23 21:23:45 +05:30
|
|
|
projectId,
|
|
|
|
commitsPath,
|
2019-12-26 22:10:19 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|