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

Improve enterprise banner

Jan Sandbrink0fb17dbf25a9
diff --git a/app/components/enterprise_edition/banner_component.rb b/app/components/enterprise_edition/banner_component.rb
index f7ac7ed39ba..713116aed54 100644
--- a/app/components/enterprise_edition/banner_component.rb
+++ b/app/components/enterprise_edition/banner_component.rb
@@ -29,9 +29,9 @@
# ++
module EnterpriseEdition
- # Add a general description of component here
- # Add additional usage considerations or best practices that may aid the user to use the component correctly.
- # @accessibility Add any accessibility considerations
+ # A banner indicating that a given feature requires the enterprise edition of OpenProject.
+ # This component uses conventional names for translation keys or URL look-ups based on the feature_key passed in.
+ # It will only be rendered if necessary.
class BannerComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
@@ -50,6 +50,7 @@ module EnterpriseEdition
**system_arguments)
@system_arguments = system_arguments
@system_arguments[:tag] = "div"
+ @system_arguments[:test_selector] = "op-ee-banner-#{feature_key.to_s.tr('_', '-')}"
super
@feature_key = feature_key
diff --git a/spec/components/enterprise_edition/banner_component_spec.rb b/spec/components/enterprise_edition/banner_component_spec.rb
index 4bdf58bb269..a72eb6fce55 100644
--- a/spec/components/enterprise_edition/banner_component_spec.rb
+++ b/spec/components/enterprise_edition/banner_component_spec.rb
@@ -95,6 +95,7 @@ RSpec.describe EnterpriseEdition::BannerComponent, type: :component do
it "renders the component" do
render_component_in_mo
+ expect(page).to have_test_selector("op-ee-banner-some-enterprise-feature")
expect(page).to have_css ".op-ee-banner--title-container", text: title
expect(page).to have_css ".op-ee-banner--description-container", text: description
expect(page).to have_link link_title, href: