Skip to content

Commit

Permalink
Remove extraneous ui helper; reuse invite button helper
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-truong-main committed Feb 2, 2024
1 parent bfa2b0a commit bd2ef08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions app/helpers/ui_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ def invite_button_to(link, options = {}, properties = {})
_link_to link, { icon: "envelope", type: "warning", text: "Invite", size: "xs" }.merge(options), properties
end

def invite_and_approve_button_to(link, options = {}, properties = {})
properties = { method: options[:method]&.to_sym || :post, rel: "nofollow", data: { confirm: options[:confirm] || "Are you sure?" } }.merge(properties)
_link_to link, { icon: "envelope", type: "info", text: "Invite and Approve", size: "xs" }.merge(options), properties
end

def refresh_button_to(link, options = {}, properties = {})
_link_to link, { icon: "sync", type: "info", text: "Refresh", size: "md" }.merge(options), properties
end
Expand Down
3 changes: 2 additions & 1 deletion app/views/partners/_partner_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<% case status %>
<% when "uninvited" %>
<% if can_single_step_invite_and_approve %>
<%= invite_and_approve_button_to(single_step_invite_and_approve_partner_path(partner_row), confirm: "Single step invite and approve #{partner_row.name} to begin using the partner application?") %>
<% button_options = { icon: "envelope", type: "info", text: "Invite and Approve", size: "xs", confirm: "One step invite and approve #{partner_row.name} to begin using the partner application?" } %>
<%= invite_button_to(invite_and_approve_partner_path(partner_row), button_options) %>
<% else %>
<%= invite_button_to(invite_partner_path(partner_row), confirm: "Send an invitation to #{partner_row.name} to begin using the partner application?") %>
<% end %>
Expand Down

0 comments on commit bd2ef08

Please sign in to comment.