Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ff284318
Commit
ff284318
authored
May 21, 2021
by
Natalia Tepluhina
Committed by
Nicolò Maria Mezzopera
May 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Time tracking report is bugged on GraphQL boards"
parent
a64a5c04
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
87 additions
and
23 deletions
+87
-23
app/assets/javascripts/boards/components/sidebar/board_sidebar_time_tracker.vue
.../boards/components/sidebar/board_sidebar_time_tracker.vue
+1
-0
app/assets/javascripts/sidebar/components/time_tracking/report.vue
...s/javascripts/sidebar/components/time_tracking/report.vue
+5
-1
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue
...idebar/components/time_tracking/sidebar_time_tracking.vue
+7
-0
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
...scripts/sidebar/components/time_tracking/time_tracker.vue
+30
-15
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
+13
-1
app/assets/javascripts/sidebar/mount_sidebar.js
app/assets/javascripts/sidebar/mount_sidebar.js
+7
-2
app/views/shared/boards/components/sidebar/_time_tracker.html.haml
.../shared/boards/components/sidebar/_time_tracker.html.haml
+1
-0
app/views/shared/milestones/_sidebar.html.haml
app/views/shared/milestones/_sidebar.html.haml
+1
-0
changelogs/unreleased/331420-time-tracking-report-is-bugged-on-graphql-boards.yml
...1420-time-tracking-report-is-bugged-on-graphql-boards.yml
+5
-0
spec/frontend/boards/components/sidebar/board_sidebar_time_tracker_spec.js
...rds/components/sidebar/board_sidebar_time_tracker_spec.js
+2
-0
spec/frontend/sidebar/components/time_tracking/report_spec.js
.../frontend/sidebar/components/time_tracking/report_spec.js
+1
-1
spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js
...end/sidebar/components/time_tracking/time_tracker_spec.js
+14
-3
No files found.
app/assets/javascripts/boards/components/sidebar/board_sidebar_time_tracker.vue
View file @
ff284318
...
@@ -15,6 +15,7 @@ export default {
...
@@ -15,6 +15,7 @@ export default {
<
template
>
<
template
>
<issuable-time-tracker
<issuable-time-tracker
:issuable-id=
"activeBoardItem.id.toString()"
:time-estimate=
"activeBoardItem.timeEstimate"
:time-estimate=
"activeBoardItem.timeEstimate"
:time-spent=
"activeBoardItem.totalTimeSpent"
:time-spent=
"activeBoardItem.totalTimeSpent"
:human-time-estimate=
"activeBoardItem.humanTimeEstimate"
:human-time-estimate=
"activeBoardItem.humanTimeEstimate"
...
...
app/assets/javascripts/sidebar/components/time_tracking/report.vue
View file @
ff284318
...
@@ -13,13 +13,17 @@ export default {
...
@@ -13,13 +13,17 @@ export default {
GlLoadingIcon
,
GlLoadingIcon
,
GlTable
,
GlTable
,
},
},
inject
:
[
'
issuable
Id
'
,
'
issuable
Type
'
],
inject
:
[
'
issuableType
'
],
props
:
{
props
:
{
limitToHours
:
{
limitToHours
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
required
:
false
,
required
:
false
,
},
},
issuableId
:
{
type
:
String
,
required
:
true
,
},
},
},
data
()
{
data
()
{
return
{
report
:
[],
isLoading
:
true
};
return
{
report
:
[],
isLoading
:
true
};
...
...
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue
View file @
ff284318
...
@@ -13,6 +13,12 @@ export default {
...
@@ -13,6 +13,12 @@ export default {
components
:
{
components
:
{
IssuableTimeTracker
,
IssuableTimeTracker
,
},
},
props
:
{
issuableId
:
{
type
:
String
,
required
:
true
,
},
},
data
()
{
data
()
{
return
{
return
{
mediator
:
new
Mediator
(),
mediator
:
new
Mediator
(),
...
@@ -51,6 +57,7 @@ export default {
...
@@ -51,6 +57,7 @@ export default {
<
template
>
<
template
>
<div
class=
"block"
>
<div
class=
"block"
>
<issuable-time-tracker
<issuable-time-tracker
:issuable-id=
"issuableId"
:time-estimate=
"store.timeEstimate"
:time-estimate=
"store.timeEstimate"
:time-spent=
"store.totalTimeSpent"
:time-spent=
"store.totalTimeSpent"
:human-time-estimate=
"store.humanTimeEstimate"
:human-time-estimate=
"store.humanTimeEstimate"
...
...
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
View file @
ff284318
<
script
>
<
script
>
import
{
GlIcon
,
GlLink
,
GlModal
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlLink
,
GlModal
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
eventHub
from
'
../../event_hub
'
;
import
eventHub
from
'
../../event_hub
'
;
import
TimeTrackingCollapsedState
from
'
./collapsed_state.vue
'
;
import
TimeTrackingCollapsedState
from
'
./collapsed_state.vue
'
;
...
@@ -27,6 +28,7 @@ export default {
...
@@ -27,6 +28,7 @@ export default {
directives
:
{
directives
:
{
GlModal
:
GlModalDirective
,
GlModal
:
GlModalDirective
,
},
},
inject
:
[
'
issuableType
'
],
props
:
{
props
:
{
timeEstimate
:
{
timeEstimate
:
{
type
:
Number
,
type
:
Number
,
...
@@ -51,6 +53,11 @@ export default {
...
@@ -51,6 +53,11 @@ export default {
default
:
false
,
default
:
false
,
required
:
false
,
required
:
false
,
},
},
issuableId
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
/*
/*
In issue list, "time-tracking-collapsed-state" is always rendered even if the sidebar isn't collapsed.
In issue list, "time-tracking-collapsed-state" is always rendered even if the sidebar isn't collapsed.
The actual hiding is controlled with css classes:
The actual hiding is controlled with css classes:
...
@@ -94,6 +101,12 @@ export default {
...
@@ -94,6 +101,12 @@ export default {
showHelpState
()
{
showHelpState
()
{
return
Boolean
(
this
.
showHelp
);
return
Boolean
(
this
.
showHelp
);
},
},
isTimeReportSupported
()
{
return
(
[
IssuableType
.
Issue
,
IssuableType
.
MergeRequest
].
includes
(
this
.
issuableType
)
&&
this
.
issuableId
);
},
},
},
created
()
{
created
()
{
eventHub
.
$on
(
'
timeTracker:updateData
'
,
this
.
update
);
eventHub
.
$on
(
'
timeTracker:updateData
'
,
this
.
update
);
...
@@ -167,6 +180,7 @@ export default {
...
@@ -167,6 +180,7 @@ export default {
:time-estimate-human-readable=
"humanTimeEstimate"
:time-estimate-human-readable=
"humanTimeEstimate"
:limit-to-hours=
"limitToHours"
:limit-to-hours=
"limitToHours"
/>
/>
<template
v-if=
"isTimeReportSupported"
>
<gl-link
<gl-link
v-if=
"hasTimeSpent"
v-if=
"hasTimeSpent"
v-gl-modal=
"'time-tracking-report'"
v-gl-modal=
"'time-tracking-report'"
...
@@ -180,8 +194,9 @@ export default {
...
@@ -180,8 +194,9 @@ export default {
:title=
"__('Time tracking report')"
:title=
"__('Time tracking report')"
:hide-footer=
"true"
:hide-footer=
"true"
>
>
<time-tracking-report
:limit-to-hours=
"limitToHours
"
/>
<time-tracking-report
:limit-to-hours=
"limitToHours"
:issuable-id=
"issuableId
"
/>
</gl-modal>
</gl-modal>
</
template
>
<transition
name=
"help-state-toggle"
>
<transition
name=
"help-state-toggle"
>
<time-tracking-help-state
v-if=
"showHelpState"
/>
<time-tracking-help-state
v-if=
"showHelpState"
/>
</transition>
</transition>
...
...
app/assets/javascripts/sidebar/mount_milestone_sidebar.js
View file @
ff284318
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
IssuableType
}
from
'
~/issue_show/constants
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
timeTracker
from
'
./components/time_tracking/time_tracker.vue
'
;
import
timeTracker
from
'
./components/time_tracking/time_tracker.vue
'
;
...
@@ -8,7 +9,14 @@ export default class SidebarMilestone {
...
@@ -8,7 +9,14 @@ export default class SidebarMilestone {
if
(
!
el
)
return
;
if
(
!
el
)
return
;
const
{
timeEstimate
,
timeSpent
,
humanTimeEstimate
,
humanTimeSpent
,
limitToHours
}
=
el
.
dataset
;
const
{
timeEstimate
,
timeSpent
,
humanTimeEstimate
,
humanTimeSpent
,
limitToHours
,
id
,
}
=
el
.
dataset
;
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
Vue
({
new
Vue
({
...
@@ -16,6 +24,9 @@ export default class SidebarMilestone {
...
@@ -16,6 +24,9 @@ export default class SidebarMilestone {
components
:
{
components
:
{
timeTracker
,
timeTracker
,
},
},
provide
:
{
issuableType
:
IssuableType
.
Milestone
,
},
render
:
(
createElement
)
=>
render
:
(
createElement
)
=>
createElement
(
'
timeTracker
'
,
{
createElement
(
'
timeTracker
'
,
{
props
:
{
props
:
{
...
@@ -24,6 +35,7 @@ export default class SidebarMilestone {
...
@@ -24,6 +35,7 @@ export default class SidebarMilestone {
humanTimeEstimate
,
humanTimeEstimate
,
humanTimeSpent
,
humanTimeSpent
,
limitToHours
:
parseBoolean
(
limitToHours
),
limitToHours
:
parseBoolean
(
limitToHours
),
issuableId
:
id
.
toString
(),
},
},
}),
}),
});
});
...
...
app/assets/javascripts/sidebar/mount_sidebar.js
View file @
ff284318
...
@@ -383,8 +383,13 @@ function mountTimeTrackingComponent() {
...
@@ -383,8 +383,13 @@ function mountTimeTrackingComponent() {
new
Vue
({
new
Vue
({
el
,
el
,
apolloProvider
,
apolloProvider
,
provide
:
{
issuableId
:
id
,
issuableType
},
provide
:
{
issuableType
},
render
:
(
createElement
)
=>
createElement
(
SidebarTimeTracking
,
{}),
render
:
(
createElement
)
=>
createElement
(
SidebarTimeTracking
,
{
props
:
{
issuableId
:
id
.
toString
(),
},
}),
});
});
}
}
...
...
app/views/shared/boards/components/sidebar/_time_tracker.html.haml
View file @
ff284318
...
@@ -4,4 +4,5 @@
...
@@ -4,4 +4,5 @@
":human-time-estimate"
=>
"issue.humanTimeEstimate"
,
":human-time-estimate"
=>
"issue.humanTimeEstimate"
,
":human-time-spent"
=>
"issue.humanTimeSpent"
,
":human-time-spent"
=>
"issue.humanTimeSpent"
,
":limit-to-hours"
=>
"timeTrackingLimitToHours"
,
":limit-to-hours"
=>
"timeTrackingLimitToHours"
,
":issuable-id"
=>
"issue.id"
,
"root-path"
=>
"#{root_url}"
}
"root-path"
=>
"#{root_url}"
}
app/views/shared/milestones/_sidebar.html.haml
View file @
ff284318
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
time_spent:
@milestone
.
total_time_spent
,
time_spent:
@milestone
.
total_time_spent
,
human_time_estimate:
@milestone
.
human_total_time_estimate
,
human_time_estimate:
@milestone
.
human_total_time_estimate
,
human_time_spent:
@milestone
.
human_total_time_spent
,
human_time_spent:
@milestone
.
human_total_time_spent
,
id:
@milestone
.
id
,
limit_to_hours:
Gitlab
::
CurrentSettings
.
time_tracking_limit_to_hours
.
to_s
}
}
limit_to_hours:
Gitlab
::
CurrentSettings
.
time_tracking_limit_to_hours
.
to_s
}
}
=
render_if_exists
'shared/milestones/weight'
,
milestone:
milestone
=
render_if_exists
'shared/milestones/weight'
,
milestone:
milestone
...
...
changelogs/unreleased/331420-time-tracking-report-is-bugged-on-graphql-boards.yml
0 → 100644
View file @
ff284318
---
title
:
Resolve Time tracking report is bugged on GraphQL boards
merge_request
:
62109
author
:
type
:
fixed
spec/frontend/boards/components/sidebar/board_sidebar_time_tracker_spec.js
View file @
ff284318
...
@@ -26,6 +26,7 @@ describe('BoardSidebarTimeTracker', () => {
...
@@ -26,6 +26,7 @@ describe('BoardSidebarTimeTracker', () => {
store
=
createStore
();
store
=
createStore
();
store
.
state
.
boardItems
=
{
store
.
state
.
boardItems
=
{
1
:
{
1
:
{
id
:
1
,
timeEstimate
:
3600
,
timeEstimate
:
3600
,
totalTimeSpent
:
1800
,
totalTimeSpent
:
1800
,
humanTimeEstimate
:
'
1h
'
,
humanTimeEstimate
:
'
1h
'
,
...
@@ -52,6 +53,7 @@ describe('BoardSidebarTimeTracker', () => {
...
@@ -52,6 +53,7 @@ describe('BoardSidebarTimeTracker', () => {
humanTimeSpent
:
'
30min
'
,
humanTimeSpent
:
'
30min
'
,
limitToHours
:
timeTrackingLimitToHours
,
limitToHours
:
timeTrackingLimitToHours
,
showCollapsed
:
false
,
showCollapsed
:
false
,
issuableId
:
'
1
'
,
});
});
},
},
);
);
...
...
spec/frontend/sidebar/components/time_tracking/report_spec.js
View file @
ff284318
...
@@ -36,7 +36,7 @@ describe('Issuable Time Tracking Report', () => {
...
@@ -36,7 +36,7 @@ describe('Issuable Time Tracking Report', () => {
issuableId
:
1
,
issuableId
:
1
,
issuableType
,
issuableType
,
},
},
propsData
:
{
limitToHours
},
propsData
:
{
limitToHours
,
issuableId
:
'
1
'
},
localVue
,
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
});
});
...
...
spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js
View file @
ff284318
...
@@ -18,15 +18,19 @@ describe('Issuable Time Tracker', () => {
...
@@ -18,15 +18,19 @@ describe('Issuable Time Tracker', () => {
humanTimeEstimate
:
'
2h 46m
'
,
humanTimeEstimate
:
'
2h 46m
'
,
humanTimeSpent
:
'
1h 23m
'
,
humanTimeSpent
:
'
1h 23m
'
,
limitToHours
:
false
,
limitToHours
:
false
,
issuableId
:
'
1
'
,
};
};
const
mountComponent
=
({
props
=
{}
}
=
{})
=>
const
mountComponent
=
({
props
=
{}
,
issuableType
=
'
issue
'
}
=
{})
=>
mount
(
TimeTracker
,
{
mount
(
TimeTracker
,
{
propsData
:
{
...
defaultProps
,
...
props
},
propsData
:
{
...
defaultProps
,
...
props
},
directives
:
{
GlTooltip
:
createMockDirective
()
},
directives
:
{
GlTooltip
:
createMockDirective
()
},
stubs
:
{
stubs
:
{
transition
:
stubTransition
(),
transition
:
stubTransition
(),
},
},
provide
:
{
issuableType
,
},
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -210,13 +214,20 @@ describe('Issuable Time Tracker', () => {
...
@@ -210,13 +214,20 @@ describe('Issuable Time Tracker', () => {
});
});
describe
(
'
When time spent
'
,
()
=>
{
describe
(
'
When time spent
'
,
()
=>
{
beforeEach
(
()
=>
{
it
(
'
link should appear on issue
'
,
()
=>
{
wrapper
=
mountComponent
();
wrapper
=
mountComponent
();
expect
(
findReportLink
().
exists
()).
toBe
(
true
);
});
});
it
(
'
link should appear
'
,
()
=>
{
it
(
'
link should appear on merge request
'
,
()
=>
{
wrapper
=
mountComponent
({
issuableType
:
'
merge_request
'
});
expect
(
findReportLink
().
exists
()).
toBe
(
true
);
expect
(
findReportLink
().
exists
()).
toBe
(
true
);
});
});
it
(
'
link should not appear on milestone
'
,
()
=>
{
wrapper
=
mountComponent
({
issuableType
:
'
milestone
'
});
expect
(
findReportLink
().
exists
()).
toBe
(
false
);
});
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment