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

Show the video also when uploading the first token

Oliver Günther6c40b7ae9e77
diff --git a/app/controllers/enterprise_tokens_controller.rb b/app/controllers/enterprise_tokens_controller.rb
index c7a0adfd14e..0afe089439d 100644
--- a/app/controllers/enterprise_tokens_controller.rb
+++ b/app/controllers/enterprise_tokens_controller.rb
@@ -50,9 +50,12 @@ class EnterpriseTokensController < ApplicationController
saved_encoded_token = @token.encoded_token
@token.encoded_token = params[:enterprise_token][:encoded_token]
if @token.save
- flash[:notice] = t(:notice_successful_update)
respond_to do |format|
- format.html { redirect_to action: :index, status: :see_other }
+ format.html do
+ flash[:notice] = t(:notice_successful_update)
+ token_saved_flash if EnterpriseToken.one?
+ redirect_to action: :index, status: :see_other
+ end
format.json { head :no_content }
end
else
diff --git a/spec/features/admin/enterprise/enterprise_spec.rb b/spec/features/admin/enterprise/enterprise_spec.rb
index 6e0e8287f40..f41202af875 100644
--- a/spec/features/admin/enterprise/enterprise_spec.rb
+++ b/spec/features/admin/enterprise/enterprise_spec.rb
@@ -84,7 +84,9 @@ RSpec.describe "Enterprise token", :js do
fill_in "Type support token text", with: "foobar"
click_button "Add"
- expect_and_dismiss_flash(message: I18n.t(:notice_successful_update))
+ expect(page).to have_text("Quick feature overview")
+ expect(page).to have_css("#enterprise-trial-welcome-dialog video")
+ page.find('[data-close-dialog-id="enterprise-trial-welcome-dialog"]').click
# Table headers
[
@@ -130,7 +132,9 @@ RSpec.describe "Enterprise token", :js do
fill_in "Type support token text", with: "foobar"
click_button "Add"
- expect_and_dismiss_flash(message: I18n.t(:notice_successful_update))
+ expect(page).to have_text("Quick feature overview")
+ expect(page).to have_css("#enterprise-trial-welcome-dialog video")
+ page.find('[data-close-dialog-id="enterprise-trial-welcome-dialog"]').click
click_button "Add Enterprise token"
fill_in "Type support token text", with: "foobar"
diff --git a/spec/features/admin/enterprise/enterprise_trial_spec.rb b/spec/features/admin/enterprise/enterprise_trial_spec.rb
index ace0b778621..eb8b0fb3893 100644
--- a/spec/features/admin/enterprise/enterprise_trial_spec.rb
+++ b/spec/features/admin/enterprise/enterprise_trial_spec.rb
@@ -262,7 +262,8 @@ RSpec.describe "Enterprise trial management",
visit enterprise_tokens_path
expect(page).to have_text("Quick feature overview")
- expect(page).to have_css("#enterprise-trial-welcome-dialog iframe")
+ expect(page).to have_css("#enterprise-trial-welcome-dialog video")
+ page.find('[data-close-dialog-id="enterprise-trial-welcome-dialog"]').click
expect(page).to have_text("Enterprise Plan")
expect(page).to have_text("Expired")
@@ -284,7 +285,7 @@ RSpec.describe "Enterprise trial management",
end
expect(page).to have_text("Quick feature overview")
- expect(page).to have_css("#enterprise-trial-welcome-dialog iframe")
+ expect(page).to have_css("#enterprise-trial-welcome-dialog video")
expect(page).to have_text("Enterprise Plan")
expect(page).to have_text("Expired")