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
Specify type of error on every raise in `OpTurbo::Streamable`
Aaron Contreras2fc035e6a683
diff --git a/app/components/concerns/op_turbo/streamable.rb b/app/components/concerns/op_turbo/streamable.rbindex a1439bc257a..23fe8d9c926 100644--- a/app/components/concerns/op_turbo/streamable.rb+++ b/app/components/concerns/op_turbo/streamable.rb@@ -28,6 +28,10 @@module OpTurbomodule Streamable+ # rubocop:disable OpenProject/AddPreviewForViewComponent+ class MissingComponentWrapper < StandardError; end+ # rubocop:enable OpenProject/AddPreviewForViewComponent+extend ActiveSupport::Concernclass_methods do@@ -49,11 +53,12 @@ module OpTurborender_in(view_context)template = nilelse- raise "Unsupported action #{action}"+ raise ArgumentError, "Unsupported action #{action}"endunless wrapped?- raise "You need to wrap your component in a `component_wrapper` block in order to use the turbo-stream methods"+ raise MissingComponentWrapper,+ "Wrap your component in a `component_wrapper` block in order to use turbo-stream methods"endOpTurbo::StreamWrapperComponent.new(@@ -70,7 +75,8 @@ module OpTurbo# needs wrapping, not the target since it isn't the one# that needs to be rendered to perform this turbo stream action.unless component.wrapped?- raise "You need to wrap your component in a `component_wrapper` block in order to use the turbo-stream methods"+ raise MissingComponentWrapper,+ "Wrap your component in a `component_wrapper` block in order to use turbo-stream methods"endOpTurbo::StreamWrapperComponent.new(@@ -125,7 +131,8 @@ module OpTurbodef insert_target_container(tag: "div", class: nil, data: nil, style: nil, &block)unless insert_target_modified?- raise "`insert_target_modified?` needs to be implemented and return true if `insert_target_container` is " \+ raise NotImplementedError,+ "#insert_target_modified? needs to be implemented and return true if #insert_target_container is " \"used in this component"end