2018-03-27 19:54:05 +05:30
|
|
|
import Vue from 'vue';
|
2022-01-26 12:08:38 +05:30
|
|
|
import { IssuableType } from '~/issues/constants';
|
2019-09-30 21:07:59 +05:30
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2021-03-11 19:13:27 +05:30
|
|
|
import timeTracker from './components/time_tracking/time_tracker.vue';
|
2018-03-27 19:54:05 +05:30
|
|
|
|
|
|
|
export default class SidebarMilestone {
|
|
|
|
constructor() {
|
|
|
|
const el = document.getElementById('issuable-time-tracker');
|
|
|
|
|
|
|
|
if (!el) return;
|
|
|
|
|
2021-09-04 01:27:46 +05:30
|
|
|
const {
|
|
|
|
timeEstimate,
|
|
|
|
timeSpent,
|
|
|
|
humanTimeEstimate,
|
|
|
|
humanTimeSpent,
|
|
|
|
limitToHours,
|
|
|
|
iid,
|
|
|
|
} = 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,
|
2022-04-04 11:22:00 +05:30
|
|
|
name: 'SidebarMilestoneRoot',
|
2018-03-27 19:54:05 +05:30
|
|
|
components: {
|
|
|
|
timeTracker,
|
|
|
|
},
|
2021-09-04 01:27:46 +05:30
|
|
|
provide: {
|
|
|
|
issuableType: IssuableType.Milestone,
|
|
|
|
},
|
2021-03-08 18:12:59 +05:30
|
|
|
render: (createElement) =>
|
2018-12-13 13:39:08 +05:30
|
|
|
createElement('timeTracker', {
|
|
|
|
props: {
|
2019-09-30 21:07:59 +05:30
|
|
|
limitToHours: parseBoolean(limitToHours),
|
2021-09-04 01:27:46 +05:30
|
|
|
issuableIid: iid.toString(),
|
|
|
|
initialTimeTracking: {
|
|
|
|
timeEstimate: parseInt(timeEstimate, 10),
|
|
|
|
totalTimeSpent: parseInt(timeSpent, 10),
|
|
|
|
humanTimeEstimate,
|
|
|
|
humanTotalTimeSpent: humanTimeSpent,
|
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
}),
|
2018-03-27 19:54:05 +05:30
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|