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

Remove GOVUK_DISABLE_SEARCH_AUTOCOMPLETE feature flag #4533

Merged
merged 1 commit into from
Jan 10, 2025
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 @@ -20,6 +20,7 @@
* Use component wrapper on warning text component ([PR #4351](https://github.com/alphagov/govuk_publishing_components/pull/4531))
* Remove govspeak advisory component ([PR #4349](https://github.com/alphagov/govuk_publishing_components/pull/4349))
* Use component wrapper on super navigation header ([PR #4534](https://github.com/alphagov/govuk_publishing_components/pull/4534))
* Remove `GOVUK_DISABLE_SEARCH_AUTOCOMPLETE` feature flag ([PR #4533](https://github.com/alphagov/govuk_publishing_components/pull/4533))

## 47.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
label: "Site-wide",
}
) do %>
<% search_options = {
<%= render "govuk_publishing_components/components/search_with_autocomplete", {
name: "keywords",
inline_label: false,
label_size: "m",
Expand All @@ -321,15 +321,9 @@
size: "large",
margin_bottom: 0,
disable_corrections: true,
source_url: [Plek.new.website_root, "/api/search/autocomplete.json"].join,
source_key: "suggestions",
} %>
<% if ENV["GOVUK_DISABLE_SEARCH_AUTOCOMPLETE"] %>
<%= render "govuk_publishing_components/components/search", search_options %>
<% else %>
<%= render "govuk_publishing_components/components/search_with_autocomplete", search_options.merge({
source_url: [Plek.new.website_root, "/api/search/autocomplete.json"].join,
source_key: "suggestions",
}) %>
<% end %>
<% end %>
</div>
</div>
Expand Down
8 changes: 0 additions & 8 deletions spec/components/layout_super_navigation_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,5 @@ def component_name
render_component({})
assert_select ".gem-c-search-with-autocomplete[data-source-url='http://www.dev.gov.uk/api/search/autocomplete.json']"
end

it "allows the GOVUK_DISABLE_SEARCH_AUTOCOMPLETE env var presence to fallback to search without autocomplete" do
ClimateControl.modify GOVUK_DISABLE_SEARCH_AUTOCOMPLETE: "1" do
render_component({})
assert_select ".gem-c-search-autocomplete", false
assert_select ".gem-c-search"
end
end
end
end
Loading