Skip to content

Commit

Permalink
Merge pull request #4027 from 3scale/fix_html_button
Browse files Browse the repository at this point in the history
🐛 Fix small compatibility issue with PatternflyFormBuilder's `commit_button`
  • Loading branch information
josemigallas authored Mar 4, 2025
2 parents dbecd61 + a075c0d commit ff49784
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/lib/fields/patternfly_form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def output_html(field, options = {})
end

def commit_button(title, opts = {})
raise ArgumentError, 'button_html prop will be ignored, use standard html attributes' if opts.key?(:button_html)

tag.button(title, type: :submit, class: 'pf-c-button pf-m-primary', **opts)
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/buyers/service_contracts/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include_blank: false,
required: true %>
<%= form.actions do %>
<%= form.commit_button 'Change subscription', button_html: { 'data-disable-with': 'Change subscription' } %>
<%= form.commit_button 'Change subscription', data: { 'disable-with': 'Change subscription' } %>
<% end %>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/buyers/service_contracts/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
required: true %>

<%= form.actions do %>
<%= form.commit_button 'Create subscription', button_html: { 'data-disable_with': 'Create subscription' } %>
<%= form.commit_button 'Create subscription', data: { 'disable_with': 'Create subscription' } %>
<% end %>
<% end %>

Expand Down

0 comments on commit ff49784

Please sign in to comment.