debian-mirror-gitlab/app/assets/javascripts/boards/components/issue_time_estimate.vue

53 lines
1.2 KiB
Vue
Raw Normal View History

2018-12-13 13:39:08 +05:30
<script>
2020-11-24 15:15:51 +05:30
import { GlTooltip, GlIcon } from '@gitlab/ui';
2018-12-13 13:39:08 +05:30
import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';
2021-03-11 19:13:27 +05:30
import { __ } from '~/locale';
2018-12-13 13:39:08 +05:30
export default {
2021-03-08 18:12:59 +05:30
i18n: {
timeEstimate: __('Time estimate'),
},
2018-12-13 13:39:08 +05:30
components: {
2020-11-24 15:15:51 +05:30
GlIcon,
2018-12-13 13:39:08 +05:30
GlTooltip,
},
2021-03-08 18:12:59 +05:30
inject: ['timeTrackingLimitToHours'],
2018-12-13 13:39:08 +05:30
props: {
estimate: {
type: Number,
required: true,
},
},
computed: {
title() {
2021-03-08 18:12:59 +05:30
return stringifyTime(
parseSeconds(this.estimate, { limitToHours: this.timeTrackingLimitToHours }),
true,
);
2018-12-13 13:39:08 +05:30
},
timeEstimate() {
2021-03-08 18:12:59 +05:30
return stringifyTime(
parseSeconds(this.estimate, { limitToHours: this.timeTrackingLimitToHours }),
);
2018-12-13 13:39:08 +05:30
},
},
};
</script>
<template>
<span>
2019-02-15 15:39:39 +05:30
<span ref="issueTimeEstimate" class="board-card-info card-number">
2021-04-17 20:07:23 +05:30
<gl-icon name="hourglass" class="board-card-info-icon gl-mr-2" />
2021-03-08 18:12:59 +05:30
<time class="board-card-info-text">{{ timeEstimate }}</time>
2018-12-13 13:39:08 +05:30
</span>
<gl-tooltip
:target="() => $refs.issueTimeEstimate"
placement="bottom"
class="js-issue-time-estimate"
>
2021-03-08 18:12:59 +05:30
<span class="gl-font-weight-bold gl-display-block">{{ $options.i18n.timeEstimate }}</span>
{{ title }}
2018-12-13 13:39:08 +05:30
</gl-tooltip>
</span>
</template>