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 %> -
+<%= tag.div(**component_helper.all_attributes) do %> <%= render "govuk_publishing_components/components/feedback/yes_no_banner", disable_ga4: %> <%= render "govuk_publishing_components/components/feedback/problem_form", url_without_pii: url_without_pii, disable_ga4: %> <%= render "govuk_publishing_components/components/feedback/survey_signup_form", path_without_pii: path_without_pii, disable_ga4: %> -
+<% end %> diff --git a/app/views/govuk_publishing_components/components/docs/feedback.yml b/app/views/govuk_publishing_components/components/docs/feedback.yml index 690594e109..905d5b2c33 100644 --- a/app/views/govuk_publishing_components/components/docs/feedback.yml +++ b/app/views/govuk_publishing_components/components/docs/feedback.yml @@ -4,6 +4,7 @@ body: | This component is designed to sit at the bottom of pages on GOV.UK to allow users to submit feedback on that page. This component uses JavaScript for expanding and collapsing and also for submitting form responses. This code is not compatible with Internet Explorer, so IE11 and down do not use JavaScript to submit the forms, instead falling back to a normal form submission. +uses_component_wrapper_helper: true accessibility_criteria: | The form must: