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
2edc507b
Commit
2edc507b
authored
May 16, 2021
by
Lee Tickett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Observe limit to hours setting in timelog report
Changelog: added
parent
f7a0dae4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
app/assets/javascripts/sidebar/components/time_tracking/report.vue
...s/javascripts/sidebar/components/time_tracking/report.vue
+11
-1
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
...scripts/sidebar/components/time_tracking/time_tracker.vue
+1
-1
changelogs/unreleased/330845-observe-limit-to-hours.yml
changelogs/unreleased/330845-observe-limit-to-hours.yml
+5
-0
spec/frontend/sidebar/components/time_tracking/report_spec.js
.../frontend/sidebar/components/time_tracking/report_spec.js
+29
-1
No files found.
app/assets/javascripts/sidebar/components/time_tracking/report.vue
View file @
2edc507b
...
...
@@ -14,6 +14,13 @@ export default {
GlTable
,
},
inject
:
[
'
issuableId
'
,
'
issuableType
'
],
props
:
{
limitToHours
:
{
type
:
Boolean
,
default
:
false
,
required
:
false
,
},
},
data
()
{
return
{
report
:
[],
isLoading
:
true
};
},
...
...
@@ -60,7 +67,10 @@ export default {
},
formatTimeSpent
(
seconds
)
{
const
negative
=
seconds
<
0
;
return
(
negative
?
'
-
'
:
''
)
+
stringifyTime
(
parseSeconds
(
seconds
));
return
(
(
negative
?
'
-
'
:
''
)
+
stringifyTime
(
parseSeconds
(
seconds
,
{
limitToHours
:
this
.
limitToHours
}))
);
},
},
fields
:
[
...
...
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
View file @
2edc507b
...
...
@@ -180,7 +180,7 @@ export default {
:title=
"__('Time tracking report')"
:hide-footer=
"true"
>
<time-tracking-report
/>
<time-tracking-report
:limit-to-hours=
"limitToHours"
/>
</gl-modal>
<transition
name=
"help-state-toggle"
>
<time-tracking-help-state
v-if=
"showHelpState"
/>
...
...
changelogs/unreleased/330845-observe-limit-to-hours.yml
0 → 100644
View file @
2edc507b
---
title
:
Observe limit to hours setting in timelog report
merge_request
:
61849
author
:
Lee Tickett @leetickett
type
:
added
spec/frontend/sidebar/components/time_tracking/report_spec.js
View file @
2edc507b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
getAllByRole
}
from
'
@testing-library/dom
'
;
import
{
getAllByRole
,
getByRole
}
from
'
@testing-library/dom
'
;
import
{
shallowMount
,
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
...
@@ -25,6 +25,7 @@ describe('Issuable Time Tracking Report', () => {
queryHandler
=
successIssueQueryHandler
,
issuableType
=
'
issue
'
,
mountFunction
=
shallowMount
,
limitToHours
=
false
,
}
=
{})
=>
{
fakeApollo
=
createMockApollo
([
[
getIssueTimelogsQuery
,
queryHandler
],
...
...
@@ -35,6 +36,7 @@ describe('Issuable Time Tracking Report', () => {
issuableId
:
1
,
issuableType
,
},
propsData
:
{
limitToHours
},
localVue
,
apolloProvider
:
fakeApollo
,
});
...
...
@@ -94,4 +96,30 @@ describe('Issuable Time Tracking Report', () => {
expect
(
getAllByRole
(
wrapper
.
element
,
'
row
'
,
{
name
:
/Administrator/i
})).
toHaveLength
(
3
);
});
});
describe
(
'
observes `limit display of time tracking units to hours` setting
'
,
()
=>
{
describe
(
'
when false
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
({
limitToHours
:
false
,
mountFunction
:
mount
});
});
it
(
'
renders correct results
'
,
async
()
=>
{
await
waitForPromises
();
expect
(
getByRole
(
wrapper
.
element
,
'
columnheader
'
,
{
name
:
/1d 30m/i
})).
not
.
toBeNull
();
});
});
describe
(
'
when true
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
({
limitToHours
:
true
,
mountFunction
:
mount
});
});
it
(
'
renders correct results
'
,
async
()
=>
{
await
waitForPromises
();
expect
(
getByRole
(
wrapper
.
element
,
'
columnheader
'
,
{
name
:
/8h 30m/i
})).
not
.
toBeNull
();
});
});
});
});
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