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
487ac98a
Commit
487ac98a
authored
Sep 14, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ports new refactor from EE to CE
parent
81d949f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
5 deletions
+17
-5
app/controllers/projects/merge_requests/creations_controller.rb
...ntrollers/projects/merge_requests/creations_controller.rb
+3
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+3
-0
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+9
-3
app/views/notify/new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.html.haml
+1
-1
app/views/notify/new_merge_request_email.text.erb
app/views/notify/new_merge_request_email.text.erb
+1
-1
No files found.
app/controllers/projects/merge_requests/creations_controller.rb
View file @
487ac98a
...
...
@@ -103,6 +103,9 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
@source_project
=
@merge_request
.
source_project
@commits
=
set_commits_for_rendering
(
@merge_request
.
commits
)
@commit
=
@merge_request
.
diff_head_commit
# FIXME: We have to assign a presenter to another instance variable
# due to class_name checks being made with issuable classes
@mr_presenter
=
@merge_request
.
present
(
current_user:
current_user
)
@labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
).
execute
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
487ac98a
...
...
@@ -331,6 +331,9 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@target_project
=
@merge_request
.
target_project
@target_branches
=
@merge_request
.
target_project
.
repository
.
branch_names
@noteable
=
@merge_request
# FIXME: We have to assign a presenter to another instance variable
# due to class_name checks being made with issuable classes
@mr_presenter
=
@merge_request
.
present
(
current_user:
current_user
)
end
...
...
app/mailers/emails/merge_requests.rb
View file @
487ac98a
...
...
@@ -3,13 +3,14 @@
module
Emails
module
MergeRequests
def
new_merge_request_email
(
recipient_id
,
merge_request_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
present:
true
)
mail_new_thread
(
@merge_request
,
merge_request_thread_options
(
@merge_request
.
author_id
,
recipient_id
,
reason
))
end
def
new_mention_in_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
present:
true
)
mail_answer_thread
(
@merge_request
,
merge_request_thread_options
(
updated_by_user_id
,
recipient_id
,
reason
))
end
...
...
@@ -75,11 +76,16 @@ module Emails
private
def
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
def
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
present:
false
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@project
=
@merge_request
.
project
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
if
present
recipient
=
User
.
find
(
recipient_id
)
@mr_presenter
=
@merge_request
.
present
(
current_user:
recipient
)
end
@sent_notification
=
SentNotification
.
record
(
@merge_request
,
recipient_id
,
reply_key
)
end
...
...
app/views/notify/new_merge_request_email.html.haml
View file @
487ac98a
...
...
@@ -9,7 +9,7 @@
%p
Assignee:
#{
@merge_request
.
assignee_name
}
=
render_if_exists
'notify/merge_request_approvers'
,
merge_request:
@merge_request
=
render_if_exists
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
-
if
@merge_request
.
description
%div
...
...
app/views/notify/new_merge_request_email.text.erb
View file @
487ac98a
...
...
@@ -5,6 +5,6 @@ New Merge Request <%= @merge_request.to_reference %>
<%=
merge_path_description
(
@merge_request
,
'to'
)
%>
Author:
<%=
@merge_request
.
author_name
%>
Assignee:
<%=
@merge_request
.
assignee_name
%>
<%=
render_if_exists
'notify/merge_request_approvers'
,
merge_request:
@merge_request
%>
<%=
render_if_exists
'notify/merge_request_approvers'
,
presenter:
@mr_presenter
%>
<%=
@merge_request
.
description
%>
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