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
Boxiang Sun
gitlab-ce
Commits
5f947856
Commit
5f947856
authored
Apr 05, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make issue-from-discussion description text more consistent
parent
9c4a06a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
app/services/issues/build_service.rb
app/services/issues/build_service.rb
+7
-4
No files found.
app/services/issues/build_service.rb
View file @
5f947856
...
...
@@ -35,14 +35,17 @@ module Issues
end
def
item_for_discussion
(
discussion
)
first_note
=
discussion
.
first_note_to_resolve
||
discussion
.
first_note
first_note
_to_resolve
=
discussion
.
first_note_to_resolve
||
discussion
.
first_note
other_note_count
=
discussion
.
notes
.
size
-
1
note_url
=
Gitlab
::
UrlBuilder
.
build
(
first_note
)
note_url
=
Gitlab
::
UrlBuilder
.
build
(
first_note
_to_resolve
)
discussion_info
=
"- [ ]
#{
first_note
.
author
.
to_reference
}
commented on a [discussion](
#{
note_url
}
): "
is_very_first_note
=
first_note_to_resolve
==
discussion
.
first_note
action
=
is_very_first_note
?
"started"
:
"commented on"
discussion_info
=
"- [ ]
#{
first_note_to_resolve
.
author
.
to_reference
}
#{
action
}
a [discussion](
#{
note_url
}
): "
discussion_info
<<
" (+
#{
other_note_count
}
#{
'comment'
.
pluralize
(
other_note_count
)
}
)"
if
other_note_count
>
0
note_without_block_quotes
=
Banzai
::
Filter
::
BlockquoteFenceFilter
.
new
(
first_note
.
note
).
call
note_without_block_quotes
=
Banzai
::
Filter
::
BlockquoteFenceFilter
.
new
(
first_note
_to_resolve
.
note
).
call
spaces
=
' '
*
4
quote
=
note_without_block_quotes
.
lines
.
map
{
|
line
|
"
#{
spaces
}
>
#{
line
}
"
}.
join
...
...
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