diff options
Diffstat (limited to 'app/assets/javascripts/sidebar/components/time_tracking')
4 files changed, 13 insertions, 39 deletions
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/estimate_only_pane.vue b/app/assets/javascripts/sidebar/components/time_tracking/estimate_only_pane.vue deleted file mode 100644 index 8a80b1bf13f..00000000000 --- a/app/assets/javascripts/sidebar/components/time_tracking/estimate_only_pane.vue +++ /dev/null @@ -1,18 +0,0 @@ -<script> -export default { - name: 'TimeTrackingEstimateOnlyPane', - props: { - timeEstimateHumanReadable: { - type: String, - required: true, - }, - }, -}; -</script> - -<template> - <div data-testid="estimateOnlyPane"> - <span class="gl-font-weight-bold">{{ s__('TimeTracking|Estimated:') }} </span - >{{ timeEstimateHumanReadable }} - </div> -</template> diff --git a/app/assets/javascripts/sidebar/components/time_tracking/no_tracking_pane.vue b/app/assets/javascripts/sidebar/components/time_tracking/no_tracking_pane.vue deleted file mode 100644 index 2d3d0ce8dc5..00000000000 --- a/app/assets/javascripts/sidebar/components/time_tracking/no_tracking_pane.vue +++ /dev/null @@ -1,11 +0,0 @@ -<script> -export default { - name: 'TimeTrackingNoTrackingPane', -}; -</script> - -<template> - <div data-testid="noTrackingPane"> - <span class="no-value">{{ __('No estimate or time spent') }}</span> - </div> -</template> diff --git a/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue b/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue index 6bef5ed67a4..26e0a0da860 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue @@ -27,7 +27,7 @@ export default { listenForQuickActions() { $(document).on('ajax:success', '.gfm-form', this.quickActionListened); - eventHub.$on('timeTrackingUpdated', data => { + eventHub.$on('timeTrackingUpdated', (data) => { this.quickActionListened({ detail: [data] }); }); }, diff --git a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue index 3199ed1e615..26b8e087512 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue @@ -1,22 +1,23 @@ <script> import { GlIcon } from '@gitlab/ui'; +import { s__, __ } from '~/locale'; import TimeTrackingHelpState from './help_state.vue'; import TimeTrackingCollapsedState from './collapsed_state.vue'; import TimeTrackingSpentOnlyPane from './spent_only_pane.vue'; -import TimeTrackingNoTrackingPane from './no_tracking_pane.vue'; -import TimeTrackingEstimateOnlyPane from './estimate_only_pane.vue'; import TimeTrackingComparisonPane from './comparison_pane.vue'; import eventHub from '../../event_hub'; export default { name: 'IssuableTimeTracker', + i18n: { + noTimeTrackingText: __('No estimate or time spent'), + estimatedOnlyText: s__('TimeTracking|Estimated:'), + }, components: { GlIcon, TimeTrackingCollapsedState, - TimeTrackingEstimateOnlyPane, TimeTrackingSpentOnlyPane, - TimeTrackingNoTrackingPane, TimeTrackingComparisonPane, TimeTrackingHelpState, }, @@ -139,15 +140,17 @@ export default { </div> </div> <div class="time-tracking-content hide-collapsed"> - <time-tracking-estimate-only-pane - v-if="showEstimateOnlyState" - :time-estimate-human-readable="humanTimeEstimate" - /> + <div v-if="showEstimateOnlyState" data-testid="estimateOnlyPane"> + <span class="gl-font-weight-bold">{{ $options.i18n.estimatedOnlyText }} </span + >{{ humanTimeEstimate }} + </div> <time-tracking-spent-only-pane v-if="showSpentOnlyState" :time-spent-human-readable="humanTimeSpent" /> - <time-tracking-no-tracking-pane v-if="showNoTimeTrackingState" /> + <div v-if="showNoTimeTrackingState" data-testid="noTrackingPane"> + <span class="gl-text-gray-500">{{ $options.i18n.noTimeTrackingText }}</span> + </div> <time-tracking-comparison-pane v-if="showComparisonState" :time-estimate="timeEstimate" |