Commit 4a95ba1e authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'eread/migrate-tooltip-time-track-comparison' into 'master'

Migrate time tracking tooltip

See merge request gitlab-org/gitlab!44871
parents c8f2d31e 14ec10ad
<script> <script>
import { GlProgressBar } from '@gitlab/ui'; import { GlProgressBar, GlTooltipDirective } from '@gitlab/ui';
import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility'; import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';
import tooltip from '../../../vue_shared/directives/tooltip';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
export default { export default {
...@@ -10,7 +9,7 @@ export default { ...@@ -10,7 +9,7 @@ export default {
GlProgressBar, GlProgressBar,
}, },
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
props: { props: {
timeSpent: { timeSpent: {
...@@ -73,7 +72,7 @@ export default { ...@@ -73,7 +72,7 @@ export default {
<template> <template>
<div class="time-tracking-comparison-pane"> <div class="time-tracking-comparison-pane">
<div <div
v-tooltip v-gl-tooltip
:title="timeRemainingTooltip" :title="timeRemainingTooltip"
:class="timeRemainingStatusClass" :class="timeRemainingStatusClass"
class="compare-meter" class="compare-meter"
......
...@@ -229,7 +229,7 @@ RSpec.describe 'Issue Boards', :js do ...@@ -229,7 +229,7 @@ RSpec.describe 'Issue Boards', :js do
end end
context 'time tracking' do context 'time tracking' do
let(:compare_meter_tooltip) { find('.time-tracking .time-tracking-content .compare-meter')['data-original-title'] } let(:compare_meter_tooltip) { find('.time-tracking .time-tracking-content .compare-meter')['title'] }
before do before do
issue2.timelogs.create(time_spent: 14400, user: user) issue2.timelogs.create(time_spent: 14400, user: user)
......
...@@ -155,8 +155,7 @@ describe('Issuable Time Tracker', () => { ...@@ -155,8 +155,7 @@ describe('Issuable Time Tracker', () => {
it('should show the correct tooltip text', done => { it('should show the correct tooltip text', done => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.showComparisonState).toBe(true); expect(vm.showComparisonState).toBe(true);
const $title = vm.$el.querySelector('.time-tracking-content .compare-meter').dataset const $title = vm.$el.querySelector('.time-tracking-content .compare-meter').title;
.originalTitle;
expect($title).toBe('Time remaining: 26h 23m'); expect($title).toBe('Time remaining: 26h 23m');
done(); done();
......
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