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
ed834c9f
Commit
ed834c9f
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
Make all system notes lowercase
parent
999edc5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
app/services/system_note_service.rb
app/services/system_note_service.rb
+12
-8
No files found.
app/services/system_note_service.rb
View file @
ed834c9f
...
...
@@ -118,16 +118,18 @@ module SystemNoteService
#
# Example Note text:
#
# "Changed estimate of this issue to 3d 5h"
# "removed time estimate on this issue"
#
# "changed time estimate of this issue to 3d 5h"
#
# Returns the created Note object
def
change_time_estimate
(
noteable
,
project
,
author
)
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
noteable
.
time_estimate
)
body
=
if
noteable
.
time_estimate
==
0
"
R
emoved time estimate on this
#{
noteable
.
human_class_name
}
"
"
r
emoved time estimate on this
#{
noteable
.
human_class_name
}
"
else
"
C
hanged time estimate of this
#{
noteable
.
human_class_name
}
to
#{
parsed_time
}
"
"
c
hanged time estimate of this
#{
noteable
.
human_class_name
}
to
#{
parsed_time
}
"
end
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
...
...
@@ -142,7 +144,9 @@ module SystemNoteService
#
# Example Note text:
#
# "Added 2h 30m of time spent on this issue"
# "removed time spent on this issue"
#
# "added 2h 30m of time spent on this issue"
#
# Returns the created Note object
...
...
@@ -150,10 +154,10 @@ module SystemNoteService
time_spent
=
noteable
.
time_spent
if
time_spent
==
:reset
body
=
"
R
emoved time spent on this
#{
noteable
.
human_class_name
}
"
body
=
"
r
emoved time spent on this
#{
noteable
.
human_class_name
}
"
else
parsed_time
=
Gitlab
::
TimeTrackingFormatter
.
output
(
time_spent
.
abs
)
action
=
time_spent
>
0
?
'
Added'
:
'S
ubtracted'
action
=
time_spent
>
0
?
'
added'
:
's
ubtracted'
body
=
"
#{
action
}
#{
parsed_time
}
of time spent on this
#{
noteable
.
human_class_name
}
"
end
...
...
@@ -221,7 +225,7 @@ module SystemNoteService
end
def
discussion_continued_in_issue
(
discussion
,
project
,
author
,
issue
)
body
=
"
Add
ed
#{
issue
.
to_reference
}
to continue this discussion"
body
=
"
creat
ed
#{
issue
.
to_reference
}
to continue this discussion"
note_attributes
=
discussion
.
reply_attributes
.
merge
(
project:
project
,
author:
author
,
note:
body
)
note_attributes
[
:type
]
=
note_attributes
.
delete
(
:note_type
)
...
...
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