diff --git a/app/components/admin/backups/show_page_header_component.html.erb b/app/components/admin/backups/show_page_header_component.html.erb index 299bdb8e72e..a9425213c20 100644 --- a/app/components/admin/backups/show_page_header_component.html.erb +++ b/app/components/admin/backups/show_page_header_component.html.erb @@ -58,8 +58,8 @@ See COPYRIGHT and LICENSE files for more details. href: delete_token_admin_backups_path, aria: { label: I18n.t("backup.label_delete_token") }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :post + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :post }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/admin/quarantined_attachments/row_component.rb b/app/components/admin/quarantined_attachments/row_component.rb index 5d83c4926be..507811c7a66 100644 --- a/app/components/admin/quarantined_attachments/row_component.rb +++ b/app/components/admin/quarantined_attachments/row_component.rb @@ -86,8 +86,11 @@ module Admin helpers.op_icon("icon icon-delete"), { controller: "/admin/attachments/quarantined_attachments", action: :destroy, id: model }, title: I18n.t("antivirus_scan.quarantined_attachments.delete"), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure), disable_with: I18n.t(:label_loading) } + data: { + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_submits_with: I18n.t(:label_loading) + } ) end end diff --git a/app/components/colors/edit_page_header_component.html.erb b/app/components/colors/edit_page_header_component.html.erb index d03fc0c8987..805f6430d03 100644 --- a/app/components/colors/edit_page_header_component.html.erb +++ b/app/components/colors/edit_page_header_component.html.erb @@ -41,8 +41,8 @@ See COPYRIGHT and LICENSE files for more details. href: color_path(@color), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/custom_actions/row_component.rb b/app/components/custom_actions/row_component.rb index 9a51a70d1c1..2f3f065f605 100644 --- a/app/components/custom_actions/row_component.rb +++ b/app/components/custom_actions/row_component.rb @@ -63,8 +63,10 @@ module CustomActions link_to( helpers.op_icon("icon icon-delete"), helpers.custom_action_path(action), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure) + }, title: t(:button_delete) ) end diff --git a/app/components/enumerations/row_component.rb b/app/components/enumerations/row_component.rb index 4ba4c7f21dd..1a51db6e948 100644 --- a/app/components/enumerations/row_component.rb +++ b/app/components/enumerations/row_component.rb @@ -64,8 +64,7 @@ module Enumerations helpers.link_to( helpers.op_icon("icon icon-delete"), helpers.enumeration_path(enumeration), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, title: t(:button_delete) ) end diff --git a/app/components/groups/edit_page_header_component.html.erb b/app/components/groups/edit_page_header_component.html.erb index f99070f31f3..b4a19bff6cf 100644 --- a/app/components/groups/edit_page_header_component.html.erb +++ b/app/components/groups/edit_page_header_component.html.erb @@ -54,8 +54,8 @@ See COPYRIGHT and LICENSE files for more details. href: group_path(@group), aria: { label: I18n.t(:button_delete) }, data: { - confirm: t(:text_are_you_sure), - method: :delete + turbo_confirm: t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/groups/show_page_header_component.html.erb b/app/components/groups/show_page_header_component.html.erb index e06660c8357..da21c0482af 100644 --- a/app/components/groups/show_page_header_component.html.erb +++ b/app/components/groups/show_page_header_component.html.erb @@ -55,8 +55,8 @@ See COPYRIGHT and LICENSE files for more details. href: group_path(@group), aria: { label: I18n.t(:button_delete) }, data: { - confirm: t(:text_are_you_sure), - method: :delete + turbo_confirm: t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/ldap_auth_sources/row_component.rb b/app/components/ldap_auth_sources/row_component.rb index f1ee95ed1a9..34b598942c5 100644 --- a/app/components/ldap_auth_sources/row_component.rb +++ b/app/components/ldap_auth_sources/row_component.rb @@ -62,8 +62,7 @@ module LdapAuthSources link_to I18n.t(:button_delete), { controller: "ldap_auth_sources", id: model.id, action: :destroy }, - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, class: "icon icon-delete", title: I18n.t(:button_delete) end diff --git a/app/components/members/delete_member_dialog_component.html.erb b/app/components/members/delete_member_dialog_component.html.erb index fa1b200f681..5f367932954 100644 --- a/app/components/members/delete_member_dialog_component.html.erb +++ b/app/components/members/delete_member_dialog_component.html.erb @@ -62,8 +62,8 @@ See COPYRIGHT and LICENSE files for more details. <% dialog.with_footer do %> <%= cancel_button %> - <%= button(scheme: :danger, tag: :a, href: delete_url(project: true), data: { method: :delete }) { t(:button_remove_member) } %> - <%= button(scheme: :danger, tag: :a, href: delete_url(project: true, work_package_shares_role_id: "all"), data: { method: :delete }) { t(:button_remove_member_and_shares) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(project: true), data: { turbo_method: :delete }) { t(:button_remove_member) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(project: true, work_package_shares_role_id: "all"), data: { turbo_method: :delete }) { t(:button_remove_member_and_shares) } %> <% end %> <% when can_delete_roles? %> <% dialog.with_body do %> @@ -78,7 +78,7 @@ See COPYRIGHT and LICENSE files for more details. <% dialog.with_footer do %> <%= cancel_button %> - <%= button(scheme: :danger, tag: :a, href: delete_url(project: true), data: { method: :delete }) { t(:button_remove) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(project: true), data: { turbo_method: :delete }) { t(:button_remove) } %> <% end %> <% else %> <% dialog.with_body do %> diff --git a/app/components/members/delete_work_package_shares_dialog_component.html.erb b/app/components/members/delete_work_package_shares_dialog_component.html.erb index 202e3bc69e7..68f79b3c79d 100644 --- a/app/components/members/delete_work_package_shares_dialog_component.html.erb +++ b/app/components/members/delete_work_package_shares_dialog_component.html.erb @@ -59,8 +59,8 @@ See COPYRIGHT and LICENSE files for more details. <% dialog.with_footer do %> <%= cancel_button %> - <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: "all"), data: { method: :delete }) { t(:button_revoke_all) } %> - <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: shared_role_id), data: { method: :delete }) { t(:button_revoke_only, shared_role_name:) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: "all"), data: { turbo_method: :delete }) { t(:button_revoke_all) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: shared_role_id), data: { turbo_method: :delete }) { t(:button_revoke_only, shared_role_name:) } %> <% end %> <% when direct_shared_work_packages_count? %> <% dialog.with_body do %> @@ -84,7 +84,7 @@ See COPYRIGHT and LICENSE files for more details. <% dialog.with_footer do %> <%= cancel_button %> - <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: "all"), data: { method: :delete }) { t(:button_revoke_access) } %> + <%= button(scheme: :danger, tag: :a, href: delete_url(work_package_shares_role_id: "all"), data: { turbo_method: :delete }) { t(:button_revoke_access) } %> <% end %> <% else %> <% dialog.with_body do %> diff --git a/app/components/messages/show_page_header_component.html.erb b/app/components/messages/show_page_header_component.html.erb index 7d4d670b37b..9181b253ee9 100644 --- a/app/components/messages/show_page_header_component.html.erb +++ b/app/components/messages/show_page_header_component.html.erb @@ -49,8 +49,8 @@ href: topic_path(@topic), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/my/access_token/api/row_component.rb b/app/components/my/access_token/api/row_component.rb index 4c8c6e7cd4c..ab642047b93 100644 --- a/app/components/my/access_token/api/row_component.rb +++ b/app/components/my/access_token/api/row_component.rb @@ -62,8 +62,11 @@ module My action: delete_action, access_token_id: api_token.id }, - method: :delete, - data: { confirm: t("my_account.access_tokens.simple_revoke_confirmation"), test_selector: "api-token-revoke" }, + data: { + turbo_method: :delete, + turbo_confirm: t("my_account.access_tokens.simple_revoke_confirmation"), + test_selector: "api-token-revoke" + }, class: "icon icon-delete" end diff --git a/app/components/notifications/index_sub_header_component.html.erb b/app/components/notifications/index_sub_header_component.html.erb index 293f4dc22e2..a3782ea274e 100644 --- a/app/components/notifications/index_sub_header_component.html.erb +++ b/app/components/notifications/index_sub_header_component.html.erb @@ -21,7 +21,7 @@ subheader.with_action_button( tag: :a, href: mark_all_read_notifications_path(**current_filters), - data: { method: :post, confirm: I18n.t("js.notifications.center.mark_all_read_confirmation") }, + data: { turbo_method: :post, turbo_confirm: I18n.t("js.notifications.center.mark_all_read_confirmation") }, size: :medium, leading_icon: :"op-read-all", label: I18n.t("js.notifications.center.mark_all_read"), diff --git a/app/components/oauth/show_page_header_component.html.erb b/app/components/oauth/show_page_header_component.html.erb index 03a7a7200d0..c3357db70ce 100644 --- a/app/components/oauth/show_page_header_component.html.erb +++ b/app/components/oauth/show_page_header_component.html.erb @@ -55,8 +55,8 @@ See COPYRIGHT and LICENSE files for more details. href: oauth_application_path(@application), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/app/components/projects/index_page_header_component.html.erb b/app/components/projects/index_page_header_component.html.erb index 4bcee7d9c0a..b53011530b8 100644 --- a/app/components/projects/index_page_header_component.html.erb +++ b/app/components/projects/index_page_header_component.html.erb @@ -54,7 +54,7 @@ classes: "op-primer--star-icon", tag: :a, href: helpers.build_favorite_path(query, format: :html), - data: { method: :delete, "test-selector": "project-query-unfavorite" } + data: { turbo_method: :delete, "test-selector": "project-query-unfavorite" } ) else header.with_action_icon_button( @@ -63,7 +63,7 @@ label: t(:button_favorite), tag: :a, href: helpers.build_favorite_path(query, format: :html), - data: { method: :post, "test-selector": "project-query-favorite" } + data: { turbo_method: :post, "test-selector": "project-query-favorite" } ) end end diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rb index ffaa8a69cb4..f3f7ffdee88 100644 --- a/app/components/projects/row_component.rb +++ b/app/components/projects/row_component.rb @@ -58,7 +58,7 @@ module Projects tag: :a, tooltip_direction: :e, href: helpers.build_favorite_path(project, format: :html), - data: { "turbo-method": currently_favorited? ? :delete : :post }, + data: { turbo_method: currently_favorited? ? :delete : :post }, classes: currently_favorited? ? "op-primer--star-icon " : "op-project-row-component--favorite", label: currently_favorited? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite), aria: { label: currently_favorited? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite) }, @@ -362,8 +362,8 @@ module Projects label: I18n.t(:button_archive), href: project_archive_path(project, status: params[:status]), data: { - confirm: t("project.archive.are_you_sure", name: project.name), - method: :post + turbo_method: :post, + turbo_confirm: t("project.archive.are_you_sure", name: project.name) } } end @@ -376,7 +376,7 @@ module Projects icon: :unlock, label: I18n.t(:button_unarchive), href: project_archive_path(project, status: params[:status]), - data: { method: :delete } + data: { turbo_method: :delete } } end end diff --git a/app/components/projects/settings/index_page_header_component.html.erb b/app/components/projects/settings/index_page_header_component.html.erb index 6f7ad6fdd90..9f57144c255 100644 --- a/app/components/projects/settings/index_page_header_component.html.erb +++ b/app/components/projects/settings/index_page_header_component.html.erb @@ -81,7 +81,7 @@ label: t(:button_archive), href: project_archive_path(@project, status: "", name: @project.name), content_arguments: { - data: { confirm: t("project.archive.are_you_sure", name: @project.name), method: :post }, + data: { turbo_method: :post, turbo_confirm: t("project.archive.are_you_sure", name: @project.name) }, test_selector: "project-settings--archive" } ) do |item| @@ -96,7 +96,7 @@ label: t("project.template.#{label}"), href: project_templated_path(@project), content_arguments: { - data: { method: @project.templated ? :delete : :post }, + data: { turbo_method: @project.templated ? :delete : :post }, test_selector: "project-settings--mark-template" } ) do |item| diff --git a/app/components/settings/project_custom_field_sections/custom_field_row_component.rb b/app/components/settings/project_custom_field_sections/custom_field_row_component.rb index 239dba9a6c9..a0167b86043 100644 --- a/app/components/settings/project_custom_field_sections/custom_field_row_component.rb +++ b/app/components/settings/project_custom_field_sections/custom_field_row_component.rb @@ -89,8 +89,12 @@ module Settings scheme: :danger, href: admin_settings_project_custom_field_path(@project_custom_field), form_arguments: { - method: :delete, data: { confirm: t("text_are_you_sure_with_project_custom_fields"), - "turbo-stream": true, test_selector: "project-custom-field-delete" } + method: :delete, + data: { + turbo_confirm: t("text_are_you_sure_with_project_custom_fields"), + turbo_stream: true, + test_selector: "project-custom-field-delete" + } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/app/components/settings/project_custom_field_sections/show_component.rb b/app/components/settings/project_custom_field_sections/show_component.rb index 3203b36f1dc..ac5d5b1d208 100644 --- a/app/components/settings/project_custom_field_sections/show_component.rb +++ b/app/components/settings/project_custom_field_sections/show_component.rb @@ -116,8 +116,12 @@ module Settings scheme: :danger, href: admin_settings_project_custom_field_section_path(@project_custom_field_section), form_arguments: { - method: :delete, data: { confirm: t("text_are_you_sure"), "turbo-stream": true, - test_selector: "project-custom-field-section-delete" } + method: :delete, + data: { + turbo_confirm: t(:text_are_you_sure), + turbo_stream: true, + test_selector: "project-custom-field-section-delete" + } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/app/components/settings/project_phase_definitions/row_component.html.erb b/app/components/settings/project_phase_definitions/row_component.html.erb index ae6983e7de3..a7137fc5f34 100644 --- a/app/components/settings/project_phase_definitions/row_component.html.erb +++ b/app/components/settings/project_phase_definitions/row_component.html.erb @@ -81,7 +81,7 @@ See COPYRIGHT and LICENSE files for more details. form_arguments: { method: :delete, data: { - confirm: t("text_are_you_sure_with_project_life_cycle_step") + turbo_confirm: t("text_are_you_sure_with_project_life_cycle_step") } } ) do |item| diff --git a/app/components/statuses/row_component.rb b/app/components/statuses/row_component.rb index dd49dd6124f..64fd3be7232 100644 --- a/app/components/statuses/row_component.rb +++ b/app/components/statuses/row_component.rb @@ -78,8 +78,7 @@ module Statuses link_to( helpers.op_icon("icon icon-delete"), status_path(status), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, title: t(:button_delete) ) end diff --git a/app/components/users/edit_page_header_component.html.erb b/app/components/users/edit_page_header_component.html.erb index 6ef00d2c9fc..8538ab72fad 100644 --- a/app/components/users/edit_page_header_component.html.erb +++ b/app/components/users/edit_page_header_component.html.erb @@ -51,7 +51,7 @@ See COPYRIGHT and LICENSE files for more details. mobile_label: t(:label_send_invitation), size: :medium, href: resend_invitation_user_path(@user), - data: { method: :post }, + data: { turbo_method: :post }, aria: { label: I18n.t(:label_send_invitation) }, title: I18n.t(:tooltip_resend_invitation) ) do |button| @@ -70,7 +70,7 @@ See COPYRIGHT and LICENSE files for more details. size: :medium, name: name, href: change_status_user_path(@user, { name => "" }), - data: { method: :post }, + data: { turbo_method: :post }, aria: { label: title }, title: title ) do |button| diff --git a/app/components/users/sessions/row_component.rb b/app/components/users/sessions/row_component.rb index ae8550aff4e..9b27423feb8 100644 --- a/app/components/users/sessions/row_component.rb +++ b/app/components/users/sessions/row_component.rb @@ -105,9 +105,9 @@ module Users href: url_for(revoke_path), "aria-label": I18n.t(:button_revoke), data: { - method: :delete, - confirm: I18n.t(:text_are_you_sure), - disable_with: I18n.t(:label_loading) + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_submits_with: I18n.t(:label_loading) } ) ) diff --git a/app/components/users/show_page_header_component.html.erb b/app/components/users/show_page_header_component.html.erb index b71911afbd6..85dc0bb68ee 100644 --- a/app/components/users/show_page_header_component.html.erb +++ b/app/components/users/show_page_header_component.html.erb @@ -55,7 +55,7 @@ See COPYRIGHT and LICENSE files for more details. mobile_label: t(:label_send_invitation), size: :medium, href: resend_invitation_user_path(@user), - data: { method: :post }, + data: { turbo_method: :post }, aria: { label: I18n.t(:label_send_invitation) }, title: I18n.t(:tooltip_resend_invitation) ) do |button| diff --git a/app/components/versions/row_component.rb b/app/components/versions/row_component.rb index d5f249b5be1..1a6187596f3 100644 --- a/app/components/versions/row_component.rb +++ b/app/components/versions/row_component.rb @@ -108,8 +108,7 @@ module Versions helpers.link_to_if_authorized "", { controller: "/versions", action: "destroy", id: version }, - data: { confirm: t(:text_are_you_sure) }, - method: :delete, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, class: "icon icon-delete", title: t(:button_delete) end diff --git a/app/components/wiki_pages/show_page_header_component.html.erb b/app/components/wiki_pages/show_page_header_component.html.erb index d7dd08a7a65..de0802442f4 100644 --- a/app/components/wiki_pages/show_page_header_component.html.erb +++ b/app/components/wiki_pages/show_page_header_component.html.erb @@ -80,7 +80,7 @@ See COPYRIGHT and LICENSE files for more details. label: lock_data[:label], tag: :a, size: :medium, - content_arguments: { data: { method: :post } }, + content_arguments: { data: { turbo_method: :post } }, href: url_for(controller: "wiki", action: "protect", id: @page, protected: lock_data[:protected]) ) do |item| item.with_leading_visual_icon(icon: lock_data[:icon]) @@ -116,7 +116,7 @@ See COPYRIGHT and LICENSE files for more details. scheme: :danger, tag: :a, size: :medium, - content_arguments: { data: { confirm: t(:text_are_you_sure), method: :delete } }, + content_arguments: { data: { turbo_confirm: t(:text_are_you_sure), turbo_method: :delete } }, href: url_for(controller: "wiki", action: "destroy", id: @page), data: { "test-selector": "wiki-delete-action-menu-item" } ) do |item| diff --git a/app/components/work_package_relations_tab/relation_component.html.erb b/app/components/work_package_relations_tab/relation_component.html.erb index ba5f9a4b45a..159f4920f84 100644 --- a/app/components/work_package_relations_tab/relation_component.html.erb +++ b/app/components/work_package_relations_tab/relation_component.html.erb @@ -36,7 +36,7 @@ form_arguments: { method: :delete, data: { - confirm: t("text_are_you_sure"), + turbo_confirm: t("text_are_you_sure"), turbo_stream: true, update_work_package: true } diff --git a/app/components/work_package_types/types/row_component.rb b/app/components/work_package_types/types/row_component.rb index 0601ebe1d83..230e5479ba9 100644 --- a/app/components/work_package_types/types/row_component.rb +++ b/app/components/work_package_types/types/row_component.rb @@ -86,8 +86,7 @@ module WorkPackageTypes link_to( "", model, - method: :delete, - data: { confirm: t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, class: "icon icon-delete", title: t(:button_delete) ) diff --git a/app/controllers/admin/attachments/quarantined_attachments_controller.rb b/app/controllers/admin/attachments/quarantined_attachments_controller.rb index 52ad8019e40..2b0b734cb20 100644 --- a/app/controllers/admin/attachments/quarantined_attachments_controller.rb +++ b/app/controllers/admin/attachments/quarantined_attachments_controller.rb @@ -52,7 +52,7 @@ module Admin I18n.t("antivirus_scan.deleted_by_admin", filename: @attachment.filename)) flash[:notice] = t(:notice_successful_delete) - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index a70f6add13b..4d71eb5c454 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -62,7 +62,7 @@ class AdminController < ApplicationController @plugins = Redmine::Plugin.not_bundled.sort end - def test_email + def test_email # rubocop:disable Metrics/AbcSize raise_delivery_errors = ActionMailer::Base.raise_delivery_errors # Force ActionMailer to raise delivery errors so we can catch it ActionMailer::Base.raise_delivery_errors = true @@ -73,7 +73,7 @@ class AdminController < ApplicationController flash[:error] = I18n.t(:notice_email_error, value: Redmine::CodesetUtil.replace_invalid_utf8(e.message.dup)) end ActionMailer::Base.raise_delivery_errors = raise_delivery_errors - redirect_to admin_settings_mail_notifications_path + redirect_to admin_settings_mail_notifications_path, status: :see_other end def info diff --git a/app/controllers/attribute_help_texts_controller.rb b/app/controllers/attribute_help_texts_controller.rb index 56250ac3948..946f80a370f 100644 --- a/app/controllers/attribute_help_texts_controller.rb +++ b/app/controllers/attribute_help_texts_controller.rb @@ -93,7 +93,8 @@ class AttributeHelpTextsController < ApplicationController flash[:error] = t(:error_can_not_delete_entry) end - redirect_to attribute_help_texts_path(tab: @attribute_help_text.attribute_scope) + redirect_to attribute_help_texts_path(tab: @attribute_help_text.attribute_scope), + status: :see_other end protected diff --git a/app/controllers/concerns/custom_fields/shared_actions.rb b/app/controllers/concerns/custom_fields/shared_actions.rb index ebacebf5458..d7cc27344d4 100644 --- a/app/controllers/concerns/custom_fields/shared_actions.rb +++ b/app/controllers/concerns/custom_fields/shared_actions.rb @@ -100,7 +100,7 @@ module CustomFields rescue StandardError flash[:error] = I18n.t(:error_can_not_delete_custom_field) end - redirect_to index_path(@custom_field, tab: @custom_field.class.name) + redirect_to index_path(@custom_field, tab: @custom_field.class.name), status: :see_other end def delete_option @@ -114,7 +114,7 @@ module CustomFields flash[:error] = @custom_option.errors.full_messages end - redirect_to edit_path(@custom_field, id: @custom_field.id) + redirect_to edit_path(@custom_field, id: @custom_field.id), status: :see_other end def new_custom_field diff --git a/app/controllers/custom_actions_controller.rb b/app/controllers/custom_actions_controller.rb index efe8c9f8b15..bfeb80dd4b2 100644 --- a/app/controllers/custom_actions_controller.rb +++ b/app/controllers/custom_actions_controller.rb @@ -68,7 +68,7 @@ class CustomActionsController < ApplicationController def destroy @custom_action.destroy - redirect_to custom_actions_path + redirect_to custom_actions_path, status: :see_other end private @@ -76,7 +76,7 @@ class CustomActionsController < ApplicationController def index_or_render(render_action) ->(call) { call.on_success do - redirect_to custom_actions_path + redirect_to custom_actions_path, status: :see_other end call.on_failure do diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index c7ddd9a9aa1..b2864f33ce1 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -77,7 +77,7 @@ class GroupsController < ApplicationController if service_call.success? flash[:notice] = I18n.t(:notice_successful_update) - redirect_to(groups_path) + redirect_to(groups_path, status: :see_other) else render action: :edit, status: :unprocessable_entity end @@ -89,7 +89,7 @@ class GroupsController < ApplicationController .call flash[:info] = I18n.t(:notice_deletion_scheduled) - redirect_to(action: :index) + redirect_to(action: :index, status: :see_other) end def add_users @@ -139,7 +139,11 @@ class GroupsController < ApplicationController .call flash[:notice] = I18n.t :notice_successful_delete - redirect_to controller: "/groups", action: "edit", id: @group, tab: redirected_to_tab(member) + redirect_to controller: "/groups", + action: "edit", + id: @group, + tab: redirected_to_tab(member), + status: :see_other end protected @@ -187,6 +191,10 @@ class GroupsController < ApplicationController service_call.apply_flash_message!(flash) end - redirect_to controller: "/groups", action: "edit", id: @group, tab: "users" + redirect_to controller: "/groups", + action: "edit", + id: @group, + tab: "users", + status: :see_other end end diff --git a/app/controllers/ldap_auth_sources_controller.rb b/app/controllers/ldap_auth_sources_controller.rb index f74fee38fa2..f0e8a072c79 100644 --- a/app/controllers/ldap_auth_sources_controller.rb +++ b/app/controllers/ldap_auth_sources_controller.rb @@ -96,7 +96,7 @@ class LdapAuthSourcesController < ApplicationController else flash[:warning] = t(:notice_wont_delete_auth_source) end - redirect_to action: "index" + redirect_to action: "index", status: :see_other end protected diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 584a505b996..77c6f9abb0c 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -97,7 +97,7 @@ class MembersController < ApplicationController display_error(service_call) end - redirect_to project_members_path(project_id: @project) + redirect_to project_members_path(project_id: @project), status: :see_other end def autocomplete_for_member diff --git a/app/controllers/my/access_tokens_controller.rb b/app/controllers/my/access_tokens_controller.rb index 4569fbab69c..b0e5cb3389e 100644 --- a/app/controllers/my/access_tokens_controller.rb +++ b/app/controllers/my/access_tokens_controller.rb @@ -77,7 +77,7 @@ module My else flash[:error] = I18n.t("my_account.access_tokens.storages.failed") end - redirect_to action: :index + redirect_to action: :index, status: :see_other end def generate_rss_key # rubocop:disable Metrics/AbcSize @@ -91,7 +91,7 @@ module My Rails.logger.error "Failed to reset user ##{current_user.id} RSS key: #{e}" flash[:error] = t("my.access_token.failed_to_reset_token", error: e.message) ensure - redirect_to action: :index + redirect_to action: :index, status: :see_other end def revoke_rss_key @@ -101,7 +101,7 @@ module My Rails.logger.error "Failed to revoke rss token ##{current_user.id}: #{e}" flash[:error] = t("my.access_token.failed_to_reset_token", error: e.message) ensure - redirect_to action: :index + redirect_to action: :index, status: :see_other end def generate_api_key @@ -139,7 +139,7 @@ module My end # rubocop:enable Rails/ActionControllerFlashBeforeRender - redirect_to action: :index + redirect_to action: :index, status: :see_other end def revoke_ical_meeting_token # rubocop:disable Metrics/AbcSize @@ -158,7 +158,7 @@ module My end # rubocop:enable Rails/ActionControllerFlashBeforeRender - redirect_to action: :index + redirect_to action: :index, status: :see_other end def revoke_ical_token @@ -169,7 +169,7 @@ module My Rails.logger.error "Failed to revoke all ical tokens for ##{current_user.id}: #{e}" flash[:error] = t("my.access_token.failed_to_reset_token", error: e.message) ensure - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/app/controllers/my/auto_login_tokens_controller.rb b/app/controllers/my/auto_login_tokens_controller.rb index c75274c2753..5f216a73c3b 100644 --- a/app/controllers/my/auto_login_tokens_controller.rb +++ b/app/controllers/my/auto_login_tokens_controller.rb @@ -42,7 +42,7 @@ module My @token.destroy flash[:notice] = I18n.t(:notice_successful_delete) - redirect_to my_sessions_path + redirect_to my_sessions_path, status: :see_other end private diff --git a/app/controllers/my/sessions_controller.rb b/app/controllers/my/sessions_controller.rb index 69aff7bcbff..b723b42af5f 100644 --- a/app/controllers/my/sessions_controller.rb +++ b/app/controllers/my/sessions_controller.rb @@ -65,7 +65,7 @@ module My @session.delete flash[:notice] = I18n.t(:notice_successful_delete) - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb index 891d8c18028..6ed500f5342 100644 --- a/app/controllers/oauth/applications_controller.rb +++ b/app/controllers/oauth/applications_controller.rb @@ -96,7 +96,7 @@ module OAuth flash[:error] = t(:error_can_not_delete_entry) end - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/app/controllers/projects/archive_controller.rb b/app/controllers/projects/archive_controller.rb index ad8c556276b..fbc9911b380 100644 --- a/app/controllers/projects/archive_controller.rb +++ b/app/controllers/projects/archive_controller.rb @@ -47,11 +47,12 @@ class Projects::ArchiveController < ApplicationController service_call = change_status(status) if service_call.success? - redirect_to(projects_path) + redirect_to(projects_path, status: :see_other) else flash[:error] = t(:"error_can_not_#{status}_project", errors: service_call.errors.full_messages.join(", ")) - redirect_back fallback_location: projects_path + redirect_back fallback_location: projects_path, + status: :see_other end end diff --git a/app/controllers/projects/templated_controller.rb b/app/controllers/projects/templated_controller.rb index 92fc50d026e..6b0615c73e1 100644 --- a/app/controllers/projects/templated_controller.rb +++ b/app/controllers/projects/templated_controller.rb @@ -42,7 +42,7 @@ class Projects::TemplatedController < ApplicationController private - def change_templated_action(templated) + def change_templated_action(templated) # rubocop:disable Metrics/AbcSize service_call = Projects::UpdateService .new(user: current_user, model: @project) @@ -59,6 +59,6 @@ class Projects::TemplatedController < ApplicationController flash[:error] = messages.join(". ") end - redirect_to project_settings_general_path(@project) + redirect_to project_settings_general_path(@project), status: :see_other end end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 2c56019a0ab..b4df0c38ea6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -129,7 +129,8 @@ class RepositoriesController < ApplicationController else flash[:error] = repository.errors.full_messages end - redirect_to project_settings_repository_path(@project) + redirect_to project_settings_repository_path(@project), + status: :see_other end alias_method :browse, :show diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 63bcb47b9d7..71cd8ddc67b 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -111,7 +111,7 @@ class VersionsController < ApplicationController flash[:error] << archived_project_mesage if archived_projects.any? end - redirect_to project_settings_versions_path(@project) + redirect_to project_settings_versions_path(@project), status: :see_other end private diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index df25fe92ca5..bbccbf2b435 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -60,7 +60,7 @@ class WatchersController < ApplicationController def set_watcher(user, watching) @watched.set_watcher(user, watching) - redirect_back(fallback_location: home_url) + redirect_back(fallback_location: home_url, status: :see_other) end def deny_access_unless_visible diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index dc9e4ebc902..bd199274fef 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -280,9 +280,9 @@ class WikiController < ApplicationController # Removes a wiki page and its history # Children can be either set as root pages, removed or reassigned to another parent page - def destroy + def destroy # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity unless editable? - flash[:error] = I18n.t(:error_unable_delete_wiki) + flash.now[:error] = I18n.t(:error_unable_delete_wiki) return render_403 end @@ -309,12 +309,11 @@ class WikiController < ApplicationController end @page.destroy + flash[:notice] = I18n.t(:notice_successful_delete) if page = @wiki.find_page(@wiki.start_page) || @wiki.pages.first - flash[:notice] = I18n.t(:notice_successful_delete) - redirect_to action: "index", project_id: @project, id: page + redirect_to action: "index", project_id: @project, id: page, status: :see_other else - flash[:notice] = I18n.t(:notice_successful_delete) - redirect_to project_path(@project) + redirect_to project_path(@project), status: :see_other end end @@ -345,6 +344,7 @@ class WikiController < ApplicationController def show_create? @editable && @page && User.current.allowed_in_project?(:edit_wiki_pages, @project) end + private def locked? diff --git a/app/controllers/wiki_menu_items_controller.rb b/app/controllers/wiki_menu_items_controller.rb index 5e1fe78188b..5bd15ca8eac 100644 --- a/app/controllers/wiki_menu_items_controller.rb +++ b/app/controllers/wiki_menu_items_controller.rb @@ -103,7 +103,7 @@ class WikiMenuItemsController < ApplicationController flash[:notice] = t(:notice_successful_update) end - redirect_back_or_default({ action: "edit", id: @page }) + redirect_back_or_default({ action: "edit", id: @page }, status: :see_other) else respond_to do |format| format.html do diff --git a/app/controllers/work_package_types/types_controller.rb b/app/controllers/work_package_types/types_controller.rb index 78ce606a51d..6191ebb7d24 100644 --- a/app/controllers/work_package_types/types_controller.rb +++ b/app/controllers/work_package_types/types_controller.rb @@ -93,7 +93,7 @@ module WorkPackageTypes else flash[:error] = destroy_error_message end - redirect_to action: "index" + redirect_to action: "index", status: :see_other end protected diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 80fdade24e2..28f2bb6fd0d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -99,8 +99,7 @@ module ApplicationHelper def delete_link(url, options = {}) options = { - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, class: "icon icon-delete" }.merge(options) @@ -199,10 +198,10 @@ module ApplicationHelper def time_tag(time) text = distance_of_time_in_words(Time.now, time) - if @project and @project.module_enabled?("activity") + if @project&.module_enabled?("activity") # rubocop:disable Rails/HelperInstanceVariable link_to(text, { controller: "/activities", action: "index", - project_id: @project, + project_id: @project, # rubocop:disable Rails/HelperInstanceVariable from: time.to_date }, title: format_time(time)) else diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index e8a3fde4c24..d6416a80b0f 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -38,13 +38,16 @@ module MembersHelper if member.roles.length == 1 link_to("", principal_membership_path(member.principal, member), - { method: :delete, class: "icon icon-delete", title: t(:button_delete), - data: { "test-selector" => "delete-global-role" } }) + { class: "icon icon-delete", title: t(:button_delete), + data: { turbo_method: :delete, "test-selector" => "delete-global-role" } }) else link_to("", principal_membership_path(member.principal, member, "membership[role_ids]" => member.roles - [role]), - { method: :patch, class: "icon icon-delete", title: t(:button_delete), - data: { "test-selector" => "delete-global-role" } }) + { + class: "icon icon-delete", + title: t(:button_delete), + data: { turbo_method: :patch, "test-selector" => "delete-global-role" } + }) end end diff --git a/app/helpers/reorder_links_helper.rb b/app/helpers/reorder_links_helper.rb index 542e77400bb..18ebf910481 100644 --- a/app/helpers/reorder_links_helper.rb +++ b/app/helpers/reorder_links_helper.rb @@ -49,7 +49,7 @@ module ReorderLinksHelper class: "icon-context #{icon_class} icon-small") link_to(text + icon, url.merge("#{name}[move_to]" => direction), - method:, + data: { turbo_method: method }, title: label) end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 42d34e08a37..e485e80ffe7 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -130,7 +130,7 @@ module UsersHelper href: change_status_user_path(user, name.to_sym => "1", back_url: request.fullpath), - data: { method: :post }) do |button| + data: { turbo_method: :post }) do |button| button.with_leading_visual_icon(icon: change_user_status_icons[name]) title end diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 0ce05c8fb03..95e63ab46cc 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -65,8 +65,6 @@ module WatchersHelper object_type: object.class.to_s.underscore.pluralize, object_id: object.id) - method = watched ? :delete : :post - label = watched ? I18n.t(:button_unwatch) : I18n.t(:button_watch) { @@ -75,7 +73,7 @@ module WatchersHelper scheme: :default, aria: { label: label }, data: { - method: + turbo_method: watched ? :delete : :post }, mobile_icon: watched ? "eye-closed" : "eye", mobile_label: label diff --git a/app/views/account/_password_login_form.html.erb b/app/views/account/_password_login_form.html.erb index 86766524f92..7dd30a45598 100644 --- a/app/views/account/_password_login_form.html.erb +++ b/app/views/account/_password_login_form.html.erb @@ -64,7 +64,7 @@ See COPYRIGHT and LICENSE files for more details. <%= submit_tag t(:button_login), name: :login, class: "button -primary button_no-margin", - data: { disable_with: t(:label_loading) } %> + data: { turbo_submits_with: t(:label_loading) } %>
<% end %> diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb index 999971035b5..94f3955e987 100644 --- a/app/views/custom_fields/_tab.html.erb +++ b/app/views/custom_fields/_tab.html.erb @@ -160,8 +160,10 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to( op_icon("icon icon-delete"), custom_field_path(custom_field), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure) + }, title: t(:button_delete) ) %> diff --git a/app/views/custom_styles/show.html.erb b/app/views/custom_styles/show.html.erb index fd962a4885a..8ae9c26aaf4 100644 --- a/app/views/custom_styles/show.html.erb +++ b/app/views/custom_styles/show.html.erb @@ -48,7 +48,10 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag t(:button_save), - data: { test_selector: "color-theme-button", confirm: (t("admin.custom_styles.theme_warning") if @current_theme.blank?) } %> + data: { + test_selector: "color-theme-button", + turbo_confirm: (t("admin.custom_styles.theme_warning") if @current_theme.blank?) + } %> <% end %> diff --git a/app/views/custom_styles/uploads/_image.html.erb b/app/views/custom_styles/uploads/_image.html.erb index 80881843603..94a8eec48b4 100644 --- a/app/views/custom_styles/uploads/_image.html.erb +++ b/app/views/custom_styles/uploads/_image.html.erb @@ -56,7 +56,7 @@ See COPYRIGHT and LICENSE files for more details. <%= render(Primer::Beta::Button.new( tag: :a, href: image[:delete_path], - data: { method: :delete } + data: { turbo_method: :delete } )) do |button| button.with_leading_visual_icon(icon: :trash) t(:button_delete) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 12f9391ac4a..c71d7ef4d6a 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -153,8 +153,7 @@ See COPYRIGHT and LICENSE files for more details. title: t(:button_edit) %> <%= link_to_if_authorized "", { controller: "/forums", action: "destroy", project_id: @project, id: forum }, - data: { confirm: t(:text_are_you_sure) }, - method: :delete, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, class: "icon icon-delete", title: t(:button_delete) %> diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb index e4c69c82c4f..b5274b0bcae 100644 --- a/app/views/groups/_memberships.html.erb +++ b/app/views/groups/_memberships.html.erb @@ -42,75 +42,78 @@ See COPYRIGHT and LICENSE files for more details. - - -
-
+ + +
+
<%= Project.model_name.human %> -
- - -
-
+
+ + +
+
<%= t(:label_role_plural) %> -
- -
- +
+ + +
+ + - <% memberships.where.not(project: nil).each do |membership| %> - <% next if membership.new_record? %> - - - <%= link_to membership.project.name, project_members_path(membership.project) %> - - + <% memberships.where.not(project: nil).each do |membership| %> + <% next if membership.new_record? %> + + + <%= link_to membership.project.name, project_members_path(membership.project) %> + + - <%=h membership.roles.sort.collect(&:to_s).join(', ') %> + <%= h membership.roles.sort.collect(&:to_s).join(', ') %> - <%= labelled_tabular_form_for(:membership, - url: membership_of_group_path(@group, membership), - method: :patch, - html: { - id: "member-#{membership.id}-roles-form", - style: 'display:none;' - }) do |f| %> - <% roles.each do |role| %> - - <% end %> -

