Fix notification messages [SCI-9843]

This commit is contained in:
Martin Artnik 2023-12-11 14:32:22 +01:00
parent 91533a25ac
commit c0bc77024b
4 changed files with 8 additions and 25 deletions

View file

@ -24,6 +24,14 @@ class BaseNotification < Noticed::Base
def subject; end
def message
params[:message]
end
def title
params[:title]
end
private
def database_notification?

View file

@ -1,14 +1,6 @@
# frozen_string_literal: true
class LowStockNotification < BaseNotification
def message
I18n.t(
'notifications.content.item_low_stock_reminder.message_html',
repository_row_name: subject.name,
repository: repository.name
)
end
def self.subtype
:item_low_stock_reminder
end

View file

@ -1,16 +1,6 @@
# frozen_string_literal: true
class RepositoryItemDateNotification < BaseNotification
def message
unit = human_readable_unit(params[:reminder_unit], params[:reminder_value])
I18n.t(
'notifications.content.item_date_reminder.message_html',
repository_row_name: subject.name,
value: params[:reminder_value],
units: unit
)
end
def self.subtype
:item_date_reminder
end

View file

@ -1,13 +1,6 @@
# frozen_string_literal: true
class TaskDueDateNotification < BaseNotification
def message
I18n.t(
'notifications.content.my_module_due_date_reminder.message_html',
my_module_name: subject.name
)
end
def self.subtype
:my_module_due_date_reminder
end