Detailed changes
@@ -46,6 +46,7 @@
, sip : { app : Text, realm : Text }
, sip_host : Text
, snikket_hosting_api : Text
+, support_link : forall (customer_jid : Text) -> Text
, upstream_domain : Text
, web : < Inet : { interface : Text, port : Natural } | Unix : Text >
, web_register : { from : Text, to : Text }
@@ -86,5 +86,7 @@ in
upstream_domain = "example.net",
approved_domains = toMap { `example.com` = Some "customer_id" },
keepgo = Some { api_key = "", access_token = "" },
- simpleswap_api_key = ""
+ simpleswap_api_key = "",
+ support_link = \(customer_jid: Text) ->
+ "http://localhost:3002/app/accounts/2/contacts/custom_attributes/jid/${customer_jid}"
}
@@ -63,11 +63,15 @@ field(
value: @admin_info.api.to_s
)
-if @admin_info.info.tel
- field(
- var: "link",
- label: "Link",
- type: "jid-single",
- value: "#{@admin_info.info.tel}@#{CONFIG[:upstream_domain]}"
- )
-end
+field(
+ var: "link",
+ label: "Link",
+ type: "jid-single",
+ value: @admin_info.backend_jid
+)
+
+field(
+ var: "support_link",
+ label: "Support Link",
+ value: @admin_info.support_link
+)
@@ -112,12 +112,14 @@ class AdminInfo
api API
call_info String
trust_level String
+ backend_jid String
end
def self.for(
customer,
trust_level_repo: TrustLevelRepo.new,
- call_attempt_repo: CallAttemptRepo.new
+ call_attempt_repo: CallAttemptRepo.new,
+ backend_repo: TrivialBackendSgxRepo.new
)
PromiseHash.all(
jid: customer.jid,
@@ -126,7 +128,8 @@ class AdminInfo
info: CustomerInfo.for(customer),
api: API.for(customer),
call_info: call_info(customer, call_attempt_repo),
- trust_level: trust_level_repo.find(customer).then(&:to_s)
+ trust_level: trust_level_repo.find(customer).then(&:to_s),
+ backend_jid: backend_repo.get(customer.customer_id).from_jid.to_s
).then(&method(:new))
end
@@ -162,4 +165,8 @@ class AdminInfo
info.tel.gsub(/\A\+1/, "")
].join("/")
end
+
+ def support_link
+ CONFIG[:support_link].call(backend_jid)
+ end
end
@@ -114,7 +114,8 @@ CONFIG = {
bandwidth_peer: "test_peer",
keepgo: { api_key: "keepgokey", access_token: "keepgotoken" },
adr: "A Mailing Address",
- interac: "interac@example.com"
+ interac: "interac@example.com",
+ support_link: ->(*) { "https://support.com" }
}.freeze
def panic(e)