- <%= submit_tag t(:button_change), class: 'button -primary -small' %> - <%= link_to_function t(:button_cancel), "jQuery('#member-#{membership.id}-roles').show(); jQuery('#member-#{membership.id}-roles-form').hide();", - class: 'button -small' %> -

- <% end %> - - - <%= link_to_function icon_wrapper('icon icon-edit', t(:button_edit)), - "jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();" do %> - <% end %> - <%= link_to t(:button_remove), membership_of_group_path(@group, membership), - method: :delete, - class: 'icon icon-remove' %> - - - <% end %> + <%= labelled_tabular_form_for(:membership, + url: membership_of_group_path(@group, membership), + method: :patch, + html: { + id: "member-#{membership.id}-roles-form", + style: 'display:none;' + }) do |f| %> + <% roles.each do |role| %> + + <% end %> +

+ <%= submit_tag t(:button_change), class: 'button -primary -small' %> + <%= link_to_function t(:button_cancel), "jQuery('#member-#{membership.id}-roles').show(); jQuery('#member-#{membership.id}-roles-form').hide();", + class: 'button -small' %> +

+ <% end %> + + + <%= link_to_function icon_wrapper('icon icon-edit', t(:button_edit)), + "jQuery('#member-#{membership.id}-roles').hide(); jQuery('#member-#{membership.id}-roles-form').show();" do %> + <% end %> + <%= link_to t(:button_remove), + membership_of_group_path(@group, membership), + data: { turbo_method: :delete }, + class: 'icon icon-remove' %> + + + <% end %> @@ -124,11 +127,11 @@ See COPYRIGHT and LICENSE files for more details. <% if projects.any? %> <%= styled_form_tag(memberships_of_group_path(@group), method: :post) do %>
- <%=t(:label_project_new)%> + <%= t(:label_project_new) %> <%= label_tag "membership_project_id", t(:description_choose_project), class: "sr-only" %> - <% group_project_ids = @group.projects.ids %> - <% filters = [{ name: 'active', operator: '=', values: ['t']}] %> + <% group_project_ids = @group.projects.ids %> + <% filters = [{ name: 'active', operator: '=', values: ['t'] }] %> <% filters << { name: 'id', operator: '!', values: group_project_ids.map(&:to_s) } if group_project_ids.any? %> <%= angular_component_tag 'opce-project-autocompleter', inputs: { diff --git a/app/views/groups/_users_table.html.erb b/app/views/groups/_users_table.html.erb index 45a3897aa5d..e4b98e26272 100644 --- a/app/views/groups/_users_table.html.erb +++ b/app/views/groups/_users_table.html.erb @@ -50,8 +50,9 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to_user user %> - <%= link_to "", member_of_group_path(@group, user), - method: :delete, + <%= link_to "", + member_of_group_path(@group, user), + data: { turbo_method: :delete }, class: "icon icon-remove", title: t(:button_remove) %> diff --git a/app/views/individual_principals/_memberships.html.erb b/app/views/individual_principals/_memberships.html.erb index cc5a5665fd8..8371d21a4a1 100644 --- a/app/views/individual_principals/_memberships.html.erb +++ b/app/views/individual_principals/_memberships.html.erb @@ -123,7 +123,7 @@ See COPYRIGHT and LICENSE files for more details. title: t(:button_edit) %> <%= link_to(icon_wrapper('icon icon-remove', t(:button_remove)), polymorphic_path([@individual_principal, :membership], id: membership), - method: :delete, + data: { turbo_method: :delete }, title: t(:button_remove)) if membership.deletable? %> <% end %> diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 2ec9720048d..60d36d8c286 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -66,8 +66,7 @@ See COPYRIGHT and LICENSE files for more details. alt: t(:button_edit)) if message.editable_by?(User.current) %> <%= link_to(icon_wrapper('icon-context icon-delete', t(:button_delete)), { action: 'destroy', id: message }, - method: :delete, - data: { confirm: t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, title: t(:button_delete), class: 'no-decoration-on-hover', alt: t(:button_delete)) if message.destroyable_by?(User.current) %> diff --git a/app/views/my/access_tokens/_icalendar_tokens_section.html.erb b/app/views/my/access_tokens/_icalendar_tokens_section.html.erb index fe928b4537b..a85a6220c5d 100644 --- a/app/views/my/access_tokens/_icalendar_tokens_section.html.erb +++ b/app/views/my/access_tokens/_icalendar_tokens_section.html.erb @@ -82,8 +82,11 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to "", { action: "revoke_ical_token", access_token_id: token.id }, - data: { confirm: t("my_account.access_tokens.simple_revoke_confirmation"), test_selector: "ical-token-row-#{token.id}-revoke" }, - method: :delete, + data: { + turbo_method: :delete, + turbo_confirm: t("my_account.access_tokens.simple_revoke_confirmation"), + test_selector: "ical-token-row-#{token.id}-revoke" + }, class: "icon icon-delete" %> diff --git a/app/views/my/access_tokens/_oauth_tokens_section.html.erb b/app/views/my/access_tokens/_oauth_tokens_section.html.erb index ac90cd8bcfc..aa9c7f1d925 100644 --- a/app/views/my/access_tokens/_oauth_tokens_section.html.erb +++ b/app/views/my/access_tokens/_oauth_tokens_section.html.erb @@ -40,42 +40,47 @@ See COPYRIGHT and LICENSE files for more details.
- <%= render partial: "token_table_header", - locals: { - column_headers: [ - t("attributes.name"), - User.human_attribute_name(:created_at), - t("my_account.access_tokens.headers.expiration") - ] - } %> + <%= render partial: "token_table_header", + locals: { + column_headers: [ + t("attributes.name"), + User.human_attribute_name(:created_at), + t("my_account.access_tokens.headers.expiration") + ] + } %> - <% granted_applications.each do |application, tokens| %> - <% latest = tokens.max_by(&:created_at) %> - - - - - - - <% end %> + <% granted_applications.each do |application, tokens| %> + <% latest = tokens.max_by(&:created_at) %> + + + + + + + <% end %>
- <%= t("oauth.application.named", name: application.name) %> -   - (<%= t("oauth.x_active_tokens", count: tokens.count) %>) - - <%= format_time(latest.created_at) %> - - <%= format_time(latest.created_at + latest.expires_in.seconds) %> - - <%= link_to "", - revoke_my_oauth_application_path(application_id: application.id), - data: { confirm: t( - "oauth.revoke_my_application_confirmation", - token_count: t("oauth.x_active_tokens", count: tokens.count) - ), - test_selector: "oauth-token-row-#{application.id}-revoke" }, - method: :post, - class: "icon icon-delete" %> -
+ <%= t("oauth.application.named", name: application.name) %> +   + (<%= t("oauth.x_active_tokens", count: tokens.count) %>) + + <%= format_time(latest.created_at) %> + + <%= format_time(latest.created_at + latest.expires_in.seconds) %> + + <%= link_to "", + revoke_my_oauth_application_path(application_id: application.id), + data: { + turbo_method: :post, + turbo_confirm: t( + "oauth.revoke_my_application_confirmation", + token_count: t( + "oauth.x_active_tokens", + count: tokens.count + ) + ), + test_selector: "oauth-token-row-#{application.id}-revoke" + }, + class: "icon icon-delete" %> +
diff --git a/app/views/my/access_tokens/_rss_tokens_section.html.erb b/app/views/my/access_tokens/_rss_tokens_section.html.erb index bb43b28ade3..ffdebe7668d 100644 --- a/app/views/my/access_tokens/_rss_tokens_section.html.erb +++ b/app/views/my/access_tokens/_rss_tokens_section.html.erb @@ -61,8 +61,11 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to "", { action: "revoke_rss_key" }, - method: :delete, - data: { confirm: t("my_account.access_tokens.simple_revoke_confirmation"), test_selector: "rss-token-revoke" }, + data: { + turbo_method: :delete, + turbo_confirm: t("my_account.access_tokens.simple_revoke_confirmation"), + test_selector: "rss-token-revoke" + }, class: "icon icon-delete" %> @@ -72,7 +75,7 @@ See COPYRIGHT and LICENSE files for more details.
<% else %> <%= - render Primer::Beta::Link.new(href: generate_rss_key_my_access_tokens_path, data: { method: :post }, test_selector: "rss-token-add") do |link| + render Primer::Beta::Link.new(href: generate_rss_key_my_access_tokens_path, data: { turbo_method: :post }, test_selector: "rss-token-add") do |link| link.with_leading_visual_icon(icon: :plus) t("my_account.access_tokens.rss.static_token_name") end diff --git a/app/views/my/access_tokens/_storage_tokens_section.html.erb b/app/views/my/access_tokens/_storage_tokens_section.html.erb index 30bf534f3ba..0aebaf93c39 100644 --- a/app/views/my/access_tokens/_storage_tokens_section.html.erb +++ b/app/views/my/access_tokens/_storage_tokens_section.html.erb @@ -63,9 +63,11 @@ See COPYRIGHT and LICENSE files for more details. <%= link_to "", my_access_token_revoke_storage_token_path(token), - data: { confirm: t("my_account.access_tokens.storages.revoke_token", storage: token.oauth_client.integration.name), - test_selector: "storages-token-row-#{token.id}-revoke" }, - method: :delete, + data: { + turbo_method: :delete, + turbo_confirm: t("my_account.access_tokens.storages.revoke_token", storage: token.oauth_client.integration.name), + test_selector: "storages-token-row-#{token.id}-revoke" + }, class: "icon icon-delete" %> diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index a124eff05ed..a2dcaccc55b 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -62,7 +62,7 @@ See COPYRIGHT and LICENSE files for more details. href: news_path(@news), mobile_icon: :trash, mobile_label: I18n.t("button_delete"), - data: { confirm: t(:text_are_you_sure), method: :delete }, + data: { turbo_confirm: t(:text_are_you_sure), turbo_method: :delete }, aria: { label: I18n.t("button_delete") } ) do |button| button.with_leading_visual_icon(icon: :trash) @@ -77,7 +77,8 @@ See COPYRIGHT and LICENSE files for more details. <%= labelled_tabular_form_for @news, html: { id: "news-form" } do |f| %> <%= render partial: "form", locals: { f: f } %> <%= styled_button_tag t(:button_save), class: "-primary -with-icon icon-checkmark" %> - <%= link_to_function t(:button_cancel), 'jQuery("#edit-news").hide()', class: "button -with-icon icon-cancel" %> + <%= link_to_function t(:button_cancel), 'jQuery("#edit-news").hide()', + class: "button -with-icon icon-cancel" %> <% end %>
<% end %> @@ -99,8 +100,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= link_to_if_authorized icon_wrapper("icon-context icon-delete", t(:button_delete)), { controller: "/news/comments", action: "destroy", id: comment }, - data: { confirm: t(:text_are_you_sure) }, - method: :delete, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, class: "no-decoration-on-hover", title: t(:button_delete), alt: t(:button_delete) %> diff --git a/app/views/projects/settings/work_packages/categories/show.html.erb b/app/views/projects/settings/work_packages/categories/show.html.erb index 256b04a53e9..0b11353351e 100644 --- a/app/views/projects/settings/work_packages/categories/show.html.erb +++ b/app/views/projects/settings/work_packages/categories/show.html.erb @@ -89,8 +89,10 @@ See COPYRIGHT and LICENSE files for more details. title: t(:button_edit) %> <%= link_to_if_authorized "", { controller: "/categories", action: "destroy", id: category }, - data: { confirm: t(:text_are_you_sure) }, - method: :delete, + data: { + turbo_method: :delete, + turbo_confirm: t(:text_are_you_sure) + }, class: "icon icon-delete", title: t(:button_delete) %> diff --git a/app/views/repositories/destroy_info.html.erb b/app/views/repositories/destroy_info.html.erb index 2c7e70c6063..9769938e84f 100644 --- a/app/views/repositories/destroy_info.html.erb +++ b/app/views/repositories/destroy_info.html.erb @@ -60,7 +60,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_button_tag project_repository_path(@project), - method: :delete, + turbo_method: :delete, title: t(:button_delete), disabled: true, class: "-primary" do %> @@ -93,8 +93,10 @@ See COPYRIGHT and LICENSE files for more details.

