Skip to content

Commit

Permalink
Add component wrapper to feedback component
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGDS committed Oct 30, 2024
1 parent 2c1702a commit 9e947a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
%>
<div class="gem-c-feedback govuk-!-display-none-print" data-module="<%= data_module %>">
<%= 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: %>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9e947a2

Please sign in to comment.