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

Don't use primer banner

Oliver Günther7d128ca25d4d
diff --git a/app/components/enterprise_edition/banner_component.html.erb b/app/components/enterprise_edition/banner_component.html.erb
index 8049fc25167..669c0e79621 100644
--- a/app/components/enterprise_edition/banner_component.html.erb
+++ b/app/components/enterprise_edition/banner_component.html.erb
@@ -1,33 +1,47 @@
<%=
- render(Primer::Alpha::Banner.new(
- classes: "op-enterprise-banner",
- full: false,
- icon: :"op-enterprise-addons",
- **@system_arguments
- )) do
- flex_layout do |flex|
- flex.with_row do
- render(Primer::Beta::Text.new(font_weight: :bold)) { title }
- end
-
- flex.with_row(mt: 1) do
- concat render(Primer::Beta::Text.new) { description }
- concat " "
- concat render(Primer::Beta::Text.new) { plan_text }
- end
+ grid_layout("op-enterprise-banner", **@system_arguments) do |grid|
+ grid.with_area(:visual) do
+ render(Primer::Beta::Octicon.new(icon: :"op-enterprise-addons", classes: "op-enterprise-banner--icon"))
+ end
- if features.present?
+ grid.with_area(:content) do
+ flex_layout do |flex|
flex.with_row do
- content_tag(:ul) { safe_join features.map { |text| render(Primer::Beta::Text.new(tag: :li)) { text } } }
+ render(Primer::Beta::Text.new(font_weight: :bold)) { title }
+ end
+
+ flex.with_row(mt: 1) do
+ concat render(Primer::Beta::Text.new) { description }
+ concat " "
+ concat render(Primer::Beta::Text.new) { plan_text }
end
- end
- flex.with_row(mt: 2, flex_layout: true, align_items: :center) do |button_layout|
- buttons.each_with_index do |button, i|
- button_layout.with_column(ml: (i == 0 ? 0 : 2)) do
- button
+ if features.present?
+ flex.with_row do
+ content_tag(:ul) { safe_join features.map { |text| render(Primer::Beta::Text.new(tag: :li)) { text } } }
end
end
+
+ flex.with_row(mt: 2, flex_layout: true, align_items: :center) do |button_layout|
+ buttons.each_with_index do |button, i|
+ button_layout.with_column(ml: (i == 0 ? 0 : 2)) do
+ button
+ end
+ end
+ end
+ end
+ end
+
+ if @dismissable
+ grid.with_area(:dismiss) do
+ render(
+ Primer::Beta::IconButton.new(
+ classes: "op-enterprise-banner--close-icon",
+ scheme: :invisible,
+ icon: :x,
+ aria: { label: "Hide" }
+ )
+ )
end
end
end
diff --git a/app/components/enterprise_edition/banner_component.rb b/app/components/enterprise_edition/banner_component.rb
index 03927661f38..d3d20ebe492 100644
--- a/app/components/enterprise_edition/banner_component.rb
+++ b/app/components/enterprise_edition/banner_component.rb
@@ -49,6 +49,7 @@ module EnterpriseEdition
skip_render: EnterpriseToken.hide_banners?,
**system_arguments)
@system_arguments = system_arguments
+ @system_arguments[:tag] = :div
@system_arguments[:test_selector] = "op-enterprise-banner-#{feature_key.to_s.tr('_', '-')}"
super
@@ -58,6 +59,7 @@ module EnterpriseEdition
@link_title = link_title
@href = href
@skip_render = skip_render
+ @dismissable = true
end
private
@@ -112,6 +114,7 @@ module EnterpriseEdition
def free_trial_button
return if EnterpriseToken.active?
+
helpers.angular_component_tag("opce-free-trial-button")
end
diff --git a/app/components/enterprise_edition/banner_component.sass b/app/components/enterprise_edition/banner_component.sass
index c4ba4d8b311..2aca4f2c674 100644
--- a/app/components/enterprise_edition/banner_component.sass
+++ b/app/components/enterprise_edition/banner_component.sass
@@ -28,9 +28,32 @@
/ ++
/
+
.op-enterprise-banner
- border-color: var(--borderColor-severe-muted)
- background: white
+ display: grid
+ grid-auto-flow: column
+ grid-template-areas: "visual content dismiss"
+ grid-template-columns: min-content 1fr min-content
+ grid-template-rows: min-content
+ border: var(--borderWidth-thin) solid var(--borderColor-severe-muted)
+ border-radius: var(--borderRadius-medium)
+ background: var(--body-background)
+ padding: var(--base-size-8)
+
+ &--visual
+ display: grid
+ align-self: start
+ padding: var(--base-size-6) var(--base-size-8)
+
+ &--icon
+ color: var(--enterprise-upsale-color)
+ margin-block: calc(var(--base-size-4) / 2)
+
+ &--close-icon
+ color: var(--enterprise-upsale-color)
+
+ &--content
+ padding: var(--base-size-6) var(--base-size-8)
- .Banner-visual .octicon
- @extend .upsale-colored
+ &--dismiss
+ margin-left: var(--controlStack-medium-gap-condensed)