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
Merge DialogStreamHelper into ComponentStream
Jan Sandbrinkf824b479e826
diff --git a/app/controllers/admin/custom_fields/custom_field_projects_controller.rb b/app/controllers/admin/custom_fields/custom_field_projects_controller.rbindex 1607b81037b..933b5b8a35d 100644--- a/app/controllers/admin/custom_fields/custom_field_projects_controller.rb+++ b/app/controllers/admin/custom_fields/custom_field_projects_controller.rb@@ -30,7 +30,6 @@class Admin::CustomFields::CustomFieldProjectsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude FlashMessagesOutputSafetyHelperlayout "admin"diff --git a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb b/app/controllers/admin/custom_fields/hierarchy/items_controller.rbindex ed67330f040..3af126a8ca1 100644--- a/app/controllers/admin/custom_fields/hierarchy/items_controller.rb+++ b/app/controllers/admin/custom_fields/hierarchy/items_controller.rb@@ -33,7 +33,6 @@ module Adminmodule Hierarchyclass ItemsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperlayout :admin_or_frame_layoutmodel_object CustomFielddiff --git a/app/controllers/admin/settings/project_custom_field_sections_controller.rb b/app/controllers/admin/settings/project_custom_field_sections_controller.rbindex 85248086b73..35646229f79 100644--- a/app/controllers/admin/settings/project_custom_field_sections_controller.rb+++ b/app/controllers/admin/settings/project_custom_field_sections_controller.rb@@ -30,7 +30,6 @@ module Admin::Settingsclass ProjectCustomFieldSectionsController < ::Admin::SettingsControllerinclude OpTurbo::ComponentStreaminclude Admin::Settings::ProjectCustomFields::ComponentStreams- include OpTurbo::DialogStreamHelperbefore_action :set_project_custom_field_section, only: %i[update move drop destroy]diff --git a/app/controllers/admin/settings/project_custom_fields_controller.rb b/app/controllers/admin/settings/project_custom_fields_controller.rbindex 8a2b082630f..25da615cd9a 100644--- a/app/controllers/admin/settings/project_custom_fields_controller.rb+++ b/app/controllers/admin/settings/project_custom_fields_controller.rb@@ -30,7 +30,6 @@ module Admin::Settingsclass ProjectCustomFieldsController < ::Admin::SettingsControllerinclude CustomFields::SharedActionsinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude FlashMessagesOutputSafetyHelperinclude Admin::Settings::ProjectCustomFields::ComponentStreamsdiff --git a/app/controllers/attribute_help_texts_controller.rb b/app/controllers/attribute_help_texts_controller.rbindex d9f970788f3..effd3bbf80a 100644--- a/app/controllers/attribute_help_texts_controller.rb+++ b/app/controllers/attribute_help_texts_controller.rb@@ -28,7 +28,6 @@class AttributeHelpTextsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperlayout "admin"menu_item :attribute_help_textsdiff --git a/app/controllers/concerns/op_turbo/component_stream.rb b/app/controllers/concerns/op_turbo/component_stream.rbindex 2c606da0ea4..ccec531c515 100644--- a/app/controllers/concerns/op_turbo/component_stream.rb+++ b/app/controllers/concerns/op_turbo/component_stream.rb@@ -42,6 +42,12 @@ module OpTurboalias_method :respond_with_turbo_streams, :respond_to_with_turbo_streams+ def respond_with_dialog(dialog_component, status: :ok, &format_block)+ modify_via_turbo_stream(component: dialog_component, action: :dialog, status:)++ respond_to_with_turbo_streams(&format_block)+ end+def update_via_turbo_stream(component:, status: :ok, method: nil)modify_via_turbo_stream(component:, action: :update, status:, method:)enddiff --git a/app/controllers/concerns/op_turbo/dialog_stream_helper.rb b/app/controllers/concerns/op_turbo/dialog_stream_helper.rbdeleted file mode 100644index 9dbfef59aa9..00000000000--- a/app/controllers/concerns/op_turbo/dialog_stream_helper.rb+++ /dev/null@@ -1,39 +0,0 @@-# frozen_string_literal: true--#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) the OpenProject GmbH-#-# This program is free software; you can redistribute it and/or-# modify it under the terms of the GNU General Public License version 3.-#-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:-# Copyright (C) 2006-2013 Jean-Philippe Lang-# Copyright (C) 2010-2013 the ChiliProject Team-#-# This program is free software; you can redistribute it and/or-# modify it under the terms of the GNU General Public License-# as published by the Free Software Foundation; either version 2-# of the License, or (at your option) any later version.-#-# This program is distributed in the hope that it will be useful,-# but WITHOUT ANY WARRANTY; without even the implied warranty of-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-# GNU General Public License for more details.-#-# You should have received a copy of the GNU General Public License-# along with this program; if not, write to the Free Software-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.-#-# See COPYRIGHT and LICENSE files for more details.-#++--module OpTurbo- module DialogStreamHelper- def respond_with_dialog(dialog_component, status: :ok, &format_block)- modify_via_turbo_stream(component: dialog_component, action: :dialog, status:)-- respond_to_with_turbo_streams(&format_block)- end- end-enddiff --git a/app/controllers/enterprise_tokens_controller.rb b/app/controllers/enterprise_tokens_controller.rbindex 53603ee0339..b2d19d79c67 100644--- a/app/controllers/enterprise_tokens_controller.rb+++ b/app/controllers/enterprise_tokens_controller.rb@@ -28,7 +28,6 @@# See COPYRIGHT and LICENSE files for more details.#++class EnterpriseTokensController < ApplicationController- include OpTurbo::DialogStreamHelperinclude OpTurbo::ComponentStreaminclude OpModalFlashablediff --git a/app/controllers/enterprise_trials_controller.rb b/app/controllers/enterprise_trials_controller.rbindex 082f1c25d99..188526164ee 100644--- a/app/controllers/enterprise_trials_controller.rb+++ b/app/controllers/enterprise_trials_controller.rb@@ -29,7 +29,6 @@#++class EnterpriseTrialsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperbefore_action :require_adminbefore_action :load_trial_key, only: %i[request_resend]diff --git a/app/controllers/projects/queries_controller.rb b/app/controllers/projects/queries_controller.rbindex f8fef33a06c..58241e8489b 100644--- a/app/controllers/projects/queries_controller.rb+++ b/app/controllers/projects/queries_controller.rb@@ -29,7 +29,6 @@class Projects::QueriesController < ApplicationControllerinclude Queries::Loadinginclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelper# No need for a more specific authorization check. That is carried out in the contracts.no_authorization_required! :show, :new, :create, :rename, :update, :toggle_public, :destroy, :destroy_confirmation_modal,diff --git a/app/controllers/projects/settings/general_controller.rb b/app/controllers/projects/settings/general_controller.rbindex 2318c0f363b..4d5f63df3b2 100644--- a/app/controllers/projects/settings/general_controller.rb+++ b/app/controllers/projects/settings/general_controller.rb@@ -30,7 +30,6 @@class Projects::Settings::GeneralController < Projects::SettingsControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelpermenu_item :settings_generaldiff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rbindex 12e3c69d7a5..3000fd9c615 100644--- a/app/controllers/projects_controller.rb+++ b/app/controllers/projects_controller.rb@@ -28,7 +28,6 @@class ProjectsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelpermenu_item :overviewmenu_item :roadmap, only: :roadmapdiff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rbindex f020a2c9d5a..3ea98b841e6 100644--- a/app/controllers/shares_controller.rb+++ b/app/controllers/shares_controller.rb@@ -28,7 +28,6 @@class SharesController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude MemberHelperbefore_action :load_entitydiff --git a/app/controllers/work_package_hierarchy_relations_controller.rb b/app/controllers/work_package_hierarchy_relations_controller.rbindex 262750112f7..66cf444a2b5 100644--- a/app/controllers/work_package_hierarchy_relations_controller.rb+++ b/app/controllers/work_package_hierarchy_relations_controller.rb@@ -30,7 +30,6 @@class WorkPackageHierarchyRelationsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperclass InvalidRelationType < StandardError; enddiff --git a/app/controllers/work_package_relations_controller.rb b/app/controllers/work_package_relations_controller.rbindex 196b8a001fb..98699eee7b1 100644--- a/app/controllers/work_package_relations_controller.rb+++ b/app/controllers/work_package_relations_controller.rb@@ -30,7 +30,6 @@class WorkPackageRelationsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperbefore_action :set_work_packagebefore_action :set_relation, only: %i[edit update]diff --git a/app/controllers/work_packages/dialogs_controller.rb b/app/controllers/work_packages/dialogs_controller.rbindex dd32d35cdbb..4caba9713a1 100644--- a/app/controllers/work_packages/dialogs_controller.rb+++ b/app/controllers/work_packages/dialogs_controller.rb@@ -30,7 +30,6 @@class WorkPackages::DialogsController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperlayout falsebefore_action :find_project_by_project_iddiff --git a/app/controllers/work_packages_controller.rb b/app/controllers/work_packages_controller.rbindex e7f3ab50b73..2bf6c7d59a9 100644--- a/app/controllers/work_packages_controller.rb+++ b/app/controllers/work_packages_controller.rb@@ -31,7 +31,6 @@ class WorkPackagesController < ApplicationControllerinclude PaginationHelperinclude Layoutinclude WorkPackagesControllerHelper- include OpTurbo::DialogStreamHelperinclude OpTurbo::ComponentStreamaccept_key_auth :index, :showdiff --git a/lookbook/docs/patterns/05-dialogs.md.erb b/lookbook/docs/patterns/05-dialogs.md.erbindex c17d61aa34a..f970d45f4cd 100644--- a/lookbook/docs/patterns/05-dialogs.md.erb+++ b/lookbook/docs/patterns/05-dialogs.md.erb@@ -28,9 +28,8 @@ The async-controller stimulus controller will ensure that a loading progress bar```rubyclass TestController < ApplicationControler- # include the helper modules+ # include the helper moduleinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelper# ...@@ -40,7 +39,7 @@ class TestController < ApplicationControlerend```-For this to work, the `OpTurbo::Streamable` module needs to be included in the modal component, along with the `OpTurbo::DialogStreamHelper` and `OpTurbo::ComponentStream` modules in the corresponding controller:+For this to work, the `OpTurbo::Streamable` module needs to be included in the modal component, along with the `OpTurbo::ComponentStream` module in the corresponding controller:```rubyclass MyDialogComponent < ApplicationControler@@ -142,9 +141,8 @@ Referring to the example above (see "Dialogs with separate forms"), a controller```rubyclass TestController < ApplicationControler- # include the helper modules+ # include the helper moduleinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelper# ...diff --git a/modules/costs/app/controllers/time_entries_controller.rb b/modules/costs/app/controllers/time_entries_controller.rbindex 3e5444bb2d3..9f8f81cdb65 100644--- a/modules/costs/app/controllers/time_entries_controller.rb+++ b/modules/costs/app/controllers/time_entries_controller.rb@@ -30,7 +30,6 @@class TimeEntriesController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude Redmine::I18nbefore_action :require_logindiff --git a/modules/job_status/app/controllers/job_statuses_controller.rb b/modules/job_status/app/controllers/job_statuses_controller.rbindex c775f8216af..6e711d956f7 100644--- a/modules/job_status/app/controllers/job_statuses_controller.rb+++ b/modules/job_status/app/controllers/job_statuses_controller.rb@@ -28,7 +28,6 @@class JobStatusesController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperno_authorization_required! :show, :dialog, :dialog_bodybefore_action :validate_job, only: [:dialog_body]diff --git a/modules/meeting/app/controllers/meeting_sections_controller.rb b/modules/meeting/app/controllers/meeting_sections_controller.rbindex 7eb8d7d87f1..b7376df6dc5 100644--- a/modules/meeting/app/controllers/meeting_sections_controller.rb+++ b/modules/meeting/app/controllers/meeting_sections_controller.rb@@ -30,7 +30,6 @@class MeetingSectionsController < ApplicationControllerinclude AttachableServiceCallinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude Meetings::AgendaComponentStreamsbefore_action :set_meetingdiff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex 56e7e3abad0..13b2da65081 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -50,7 +50,6 @@ class MeetingsController < ApplicationControllerinclude OpTurbo::ComponentStreaminclude OpTurbo::FlashStreamHelper- include OpTurbo::DialogStreamHelperinclude Meetings::AgendaComponentStreamsinclude MetaTagsHelperdiff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex 901b5c40bef..0f82d4af99d 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -5,7 +5,6 @@ class RecurringMeetingsController < ApplicationControllerinclude PaginationHelperinclude OpTurbo::ComponentStreaminclude OpTurbo::FlashStreamHelper- include OpTurbo::DialogStreamHelperbefore_action :load_and_authorize_in_optional_projectbefore_action :find_meeting, except: %i[index new create]diff --git a/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb b/modules/meeting/app/controllers/work_package_meetings_tab_controller.rbindex 172a5e1233e..2634fdebc48 100644--- a/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb+++ b/modules/meeting/app/controllers/work_package_meetings_tab_controller.rb@@ -30,7 +30,6 @@class WorkPackageMeetingsTabController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude Meetings::WorkPackageMeetingsTabComponentStreamsbefore_action :set_work_packagediff --git a/modules/overviews/app/controllers/overviews/overviews_controller.rb b/modules/overviews/app/controllers/overviews/overviews_controller.rbindex 9376f05c2d2..b88e8c6e979 100644--- a/modules/overviews/app/controllers/overviews/overviews_controller.rb+++ b/modules/overviews/app/controllers/overviews/overviews_controller.rb@@ -29,7 +29,6 @@module ::Overviewsclass OverviewsController < ::Grids::BaseInProjectControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperbefore_action :jump_to_project_menu_itembefore_action :set_sidebar_enableddiff --git a/modules/overviews/app/controllers/overviews/project_phases_controller.rb b/modules/overviews/app/controllers/overviews/project_phases_controller.rbindex 13dd5174465..2498292c41c 100644--- a/modules/overviews/app/controllers/overviews/project_phases_controller.rb+++ b/modules/overviews/app/controllers/overviews/project_phases_controller.rb@@ -31,7 +31,6 @@module ::Overviewsclass ProjectPhasesController < ::ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperbefore_action :find_project_phase_and_projectbefore_action :authorizediff --git a/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages/project_storages_controller.rbindex e82221a0877..50620da35b2 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@@ -30,7 +30,6 @@class Storages::Admin::Storages::ProjectStoragesController < ApplicationControllerinclude OpTurbo::ComponentStream- include OpTurbo::DialogStreamHelperinclude FlashMessagesOutputSafetyHelperinclude Storages::OAuthAccessGrantable