From 2fa3de6213745ef6f493493d3af0c1c750dc6a5d Mon Sep 17 00:00:00 2001 From: Rob Bond Date: Thu, 23 Jan 2020 09:59:58 +0000 Subject: [PATCH 1/5] added queue threshold parameter --- lib/webchat.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/webchat.yaml b/lib/webchat.yaml index 9d73805eb..38eb5c7f0 100644 --- a/lib/webchat.yaml +++ b/lib/webchat.yaml @@ -1,40 +1,40 @@ - base_path: /government/organisations/hm-revenue-customs/contact/child-benefit open_url: https://tax.service.gov.uk/ask-hmrc/webchat/child-benefit - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006859&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006859&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/income-tax-enquiries-for-individuals-pensioners-and-employees open_url: https://tax.service.gov.uk/ask-hmrc/webchat/income-tax-enquiries-for-individuals-pensioners-and-employees - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006852&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006852&siteID=10006719&businessUnitID=19001235&q-thresh=1 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/vat-online-services-helpdesk open_url: https://tax.service.gov.uk/ask-hmrc/webchat/vat-online-services-helpdesk - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006860&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006860&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/national-insurance-numbers open_url: https://tax.service.gov.uk/ask-hmrc/webchat/national-insurance-numbers - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006855&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006855&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/self-assessment open_url: https://tax.service.gov.uk/ask-hmrc/webchat/self-assessment - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006851&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006851&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/tax-credits-enquiries open_url: https://tax.service.gov.uk/ask-hmrc/webchat/tax-credits-enquiries - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006858&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006858&siteID=10006719&businessUnitID=19001235&q-thresh=1 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/vat-enquiries open_url: https://tax.service.gov.uk/ask-hmrc/webchat/vat-enquiries - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006860&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006860&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/customs-international-trade-and-excise-enquiries open_url: https://tax.service.gov.uk/ask-hmrc/webchat/customs-international-trade-and-excise-enquiries - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006861&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006861&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/employer-enquiries open_url: https://tax.service.gov.uk/ask-hmrc/webchat/employer-enquiries - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006854&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006854&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true - base_path: /government/organisations/hm-revenue-customs/contact/online-services-helpdesk open_url: https://tax.service.gov.uk/ask-hmrc/webchat/online-services-helpdesk - availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006856&siteID=10006719&businessUnitID=19001235 + availability_url: https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006856&siteID=10006719&businessUnitID=19001235&q-thresh=1.2 open_url_redirect: true From 65e9a2226cbd2890c2560b0e148c2dc17eacdd41 Mon Sep 17 00:00:00 2001 From: Rob Bond Date: Thu, 23 Jan 2020 10:45:54 +0000 Subject: [PATCH 2/5] updated logic to cater for an available state displayed when a queue slot is available even tho status is busy --- app/assets/javascripts/webchat/library.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/webchat/library.js b/app/assets/javascripts/webchat/library.js index 2adca0f4b..a045a34a1 100644 --- a/app/assets/javascripts/webchat/library.js +++ b/app/assets/javascripts/webchat/library.js @@ -53,6 +53,8 @@ function apiSuccess (result) { + result = {"inHOP":"true","status":"busy","availability":"false"} + if(result.hasOwnProperty('inHOP')){ var validState = API_STATES.indexOf(result.status.toUpperCase()) != -1 var state = validState ? result.status : "ERROR" @@ -62,13 +64,17 @@ state="AVAILABLE" } if (result.status == "busy"){ - state="BUSY" + state="AVAILABLE" } if (result.status == "offline"){ state="UNAVAILABLE" } }else{ - state="UNAVAILABLE" + if (result.status == "busy"){ + state="BUSY" + }else{ + state="UNAVAILABLE" + } } }else{ state = "UNAVAILABLE" From 57107eafb3d6a594ccc2a7343218bfe8078fe620 Mon Sep 17 00:00:00 2001 From: Rob Bond Date: Thu, 23 Jan 2020 11:31:34 +0000 Subject: [PATCH 3/5] updated to fix test --- app/assets/javascripts/webchat/library.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/webchat/library.js b/app/assets/javascripts/webchat/library.js index a045a34a1..9ee5f4d57 100644 --- a/app/assets/javascripts/webchat/library.js +++ b/app/assets/javascripts/webchat/library.js @@ -53,10 +53,9 @@ function apiSuccess (result) { - result = {"inHOP":"true","status":"busy","availability":"false"} - if(result.hasOwnProperty('inHOP')){ var validState = API_STATES.indexOf(result.status.toUpperCase()) != -1 + console.log(validState) var state = validState ? result.status : "ERROR" if (result.inHOP == "true"){ if(result.availability == "true"){ From 615d546b89839b422ce18ce5f1592eca39609e9d Mon Sep 17 00:00:00 2001 From: Rob Bond Date: Thu, 23 Jan 2020 11:33:02 +0000 Subject: [PATCH 4/5] removed comment --- app/assets/javascripts/webchat/library.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/webchat/library.js b/app/assets/javascripts/webchat/library.js index 9ee5f4d57..738191702 100644 --- a/app/assets/javascripts/webchat/library.js +++ b/app/assets/javascripts/webchat/library.js @@ -55,7 +55,6 @@ if(result.hasOwnProperty('inHOP')){ var validState = API_STATES.indexOf(result.status.toUpperCase()) != -1 - console.log(validState) var state = validState ? result.status : "ERROR" if (result.inHOP == "true"){ if(result.availability == "true"){ From 88d7a9cb230b516ae1daf078915754b2428212d9 Mon Sep 17 00:00:00 2001 From: Rob Bond Date: Thu, 23 Jan 2020 11:44:02 +0000 Subject: [PATCH 5/5] fixed test --- test/presenters/contact_presenter_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/presenters/contact_presenter_test.rb b/test/presenters/contact_presenter_test.rb index 2afb391ac..571c99c78 100644 --- a/test/presenters/contact_presenter_test.rb +++ b/test/presenters/contact_presenter_test.rb @@ -88,7 +88,7 @@ def schema_name schema = schema_item("contact_with_webchat") presented = present_example(schema) assert_equal true, presented.show_webchat? - assert_equal presented.webchat.availability_url, "https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006852&siteID=10006719&businessUnitID=19001235" + assert_equal presented.webchat.availability_url, "https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006852&siteID=10006719&businessUnitID=19001235&q-thresh=1" assert_equal presented.webchat.open_url, "https://tax.service.gov.uk/ask-hmrc/webchat/income-tax-enquiries-for-individuals-pensioners-and-employees" end end