From eb359e4dcf5019e4187a21c7a2e6db26f5053cb1 Mon Sep 17 00:00:00 2001 From: ulferts Date: Tue, 22 Oct 2024 16:41:39 +0200 Subject: [PATCH 1/2] fix url for notification center in case of a show all --- app/views/digest_mailer/work_packages.html.erb | 2 +- spec/mailers/digest_mailer_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/digest_mailer/work_packages.html.erb b/app/views/digest_mailer/work_packages.html.erb index 802f6f887ac4..32965e9394de 100644 --- a/app/views/digest_mailer/work_packages.html.erb +++ b/app/views/digest_mailer/work_packages.html.erb @@ -60,7 +60,7 @@ >
- <%= I18n.t(:'mail.work_packages.see_all') %> diff --git a/spec/mailers/digest_mailer_spec.rb b/spec/mailers/digest_mailer_spec.rb index 6b6b4d9fba2d..4dabc26717c4 100644 --- a/spec/mailers/digest_mailer_spec.rb +++ b/spec/mailers/digest_mailer_spec.rb @@ -120,6 +120,16 @@ .to have_text(expected_text, normalize_ws: true) end + it "includes a reference to the notification center if there are more than the maximum number of shown work packages" do + stub_const("DigestMailer::MAX_SHOWN_WORK_PACKAGES", 0) + + expect(mail_body) + .to have_text I18n.t(:"mail.work_packages.more_to_see.one") + + expect(mail_body) + .to have_link(I18n.t(:"mail.work_packages.see_all"), href: notifications_url) + end + context "with only a deleted work package for the digest" do let(:work_package) { nil } From 8937defc9c9478825aa43d3cdb2be3e5fd77069f Mon Sep 17 00:00:00 2001 From: ulferts Date: Tue, 22 Oct 2024 16:41:59 +0200 Subject: [PATCH 2/2] avoid naming conflicts on concurrency key --- app/workers/mails/reminder_job.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/workers/mails/reminder_job.rb b/app/workers/mails/reminder_job.rb index 01e84db4ea28..bbc6eaba109e 100644 --- a/app/workers/mails/reminder_job.rb +++ b/app/workers/mails/reminder_job.rb @@ -32,7 +32,11 @@ class Mails::ReminderJob < Mails::DeliverJob good_job_control_concurrency_with( total_limit: 1, - key: -> { "#{self.class.name}-#{arguments.last}" } + key: -> do + id = arguments.last.respond_to?(:id) ? arguments.last.id : arguments.last + + "#{self.class.name}-#{id}" + end ) private