diff --git a/app/components/enterprise_edition/banner_component.rb b/app/components/enterprise_edition/banner_component.rb index 516106a3579..03927661f38 100644 --- a/app/components/enterprise_edition/banner_component.rb +++ b/app/components/enterprise_edition/banner_component.rb @@ -46,7 +46,7 @@ module EnterpriseEdition description: nil, link_title: nil, href: nil, - skip_render: !EnterpriseToken.show_banners?(feature: feature_key), + skip_render: EnterpriseToken.hide_banners?, **system_arguments) @system_arguments = system_arguments @system_arguments[:test_selector] = "op-enterprise-banner-#{feature_key.to_s.tr('_', '-')}" diff --git a/app/components/work_packages/types/subject_configuration_component.html.erb b/app/components/work_packages/types/subject_configuration_component.html.erb index 062014b3d7e..2e21afe60ff 100644 --- a/app/components/work_packages/types/subject_configuration_component.html.erb +++ b/app/components/work_packages/types/subject_configuration_component.html.erb @@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details. ++#%> <%= - render(EnterpriseEdition::BannerComponent.new(:automatic_subject_generation, mb: 3)) + render(EnterpriseEdition::BannerComponent.new(:work_package_subject_generation, mb: 3)) %> <%= diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1a1ad14f73d..8146e13e3b0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -242,7 +242,9 @@ module ApplicationHelper css << ("action-#{action_name}") end - css << "ee-banners-#{EnterpriseToken.show_banners? ? 'visible' : 'hidden'}" + if EnterpriseToken.hide_banners? + css << "ee-banners-hidden" + end css << "env-#{Rails.env}" diff --git a/app/helpers/homescreen_helper.rb b/app/helpers/homescreen_helper.rb index c828f5a6623..cd0ebf088e3 100644 --- a/app/helpers/homescreen_helper.rb +++ b/app/helpers/homescreen_helper.rb @@ -54,7 +54,7 @@ module HomescreenHelper ## # Determine whether we should render the links on homescreen? def show_homescreen_links? - EnterpriseToken.show_banners? || OpenProject::Configuration.show_community_links? + OpenProject::Configuration.show_community_links? end ## diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb index 55b2d0c44f8..5b84725c92f 100644 --- a/app/models/enterprise_token.rb +++ b/app/models/enterprise_token.rb @@ -45,12 +45,8 @@ class EnterpriseToken < ApplicationRecord current && !current.expired? end - def show_banners?(feature: nil) - if feature - OpenProject::Configuration.ee_manager_visible? && (!active? || !allows_to?(feature)) - else - OpenProject::Configuration.ee_manager_visible? && !active? - end + def hide_banners? + !OpenProject::Configuration.ee_manager_visible? end def banner_type_for(feature:) @@ -88,6 +84,7 @@ class EnterpriseToken < ApplicationRecord :reprieve_days, :reprieve_days_left, :restrictions, + :available_features, :plan, :features, :version, diff --git a/app/views/projects/settings/modules/_form.html.erb b/app/views/projects/settings/modules/_form.html.erb index da66258b55d..8c0bc3a5294 100644 --- a/app/views/projects/settings/modules/_form.html.erb +++ b/app/views/projects/settings/modules/_form.html.erb @@ -33,7 +33,8 @@ See COPYRIGHT and LICENSE files for more details.