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 search-with-autocomplete component as assets #3532

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

kevindew
Copy link
Member

@kevindew kevindew commented Dec 11, 2024

This adds in search-with-autocomplete to the global assets that static uses, this is added because the layout-super-navigation-header makes use of the search-with-autocomplete component.

The motivation for this change was to resolve a bug when we pushed search-with-autocomplete live and we discovered that the autocomplete only rendered and operated correctly on a few pages that already had the component embedded. The reason this was not operational was because the CSS and JavaScript were not available unless the autocomplete was already embedded.

There was a decision to make as to whether to add the dependency to the layout-super-navigation-header component or to add them separately here. I've gone with the separate approach as that was the precedent already used for the search nested component.

Following this change I'm going to go through and remove the previous embeddings of the JS and CSS so that we don't have it included twice.

Follow these steps if you are doing a Rails upgrade.

@kevindew kevindew marked this pull request as ready for review December 11, 2024 14:39
kevindew added a commit to alphagov/govuk_publishing_components that referenced this pull request Dec 11, 2024
This adds the search-with-autocomplete component to the list of those
served by static. We are adding this to static in: alphagov/static#3532
This adds in search-with-autocomplete to the global assets that static
uses, this is added because the layout-super-navigation-header makes use
of the search-with-autocomplete component.

The motivation for this change was to resolve a bug when we pushed
search-with-autocomplete live and we discovered that the autocomplete
only rendered and operated correctly on a few pages that already had
the component embedded. The reason this was not operational was because
the CSS and JavaScript were not available unless the autocomplete was
already embedded.

There was a decision to make as to whether to add the dependency to the
layout-super-navigation-header component or to add them separately here.
I've gone with the separate approach as that was the precedent already
used for the search nested component.

Following this change I'm going to go through and remove the previous
embeddings of the JS and CSS so that we don't have it included twice.
@kevindew kevindew force-pushed the fix-search-autocomplete branch from 1effbc5 to 5bf9522 Compare December 11, 2024 14:44
kevindew added a commit to alphagov/govuk_publishing_components that referenced this pull request Dec 11, 2024
This adds the search-with-autocomplete component to the list of those
served by static. We are adding this to static in:
alphagov/static#3532 and want to avoid serving
this stylesheet unnecessarily to users.
kevindew added a commit to alphagov/govuk_publishing_components that referenced this pull request Dec 11, 2024
This adds the search-with-autocomplete component stylesheet to the list of
those served by static. We are adding this to static in:
alphagov/static#3532 and want to avoid serving
this stylesheet unnecessarily to users.
@kevindew kevindew merged commit c9a5002 into main Dec 11, 2024
11 checks passed
@kevindew kevindew deleted the fix-search-autocomplete branch December 11, 2024 14:52
kevindew added a commit to alphagov/frontend that referenced this pull request Dec 11, 2024
This javascript is now provided by static [1] and is thus removed from
this repo to ensure that we don't send the same asset to users
multiple times unnecessarily.

It continues the convention of applications only adding the JS of
components which are not provided by static [2].

[1]: alphagov/static#3532
[2]: #3281
kevindew added a commit to alphagov/finder-frontend that referenced this pull request Dec 11, 2024
This javascript is now provided by static [1] and is thus removed from
this repo to ensure that we don't send the same asset to users
multiple times unnecessarily.

It continues the convention of applications only adding the JS of
components which are not provided by static [2].

[1]: alphagov/static#3532
[2]: #2819
kevindew added a commit to alphagov/govuk-helm-charts that referenced this pull request Dec 11, 2024
We believe we have resolved the issues now that led to this feature being disabled (see: alphagov/static#3532)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants