From 1695580b9e9c150af16bd55a462aabdeb0c40870 Mon Sep 17 00:00:00 2001 From: Bjorn Forsberg Date: Fri, 1 Dec 2023 14:43:52 +0100 Subject: [PATCH] Keep turbo frame, but dont tell it which one to update --- app/views/metrics/_filter.html.erb | 2 +- app/views/metrics/_forecasts_form.html.erb | 3 ++- app/views/metrics/_tile.html.erb | 3 +++ app/views/metrics/show.html.erb | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/metrics/_filter.html.erb b/app/views/metrics/_filter.html.erb index 645e5a7..0f60ced 100644 --- a/app/views/metrics/_filter.html.erb +++ b/app/views/metrics/_filter.html.erb @@ -1,7 +1,7 @@ <%= form_tag( url_for(action: action_name, charge_type: filter.charge_type), method: :get, - data: {controller: "filters"}, + data: {controller: "filters", turbo_action: :advance}, ) do %> <%= hidden_field_tag :chart, filter.chart %> diff --git a/app/views/metrics/_forecasts_form.html.erb b/app/views/metrics/_forecasts_form.html.erb index 5bc434c..b263542 100644 --- a/app/views/metrics/_forecasts_form.html.erb +++ b/app/views/metrics/_forecasts_form.html.erb @@ -5,7 +5,8 @@ data: { controller: "submittable", submittable_target: "form", - action: "change->submittable#submit" + action: "change->submittable#submit", + turbo_action: :advance } ) do |form| %> diff --git a/app/views/metrics/_tile.html.erb b/app/views/metrics/_tile.html.erb index 796f237..9acf288 100644 --- a/app/views/metrics/_tile.html.erb +++ b/app/views/metrics/_tile.html.erb @@ -5,6 +5,9 @@ content: polaris_icon(name: "ViewMinor", color: :subdued), title: "View chart", url: url_for(action: action_name, **filter.to_param.merge(chart: tile.handle)), + data: { + turbo_action: "advance", + }, }] ) do %> <%= polaris_stack(alignment: :center) do |stack| %> diff --git a/app/views/metrics/show.html.erb b/app/views/metrics/show.html.erb index 7d55f2e..b6b2a0d 100644 --- a/app/views/metrics/show.html.erb +++ b/app/views/metrics/show.html.erb @@ -5,7 +5,7 @@ <%= render "shared/page_actions", page: page %> - <%= tag.div data: { controller: "loading" } do %> + <%= turbo_frame_tag :metrics, data: { controller: "loading" } do %> <%= polaris_vertical_stack(gap: "6") do %>