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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 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 { __ } from '~/locale';
2018-11-07 17:20:17 +00:00
export default {
i18n: {
timeEstimate: __('Time estimate'),
},
2018-11-07 17:20:17 +00:00
components: {
GlIcon,
2018-11-07 17:20:17 +00:00
GlTooltip,
},
inject: ['timeTrackingLimitToHours'],
2018-11-07 17:20:17 +00:00
props: {
estimate: {
type: Number,
required: true,
},
},
computed: {
title() {
return stringifyTime(
parseSeconds(this.estimate, { limitToHours: this.timeTrackingLimitToHours }),
true,
);
2018-11-07 17:20:17 +00:00
},
timeEstimate() {
return stringifyTime(
parseSeconds(this.estimate, { limitToHours: this.timeTrackingLimitToHours }),
);
2018-11-07 17:20:17 +00:00
},
},
};
</script>
<template>
<span>
<span ref="issueTimeEstimate" class="board-card-info gl-mr-3 gl-text-secondary gl-cursor-help">
<gl-icon name="hourglass" class="board-card-info-icon gl-mr-2" />
<time class="board-card-info-text">{{ timeEstimate }}</time>
2018-11-07 17:20:17 +00:00
</span>
<gl-tooltip
:target="() => $refs.issueTimeEstimate"
placement="bottom"
data-testid="issue-time-estimate"
2018-11-07 17:20:17 +00:00
>
<span class="gl-font-weight-bold gl-display-block">{{ $options.i18n.timeEstimate }}</span>
{{ title }}
2018-11-07 17:20:17 +00:00
</gl-tooltip>
</span>
</template>