Commit d49e840c authored by Eulyeon Ko's avatar Eulyeon Ko

Remove time tracking sub components

Both estimate_only_pane.vue and no_tracking_pane.vue
did not contain any logic in them and having them as
separate components add unnecessary overhead (of having
vue instances).

Rather than turning them into functional components,
(because their templates are tiny)
this commit inlines them in time_tracker.vue

Also changes text color for "No estimate or time spent"
to gl-text-gray-500.
parent 2298c1b2
<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>
<script>
export default {
name: 'TimeTrackingNoTrackingPane',
};
</script>
<template>
<div data-testid="noTrackingPane">
<span class="no-value">{{ __('No estimate or time spent') }}</span>
</div>
</template>
<script> <script>
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import { s__, __ } from '~/locale';
import TimeTrackingHelpState from './help_state.vue'; import TimeTrackingHelpState from './help_state.vue';
import TimeTrackingCollapsedState from './collapsed_state.vue'; import TimeTrackingCollapsedState from './collapsed_state.vue';
import TimeTrackingSpentOnlyPane from './spent_only_pane.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 TimeTrackingComparisonPane from './comparison_pane.vue';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
export default { export default {
name: 'IssuableTimeTracker', name: 'IssuableTimeTracker',
i18n: {
noTimeTrackingText: __('No estimate or time spent'),
estimatedOnlyText: s__('TimeTracking|Estimated:'),
},
components: { components: {
GlIcon, GlIcon,
TimeTrackingCollapsedState, TimeTrackingCollapsedState,
TimeTrackingEstimateOnlyPane,
TimeTrackingSpentOnlyPane, TimeTrackingSpentOnlyPane,
TimeTrackingNoTrackingPane,
TimeTrackingComparisonPane, TimeTrackingComparisonPane,
TimeTrackingHelpState, TimeTrackingHelpState,
}, },
...@@ -139,15 +140,17 @@ export default { ...@@ -139,15 +140,17 @@ export default {
</div> </div>
</div> </div>
<div class="time-tracking-content hide-collapsed"> <div class="time-tracking-content hide-collapsed">
<time-tracking-estimate-only-pane <div v-if="showEstimateOnlyState" data-testid="estimateOnlyPane">
v-if="showEstimateOnlyState" <span class="gl-font-weight-bold">{{ $options.i18n.estimatedOnlyText }} </span
:time-estimate-human-readable="humanTimeEstimate" >{{ humanTimeEstimate }}
/> </div>
<time-tracking-spent-only-pane <time-tracking-spent-only-pane
v-if="showSpentOnlyState" v-if="showSpentOnlyState"
:time-spent-human-readable="humanTimeSpent" :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 <time-tracking-comparison-pane
v-if="showComparisonState" v-if="showComparisonState"
:time-estimate="timeEstimate" :time-estimate="timeEstimate"
......
---
title: Fix text color for 'no estimate or time spent' message in time tracker component
merge_request: 50558
author:
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment