From fa976ff92c26367a1047124b07fa81053feef170 Mon Sep 17 00:00:00 2001 From: Graham Lewis <44037625+gclssvglx@users.noreply.github.com> Date: Fri, 22 Oct 2021 16:04:31 +0100 Subject: [PATCH] Fix missing hidden CSS class A CSS class of 'hidden' is referenced but no longer present causing all UNAVAILABLE statuses to be visible on the page. Replace 'hidden' class with GOV.UK 'govuk-!-display-none' class from the GOV.UK components gem. --- app/assets/javascripts/webchat/library.js | 4 +- app/views/shared/_webchat.html.erb | 6 +-- spec/javascripts/webchat.spec.js | 54 +++++++++++------------ 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/webchat/library.js b/app/assets/javascripts/webchat/library.js index 66544b0ea..cc7c3cace 100644 --- a/app/assets/javascripts/webchat/library.js +++ b/app/assets/javascripts/webchat/library.js @@ -91,8 +91,8 @@ function advisorStateChange (state) { state = state.toLowerCase() var currentState = $el.find('.' + webchatStateClass + state) - $el.find('[class^="' + webchatStateClass + '"]').addClass('hidden') - currentState.removeClass('hidden') + $el.find('[class^="' + webchatStateClass + '"]').addClass('govuk-!-display-none') + currentState.removeClass('govuk-!-display-none') trackEvent(state) } diff --git a/app/views/shared/_webchat.html.erb b/app/views/shared/_webchat.html.erb index 949b1e0c5..01673eb28 100644 --- a/app/views/shared/_webchat.html.erb +++ b/app/views/shared/_webchat.html.erb @@ -12,13 +12,13 @@ <%= t("shared.webchat.technical_problem") %> -