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
625244bd
Commit
625244bd
authored
Dec 19, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move all the prepend in mailers to bottom
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
14e17bc0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
26 deletions
+24
-26
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+2
-2
app/mailers/emails/notes.rb
app/mailers/emails/notes.rb
+2
-2
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+2
-2
app/mailers/notify.rb
app/mailers/notify.rb
+2
-2
ee/app/mailers/ee/emails/merge_requests.rb
ee/app/mailers/ee/emails/merge_requests.rb
+5
-5
ee/app/mailers/ee/emails/notes.rb
ee/app/mailers/ee/emails/notes.rb
+2
-4
ee/app/mailers/ee/emails/projects.rb
ee/app/mailers/ee/emails/projects.rb
+8
-8
ee/spec/mailers/ee/emails/merge_requests_spec.rb
ee/spec/mailers/ee/emails/merge_requests_spec.rb
+1
-1
No files found.
app/mailers/emails/merge_requests.rb
View file @
625244bd
...
...
@@ -2,8 +2,6 @@
module
Emails
module
MergeRequests
prepend
Emails
::
EE
::
MergeRequests
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
new_merge_request_email
(
recipient_id
,
merge_request_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
present:
true
)
...
...
@@ -115,3 +113,5 @@ module Emails
end
end
end
Emails
::
MergeRequests
.
prepend
(
EE
::
Emails
::
MergeRequests
)
app/mailers/emails/notes.rb
View file @
625244bd
...
...
@@ -2,8 +2,6 @@
module
Emails
module
Notes
prepend
Emails
::
EE
::
Notes
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
note_commit_email
(
recipient_id
,
note_id
)
setup_note_mail
(
note_id
,
recipient_id
)
...
...
@@ -70,3 +68,5 @@ module Emails
end
end
end
Emails
::
Notes
.
prepend
(
EE
::
Emails
::
Notes
)
app/mailers/emails/projects.rb
View file @
625244bd
...
...
@@ -2,8 +2,6 @@
module
Emails
module
Projects
prepend
Emails
::
EE
::
Projects
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
project_was_moved_email
(
project_id
,
user_id
,
old_path_with_namespace
)
@current_user
=
@user
=
User
.
find
user_id
@project
=
Project
.
find
project_id
...
...
@@ -59,3 +57,5 @@ module Emails
end
end
end
Emails
::
Projects
.
prepend
(
EE
::
Emails
::
Projects
)
app/mailers/notify.rb
View file @
625244bd
# frozen_string_literal: true
class
Notify
<
BaseMailer
prepend
::
EE
::
Notify
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
GitlabRoutingHelper
include
EmailsHelper
...
...
@@ -212,3 +210,5 @@ class Notify < BaseMailer
@unsubscribe_url
=
unsubscribe_sent_notification_url
(
@sent_notification
)
end
end
Notify
.
prepend
(
EE
::
Notify
)
ee/app/mailers/e
mails/ee
/merge_requests.rb
→
ee/app/mailers/e
e/emails
/merge_requests.rb
View file @
625244bd
# frozen_string_literal: true
module
E
mails
module
E
E
module
E
E
module
E
mails
module
MergeRequests
def
add_merge_request_approver_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
present:
true
)
@updated_by
=
User
.
find
(
updated_by_user_id
)
@updated_by
=
::
User
.
find
(
updated_by_user_id
)
mail_answer_thread
(
@merge_request
,
merge_request_thread_options
(
updated_by_user_id
,
recipient_id
,
reason
))
end
def
approved_merge_request_email
(
recipient_id
,
merge_request_id
,
approved_by_user_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
@approved_by
=
User
.
find
(
approved_by_user_id
)
@approved_by
=
::
User
.
find
(
approved_by_user_id
)
mail_answer_thread
(
@merge_request
,
merge_request_thread_options
(
approved_by_user_id
,
recipient_id
,
reason
))
end
def
unapproved_merge_request_email
(
recipient_id
,
merge_request_id
,
unapproved_by_user_id
,
reason
=
nil
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
@unapproved_by
=
User
.
find
(
unapproved_by_user_id
)
@unapproved_by
=
::
User
.
find
(
unapproved_by_user_id
)
mail_answer_thread
(
@merge_request
,
merge_request_thread_options
(
unapproved_by_user_id
,
recipient_id
,
reason
))
end
end
...
...
ee/app/mailers/e
mails/ee
/notes.rb
→
ee/app/mailers/e
e/emails
/notes.rb
View file @
625244bd
# frozen_string_literal: true
module
E
mails
module
E
E
module
E
E
module
E
mails
module
Notes
extend
::
Gitlab
::
Utils
::
Override
def
note_epic_email
(
recipient_id
,
note_id
)
setup_note_mail
(
note_id
,
recipient_id
)
...
...
ee/app/mailers/e
mails/ee
/projects.rb
→
ee/app/mailers/e
e/emails
/projects.rb
View file @
625244bd
# frozen_string_literal: true
module
E
mails
module
E
E
module
E
E
module
E
mails
module
Projects
def
mirror_was_hard_failed_email
(
project_id
,
user_id
)
@project
=
Project
.
find
(
project_id
)
user
=
User
.
find
(
user_id
)
@project
=
::
Project
.
find
(
project_id
)
user
=
::
User
.
find
(
user_id
)
mail
(
to:
user
.
notification_email
,
subject:
subject
(
'Repository mirroring paused'
))
end
def
project_mirror_user_changed_email
(
new_mirror_user_id
,
deleted_user_name
,
project_id
)
@project
=
Project
.
find
(
project_id
)
@project
=
::
Project
.
find
(
project_id
)
@deleted_user_name
=
deleted_user_name
new_mirror_user
=
User
.
find
(
new_mirror_user_id
)
new_mirror_user
=
::
User
.
find
(
new_mirror_user_id
)
mail
(
to:
new_mirror_user
.
notification_email
,
subject:
subject
(
'Mirror user changed'
))
...
...
@@ -24,7 +24,7 @@ module Emails
def
prometheus_alert_fired_email
(
project_id
,
user_id
,
alert_params
)
alert_metric_id
=
alert_params
[
"labels"
][
"gitlab_alert_id"
]
@project
=
Project
.
find_by
(
id:
project_id
)
@project
=
::
Project
.
find_by
(
id:
project_id
)
return
unless
@project
@alert
=
@project
.
prometheus_alerts
.
find_by
(
prometheus_metric:
alert_metric_id
)
...
...
@@ -32,7 +32,7 @@ module Emails
@environment
=
@alert
.
environment
user
=
User
.
find_by
(
id:
user_id
)
user
=
::
User
.
find_by
(
id:
user_id
)
return
unless
user
subject_text
=
"Alert:
#{
@environment
.
name
}
-
#{
@alert
.
title
}
#{
@alert
.
computed_operator
}
#{
@alert
.
threshold
}
for 5 minutes"
...
...
ee/spec/mailers/e
mails/ee
/merge_requests_spec.rb
→
ee/spec/mailers/e
e/emails
/merge_requests_spec.rb
View file @
625244bd
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
'email_spec'
describe
E
mails
::
EE
::
MergeRequests
do
describe
E
E
::
Emails
::
MergeRequests
do
include
EmailSpec
::
Matchers
let
(
:user
)
{
create
(
:user
)
}
...
...
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