Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add component wrapper to feedback component #4351

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
## Unreleased

* Add component wrapper helper to radio component ([PR #4366](https://github.com/alphagov/govuk_publishing_components/pull/4366))
* Add component wrapper to feedback component ([PR #4351](https://github.com/alphagov/govuk_publishing_components/pull/4351))

## 45.1.0

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
Loading