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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Show buttons in the banner above
Oliver Günther4127b50ca609
diff --git a/app/components/enterprise_edition/upsell_buttons_component.rb b/app/components/enterprise_edition/upsell_buttons_component.rbindex 79206a9c553..aec2538fd2b 100644--- a/app/components/enterprise_edition/upsell_buttons_component.rb+++ b/app/components/enterprise_edition/upsell_buttons_component.rb@@ -33,13 +33,15 @@ module EnterpriseEditioninclude OpPrimer::ComponentHelpers# @param feature_key [Symbol, NilClass] The key of the feature to show the banner for.+ # @param show_buy_now [Boolean] Whether to show the "Buy now" button.# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>- def initialize(feature_key, **system_arguments)+ def initialize(feature_key, show_buy_now: false, **system_arguments)super@system_arguments = system_arguments@system_arguments[:align_items] ||= :center@feature_key = feature_key+ @show_buy_now = show_buy_nowenddef call@@ -85,7 +87,24 @@ module EnterpriseEdition# Allow providing a custom upgrade now buttondef upgrade_now_button- nil+ if @show_buy_now+ button_title = t("admin.enterprise.book_now")+ render(+ Primer::Beta::Button.new(+ tag: :a,+ size: :medium,+ href: "#",+ aria: { label: button_title },+ classes: "upsell-colored-background",+ role: "button",+ data: {+ "cb-type": "checkout",+ "cb-plan-id": OpenProject::Configuration.enterprise_plan+ },+ title: button_title+ )+ ) { button_title }+ endenddef more_info_buttondiff --git a/app/components/enterprise_trials/banner_component.html.erb b/app/components/enterprise_trials/banner_component.html.erbindex 87b3381c639..fea750b1116 100644--- a/app/components/enterprise_trials/banner_component.html.erb+++ b/app/components/enterprise_trials/banner_component.html.erb@@ -42,7 +42,7 @@<% end %></p>- <%= render EnterpriseEdition::UpsellButtonsComponent.new(nil) %>+ <%= render EnterpriseEdition::UpsellButtonsComponent.new(nil, show_buy_now: true) %></div><div class="widget-box--blocks--upsell-image"style="background-image: url(<%= image_path("enterprise/homescreen.png") %>)"></div>diff --git a/app/components/enterprise_trials/trial_button_component.rb b/app/components/enterprise_trials/trial_button_component.rbindex 661df6efdf4..3e6833a09cd 100644--- a/app/components/enterprise_trials/trial_button_component.rb+++ b/app/components/enterprise_trials/trial_button_component.rb@@ -41,23 +41,16 @@ module EnterpriseTrialsenddef call- if @trial_key- render(- Primer::Beta::Button.new(- tag: :a,- href: enterprise_tokens_path- )- ) do- I18n.t(:button_try_again)- end- else- render(- Primer::Beta::Button.new(- tag: :a,- href: trial_dialog_enterprise_trial_path,- data: { turbo_stream: true }- )- ) do+ render(+ Primer::Beta::Button.new(+ tag: :a,+ href: trial_dialog_enterprise_trial_path,+ data: { turbo_stream: true }+ )+ ) do+ if @trial_key+ I18n.t("ee.trial.request_again")+ elseI18n.t("admin.enterprise.start_trial")endenddiff --git a/app/views/enterprise_tokens/_info.html.erb b/app/views/enterprise_tokens/_info.html.erbindex 135f2357a72..9c3c42b7cbb 100644--- a/app/views/enterprise_tokens/_info.html.erb+++ b/app/views/enterprise_tokens/_info.html.erb@@ -65,40 +65,6 @@ See COPYRIGHT and LICENSE files for more details.button_titleendend-- 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%>diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 59ee0f9b54c..8ed060ddaaf 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1910,7 +1910,6 @@ 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"@@ -2196,7 +2195,7 @@ en: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"+ request_again: "Request again"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."diff --git a/spec/features/admin/enterprise/enterprise_spec.rb b/spec/features/admin/enterprise/enterprise_spec.rbindex 8580fde6d11..62d7ddb2b4b 100644--- a/spec/features/admin/enterprise/enterprise_spec.rb+++ b/spec/features/admin/enterprise/enterprise_spec.rb@@ -54,10 +54,7 @@ RSpec.describe "Enterprise token", :js doendit "shows a teaser page and has a button to add a token" do- # The teaser page is displayed- # TODO: this will likely change, adapt to the new teaser pageexpect(page).to have_link("Start free trial")- expect(page).to have_css(".button", text: "Book now")# Try adding invalid enterprise token dataexpect(page).to have_button("Add Enterprise token")