Commit d27308bb authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'revert-48655' into 'master'

Revert !48655 "Use test detection based on crystalball mapping in rspec jobs"

See merge request gitlab-org/gitlab!48990
parents 412ecb83 03bcd811
...@@ -106,7 +106,8 @@ module NotificationsHelper ...@@ -106,7 +106,8 @@ module NotificationsHelper
when :success_pipeline when :success_pipeline
s_('NotificationEvent|Successful pipeline') s_('NotificationEvent|Successful pipeline')
else else
s_(event.to_s.humanize) event_name = "NotificationEvent|#{event.to_s.humanize}"
s_(event_name)
end end
end end
......
...@@ -30,6 +30,7 @@ class NotificationSetting < ApplicationRecord ...@@ -30,6 +30,7 @@ class NotificationSetting < ApplicationRecord
scope :preload_source_route, -> { preload(source: [:route]) } scope :preload_source_route, -> { preload(source: [:route]) }
# NOTE: Applicable unfound_translations.rb also needs to be updated when below events are changed.
EMAIL_EVENTS = [ EMAIL_EVENTS = [
:new_release, :new_release,
:new_note, :new_note,
...@@ -51,7 +52,6 @@ class NotificationSetting < ApplicationRecord ...@@ -51,7 +52,6 @@ class NotificationSetting < ApplicationRecord
:moved_project :moved_project
].freeze ].freeze
# Update unfound_translations.rb when events are changed
def self.email_events(source = nil) def self.email_events(source = nil)
EMAIL_EVENTS EMAIL_EVENTS
end end
......
...@@ -18859,9 +18859,15 @@ msgstr "" ...@@ -18859,9 +18859,15 @@ msgstr ""
msgid "NotificationEvent|Fixed pipeline" msgid "NotificationEvent|Fixed pipeline"
msgstr "" msgstr ""
msgid "NotificationEvent|Issue due"
msgstr ""
msgid "NotificationEvent|Merge merge request" msgid "NotificationEvent|Merge merge request"
msgstr "" msgstr ""
msgid "NotificationEvent|Moved project"
msgstr ""
msgid "NotificationEvent|New epic" msgid "NotificationEvent|New epic"
msgstr "" msgstr ""
...@@ -18877,6 +18883,9 @@ msgstr "" ...@@ -18877,6 +18883,9 @@ msgstr ""
msgid "NotificationEvent|New release" msgid "NotificationEvent|New release"
msgstr "" msgstr ""
msgid "NotificationEvent|Push to merge request"
msgstr ""
msgid "NotificationEvent|Reassign issue" msgid "NotificationEvent|Reassign issue"
msgstr "" msgstr ""
...@@ -18886,6 +18895,9 @@ msgstr "" ...@@ -18886,6 +18895,9 @@ msgstr ""
msgid "NotificationEvent|Reopen issue" msgid "NotificationEvent|Reopen issue"
msgstr "" msgstr ""
msgid "NotificationEvent|Reopen merge request"
msgstr ""
msgid "NotificationEvent|Successful pipeline" msgid "NotificationEvent|Successful pipeline"
msgstr "" msgstr ""
......
...@@ -4,16 +4,20 @@ ...@@ -4,16 +4,20 @@
# https://github.com/grosser/gettext_i18n_rails#unfound-translations-with-rake-gettextfind # https://github.com/grosser/gettext_i18n_rails#unfound-translations-with-rake-gettextfind
# NotificationSetting.email_events # NotificationSetting.email_events
N_('NotificationEvent|New release')
N_('NotificationEvent|New note') N_('NotificationEvent|New note')
N_('NotificationEvent|New issue') N_('NotificationEvent|New issue')
N_('NotificationEvent|Reopen issue') N_('NotificationEvent|Reopen issue')
N_('NotificationEvent|Close issue') N_('NotificationEvent|Close issue')
N_('NotificationEvent|Reassign issue') N_('NotificationEvent|Reassign issue')
N_('NotificationEvent|Issue due')
N_('NotificationEvent|New merge request') N_('NotificationEvent|New merge request')
N_('NotificationEvent|Push to merge request')
N_('NotificationEvent|Reopen merge request')
N_('NotificationEvent|Close merge request') N_('NotificationEvent|Close merge request')
N_('NotificationEvent|Reassign merge request') N_('NotificationEvent|Reassign merge request')
N_('NotificationEvent|Change reviewer merge request')
N_('NotificationEvent|Merge merge request') N_('NotificationEvent|Merge merge request')
N_('NotificationEvent|Failed pipeline') N_('NotificationEvent|Failed pipeline')
N_('NotificationEvent|Fixed pipeline') N_('NotificationEvent|Fixed pipeline')
N_('NotificationEvent|New release') N_('NotificationEvent|Moved project')
N_('NotificationEvent|Change reviewer merge request')
...@@ -20,10 +20,19 @@ RSpec.describe NotificationsHelper do ...@@ -20,10 +20,19 @@ RSpec.describe NotificationsHelper do
end end
describe '#notification_event_name' do describe '#notification_event_name' do
it { expect(notification_event_name(:success_pipeline)).to match('Successful pipeline') } context 'for success_pipeline' do
it { expect(notification_event_name(:failed_pipeline)).to match('Failed pipeline') } it 'returns the custom name' do
it { expect(notification_event_name(:fixed_pipeline)).to match('Fixed pipeline') } expect(FastGettext).to receive(:cached_find).with('NotificationEvent|Successful pipeline')
it { expect(notification_event_name(:moved_project)).to match('Moved project') } expect(notification_event_name(:success_pipeline)).to eq('Successful pipeline')
end
end
context 'for everything else' do
it 'returns a humanized name' do
expect(FastGettext).to receive(:cached_find).with('NotificationEvent|Failed pipeline')
expect(notification_event_name(:failed_pipeline)).to eq('Failed pipeline')
end
end
end end
describe '#notification_icon_level' do describe '#notification_icon_level' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment