From bd2ef08ab3fd39576a3f47f87db078b122b067a9 Mon Sep 17 00:00:00 2001 From: Vincent Truong Date: Fri, 2 Feb 2024 12:54:21 -0600 Subject: [PATCH] Remove extraneous ui helper; reuse invite button helper --- app/helpers/ui_helper.rb | 5 ----- app/views/partners/_partner_row.html.erb | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/helpers/ui_helper.rb b/app/helpers/ui_helper.rb index 26e57546c1..cc50e9046d 100644 --- a/app/helpers/ui_helper.rb +++ b/app/helpers/ui_helper.rb @@ -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 diff --git a/app/views/partners/_partner_row.html.erb b/app/views/partners/_partner_row.html.erb index 1eac52b005..92defdfd4d 100644 --- a/app/views/partners/_partner_row.html.erb +++ b/app/views/partners/_partner_row.html.erb @@ -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 %>