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

[#55968] Review feedback

Judith Roth360d62cf464a
diff --git a/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rb
index c1636835181..794bbfada84 100644
--- a/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rb
@@ -32,6 +32,7 @@ class Storages::Admin::Storages::ProjectStoragesController < ApplicationControll
include OpTurbo::ComponentStream
include OpTurbo::DialogStreamHelper
include FlashMessagesOutputSafetyHelper
+ include ApplicationComponentStreams
layout "admin"
@@ -88,6 +89,13 @@ class Storages::Admin::Storages::ProjectStoragesController < ApplicationControll
def load_project_storage
@project_storage = Storages::ProjectStorage.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ update_flash_message_via_turbo_stream(
+ message: t(:notice_file_not_found), full: true, dismiss_scheme: :hide, scheme: :danger
+ )
+ update_project_list_via_turbo_stream
+
+ respond_with_turbo_streams
end
def find_model_object(object_id = :storage_id)
diff --git a/modules/storages/spec/components/storages/project_storages/destroy_confirmation_dialog_component_spec.rb b/modules/storages/spec/components/storages/project_storages/destroy_confirmation_dialog_component_spec.rb
index 15176c26481..982c51a46d7 100644
--- a/modules/storages/spec/components/storages/project_storages/destroy_confirmation_dialog_component_spec.rb
+++ b/modules/storages/spec/components/storages/project_storages/destroy_confirmation_dialog_component_spec.rb
@@ -33,7 +33,7 @@ RSpec.describe Storages::ProjectStorages::DestroyConfirmationDialogComponent,
type: :component do
describe "#heading" do
it "contains the storage type" do
- storage = create(:one_drive_storage)
+ storage = build_stubbed(:one_drive_storage)
project_storage = build_stubbed(:project_storage, storage:)
component = described_class.new(storage:, project_storage:)
@@ -43,7 +43,7 @@ RSpec.describe Storages::ProjectStorages::DestroyConfirmationDialogComponent,
end
describe "#text" do
- let(:storage) { create(:storage, :as_generic) }
+ let(:storage) { build_stubbed(:storage, :as_generic) }
context "for a project with automatically managed project folder" do
it "includes an additional hint for data loss" do