Skip to content

Commit bd38083

Browse files
Added disable_with to existing button_to helpers so their behavior is consistent with other buttons
1 parent bd92ff1 commit bd38083

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/views/partner_users/_users.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
</td>
5050
<td class='d-flex flex-column'>
5151
<% unless user.invitation_accepted_at %>
52-
<%= button_to resend_invitation_partner_user_path(partner, user), method: :post, class: "btn btn-warning btn-xs mb-2" do %>
52+
<%= button_to resend_invitation_partner_user_path(partner, user), method: :post, data: { disable_with: "Please wait..." }, class: "btn btn-warning btn-xs mb-2" do %>
5353
<i class="fa fa-envelope"></i> Resend Invitation
5454
<% end %>
5555
<% end %>
56-
<%= button_to reset_password_partner_user_path(partner, user), method: :post, data: { confirm: "Are you sure?" }, class: "btn btn-info btn-xs mb-2" do %>
56+
<%= button_to reset_password_partner_user_path(partner, user), method: :post, data: { confirm: "Are you sure?", disable_with: "Please wait..." }, class: "btn btn-info btn-xs mb-2" do %>
5757
<i class="fa fa-key"></i> Reset Password
5858
<% end %>
59-
<%= button_to partner_user_path(partner, user), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger btn-xs" do %>
59+
<%= button_to partner_user_path(partner, user), method: :delete, data: { confirm: "Are you sure?", disable_with: "Please wait..." }, class: "btn btn-danger btn-xs" do %>
6060
<i class="fa fa-ban"></i> Remove Access
6161
<% end %>
6262

app/views/partners/_partner_row.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<% when "awaiting_review" %>
4040
<%= view_button_to partner_path(partner_row) + "#partner-information", { text: "Review Applicant's Profile", icon: "check", type: "warning" } %>
4141
<% when "approved" %>
42-
<%= button_to recertify_partner_partner_path(partner_row), data: { confirm: "Recertify partner #{partner_row.name}?"}, class: "btn btn-xs bg-red" do %>
42+
<%= button_to recertify_partner_partner_path(partner_row), data: { confirm: "Recertify partner #{partner_row.name}?", disable_with: "Please wait..."}, class: "btn btn-xs bg-red" do %>
4343
<i class="fa fa-refresh"></i> Request Recertification
4444
<% end %>
4545
<% when "deactivated" %>

app/views/requests/_request_row.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</td>
2323
<td class="text-right">
2424
<%= view_button_to request_path(request_row) %>
25-
<%= button_to 'Cancel', new_request_cancelation_path(request_id: request_row.id), method: :get, class: 'btn btn-danger btn-xs' %>
25+
<%= button_to 'Cancel', new_request_cancelation_path(request_id: request_row.id), method: :get, data: { disable_with: "Please wait..." }, class: 'btn btn-danger btn-xs' %>
2626
<%= print_button_to print_picklist_request_path(request_row), { format: :pdf, text: "Print", size: "xs" } %>
2727
</td>
2828
</tr>

app/views/requests/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<%= view_button_to(distribution_path(@request.distribution), {text: "View Associated Distribution", size: "md"}) if @request.distribution %>
111111
<%= print_button_to print_picklist_request_path(@request), { format: :pdf, text: "Print", size: "md" } %>
112112
<%= button_to 'Cancel', new_request_cancelation_path(request_id: @request.id),
113-
method: :get, form_class: 'd-inline', class: 'btn btn-danger btn-md' %>
113+
method: :get, data: { disable_with: "Please wait..." }, form_class: 'd-inline', class: 'btn btn-danger btn-md' %>
114114
</div>
115115
</div>
116116
</div>

0 commit comments

Comments
 (0)