Skip to content

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

Extract show/hide of EE banners from ee_manager_visible

Oliver Günthere7e2c0bab22c
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index 5b84725c92f..2dcad4af441 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -46,7 +46,7 @@ class EnterpriseToken < ApplicationRecord
end
def hide_banners?
- !OpenProject::Configuration.ee_manager_visible?
+ OpenProject::Configuration.ee_hide_banners?
end
def banner_type_for(feature:)
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index 87b9cda28be..03f3e58d4a4 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -409,10 +409,14 @@ module Settings
allowed: %w[standard bim]
},
ee_manager_visible: {
- description: "Show or hide the Enterprise configuration page and enterprise banners",
+ description: "Show the Enterprise configuration page",
default: true,
writable: false
},
+ ee_hide_banners: {
+ description: "Hide the Enterprise enterprise banners",
+ default: false
+ },
enable_internal_assets_server: {
description: "Serve assets through the Rails internal asset server",
default: false,
diff --git a/docs/installation-and-operations/configuration/environment/README.md b/docs/installation-and-operations/configuration/environment/README.md
index 7e5745bb783..80d57a7cf1a 100644
--- a/docs/installation-and-operations/configuration/environment/README.md
+++ b/docs/installation-and-operations/configuration/environment/README.md
@@ -186,6 +186,7 @@ OPENPROJECT_DROP__OLD__SESSIONS__ON__LOGIN (default=false) Destroy all sessions
OPENPROJECT_DROP__OLD__SESSIONS__ON__LOGOUT (default=true) Destroy all sessions for current_user on logout
OPENPROJECT_EDITION (default="standard") OpenProject edition mode
OPENPROJECT_EE__MANAGER__VISIBLE (default=true) Show or hide the Enterprise configuration page and enterprise banners
+OPENPROJECT_EE__HIDE__BANNERS (default=false) Hide the Enterprise enterprise banners
OPENPROJECT_EMAIL__DELIVERY__CONFIGURATION (default="inapp")
OPENPROJECT_EMAIL__DELIVERY__METHOD (default=nil) Email delivery method
OPENPROJECT_EMAIL__LOGIN (default=false) Use email as login
diff --git a/spec/models/enterprise_token_spec.rb b/spec/models/enterprise_token_spec.rb
index cdf1a66deda..c2e121627bf 100644
--- a/spec/models/enterprise_token_spec.rb
+++ b/spec/models/enterprise_token_spec.rb
@@ -32,13 +32,13 @@ require "spec_helper"
RSpec.describe EnterpriseToken do
let(:object) { OpenProject::Token.new domain: Setting.host_name }
- let(:ee_manager_visible) { true }
+ let(:ee_hide_banners) { true }
subject { described_class.new(encoded_token: "foo") }
before do
RequestStore.delete :current_ee_token
- allow(OpenProject::Configuration).to receive(:ee_manager_visible?).and_return(ee_manager_visible)
+ allow(OpenProject::Configuration).to receive(:ee_hide_banners?).and_return(ee_hide_banners)
end
describe ".active?" do
@@ -71,18 +71,18 @@ RSpec.describe EnterpriseToken do
describe ".hide_banners?" do
context "when ee manager is visible" do
- let(:ee_manager_visible) { true }
+ let(:ee_hide_banners) { true }
it "returns true" do
- expect(described_class).not_to be_hide_banners
+ expect(described_class).to be_hide_banners
end
end
context "when ee manager is not visible" do
- let(:ee_manager_visible) { false }
+ let(:ee_hide_banners) { false }
it "returns false" do
- expect(described_class).to be_hide_banners
+ expect(described_class).not_to be_hide_banners
end
end
end
@@ -221,10 +221,10 @@ RSpec.describe EnterpriseToken do
end
end
- describe "Configuration file has `ee_manager_visible` set to false" do
+ describe "Configuration file has `ee_hide_banners` set to false" do
it "does not show banners promoting EE" do
- allow(OpenProject::Configuration).to receive(:ee_manager_visible?).and_return(false)
- expect(described_class).to be_hide_banners
+ allow(OpenProject::Configuration).to receive(:ee_hide_banners?).and_return(false)
+ expect(described_class).not_to be_hide_banners
end
end
end