<%= link_to project_repository_path(@project), title: t(:button_delete), - method: :delete, - data: { "test-selector": "remove-repository-button" }, + data: { + turbo_method: :delete, + "test-selector": "remove-repository-button" + }, class: "button" do %> <%= op_icon("button--icon icon-remove") %> <%= t(:button_remove) %> diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb index c8fe30b9f6d..4f6c9549ed5 100644 --- a/app/views/roles/index.html.erb +++ b/app/views/roles/index.html.erb @@ -113,8 +113,7 @@ See COPYRIGHT and LICENSE files for more details. <%= unless role.builtin? link_to( "", role_path(role), - method: :delete, - data: { confirm: t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: t(:text_are_you_sure) }, class: "icon icon-delete", title: t(:button_delete) ) diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index fbc29160d9e..ffc4e923fa3 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -60,8 +60,8 @@ See COPYRIGHT and LICENSE files for more details. href: version_path(@version), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete, test_selector: "version-delete-button" }, title: I18n.t(:button_delete) diff --git a/app/views/wiki/_page_form.html.erb b/app/views/wiki/_page_form.html.erb index 25b50578159..720082c0956 100644 --- a/app/views/wiki/_page_form.html.erb +++ b/app/views/wiki/_page_form.html.erb @@ -38,5 +38,5 @@ <%= link_to t(:button_cancel), { controller: "/wiki", action: "show", project_id: @project, id: (@page.new_record? ? nil : @page) }, - data: { confirm: t(:text_are_you_sure) }, + data: { turbo_confirm: t(:text_are_you_sure) }, class: "button -with-icon icon-cancel" %> diff --git a/app/views/work_package_types/form_configuration_tab/_form.html.erb b/app/views/work_package_types/form_configuration_tab/_form.html.erb index 1ddad734b55..54232eea089 100644 --- a/app/views/work_package_types/form_configuration_tab/_form.html.erb +++ b/app/views/work_package_types/form_configuration_tab/_form.html.erb @@ -65,7 +65,7 @@ See COPYRIGHT and LICENSE files for more details.

