debian-mirror-gitlab/app/assets/javascripts/sidebar/mount_milestone_sidebar.js

30 lines
734 B
JavaScript
Raw Normal View History

2018-03-27 19:54:05 +05:30
import Vue from 'vue';
import timeTracker from './components/time_tracking/time_tracker.vue';
export default class SidebarMilestone {
constructor() {
const el = document.getElementById('issuable-time-tracker');
if (!el) return;
2018-12-05 23:21:45 +05:30
const { timeEstimate, timeSpent, humanTimeEstimate, humanTimeSpent } = el.dataset;
2018-03-27 19:54:05 +05:30
// eslint-disable-next-line no-new
new Vue({
el,
components: {
timeTracker,
},
render: createElement => createElement('timeTracker', {
props: {
2018-12-05 23:21:45 +05:30
timeEstimate: parseInt(timeEstimate, 10),
timeSpent: parseInt(timeSpent, 10),
humanTimeEstimate,
humanTimeSpent,
2018-03-27 19:54:05 +05:30
rootPath: '/',
},
}),
});
}
}