OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fix[Op#52449]: only render health notifications in automatically managed context
Kabiru Mwenja31bf7c9c6268
diff --git a/modules/storages/app/components/storages/admin/sidebar/health_notifications_component.rb b/modules/storages/app/components/storages/admin/sidebar/health_notifications_component.rbindex fe19dab2382..a2960c5e693 100644--- a/modules/storages/app/components/storages/admin/sidebar/health_notifications_component.rb+++ b/modules/storages/app/components/storages/admin/sidebar/health_notifications_component.rb@@ -41,6 +41,10 @@ module Storages@storage = storageend+ def render?+ storage.automatically_managed?+ end+def notification_statusif storage.health_notifications_enabled?{ icon: :"bell-slash",diff --git a/modules/storages/spec/components/storages/admin/sidebar/health_notifications_component_spec.rb b/modules/storages/spec/components/storages/admin/sidebar/health_notifications_component_spec.rbindex 356c435effc..41034f3836b 100644--- a/modules/storages/spec/components/storages/admin/sidebar/health_notifications_component_spec.rb+++ b/modules/storages/spec/components/storages/admin/sidebar/health_notifications_component_spec.rb@@ -31,12 +31,10 @@ require_module_spec_helperRSpec.describe Storages::Admin::Sidebar::HealthNotificationsComponent, type: :component docontext "when subscribed to email notifications" do- let(:health_notifications_component) { described_class.new(storage:) }-- let(:storage) { build_stubbed(:nextcloud_storage, :with_health_notifications_enabled) }+ let(:storage) { build_stubbed(:nextcloud_storage, :with_health_notifications_enabled, :as_automatically_managed) }before do- render_inline(health_notifications_component)+ render_inline(described_class.new(storage:))endit "renders an unsubscribe option with info" do@@ -50,12 +48,10 @@ RSpec.describe Storages::Admin::Sidebar::HealthNotificationsComponent, type: :coendcontext "when unsubscribed to email notifications" do- let(:health_notifications_component) { described_class.new(storage:) }-- let(:storage) { build_stubbed(:nextcloud_storage, :with_health_notifications_disabled) }+ let(:storage) { build_stubbed(:nextcloud_storage, :with_health_notifications_disabled, :as_automatically_managed) }before do- render_inline(health_notifications_component)+ render_inline(described_class.new(storage:))endit "renders an unsubscribe option with info" do@@ -67,4 +63,13 @@ RSpec.describe Storages::Admin::Sidebar::HealthNotificationsComponent, type: :coexpect(page).to have_button("Subscribe")endend++ context "with non-automatically managed storage" do+ let(:storage) { build_stubbed(:nextcloud_storage, :as_not_automatically_managed) }++ it "does not render" do+ render_inline described_class.new(storage:)+ expect(page.text).to be_empty+ end+ endend