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
feat[Op#50985]: Use Primer Flash for Administration settings with Primer
Kabiru Mwenja5c678e350b0e
diff --git a/modules/meeting/app/components/flash_message_component.rb b/modules/meeting/app/components/flash_message_component.rbindex bddfb6cc9fe..0431be865f2 100644--- a/modules/meeting/app/components/flash_message_component.rb+++ b/modules/meeting/app/components/flash_message_component.rb@@ -31,7 +31,8 @@ class FlashMessageComponent < ApplicationComponentinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- def initialize(message: nil, full: false, spacious: false, dismissible: false, icon: nil, scheme: :default)+ def initialize(message: nil, full: false, spacious: false, dismissible: false, icon: nil, scheme: :default,+ test_selector: "primer-flash-message-component")super@message = message@@ -40,6 +41,7 @@ class FlashMessageComponent < ApplicationComponent@dismissible = dismissible # TODO: not working yet -> JS dependency not provided?@icon = icon@scheme = scheme+ @test_selector = test_selectorenddef call@@ -56,7 +58,8 @@ class FlashMessageComponent < ApplicationComponentdef flash_partialrender(Primer::Beta::Flash.new(- full: @full, spacious: @spacious, dismissible: @dismissible, icon: @icon, scheme: @scheme+ full: @full, spacious: @spacious, dismissible: @dismissible, icon: @icon, scheme: @scheme,+ test_selector: @test_selector)) { @message }endenddiff --git a/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb b/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rbindex 08c6ccabbbc..9fe01f4ebae 100644--- a/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb+++ b/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb@@ -74,7 +74,12 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatioservice_result = call_update_serviceif service_result.success?- flash[:notice] = I18n.t(:'storages.notice_successful_storage_connection')+ flash[:primer_flash] = {+ message: I18n.t(:'storages.notice_successful_storage_connection'),+ scheme: :success,+ dismissible: true,+ full: true+ }redirect_to admin_settings_storages_pathelserespond_to do |format|diff --git a/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb b/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rbindex de67ad1a96d..a0ea23dce9b 100644--- a/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb+++ b/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb@@ -62,7 +62,7 @@ class Storages::Admin::OAuthClientsController < ApplicationController# Actually create a OAuthClient object.# Use service pattern to create a new OAuthClient# Called by: Global app/config/routes.rb to serve Web page- def create # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity+ def create # rubocop:disable Metrics/AbcSizecall_oauth_clients_create_serviceservice_result.on_failure do@@ -77,7 +77,12 @@ class Storages::Admin::OAuthClientsController < ApplicationControllerformat.turbo_stream { render :create }endelsif @storage.provider_type_one_drive?- flash[:notice] = I18n.t(:'storages.notice_successful_storage_connection')+ flash[:primer_flash] = {+ message: I18n.t(:'storages.notice_successful_storage_connection'),+ scheme: :success,+ dismissible: true,+ full: true+ }redirect_to admin_settings_storages_pathelseraise "Unsupported provider type: #{@storage.short_provider_type}"diff --git a/modules/storages/spec/features/admin_storages_spec.rb b/modules/storages/spec/features/admin_storages_spec.rbindex a13f6b2bc96..f68936d8a97 100644--- a/modules/storages/spec/features/admin_storages_spec.rb+++ b/modules/storages/spec/features/admin_storages_spec.rb@@ -250,8 +250,11 @@ RSpec.describe 'Admin storages',endexpect(page).to have_current_path(admin_settings_storages_path)- expect(page).to have_text("Storage connected successfully! Remember to activate the module and the specific " \- "storage in the project settings of each desired project to use it.")+ expect(page).to have_test_selector(+ "primer-flash-message-component",+ text: "Storage connected successfully! Remember to activate the module and the specific " \+ "storage in the project settings of each desired project to use it."+ )endendend@@ -320,8 +323,11 @@ RSpec.describe 'Admin storages',endexpect(page).to have_current_path(admin_settings_storages_path)- wait_for(page).to have_text("Storage connected successfully! Remember to activate the module and the specific " \- "storage in the project settings of each desired project to use it.")+ wait_for(page).to have_test_selector(+ "primer-flash-message-component",+ text: "Storage connected successfully! Remember to activate the module and the specific " \+ "storage in the project settings of each desired project to use it."+ )endendend