The personal finance app for everyone (by everyone)
Ruby
Correct Dialog Close Button (#85)
ByteBardb7d9c894713b
diff --git a/app/controllers/rules_controller.rb b/app/controllers/rules_controller.rbindex a63f30ee14..e22b3578fd 100644--- a/app/controllers/rules_controller.rb+++ b/app/controllers/rules_controller.rb@@ -25,7 +25,7 @@ class RulesController < ApplicationController@rule = Current.family.rules.build(rule_params)if @rule.save- redirect_to confirm_rule_path(@rule)+ redirect_to confirm_rule_path(@rule, reload_on_close: true)elserender :new, status: :unprocessable_entityenddiff --git a/app/views/accounts/new/_container.html.erb b/app/views/accounts/new/_container.html.erbindex 47a75ca9d0..67697da504 100644--- a/app/views/accounts/new/_container.html.erb+++ b/app/views/accounts/new/_container.html.erb@@ -16,7 +16,7 @@<span class="text-primary"><%= title %></span></div>- <%= icon("x", as_button: true, size: "lg", data: { action: "dialog#close" }) %>+ <%= icon("x", as_button: true, size: "lg", data: { action: "DS--dialog#close" }) %></div><div class="p-2 text-subdued">@@ -45,7 +45,7 @@</div></div><div class="flex items-center space-x-2">- <button data-action="dialog#close">Close</button>+ <button data-action="DS--dialog#close">Close</button><kbd class="bg-alpha-black-50 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.1)] p-1 rounded-md flex w-8 h-5 shrink-0 grow-0 items-center justify-center text-xs">ESC</kbd></div></div>diff --git a/app/views/rules/confirm.html.erb b/app/views/rules/confirm.html.erbindex 5307eaaff7..35f27d3740 100644--- a/app/views/rules/confirm.html.erb+++ b/app/views/rules/confirm.html.erb@@ -1,4 +1,4 @@-<%= render DS::Dialog.new(reload_on_close: true) do |dialog| %>+<%= render DS::Dialog.new(reload_on_close: params[:reload_on_close].present?) do |dialog| %><%title = if @rule.name.present?"Confirm changes to \"#{@rule.name}\""diff --git a/app/views/transactions/bulk_updates/new.html.erb b/app/views/transactions/bulk_updates/new.html.erbindex 08c112abdc..84394a8ccd 100644--- a/app/views/transactions/bulk_updates/new.html.erb+++ b/app/views/transactions/bulk_updates/new.html.erb@@ -21,7 +21,7 @@</div><div class="flex justify-end gap-2 mt-auto">- <%= render DS::Button.new(text: "Cancel", variant: "ghost", data: { action: "click->dialog#close" }) %>+ <%= render DS::Button.new(text: "Cancel", variant: "ghost", data: { action: "click->DS--dialog#close" }) %><%= render DS::Button.new(text: "Save", data: { bulk_select_scope_param: "bulk_update", action: "bulk-select#submitBulkRequest" }) %></div><% end %>diff --git a/test/controllers/rules_controller_test.rb b/test/controllers/rules_controller_test.rbindex cb5f8a0d53..30432520b6 100644--- a/test/controllers/rules_controller_test.rb+++ b/test/controllers/rules_controller_test.rb@@ -71,7 +71,7 @@ class RulesControllerTest < ActionDispatch::IntegrationTestassert_equal "set_transaction_category", rule.actions.first.action_typeassert_equal categories(:food_and_drink).id, rule.actions.first.value- assert_redirected_to confirm_rule_url(rule)+ assert_redirected_to confirm_rule_url(rule, reload_on_close: true)endtest "can update rule" do