2019-10-28 14:06:15 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import ContributorsGraphs from './components/contributors.vue';
|
2021-04-09 20:09:11 -04:00
|
|
|
import { createStore } from './stores';
|
2019-10-28 14:06:15 -04:00
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.querySelector('.js-contributors-graph');
|
|
|
|
|
|
|
|
if (!el) return null;
|
|
|
|
|
2021-04-09 20:09:11 -04:00
|
|
|
const { projectGraphPath, projectBranch, defaultBranch } = el.dataset;
|
|
|
|
const store = createStore(defaultBranch);
|
|
|
|
|
2019-10-28 14:06:15 -04:00
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
store,
|
|
|
|
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(ContributorsGraphs, {
|
|
|
|
props: {
|
2021-04-09 20:09:11 -04:00
|
|
|
endpoint: projectGraphPath,
|
|
|
|
branch: projectBranch,
|
2019-10-28 14:06:15 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|