mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-23 05:28:53 +00:00
Discard changes by reloading the page
Now there's a popup asking to confirm, which I think is worth keeping!
This commit is contained in:
@@ -35,7 +35,9 @@
|
||||
-# Y products could not be saved correctly. Please review errors and try again
|
||||
= t('.error_summary.invalid', count: @error_counts[:invalid])
|
||||
.form-buttons
|
||||
= form.submit t('.reset'), type: :reset, class: "medium"
|
||||
|
||||
%a.button.reset.medium{ href: admin_products_path(page: @page, per_page: @per_page) }
|
||||
= t('.reset')
|
||||
= form.submit t('.save'), class: "medium"
|
||||
%tr
|
||||
%th.align-left= # image
|
||||
|
||||
@@ -158,7 +158,8 @@ button:not(.plain):not(.trix-button),
|
||||
}
|
||||
|
||||
// --- Reset buttons ---
|
||||
input[type="reset"] {
|
||||
input[type="reset"],
|
||||
.reset {
|
||||
// Reset button looks like a link, but has a border the same as buttons when active.
|
||||
background: none;
|
||||
border: 1px solid transparent;
|
||||
|
||||
@@ -369,7 +369,9 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do
|
||||
product_a.update! sku: "APL-10"
|
||||
|
||||
expect {
|
||||
click_button "Discard changes"
|
||||
accept_confirm do
|
||||
click_on "Discard changes"
|
||||
end
|
||||
product_a.reload
|
||||
}.not_to change { product_a.name }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user