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

Replace inline actions with constant

Oliver Güntherd593d4046c34
diff --git a/app/components/concerns/op_turbo/streamable.rb b/app/components/concerns/op_turbo/streamable.rb
index 6c78c14a566..9f61dbeb36b 100644
--- a/app/components/concerns/op_turbo/streamable.rb
+++ b/app/components/concerns/op_turbo/streamable.rb
@@ -32,6 +32,8 @@ module OpTurbo
class MissingComponentWrapper < StandardError; end
# rubocop:enable OpenProject/AddPreviewForViewComponent
+ INLINE_ACTIONS = %i[dialog flash].freeze
+
extend ActiveSupport::Concern
class_methods do
@@ -56,7 +58,7 @@ module OpTurbo
raise ArgumentError, "Unsupported action #{action}"
end
- if inline_actions.exclude?(action) && !wrapped?
+ if INLINE_ACTIONS.exclude?(action) && !wrapped?
raise MissingComponentWrapper,
"Wrap your component in a `component_wrapper` block in order to use turbo-stream methods"
end
@@ -100,10 +102,6 @@ module OpTurbo
end
end
- def inline_actions
- %i[dialog flash]
- end
-
def wrapped?
!!@wrapped
end