Skip to content

Commit fa4fca7

Browse files
committed
Standardize usage of Form builder #submit method
button#submit helper can grab correct button text for us depending on the record passed. In special cases when we need a custom text, keyword argument "text:" can be passed to override default text.
1 parent 38c9fa0 commit fa4fca7

File tree

50 files changed

+44
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+44
-53
lines changed

admin/app/components/solidus_admin/adjustment_reasons/edit/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<form method="dialog">
1414
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1515
</form>
16-
<%= f.submit(t('.submit')) %>
16+
<%= f.submit %>
1717
<% end %>
1818
<% end %>
1919
<% end %>

admin/app/components/solidus_admin/adjustment_reasons/edit/component.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
en:
44
title: "Edit Adjustment Reason"
55
cancel: "Cancel"
6-
submit: "Update Adjustment Reason"
76
hints:
87
active: "When checked, this adjustment reason will be available for selection when adding adjustments to orders."

admin/app/components/solidus_admin/adjustment_reasons/new/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<form method="dialog">
1414
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1515
</form>
16-
<%= f.submit(t('.submit')) %>
16+
<%= f.submit %>
1717
<% end %>
1818
<% end %>
1919
<% end %>

admin/app/components/solidus_admin/adjustment_reasons/new/component.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
en:
44
title: "New Adjustment Reason"
55
cancel: "Cancel"
6-
submit: "Add Adjustment Reason"
76
hints:
87
active: "When checked, this adjustment reason will be available for selection when adding adjustments to orders."

admin/app/components/solidus_admin/orders/cart/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
class: "!w-16 inline-block",
4949
"data-action": "input->#{stimulus_id}#updateLineItem",
5050
) %>
51-
<% f.submit("Update", class: "inline-block") %>
51+
<% f.submit(class: "inline-block") %>
5252
<% end %>
5353
</td>
5454
<td class="px-6 py-4">

admin/app/components/solidus_admin/properties/edit/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<form method="dialog">
1010
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1111
</form>
12-
<%= f.submit(t('.submit')) %>
12+
<%= f.submit(text: t('.submit')) %>
1313
<% end %>
1414
<% end %>
1515
<% end %>

admin/app/components/solidus_admin/properties/new/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<form method="dialog">
1010
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1111
</form>
12-
<%= f.submit(t('.submit')) %>
12+
<%= f.submit(text: t('.submit')) %>
1313
<% end %>
1414
<% end %>
1515
<% end %>

admin/app/components/solidus_admin/refund_reasons/edit/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<form method="dialog">
1414
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1515
</form>
16-
<%= f.submit(t('.submit')) %>
16+
<%= f.submit %>
1717
<% end %>
1818
<% end %>
1919
<% end %>

admin/app/components/solidus_admin/refund_reasons/edit/component.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
en:
44
title: "Edit Refund Reason"
55
cancel: "Cancel"
6-
submit: "Update Refund Reason"
76
hints:
87
active: "When checked, this refund reason will be available for selection when adding refunds to orders."

admin/app/components/solidus_admin/refund_reasons/new/component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<form method="dialog">
1414
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
1515
</form>
16-
<%= f.submit(t('.submit')) %>
16+
<%= f.submit %>
1717
<% end %>
1818
<% end %>
1919
<% end %>

0 commit comments

Comments
 (0)