<%= styled_button_tag t(@type.new_record? ? :button_create : :button_save), - data: { disable_with: t(@type.new_record? ? :button_create : :button_save) }, + data: { turbo_submits_with: t(@type.new_record? ? :button_create : :button_save) }, class: "form-configuration--save -primary -with-icon icon-checkmark" %>
diff --git a/lib/individual_principals/membership_controller_methods.rb b/lib/individual_principals/membership_controller_methods.rb index e42ff8d7a67..572d2b9a516 100644 --- a/lib/individual_principals/membership_controller_methods.rb +++ b/lib/individual_principals/membership_controller_methods.rb @@ -44,7 +44,8 @@ module IndividualPrincipals flash[:error] = call.errors.full_messages.join("\n") end - redirect_to edit_polymorphic_path(@individual_principal, tab: redirected_to_tab(call.result)) + redirect_to edit_polymorphic_path(@individual_principal, tab: redirected_to_tab(call.result)), + status: :see_other end end end diff --git a/modules/auth_saml/app/components/saml/providers/row_component.rb b/modules/auth_saml/app/components/saml/providers/row_component.rb index 11376f2f389..9fadd742ec4 100644 --- a/modules/auth_saml/app/components/saml/providers/row_component.rb +++ b/modules/auth_saml/app/components/saml/providers/row_component.rb @@ -52,8 +52,7 @@ module Saml link_to( helpers.op_icon("icon icon-delete button--link"), url_for(action: :destroy, id: provider.id), - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, title: t(:button_delete) ) end diff --git a/modules/avatars/app/controllers/avatars/base_controller.rb b/modules/avatars/app/controllers/avatars/base_controller.rb index e0e4d1e557c..d2fcaa2ff9e 100644 --- a/modules/avatars/app/controllers/avatars/base_controller.rb +++ b/modules/avatars/app/controllers/avatars/base_controller.rb @@ -23,7 +23,7 @@ module ::Avatars else flash[:error] = result.errors.full_messages.join(", ") end - redirect_to redirect_path + redirect_to redirect_path, status: :see_other else head :method_not_allowed end diff --git a/modules/avatars/app/views/avatars/users/_local_avatars.html.erb b/modules/avatars/app/views/avatars/users/_local_avatars.html.erb index f5c7444444b..c9cfbbeb0bd 100644 --- a/modules/avatars/app/views/avatars/users/_local_avatars.html.erb +++ b/modules/avatars/app/views/avatars/users/_local_avatars.html.erb @@ -23,9 +23,8 @@ <% if local_avatar? @user %> <%= link_to t(:button_delete), @target_avatar_path, - method: :delete, class: "avatars--local-avatar-delete-link", - data: { confirm: t(:are_you_sure_delete_avatar) } %> + data: { turbo_method: :delete, turbo_confirm: t(:are_you_sure_delete_avatar) } %> <% end %>
diff --git a/modules/bim/app/components/bim/ifc_models/row_component.rb b/modules/bim/app/components/bim/ifc_models/row_component.rb index 3e7f4b3bd71..06ec53171e6 100644 --- a/modules/bim/app/components/bim/ifc_models/row_component.rb +++ b/modules/bim/app/components/bim/ifc_models/row_component.rb @@ -68,9 +68,8 @@ module Bim link_to "", bcf_project_ifc_model_path(model.project, model), class: "icon icon-delete", - data: { confirm: I18n.t(:text_are_you_sure) }, - title: I18n.t(:button_delete), - method: :delete + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, + title: I18n.t(:button_delete) end def download_link diff --git a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb index af418af6e6b..1b0e8ffaf03 100644 --- a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb +++ b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb @@ -174,7 +174,7 @@ module Bim def destroy @ifc_model.destroy - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/modules/boards/app/components/boards/row_component.rb b/modules/boards/app/components/boards/row_component.rb index 7323c514047..c6304799c1c 100644 --- a/modules/boards/app/components/boards/row_component.rb +++ b/modules/boards/app/components/boards/row_component.rb @@ -60,10 +60,10 @@ module Boards link_to( "", work_package_board_path(model), - method: :delete, class: "icon icon-delete", data: { - confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), "test-selector": "board-remove-#{model.id}" }, title: t(:button_delete) diff --git a/modules/budgets/app/components/budgets/show_page_header_component.html.erb b/modules/budgets/app/components/budgets/show_page_header_component.html.erb index 14de313d793..bd4c4f2322c 100644 --- a/modules/budgets/app/components/budgets/show_page_header_component.html.erb +++ b/modules/budgets/app/components/budgets/show_page_header_component.html.erb @@ -43,8 +43,8 @@ href: url_for({ controller: "budgets", action: "destroy", id: @budget }), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete, test_selector: "budget-delete-button" }, title: I18n.t(:button_delete) diff --git a/modules/budgets/app/controllers/budgets_controller.rb b/modules/budgets/app/controllers/budgets_controller.rb index 11130aa1cd6..ca0d9532c59 100644 --- a/modules/budgets/app/controllers/budgets_controller.rb +++ b/modules/budgets/app/controllers/budgets_controller.rb @@ -144,7 +144,7 @@ class BudgetsController < ApplicationController def destroy @budgets.each(&:destroy) flash[:notice] = t(:notice_successful_delete) - redirect_to action: "index", project_id: @project + redirect_to action: "index", project_id: @project, status: :see_other end def destroy_info @@ -260,7 +260,7 @@ class BudgetsController < ApplicationController budget = Budget.find(params[:id]) if budget.work_packages.any? - redirect_to destroy_info_budget_path(budget) + redirect_to destroy_info_budget_path(budget), status: :see_other end end diff --git a/modules/calendar/app/components/calendar/row_component.rb b/modules/calendar/app/components/calendar/row_component.rb index 2406a97e61e..d47572d730a 100644 --- a/modules/calendar/app/components/calendar/row_component.rb +++ b/modules/calendar/app/components/calendar/row_component.rb @@ -55,10 +55,10 @@ module Calendar link_to( "", project_calendar_path(project, query.id), - method: :delete, class: "icon icon-delete", data: { - confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), "test-selector": "calendar-remove-#{query.id}" }, title: t(:button_delete) diff --git a/modules/documents/app/views/documents/show.html.erb b/modules/documents/app/views/documents/show.html.erb index 7cf8811494e..187097ea3bc 100644 --- a/modules/documents/app/views/documents/show.html.erb +++ b/modules/documents/app/views/documents/show.html.erb @@ -62,8 +62,8 @@ See COPYRIGHT and LICENSE files for more details. href: url_for({ controller: "/documents", action: "destroy", id: @document }), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/modules/github_integration/app/components/deploy_targets/row_component.rb b/modules/github_integration/app/components/deploy_targets/row_component.rb index 8353d805cae..570f645d9a5 100644 --- a/modules/github_integration/app/components/deploy_targets/row_component.rb +++ b/modules/github_integration/app/components/deploy_targets/row_component.rb @@ -47,7 +47,7 @@ module DeployTargets def delete_link link_to I18n.t(:button_delete), deploy_target_path(deploy_target), - method: :delete, + data: { turbo_method: :delete }, class: "icon icon-delete" end end diff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb index 280245a2498..c5181a0b774 100644 --- a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb +++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb @@ -55,8 +55,8 @@ See COPYRIGHT and LICENSE files for more details. href: ldap_groups_synchronized_filter_path(@filter), aria: { label: I18n.t(:button_delete) }, data: { - confirm: I18n.t(:text_are_you_sure), - method: :delete + turbo_confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb index a346eefb9e1..c134aac05c2 100644 --- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb +++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb @@ -178,7 +178,7 @@ module MeetingAgendaItems scheme: :danger, href: meeting_agenda_item_path(@meeting_agenda_item.meeting, @meeting_agenda_item), form_arguments: { - method: :delete, data: { confirm: t("text_are_you_sure"), "turbo-stream": true } + method: :delete, data: { turbo_confirm: t(:text_are_you_sure), "turbo-stream": true } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb b/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb index be8f415a586..4d6769ea792 100644 --- a/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb +++ b/modules/meeting/app/components/meeting_agenda_items/outcomes/show_notes_component.rb @@ -84,7 +84,11 @@ module MeetingAgendaItems scheme: :danger, href: meeting_outcome_path(@meeting, @meeting_outcome), form_arguments: { - method: :delete, data: { confirm: t("text_are_you_sure"), "turbo-stream": true } + method: :delete, + data: { + turbo_confirm: t(:text_are_you_sure), + turbo_stream: true + } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/modules/meeting/app/components/meeting_sections/header_component.rb b/modules/meeting/app/components/meeting_sections/header_component.rb index fca56a8d8f8..87314df1fd2 100644 --- a/modules/meeting/app/components/meeting_sections/header_component.rb +++ b/modules/meeting/app/components/meeting_sections/header_component.rb @@ -156,8 +156,12 @@ module MeetingSections scheme: :danger, href: meeting_section_path(@meeting_section.meeting, @meeting_section), form_arguments: { - method: :delete, data: { confirm: confirm_text, "turbo-stream": true, - test_selector: "meeting-section-delete" } + method: :delete, + data: { + turbo_confirm: confirm_text, + turbo_stream: true, + test_selector: "meeting-section-delete" + } }) do |item| item.with_leading_visual_icon(icon: :trash) end diff --git a/modules/overviews/app/components/overviews/page_header_component.html.erb b/modules/overviews/app/components/overviews/page_header_component.html.erb index 326e192866f..62716906669 100644 --- a/modules/overviews/app/components/overviews/page_header_component.html.erb +++ b/modules/overviews/app/components/overviews/page_header_component.html.erb @@ -9,7 +9,7 @@ size: :medium, tag: :a, href: helpers.build_favorite_path(project, format: :html), - data: { method: favorited? ? :delete : :post }, + data: { turbo_method: favorited? ? :delete : :post }, classes: favorited? ? "op-primer--star-icon" : "", label: favorited? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite), aria: { label: favorited? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite) }, @@ -35,7 +35,7 @@ label: t(:label_archive_project), href: helpers.project_archive_path(project, status: "", name: project.name), content_arguments: { - data: { method: :post, turbo: false, confirm: t("project.archive.are_you_sure", name: project.name) } + data: { turbo_method: :post, confirm: t("project.archive.are_you_sure", name: project.name) } } ) do |item| item.with_leading_visual_icon(icon: :lock) diff --git a/modules/reporting/lib/widget/controls/delete.rb b/modules/reporting/lib/widget/controls/delete.rb index 29c3aee230f..f585c6322ba 100644 --- a/modules/reporting/lib/widget/controls/delete.rb +++ b/modules/reporting/lib/widget/controls/delete.rb @@ -27,7 +27,7 @@ #++ class Widget::Controls::Delete < Widget::Controls - def render + def render # rubocop:disable Metrics/AbcSize return "" if @subject.new_record? or !@options[:can_delete] button = link_to(I18n.t(:button_delete), @@ -41,7 +41,7 @@ class Widget::Controls::Delete < Widget::Controls url_opts[request_forgery_protection_token] = form_authenticity_token # if protect_against_forgery? opt1 = link_to I18n.t(:button_delete), url_for(url_opts), - method: :delete, + data: { turbo_method: :delete }, class: "button -danger icon-context icon-delete" opt2 = link_to I18n.t(:button_cancel), "#", diff --git a/modules/reporting/lib/widget/table/entry_table.rb b/modules/reporting/lib/widget/table/entry_table.rb index 10cb1a5033d..44c20cca7ee 100644 --- a/modules/reporting/lib/widget/table/entry_table.rb +++ b/modules/reporting/lib/widget/table/entry_table.rb @@ -175,8 +175,7 @@ class Widget::Table::EntryTable < Widget::Table icons << link_to(icon_wrapper("icon-context icon-delete", I18n.t(:button_delete)), action_for(result, action: "destroy") .reverse_merge(authenticity_token: form_authenticity_token), - data: { confirm: I18n.t(:text_are_you_sure) }, - method: :delete, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, class: "no-decoration-on-hover", title: I18n.t(:button_delete)) else diff --git a/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb b/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb index 9fe72e45c1a..a67d4348ead 100644 --- a/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb +++ b/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb @@ -31,7 +31,7 @@ scheme: :invisible, type: :submit, aria: { label: I18n.t("storages.buttons.replace_oauth_application") }, - data: { confirm: I18n.t("storages.confirm_replace_oauth_application") }, + data: { turbo_confirm: I18n.t("storages.confirm_replace_oauth_application") }, test_selector: "storage-replace-openproject-oauth-application-button" ) ) diff --git a/modules/storages/app/components/storages/admin/row_component.rb b/modules/storages/app/components/storages/admin/row_component.rb index e68777e2ca9..cdb597c14c1 100644 --- a/modules/storages/app/components/storages/admin/row_component.rb +++ b/modules/storages/app/components/storages/admin/row_component.rb @@ -68,9 +68,8 @@ module Storages::Admin link_to "", admin_settings_storage_path(storage), class: "icon icon-delete", - data: { confirm: I18n.t("storages.delete_warning.storage") }, - title: I18n.t(:button_delete), - method: :delete + data: { turbo_method: :delete, turbo_confirm: I18n.t("storages.delete_warning.storage") }, + title: I18n.t(:button_delete) end def edit_link diff --git a/modules/team_planner/app/components/team_planner/row_component.rb b/modules/team_planner/app/components/team_planner/row_component.rb index fce22a3c579..ed696f6f6d9 100644 --- a/modules/team_planner/app/components/team_planner/row_component.rb +++ b/modules/team_planner/app/components/team_planner/row_component.rb @@ -59,9 +59,9 @@ module TeamPlanner "", project_team_planner_path(project, query.id), class: "spot-link icon icon-delete", - method: :delete, data: { - confirm: I18n.t(:text_are_you_sure), + turbo_method: :delete, + turbo_confirm: I18n.t(:text_are_you_sure), "test-selector": "team-planner-remove-#{query.id}" }, title: t(:button_delete) diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb index be25b85f90a..2c6153ee67f 100644 --- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb +++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb @@ -18,7 +18,7 @@ module ::TwoFactorAuthentication def destroy clear_remember_token! flash[:notice] = I18n.t("two_factor_authentication.remember.cookie_removed") - redirect_to my_2fa_devices_path + redirect_to my_2fa_devices_path, status: :see_other end end end diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb index 7f4fcb314f5..792e17f6cfb 100644 --- a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb +++ b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb @@ -48,7 +48,7 @@ <%= link_to t("two_factor_authentication.remember.clear_cookie"), my_2fa_remember_cookie_path, class: "two-factor-authentication--remove-remember-cookie-link", - method: :delete %> + data: { turbo_method: :delete } %>

