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

32 lines
856 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';
2019-09-30 21:07:59 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2018-03-27 19:54:05 +05:30
export default class SidebarMilestone {
constructor() {
const el = document.getElementById('issuable-time-tracker');
if (!el) return;
2019-09-30 21:07:59 +05:30
const { timeEstimate, timeSpent, humanTimeEstimate, humanTimeSpent, limitToHours } = el.dataset;
2018-12-05 23:21:45 +05:30
2018-03-27 19:54:05 +05:30
// eslint-disable-next-line no-new
new Vue({
el,
components: {
timeTracker,
},
2018-12-13 13:39:08 +05:30
render: createElement =>
createElement('timeTracker', {
props: {
timeEstimate: parseInt(timeEstimate, 10),
timeSpent: parseInt(timeSpent, 10),
humanTimeEstimate,
humanTimeSpent,
2019-09-30 21:07:59 +05:30
limitToHours: parseBoolean(limitToHours),
2018-12-13 13:39:08 +05:30
},
}),
2018-03-27 19:54:05 +05:30
});
}
}