gitlab-org--gitlab-foss/app/assets/javascripts/boards/components/issue_time_estimate.vue

49 lines
1.2 KiB
Vue
Raw Normal View History

2018-11-07 17:20:17 +00:00
<script>
import { GlTooltip, GlIcon } from '@gitlab/ui';
2018-11-07 17:20:17 +00:00
import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';
import boardsStore from '../stores/boards_store';
2018-11-07 17:20:17 +00:00
export default {
components: {
GlIcon,
2018-11-07 17:20:17 +00:00
GlTooltip,
},
props: {
estimate: {
type: Number,
required: true,
},
},
data() {
return {
limitToHours: boardsStore.timeTracking.limitToHours,
};
},
2018-11-07 17:20:17 +00:00
computed: {
title() {
return stringifyTime(parseSeconds(this.estimate, { limitToHours: this.limitToHours }), true);
2018-11-07 17:20:17 +00:00
},
timeEstimate() {
return stringifyTime(parseSeconds(this.estimate, { limitToHours: this.limitToHours }));
2018-11-07 17:20:17 +00:00
},
},
};
</script>
<template>
<span>
2018-11-16 20:07:38 +00:00
<span ref="issueTimeEstimate" class="board-card-info card-number">
<gl-icon name="hourglass" class="board-card-info-icon" /><time class="board-card-info-text">{{
timeEstimate
}}</time>
2018-11-07 17:20:17 +00:00
</span>
<gl-tooltip
:target="() => $refs.issueTimeEstimate"
placement="bottom"
class="js-issue-time-estimate"
>
2018-11-16 20:07:38 +00:00
<span class="bold d-block">{{ __('Time estimate') }}</span> {{ title }}
2018-11-07 17:20:17 +00:00
</gl-tooltip>
</span>
</template>