Skip to content

Commit

Permalink
Merge pull request #4533 from alphagov/rem-ac-ff
Browse files Browse the repository at this point in the history
Remove `GOVUK_DISABLE_SEARCH_AUTOCOMPLETE` feature flag
  • Loading branch information
csutter authored Jan 10, 2025
2 parents 122014a + 9d9b320 commit 10ad27d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
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

0 comments on commit 10ad27d

Please sign in to comment.