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
b8208723
Commit
b8208723
authored
Jul 28, 2021
by
Lee Tickett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timelog summary to time tracking report
Changelog: added
parent
0902a6f8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
8 deletions
+25
-8
app/assets/javascripts/graphql_shared/fragments/issuable_timelogs.fragment.graphql
...aphql_shared/fragments/issuable_timelogs.fragment.graphql
+1
-0
app/assets/javascripts/sidebar/components/time_tracking/report.vue
...s/javascripts/sidebar/components/time_tracking/report.vue
+5
-5
app/graphql/types/timelog_type.rb
app/graphql/types/timelog_type.rb
+4
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/sidebar/components/time_tracking/mock_data.js
spec/frontend/sidebar/components/time_tracking/mock_data.js
+8
-2
spec/frontend/sidebar/components/time_tracking/report_spec.js
.../frontend/sidebar/components/time_tracking/report_spec.js
+2
-0
spec/graphql/types/timelog_type_spec.rb
spec/graphql/types/timelog_type_spec.rb
+1
-1
No files found.
app/assets/javascripts/graphql_shared/fragments/issuable_timelogs.fragment.graphql
View file @
b8208723
...
...
@@ -7,4 +7,5 @@ fragment TimelogFragment on Timelog {
note
{
body
}
summary
}
app/assets/javascripts/sidebar/components/time_tracking/report.vue
View file @
b8208723
...
...
@@ -62,8 +62,8 @@ export default {
formatDate
(
date
)
{
return
formatDate
(
date
,
TIME_DATE_FORMAT
);
},
get
Note
(
note
)
{
return
note
?.
body
;
get
Summary
(
summary
,
note
)
{
return
summary
??
note
?.
body
;
},
getTotalTimeSpent
()
{
const
seconds
=
this
.
report
.
reduce
((
acc
,
item
)
=>
acc
+
item
.
timeSpent
,
0
);
...
...
@@ -81,7 +81,7 @@ export default {
{
key
:
'
spentAt
'
,
label
:
__
(
'
Spent At
'
),
sortable
:
true
},
{
key
:
'
user
'
,
label
:
__
(
'
User
'
),
sortable
:
true
},
{
key
:
'
timeSpent
'
,
label
:
__
(
'
Time Spent
'
),
sortable
:
true
},
{
key
:
'
note
'
,
label
:
__
(
'
Note
'
),
sortable
:
true
},
{
key
:
'
summary
'
,
label
:
__
(
'
Summary /
Note
'
),
sortable
:
true
},
],
};
</
script
>
...
...
@@ -107,8 +107,8 @@ export default {
<div>
{{
getTotalTimeSpent
()
}}
</div>
</
template
>
<
template
#cell(
note)=
"{ item: {
note } }"
>
<div>
{{
get
Note
(
note
)
}}
</div>
<
template
#cell(
summary)=
"{ item: { summary,
note } }"
>
<div>
{{
get
Summary
(
summary
,
note
)
}}
</div>
</
template
>
<
template
#foot
(
note
)
>
</
template
>
</gl-table>
...
...
app/graphql/types/timelog_type.rb
View file @
b8208723
...
...
@@ -36,6 +36,10 @@ module Types
null:
true
,
description:
'The note where the quick action to add the logged time was executed.'
field
:summary
,
GraphQL
::
Types
::
String
,
null:
true
,
description:
'The summary of how the time was spent.'
def
user
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
User
,
object
.
user_id
).
find
end
...
...
doc/api/graphql/reference/index.md
View file @
b8208723
...
...
@@ -13381,6 +13381,7 @@ Represents a historically accurate report about the timebox.
|
<a
id=
"timelogmergerequest"
></a>
`mergeRequest`
|
[
`MergeRequest`
](
#mergerequest
)
| The merge request that logged time was added to. |
|
<a
id=
"timelognote"
></a>
`note`
|
[
`Note`
](
#note
)
| The note where the quick action to add the logged time was executed. |
|
<a
id=
"timelogspentat"
></a>
`spentAt`
|
[
`Time`
](
#time
)
| Timestamp of when the time tracked was spent at. |
|
<a
id=
"timelogsummary"
></a>
`summary`
|
[
`String`
](
#string
)
| The summary of how the time was spent. |
|
<a
id=
"timelogtimespent"
></a>
`timeSpent`
|
[
`Int!`
](
#int
)
| The time spent displayed in seconds. |
|
<a
id=
"timeloguser"
></a>
`user`
|
[
`UserCore!`
](
#usercore
)
| The user that logged the time. |
...
...
locale/gitlab.pot
View file @
b8208723
...
...
@@ -31788,6 +31788,9 @@ msgstr ""
msgid "Summary"
msgstr ""
msgid "Summary / Note"
msgstr ""
msgid "Sunday"
msgstr ""
...
...
spec/frontend/sidebar/components/time_tracking/mock_data.js
View file @
b8208723
...
...
@@ -16,9 +16,10 @@ export const getIssueTimelogsQueryResponse = {
},
spentAt
:
'
2020-05-01T00:00:00Z
'
,
note
:
{
body
:
'
I paired with @root on this last week.
'
,
body
:
'
A note
'
,
__typename
:
'
Note
'
,
},
summary
:
'
A summary
'
,
},
{
__typename
:
'
Timelog
'
,
...
...
@@ -29,6 +30,7 @@ export const getIssueTimelogsQueryResponse = {
},
spentAt
:
'
2021-05-07T13:19:01Z
'
,
note
:
null
,
summary
:
'
A summary
'
,
},
{
__typename
:
'
Timelog
'
,
...
...
@@ -39,9 +41,10 @@ export const getIssueTimelogsQueryResponse = {
},
spentAt
:
'
2021-05-01T00:00:00Z
'
,
note
:
{
body
:
'
I did some work on this last week.
'
,
body
:
'
A note
'
,
__typename
:
'
Note
'
,
},
summary
:
null
,
},
],
__typename
:
'
TimelogConnection
'
,
...
...
@@ -70,6 +73,7 @@ export const getMrTimelogsQueryResponse = {
body
:
'
Thirty minutes!
'
,
__typename
:
'
Note
'
,
},
summary
:
null
,
},
{
__typename
:
'
Timelog
'
,
...
...
@@ -80,6 +84,7 @@ export const getMrTimelogsQueryResponse = {
},
spentAt
:
'
2021-05-07T14:44:39Z
'
,
note
:
null
,
summary
:
null
,
},
{
__typename
:
'
Timelog
'
,
...
...
@@ -93,6 +98,7 @@ export const getMrTimelogsQueryResponse = {
body
:
'
A note with some time
'
,
__typename
:
'
Note
'
,
},
summary
:
null
,
},
],
__typename
:
'
TimelogConnection
'
,
...
...
spec/frontend/sidebar/components/time_tracking/report_spec.js
View file @
b8208723
...
...
@@ -74,6 +74,8 @@ describe('Issuable Time Tracking Report', () => {
expect
(
getAllByRole
(
wrapper
.
element
,
'
row
'
,
{
name
:
/John Doe18/i
})).
toHaveLength
(
1
);
expect
(
getAllByRole
(
wrapper
.
element
,
'
row
'
,
{
name
:
/Administrator/i
})).
toHaveLength
(
2
);
expect
(
getAllByRole
(
wrapper
.
element
,
'
row
'
,
{
name
:
/A note/i
})).
toHaveLength
(
1
);
expect
(
getAllByRole
(
wrapper
.
element
,
'
row
'
,
{
name
:
/A summary/i
})).
toHaveLength
(
2
);
});
});
...
...
spec/graphql/types/timelog_type_spec.rb
View file @
b8208723
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'Timelog'
]
do
let
(
:fields
)
{
%i[spent_at time_spent user issue merge_request note]
}
let
(
:fields
)
{
%i[spent_at time_spent user issue merge_request note
summary
]
}
it
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'Timelog'
)
}
it
{
expect
(
described_class
).
to
have_graphql_fields
(
fields
)
}
...
...
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