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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
5316d1cf
Commit
5316d1cf
authored
Jan 26, 2017
by
Pedro Moreira da Silva
Committed by
Oswaldo Ferreira
Feb 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove noteable object in time tracking system notes [ci-skip]
parent
ed834c9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
app/services/system_note_service.rb
app/services/system_note_service.rb
+8
-8
No files found.
app/services/system_note_service.rb
View file @
5316d1cf
...
@@ -118,18 +118,18 @@ module SystemNoteService
...
@@ -118,18 +118,18 @@ module SystemNoteService
#
#
# Example Note text:
# Example Note text:
#
#
# "removed time estimate
on this issue
"
# "removed time estimate"
#
#
# "changed time estimate
of this issue
to 3d 5h"
# "changed time estimate to 3d 5h"
#
#
# Returns the created Note object
# Returns the created Note object
def
change_time_estimate
(
noteable
,
project
,
author
)
def
change_time_estimate
(
noteable
,
project
,
author
)
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
noteable
.
time_estimate
)
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
noteable
.
time_estimate
)
body
=
if
noteable
.
time_estimate
==
0
body
=
if
noteable
.
time_estimate
==
0
"removed time estimate
on this
#{
noteable
.
human_class_name
}
"
"removed time estimate"
else
else
"changed time estimate
of this
#{
noteable
.
human_class_name
}
to
#{
parsed_time
}
"
"changed time estimate to
#{
parsed_time
}
"
end
end
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
...
@@ -144,9 +144,9 @@ module SystemNoteService
...
@@ -144,9 +144,9 @@ module SystemNoteService
#
#
# Example Note text:
# Example Note text:
#
#
# "removed time spent
on this issue
"
# "removed time spent"
#
#
# "added 2h 30m of time spent
on this issue
"
# "added 2h 30m of time spent"
#
#
# Returns the created Note object
# Returns the created Note object
...
@@ -154,11 +154,11 @@ module SystemNoteService
...
@@ -154,11 +154,11 @@ module SystemNoteService
time_spent
=
noteable
.
time_spent
time_spent
=
noteable
.
time_spent
if
time_spent
==
:reset
if
time_spent
==
:reset
body
=
"removed time spent
on this
#{
noteable
.
human_class_name
}
"
body
=
"removed time spent"
else
else
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
time_spent
.
abs
)
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
time_spent
.
abs
)
action
=
time_spent
>
0
?
'added'
:
'subtracted'
action
=
time_spent
>
0
?
'added'
:
'subtracted'
body
=
"
#{
action
}
#{
parsed_time
}
of time spent
on this
#{
noteable
.
human_class_name
}
"
body
=
"
#{
action
}
#{
parsed_time
}
of time spent"
end
end
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
...
...
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