From 6623d38d74c69ebfe7bf6dcf9ff73e90d7db1f03 Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:14:32 +0300 Subject: [PATCH] [#57505] Turn project list into favorite without reloading the page https://community.openproject.org/work_packages/57505 --- app/components/projects/row_component.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rb index da409c4e0a5f..70adc2566d7d 100644 --- a/app/components/projects/row_component.rb +++ b/app/components/projects/row_component.rb @@ -54,7 +54,7 @@ def favored tag: :a, tooltip_direction: :e, href: helpers.build_favorite_path(project, format: :html), - data: { method: currently_favored? ? :delete : :post }, + data: { "turbo-method": currently_favored? ? :delete : :post }, classes: currently_favored? ? "op-primer--star-icon " : "op-project-row-component--favorite", label: currently_favored? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite), aria: { label: currently_favored? ? I18n.t(:button_unfavorite) : I18n.t(:button_favorite) }, @@ -259,7 +259,7 @@ def more_menu_favorite_item scheme: :default, icon: "star", href: helpers.build_favorite_path(project, format: :html), - data: { method: :post }, + data: { "turbo-method": :post }, label: I18n.t(:button_favorite), aria: { label: I18n.t(:button_favorite) } } @@ -273,7 +273,7 @@ def more_menu_unfavorite_item icon: "star-fill", size: :medium, href: helpers.build_favorite_path(project, format: :html), - data: { method: :delete }, + data: { "turbo-method": :delete }, classes: "op-primer--star-icon", label: I18n.t(:button_unfavorite), aria: { label: I18n.t(:button_unfavorite) }