debian-mirror-gitlab/app/assets/javascripts/contributors/index.js

27 lines
599 B
JavaScript
Raw Normal View History

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;
2021-04-29 21:17:54 +05:30
const { projectGraphPath, projectBranch, defaultBranch } = el.dataset;
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,
2019-12-26 22:10:19 +05:30
},
});
},
});
};