~singpolyma/sgx-jmp

c6680509fe63a3d6fffe46d66017818b1ea95e25 — Christopher Vollick 8 months ago e6fa970
Telephone Link

Sometimes I need to go there to look something up or change a setting,
and every time I do I have to navigate through the UI to a number I
already know.

This should make that faster.
2 files changed, 17 insertions(+), 0 deletions(-)

M forms/admin_info.rb
M lib/customer_info.rb
M forms/admin_info.rb => forms/admin_info.rb +8 -0
@@ 23,6 23,14 @@ field(
	value: @admin_info.customer_id
)

if @admin_info.info.tel
	field(
		var: "tel_link",
		label: "Phone Number Info",
		value: @admin_info.tel_link
	)
end

if @admin_info.fwd.uri
	field(
		var: "fwd",

M lib/customer_info.rb => lib/customer_info.rb +9 -0
@@ 118,4 118,13 @@ class AdminInfo
	def form
		FormTemplate.render("admin_info", admin_info: self)
	end

	def tel_link
		[
			"https://dashboard.bandwidth.com/portal/r/a",
			CONFIG[:creds][:account],
			"numbers/details",
			info.tel.gsub(/\A\+1/, "")
		].join("/")
	end
end