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

Implement banner as trial status

Oliver Güntherf3564cf4f127
diff --git a/app/components/enterprise_trials/banner_component.html.erb b/app/components/enterprise_trials/banner_component.html.erb
new file mode 100644
index 00000000000..87b3381c639
--- /dev/null
+++ b/app/components/enterprise_trials/banner_component.html.erb
@@ -0,0 +1,50 @@
+<div class="widget-box--upsell-block">
+ <div class="widget-box--blocks--upsell-container">
+ <div class="widget-box--blocks--upsell-text">
+ <%=
+ render(Primer::OpenProject::FlexLayout.new(align_items: :center, mb: 3)) do |title_flex|
+ title_flex.with_column do
+ render(
+ Primer::Beta::Octicon.new(
+ icon: :"op-enterprise-addons",
+ size: :medium,
+ classes: "upsell-colored"
+ )
+ )
+ end
+
+ title_flex.with_column(ml: 2) do
+ render(Primer::Beta::Heading.new(tag: :h2)) do
+ if @trial_key
+ I18n.t("ee.trial.token_sent")
+ else
+ t("ee.upsell.plans_title")
+ end
+ end
+ end
+ end
+ %>
+
+ <p class="widget-box--blocks--upsell-description">
+ <% if @trial_key %>
+ <%= I18n.t("ee.trial.confirmation_info",
+ date: helpers.format_date(@trial_key.created_at),
+ email: @trial_key.data[:email]) %>
+ <% else %>
+ <%= t("ee.upsell.homescreen_description") %>
+ <% end %>
+ </p>
+ <p class="widget-box--blocks--upsell-description">
+ <% if @trial_key %>
+ <%= t("ee.trial.confirmation_subline") %>
+ <% else %>
+ <%= t("ee.upsell.homescreen_subline") %>
+ <% end %>
+ </p>
+
+ <%= render EnterpriseEdition::UpsellButtonsComponent.new(nil) %>
+ </div>
+ <div class="widget-box--blocks--upsell-image"
+ style="background-image: url(<%= image_path("enterprise/homescreen.png") %>)"></div>
+ </div>
+</div>
diff --git a/app/components/enterprise_trials/status_component.rb b/app/components/enterprise_trials/banner_component.rb
similarity index 97%
rename from app/components/enterprise_trials/status_component.rb
rename to app/components/enterprise_trials/banner_component.rb
index f97618efa8d..bd1d3688a30 100644
--- a/app/components/enterprise_trials/status_component.rb
+++ b/app/components/enterprise_trials/banner_component.rb
@@ -29,7 +29,7 @@
#++
module EnterpriseTrials
- class StatusComponent < ApplicationComponent
+ class BannerComponent < ApplicationComponent
include ApplicationHelper
include OpenProject::FormTagHelper
include OpTurbo::Streamable
diff --git a/app/components/enterprise_trials/status_component.html.erb b/app/components/enterprise_trials/status_component.html.erb
deleted file mode 100644
index 1c207f04e2b..00000000000
--- a/app/components/enterprise_trials/status_component.html.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-<% if @trial_key %>
- <%= I18n.t("ee.trial.confirmation_info",
- date: helpers.format_date(@trial_key.created_at),
- email: @trial_key.data[:email],
- ) %>
-
- <%=
- flex_layout do |flex|
- flex.with_row(flex_layout: true, align_items: :center) do |row|
- row.with_column do
- render Primer::Beta::Button.new(
- tag: :a,
- href: request_resend_enterprise_trial_path,
- data: { turbo_method: :post },
- ) do
- I18n.t("ee.trial.resend_action")
- end
- end
-
- row.with_column(ml: 1) do
- render Primer::Beta::Button.new(
- tag: :a,
- href: trial_dialog_enterprise_trial_path,
- data: { turbo_stream: true },
- ) do
- I18n.t("ee.trial.start_over")
- end
- end
- end
- end
- %>
-<% else %>
- <%= render EnterpriseTrials::TrialButtonComponent.new %>
-<% end %>
diff --git a/app/components/enterprise_trials/trial_button_component.rb b/app/components/enterprise_trials/trial_button_component.rb
index 5fa4a3f0ab7..661df6efdf4 100644
--- a/app/components/enterprise_trials/trial_button_component.rb
+++ b/app/components/enterprise_trials/trial_button_component.rb
@@ -48,7 +48,7 @@ module EnterpriseTrials
href: enterprise_tokens_path
)
) do
- I18n.t("admin.enterprise.check_trial_status")
+ I18n.t(:button_try_again)
end
else
render(
diff --git a/app/views/enterprise_tokens/_info.html.erb b/app/views/enterprise_tokens/_info.html.erb
index cba6073e4f0..135f2357a72 100644
--- a/app/views/enterprise_tokens/_info.html.erb
+++ b/app/views/enterprise_tokens/_info.html.erb
@@ -31,48 +31,76 @@ See COPYRIGHT and LICENSE files for more details.
"data-cb-site": OpenProject::Configuration.enterprise_chargebee_site %>
<% end %>
-<div class="upsell--information-container">
- <%= render EnterpriseTrials::StatusComponent.new %>
-
- <div class='upsell-actions'>
- <a href="#"
- class="button -highlight-inverted"
- data-cb-type="checkout"
- data-cb-plan-id="<%= OpenProject::Configuration.enterprise_plan %>">
- <%= t("admin.enterprise.book_now") %>
- </a>
-
- <% quote_link = OpenProject::Static::Links.links.fetch :upsell_get_quote %>
- <%= link_to t(quote_link[:label]),
- quote_link[:href],
- target: "_blank",
- class: "button -highlight-inverted", rel: "noopener" %>
- </div>
+<%= render EnterpriseTrials::BannerComponent.new %>
- <%= static_link_to :contact %>
-</div>
-<%# temporary add button %>
-<%- button_title = t("admin.enterprise.create_dialog.title") %>
-<%= render(
- Primer::Beta::Button.new(
- tag: :a,
- scheme: :primary,
- mobile_label: button_title,
- mobile_icon: :plus,
- size: :medium,
- href: new_enterprise_token_path,
- aria: { label: button_title },
- role: "button",
- data: {
- turbo_stream: true
- },
- title: button_title
- )
- ) do |button|
- button.with_leading_visual_icon(icon: :plus)
- button_title
- end %>
+<%=
+ render(Primer::Beta::Subhead.new) do |subhead|
+ subhead.with_heading(size: :medium) { EnterpriseToken.human_attribute_name(:encoded_token) }
+ subhead.with_description { I18n.t("ee.upsell.already_have_token") }
+ end
+%>
+
+<%=
+ render(Primer::OpenProject::FlexLayout.new(mb: 1)) do |button_row|
+ button_row.with_column do
+ button_title = t("admin.enterprise.create_dialog.title")
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ scheme: :primary,
+ mobile_label: button_title,
+ mobile_icon: :plus,
+ size: :medium,
+ href: new_enterprise_token_path,
+ aria: { label: button_title },
+ role: "button",
+ data: {
+ turbo_stream: true
+ },
+ title: button_title
+ )
+ ) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ button_title
+ end
+ end
+
+ button_row.with_column(ml: 1) do
+ button_title = t("admin.enterprise.book_now")
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ size: :medium,
+ href: '#',
+ aria: { label: button_title },
+ role: "button",
+ data: {
+ "cb-type": "checkout",
+ "cb-plan-id": OpenProject::Configuration.enterprise_plan,
+ },
+ title: button_title
+ )
+ ) { button_title }
+ end
+
+ button_row.with_column(ml: 1) do
+ quote_link = OpenProject::Static::Links.links.fetch :upsell_get_quote
+ button_title = t(quote_link[:label])
+ render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ size: :medium,
+ href: quote_link[:href],
+ aria: { label: button_title },
+ target: "_blank",
+ title: button_title
+ )
+ ) { button_title }
+ end
+
+ end
+%>
<div class="info-boxes upsell-benefits">
<h3 class="info-boxes--title -no-border"><%= t("js.admin.enterprise.upsell.benefits.description") %></h3>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 5e43e473002..59ee0f9b54c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -106,7 +106,6 @@ en:
required_for_feature: "This add-on is only available with an active Enterprise edition support token."
enterprise_link: "For more information, click here."
start_trial: "Start free trial"
- check_trial_status: "Check trial status"
book_now: "Book now"
get_quote: "Get a quote"
buttons:
@@ -1911,6 +1910,7 @@ en:
button_sort: "Sort"
button_submit: "Submit"
button_test: "Test"
+ button_try_again: "Try again"
button_unarchive: "Unarchive"
button_uncheck_all: "Uncheck all"
button_unlock: "Unlock"
@@ -2133,6 +2133,8 @@ en:
plan_title: "Enterprise %{plan} add-on"
plan_name: "%{plan} enterprise plan"
plan_text_html: "Available starting with the %{plan_name}."
+ already_have_token: >
+ Already have a token? Add it using the button below to upgrade to the booked Enterprise plan.
hide_banner: "Hide this banner"
homescreen_description: >
Enterprise plans extend the Community edition of OpenProject you are currently using.
@@ -2193,13 +2195,16 @@ en:
wait_for_confirmation: "We sent you an email to confirm your address in order to retrieve a trial token."
already_retrieved: "Your trial enterprise token was already retrieved. Please reach out to our support team if you need a new one."
successfully_saved: "Your trial enterprise token has been successfully retrieved."
+ token_sent: "Trial token requested"
start_over: "Start over trial request"
resend_action: "Resend confirmation email"
welcome_title: "Quick feature overview"
welcome_description: "Get a quick overview of project management and team collaboration with OpenProject Enterprise edition."
confirmation_info: >
- We sent you an email on %{date} to %{email}.
- Please check your inbox and click the confirmation link provided to start your 14 days trial.
+ We sent you an email on %{date} to %{email} with all the information to start the free trial of OpenProject Enterprise.
+ Please check your inbox and click the confirmation link provided to start your 14-day free trial.
+ confirmation_subline: >
+ Please, check your inbox and follow the steps to start your 14-day free trial.
domain_caption:
The token will be valid for your currently configured host name.
receive_newsletter_html: >
diff --git a/frontend/src/global_styles/content/_enterprise.sass b/frontend/src/global_styles/content/_enterprise.sass
index 0b5c09007b8..3048a72f7f3 100644
--- a/frontend/src/global_styles/content/_enterprise.sass
+++ b/frontend/src/global_styles/content/_enterprise.sass
@@ -16,12 +16,20 @@
.controller-homescreen .widget-boxes
.widget-box.upsell
padding: 0
- background: var(--bgColor-accent-muted)
flex-basis: 100%
border: var(--borderWidth-thin) solid var(--borderColor-severe-muted)
border-radius: var(--borderRadius-medium)
background: var(--body-background)
+.widget-box--upsell-block
+ margin-bottom: 1rem
+ border: var(--borderWidth-thin) solid var(--borderColor-severe-muted)
+ border-radius: var(--borderRadius-medium)
+ background: var(--body-background)
+ // Ensure the image does not overflow the container on the borders
+ position: relative
+ overflow: hidden
+
.widget-box--blocks--upsell-container
position: relative
padding: 20px