diff --git a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb index ee67fd9bba0..77f85d2374c 100644 --- a/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb +++ b/modules/two_factor_authentication/app/views/users/_two_factor_authentication_admin.html.erb @@ -33,8 +33,10 @@
<% unless devices.empty? %> <%= link_to delete_all_user_2fa_devices_path(@user), - method: :post, - data: { confirm: t("two_factor_authentication.admin.delete_all_are_you_sure") }, + data: { + turbo_method: :post, + turbo_confirm: t("two_factor_authentication.admin.delete_all_are_you_sure") + }, class: "button -danger" do %> <%= op_icon "button--icon icon-delete" %> <%= t "two_factor_authentication.admin.button_delete_all_devices" %> diff --git a/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb b/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb index 08d98d1d642..49ffc08b930 100644 --- a/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb +++ b/modules/webhooks/app/components/webhooks/outgoing/webhooks/row_component.rb @@ -81,8 +81,7 @@ module ::Webhooks link_to( helpers.op_icon("icon icon-delete button--link"), { controller: table.target_controller, action: :destroy, webhook_id: webhook.id }, - method: :delete, - data: { confirm: I18n.t(:text_are_you_sure) }, + data: { turbo_method: :delete, turbo_confirm: I18n.t(:text_are_you_sure) }, title: t(:button_delete) ) end diff --git a/modules/webhooks/app/components/webhooks/outgoing/webhooks/show_page_header_component.html.erb b/modules/webhooks/app/components/webhooks/outgoing/webhooks/show_page_header_component.html.erb index fa393762c84..a2db0ff32ca 100644 --- a/modules/webhooks/app/components/webhooks/outgoing/webhooks/show_page_header_component.html.erb +++ b/modules/webhooks/app/components/webhooks/outgoing/webhooks/show_page_header_component.html.erb @@ -53,8 +53,8 @@ See COPYRIGHT and LICENSE files for more details. href: admin_outgoing_webhook_path(@webhook), aria: { label: I18n.t(:button_delete) }, data: { - confirm: t(:text_are_you_sure), - method: :delete + turbo_confirm: t(:text_are_you_sure), + turbo_method: :delete }, title: I18n.t(:button_delete) ) do |button| diff --git a/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb b/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb index 8fdf84de1dc..2b100783429 100644 --- a/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb +++ b/modules/webhooks/app/controllers/webhooks/outgoing/admin_controller.rb @@ -51,7 +51,7 @@ module Webhooks flash[:error] = I18n.t(:error_failed_to_delete_entry) end - redirect_to action: :index + redirect_to action: :index, status: :see_other end private diff --git a/spec/controllers/placeholder_users/memberships_controller_spec.rb b/spec/controllers/placeholder_users/memberships_controller_spec.rb index 7d8697799c1..86f868f5416 100644 --- a/spec/controllers/placeholder_users/memberships_controller_spec.rb +++ b/spec/controllers/placeholder_users/memberships_controller_spec.rb @@ -128,7 +128,7 @@ RSpec.describe PlaceholderUsers::MembershipsController do } } - expect(response).to have_http_status :found + expect(response).to have_http_status :see_other expect(placeholder_user.reload.memberships).to be_empty end end diff --git a/spec/features/types/crud_spec.rb b/spec/features/types/crud_spec.rb index a9ea8cf3014..dc1e8a7b983 100644 --- a/spec/features/types/crud_spec.rb +++ b/spec/features/types/crud_spec.rb @@ -100,6 +100,9 @@ RSpec.describe "Types", :js do index_page.delete "Renamed type" + wait_for_network_idle + + expect_and_dismiss_flash(message: I18n.t(:notice_successful_delete)) index_page.expect_listed(existing_type) end diff --git a/spec/features/users/user_memberships_spec.rb b/spec/features/users/user_memberships_spec.rb index 0aa489cf630..37e6fcbfb22 100644 --- a/spec/features/users/user_memberships_spec.rb +++ b/spec/features/users/user_memberships_spec.rb @@ -55,8 +55,12 @@ RSpec.describe "user memberships through user page", :js, :selenium do # Remove the global role from the user principal_page.remove_global_role!(global_role.id) + wait_for_network_idle + # Verify that it is gone - principal_page.expect_global_roles([]) + retry_block do + principal_page.expect_global_roles([]) + end end end end diff --git a/spec/features/watching/toggle_watching_spec.rb b/spec/features/watching/toggle_watching_spec.rb index 68ca375043e..3b104574e07 100644 --- a/spec/features/watching/toggle_watching_spec.rb +++ b/spec/features/watching/toggle_watching_spec.rb @@ -54,7 +54,8 @@ RSpec.describe "Toggle watching", :js do click_link(I18n.t("button_watch")) expect(page).to have_link(I18n.t("button_unwatch")) - SeleniumHubWaiter.wait + wait_for_network_idle + click_link(I18n.t("button_unwatch")) expect(page).to have_link(I18n.t("button_watch")) end diff --git a/spec/support/components/work_packages/relations.rb b/spec/support/components/work_packages/relations.rb index c8d3e8abf96..a52db0d5348 100644 --- a/spec/support/components/work_packages/relations.rb +++ b/spec/support/components/work_packages/relations.rb @@ -418,7 +418,9 @@ module Components def remove_relation_with_work_package(relatable) open_action_menu_with_work_package(relatable) do - relatable_delete_button(relatable).click + accept_confirm do + relatable_delete_button(relatable).click + end end expect_no_row(relatable) diff --git a/spec/support/pages/admin/custom_actions/index.rb b/spec/support/pages/admin/custom_actions/index.rb index 9bfd15796f4..5507daf97f5 100644 --- a/spec/support/pages/admin/custom_actions/index.rb +++ b/spec/support/pages/admin/custom_actions/index.rb @@ -72,24 +72,28 @@ module Pages within_row_of(name) do find("a[title='Move to top']").trigger("click") end + wait_for_network_idle end def move_bottom(name) within_row_of(name) do find("a[title='Move to bottom']").trigger("click") end + wait_for_network_idle end def move_up(name) within_row_of(name) do find("a[title='Move up']").trigger("click") end + wait_for_network_idle end def move_down(name) within_row_of(name) do find("a[title='Move down']").trigger("click") end + wait_for_network_idle end def path diff --git a/spec/support/pages/admin/individual_principals/edit.rb b/spec/support/pages/admin/individual_principals/edit.rb index 97a6063c5d2..c447610f6e1 100644 --- a/spec/support/pages/admin/individual_principals/edit.rb +++ b/spec/support/pages/admin/individual_principals/edit.rb @@ -65,7 +65,7 @@ module Pages def remove_from_project!(name) open_projects_tab! - find_project(name).find("a[data-method=delete]").click + find_project(name).find("a[data-turbo-method=delete]").click end def edit_roles!(membership, roles) diff --git a/spec/support/pages/groups.rb b/spec/support/pages/groups.rb index c41d0b0f672..f2df41564a4 100644 --- a/spec/support/pages/groups.rb +++ b/spec/support/pages/groups.rb @@ -52,6 +52,16 @@ module Pages group(group_name).add_user! user_name end + def delete_group!(name) + accept_alert do + find_group(name).find("a[data-turbo-method=delete]").click + end + end + + def find_group(name) + find("tr", text: name) + end + def has_group?(name) has_selector? ".op-border-box-grid--row-item", text: name end @@ -63,6 +73,7 @@ module Pages class Group < Page include ::Components::Autocompleter::NgSelectAutocompleteHelpers + attr_reader :id def initialize(id) @@ -96,7 +107,7 @@ module Pages def remove_from_project!(name) open_projects_tab! SeleniumHubWaiter.wait - find_project(name).find("a[data-method=delete]").click + find_project(name).find("a[data-turbo-method=delete]").click end def search_for_project(query) @@ -134,7 +145,7 @@ module Pages open_users_tab! SeleniumHubWaiter.wait - find_user(user_name).find("a[data-method=delete]").click + find_user(user_name).find("a[data-turbo-method=delete]").click end def find_user(user_name)