diff --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.rb index 08c6ccabbbcd..9fe01f4ebae0 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 @@ def create service_result = call_update_service if 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_path else respond_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.rb index 9dd1a2088f70..8b785cf11dbe 100644 --- a/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb +++ b/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb @@ -78,7 +78,12 @@ def create # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity format.turbo_stream { render :create } end elsif @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_path else raise "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.rb index 43bf83fa2cf5..47cacaef84f6 100644 --- a/modules/storages/spec/features/admin_storages_spec.rb +++ b/modules/storages/spec/features/admin_storages_spec.rb @@ -219,8 +219,9 @@ end expect(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.find_by_id('flash-message-component')) + .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.") end end end @@ -283,8 +284,9 @@ end expect(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.find_by_id('flash-message-component')) + .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.") end end end