diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d02db302..836c1a90e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ useful summary for people upgrading their application, not a replication of the commit log. +## Unreleased + +* Add component wrapper to feedback component ([PR #4351](https://github.com/alphagov/govuk_publishing_components/pull/4351)) + ## 44.9.1 * Layout super nav header: Correct name for search input ([PR #4347](https://github.com/alphagov/govuk_publishing_components/pull/4347)) diff --git a/app/views/govuk_publishing_components/components/_feedback.html.erb b/app/views/govuk_publishing_components/components/_feedback.html.erb index af3f0dee93..8371b93685 100644 --- a/app/views/govuk_publishing_components/components/_feedback.html.erb +++ b/app/views/govuk_publishing_components/components/_feedback.html.erb @@ -11,12 +11,15 @@ path_without_pii = utf_encode(request.fullpath.gsub(email_regex, '[email]')) disable_ga4 ||= false - data_module = "feedback" - data_module << " ga4-event-tracker" unless disable_ga4 + + component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) + component_helper.add_class("gem-c-feedback govuk-!-display-none-print") + component_helper.add_data_attribute({ module: "feedback" }) + component_helper.add_data_attribute({ module: "ga4-event-tracker" }) unless disable_ga4 %> -