Skip to content

Commit

Permalink
Remove reference to details.js
Browse files Browse the repository at this point in the history
As of govuk-frontend v5, the details component does not use JS and the .js file has been removed from the package.

Remove the `data-module="govuk-details"` attribute

See 'Remove references to the JavaScript for the Details component' from https://github.com/alphagov/govuk-frontend/releases/tag/v5.0.0
  • Loading branch information
patrickpatrickpatrick authored and MartinJJones committed Jun 24, 2024
1 parent cc91185 commit 0ec16b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// = require govuk/components/details/details.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend.Details;
window.GOVUK.Modules = window.GOVUK.Modules || {};

(function (Modules) {
function GemDetails ($module) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
css_classes << shared_helper.get_margin_bottom

details_data_attributes = {}
details_data_attributes[:module] = 'govuk-details gem-details'
details_data_attributes[:module] = 'govuk-details gem-details ga4-event-tracker' unless disable_ga4
details_data_attributes[:module] = 'gem-details'
details_data_attributes[:module] = 'gem-details ga4-event-tracker' unless disable_ga4

data_attributes ||= {}
data_attributes[:details_track_click] = ''
Expand Down
2 changes: 1 addition & 1 deletion spec/components/details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def component_name
"This is more info"
end

assert_select "details.gem-c-details[data-module='govuk-details gem-details ga4-event-tracker']"
assert_select "details.gem-c-details[data-module='gem-details ga4-event-tracker']"
assert_select ".govuk-details__summary-text[data-ga4-expandable]", text: "Some title"
assert_select ".govuk-details__text", text: "This is more info"
end
Expand Down

0 comments on commit 0ec16b7

Please sign in to comment.