From c0bc77024be39adfa393f062ddb52655d08882be Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 11 Dec 2023 14:32:22 +0100 Subject: [PATCH] Fix notification messages [SCI-9843] --- app/notifications/base_notification.rb | 8 ++++++++ app/notifications/low_stock_notification.rb | 8 -------- app/notifications/repository_item_date_notification.rb | 10 ---------- app/notifications/task_due_date_notification.rb | 7 ------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/app/notifications/base_notification.rb b/app/notifications/base_notification.rb index e7e37a170..47b9e7815 100644 --- a/app/notifications/base_notification.rb +++ b/app/notifications/base_notification.rb @@ -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? diff --git a/app/notifications/low_stock_notification.rb b/app/notifications/low_stock_notification.rb index fa0275e7f..a712b20e9 100644 --- a/app/notifications/low_stock_notification.rb +++ b/app/notifications/low_stock_notification.rb @@ -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 diff --git a/app/notifications/repository_item_date_notification.rb b/app/notifications/repository_item_date_notification.rb index 9857518ce..ba41d6757 100644 --- a/app/notifications/repository_item_date_notification.rb +++ b/app/notifications/repository_item_date_notification.rb @@ -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 diff --git a/app/notifications/task_due_date_notification.rb b/app/notifications/task_due_date_notification.rb index 9fc1cf979..95100d8e5 100644 --- a/app/notifications/task_due_date_notification.rb +++ b/app/notifications/task_due_date_notification.rb @@ -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