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

Sync upstream 2022 #130

Open
wants to merge 6,022 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
6022 commits
Select commit Hold shift + click to select a range
fc50ec8
Rename `$module` to `$root` in common helpers and errors
romaricpascal Sep 20, 2024
b88cbfc
Rename `$module` to `$root` in Accordion
romaricpascal Sep 20, 2024
423514f
Rename `$module` to `$root` in Button
romaricpascal Sep 20, 2024
82df8d4
Rename `$module` to `$root` in Character Count
romaricpascal Sep 20, 2024
ac453bd
Rename `$module` to `$root` in Checkboxes
romaricpascal Sep 20, 2024
90849a0
Rename `$module` to `$root` in Error Summary
romaricpascal Sep 20, 2024
6330247
Rename `$module` to `$root` in Exit This Page
romaricpascal Sep 20, 2024
21b8cb3
Rename `$module` to `$root` in Header
romaricpascal Sep 20, 2024
cfe1093
Rename `$module` to `$root` in Notification Banner
romaricpascal Sep 20, 2024
8f32cdb
Rename `$module` to `$root` in Password Input
romaricpascal Sep 20, 2024
ff391c5
Rename `$module` to `$root` in Radios
romaricpascal Sep 20, 2024
530a41a
Rename `$module` to `$root` in Service Navigation
romaricpascal Sep 20, 2024
c7506f3
Rename `$module` to `$root` in Skip Link
romaricpascal Sep 20, 2024
0e60f4f
Rename `$module` to `$root` in Tabs
romaricpascal Sep 20, 2024
df501f2
Remove unnecessary variables in InitError tests
romaricpascal Sep 20, 2024
5e9c8da
Rename `$module` to `$root` in GOVUKFrontendComponent
romaricpascal Sep 20, 2024
7748282
Rename `$module` to `$root` in shared helpers
romaricpascal Sep 20, 2024
c77c714
Rename `$module` to `$root` in documentation
romaricpascal Sep 20, 2024
77d83e6
Update outdated example in JavaScript coding standards
romaricpascal Sep 20, 2024
817ea2e
`checkSupport` now `static`
patrickpatrickpatrick Sep 19, 2024
11d9e06
Remove `isSupported` static method for GOVUKFrontendComponent
romaricpascal Sep 23, 2024
bb472d2
Refactor `ElementError`, add `formatErrorMessage`
patrickpatrickpatrick Sep 18, 2024
c63b687
Change the components to use new `ElementError`
patrickpatrickpatrick Sep 25, 2024
c05794c
Export `GOVUKFrontendComponent` as `Component`
romaricpascal Sep 24, 2024
819c725
Add CHANGELOG entry
romaricpascal Sep 24, 2024
ed3044d
Add CHANGELOG entry for `isSupported`
romaricpascal Sep 24, 2024
dd8fd2e
Add CHANGELOG entry for `onError` option
romaricpascal Sep 24, 2024
b7eae7c
Add CHANGELOG entry for preventing double initialisation
romaricpascal Sep 24, 2024
d2b6576
Relax requirements to receive configuration with `createAll`
romaricpascal Oct 3, 2024
cd00ba0
Match argument type for `onError` to what `catch` provides
romaricpascal Oct 3, 2024
32e2324
Update `CharacterCount` to use `formatErrorMessage`
romaricpascal Sep 27, 2024
cba4d74
Refactor check for child components implementing a `moduleName` stati…
romaricpascal Sep 27, 2024
de6b95b
WIP - Refactor `InitError` to use `formatErrorMessage` or accept an a…
romaricpascal Sep 27, 2024
7cb7b62
Refactor `GOVUKFrontendComponent` `root` typing
patrickpatrickpatrick Oct 2, 2024
42c5276
Make changes to components due to `root` changes
patrickpatrickpatrick Oct 2, 2024
632e271
Add brand color for SFO
ChrisBAshton Oct 8, 2024
6b11203
Update CHANGELOG.md to include SFO brand color change
ChrisBAshton Oct 8, 2024
086734c
Use `get` for `$root` in `GOVUKFrontendComponent`
patrickpatrickpatrick Oct 10, 2024
b2f6183
Use `this.$root` in component options documentation
romaricpascal Oct 8, 2024
3edf2c0
Merge pull request #5389 from alphagov/add-brand-color-sfo
romaricpascal Oct 10, 2024
fe83aa4
Merge pull request #5338 from alphagov/public-js-api
romaricpascal Oct 10, 2024
9fb4b89
Release v5.7.0
owenatgov Oct 10, 2024
663748a
Merge pull request #5394 from alphagov/release-5.7.0
owenatgov Oct 10, 2024
6805620
Merge pull request #5390 from alphagov/component-options-this-root
romaricpascal Oct 10, 2024
1bc77e1
Update DCMS, Defra, DSIT and FCDO brand colours
querkmachine Oct 10, 2024
617ef04
Update for Scotland and Wales office rebrands
querkmachine Oct 10, 2024
4e1ccea
Merge pull request #5396 from alphagov/update-organisation-colours-oc…
querkmachine Oct 11, 2024
8a95be4
Mark file upload ‘value’ parameter as deprecated
querkmachine Sep 16, 2024
782fba5
Merge pull request #5330 from alphagov/file-upload-deprecate-value-param
querkmachine Oct 11, 2024
5d6fd4c
Fix typo in name of removed crest image
romaricpascal Oct 11, 2024
23569ac
Release v5.7.1
owenatgov Oct 11, 2024
77521fc
Merge pull request #5400 from alphagov/release-5.7.1
owenatgov Oct 11, 2024
d219d30
Merge pull request #5399 from alphagov/romaricpascal-patch-1
romaricpascal Oct 11, 2024
8fd0fd7
Merge pull request #5391 from alphagov/dependabot/npm_and_yarn/types-…
romaricpascal Oct 11, 2024
263fa20
Bump actions/cache from 4.1.0 to 4.1.1
dependabot[bot] Oct 14, 2024
4462842
Bump actions/checkout from 4.2.0 to 4.2.1
dependabot[bot] Oct 14, 2024
5e2ace6
Bump actions/upload-artifact from 4.4.0 to 4.4.3
dependabot[bot] Oct 14, 2024
5f6be9b
Bump actions/cache in /.github/workflows/actions/install-node
dependabot[bot] Oct 14, 2024
1c8b0c5
Bump typedoc from 0.26.8 to 0.26.9
dependabot[bot] Oct 14, 2024
aa57f06
Bump cookie-parser from 1.4.6 to 1.4.7
dependabot[bot] Oct 14, 2024
f53549d
Bump actions/cache in /.github/workflows/actions/build
dependabot[bot] Oct 14, 2024
a7504c7
Merge pull request #5408 from alphagov/dependabot/npm_and_yarn/typedo…
romaricpascal Oct 14, 2024
fcf1e45
Add link to 5.0.0 release in section for `isSupported`
romaricpascal Oct 15, 2024
5a0322c
Merge pull request #5417 from alphagov/romaricpascal-patch-1
romaricpascal Oct 15, 2024
8e21893
Bump the babel group with 2 updates
dependabot[bot] Oct 21, 2024
2c1174c
Bump the percy group with 2 updates
dependabot[bot] Oct 21, 2024
2cbd5e3
Bump caniuse-lite from 1.0.30001667 to 1.0.30001669
dependabot[bot] Oct 21, 2024
3695a00
Bump html-validate from 8.24.0 to 8.24.2
dependabot[bot] Oct 21, 2024
b9f7067
Merge pull request #5401 from alphagov/dependabot/github_actions/acti…
owenatgov Oct 21, 2024
11ddee8
Merge pull request #5402 from alphagov/dependabot/github_actions/acti…
owenatgov Oct 21, 2024
1e36e0a
Merge pull request #5403 from alphagov/dependabot/github_actions/acti…
owenatgov Oct 21, 2024
746e650
Merge pull request #5407 from alphagov/dependabot/github_actions/dot-…
owenatgov Oct 21, 2024
e9d5823
Merge pull request #5412 from alphagov/dependabot/npm_and_yarn/cookie…
owenatgov Oct 21, 2024
5d6f40a
Merge pull request #5404 from alphagov/dependabot/npm_and_yarn/babel-…
owenatgov Oct 21, 2024
af94c08
Merge pull request #5414 from alphagov/dependabot/github_actions/dot-…
owenatgov Oct 21, 2024
cd6262f
Merge pull request #5419 from alphagov/dependabot/npm_and_yarn/percy-…
owenatgov Oct 21, 2024
fd4348f
Bump express from 4.21.0 to 4.21.1
dependabot[bot] Oct 21, 2024
63bf61b
Bump the test group across 1 directory with 3 updates
dependabot[bot] Oct 21, 2024
b301a64
Bump @types/node from 22.7.5 to 22.7.7 in the types group
dependabot[bot] Oct 21, 2024
af328be
Merge pull request #5422 from alphagov/dependabot/npm_and_yarn/canius…
owenatgov Oct 21, 2024
6acd99e
Merge pull request #5413 from alphagov/dependabot/npm_and_yarn/expres…
owenatgov Oct 21, 2024
4181b3b
Merge pull request #5420 from alphagov/dependabot/npm_and_yarn/test-b…
owenatgov Oct 21, 2024
fab11b7
Merge pull request #5424 from alphagov/dependabot/npm_and_yarn/html-v…
owenatgov Oct 21, 2024
cbf4ef1
Merge pull request #5421 from alphagov/dependabot/npm_and_yarn/types-…
owenatgov Oct 21, 2024
1578df1
Bump actions/cache from 4.1.1 to 4.1.2
dependabot[bot] Oct 28, 2024
4596153
Bump actions/checkout from 4.2.1 to 4.2.2
dependabot[bot] Oct 28, 2024
5286e6c
Bump the babel group with 2 updates
dependabot[bot] Oct 28, 2024
2feef97
Bump actions/setup-node in /.github/workflows/actions/setup-node
dependabot[bot] Oct 28, 2024
84c5c8c
Bump marked from 14.1.2 to 14.1.3
dependabot[bot] Oct 28, 2024
4c0c3de
Bump caniuse-lite from 1.0.30001669 to 1.0.30001673
dependabot[bot] Oct 28, 2024
893082a
Bump @testing-library/jest-dom from 6.5.0 to 6.6.2
dependabot[bot] Oct 28, 2024
227dfc7
Bump sass-embedded from 1.79.4 to 1.80.4
dependabot[bot] Oct 28, 2024
3f201a5
Bump typedoc from 0.26.9 to 0.26.10
dependabot[bot] Oct 28, 2024
be6639e
Bump actions/cache in /.github/workflows/actions/build
dependabot[bot] Oct 28, 2024
1dc33c2
Bump actions/cache in /.github/workflows/actions/install-node
dependabot[bot] Oct 28, 2024
acaca43
Merge pull request #5443 from alphagov/dependabot/npm_and_yarn/typedo…
romaricpascal Oct 29, 2024
653df30
Merge pull request #5445 from alphagov/dependabot/github_actions/dot-…
romaricpascal Oct 29, 2024
31462a2
Merge pull request #5444 from alphagov/dependabot/github_actions/dot-…
romaricpascal Oct 29, 2024
6e3733c
Merge pull request #5431 from alphagov/dependabot/github_actions/acti…
romaricpascal Oct 29, 2024
6b002cc
Merge pull request #5438 from alphagov/dependabot/npm_and_yarn/marked…
romaricpascal Oct 29, 2024
c7af706
Merge pull request #5432 from alphagov/dependabot/github_actions/acti…
romaricpascal Oct 29, 2024
03c250a
Bump actions/setup-node from 4.0.4 to 4.1.0
dependabot[bot] Oct 29, 2024
0e5ef7e
Merge pull request #5434 from alphagov/dependabot/npm_and_yarn/babel-…
romaricpascal Oct 29, 2024
2785fd8
Merge pull request #5435 from alphagov/dependabot/github_actions/dot-…
romaricpascal Oct 29, 2024
b3b0d04
Merge pull request #5439 from alphagov/dependabot/npm_and_yarn/canius…
romaricpascal Oct 29, 2024
e2d9faf
Merge pull request #5441 from alphagov/dependabot/npm_and_yarn/testin…
romaricpascal Oct 29, 2024
d346de1
Bump the test group with 4 updates
dependabot[bot] Oct 28, 2024
5cd36b2
Merge pull request #5433 from alphagov/dependabot/github_actions/acti…
owenatgov Oct 31, 2024
1ffabf7
Bump @types/node from 22.7.7 to 22.8.1 in the types group
dependabot[bot] Oct 28, 2024
c3ead36
Merge pull request #5436 from alphagov/dependabot/npm_and_yarn/test-3…
owenatgov Oct 31, 2024
8ca55c8
Merge pull request #5437 from alphagov/dependabot/npm_and_yarn/types-…
owenatgov Oct 31, 2024
751fb3c
Update Node version we use to latest LTS
romaricpascal Oct 31, 2024
14144e2
Merge pull request #5446 from alphagov/update-node-lts
romaricpascal Oct 31, 2024
1969a62
Update Node.js version in package.json files
romaricpascal Oct 31, 2024
cec5c59
Update Node.js version in .browserslistrc files
romaricpascal Oct 31, 2024
aef02c8
Document what needs updating beyond `.nvmrc`
romaricpascal Oct 31, 2024
d341667
Merge pull request #5447 from alphagov/node-22-update-in-other-files
romaricpascal Nov 1, 2024
652ad88
Add deprecations from this new release to `silenceDeprecations` when …
romaricpascal Nov 1, 2024
febc1d3
Bump typedoc from 0.26.10 to 0.26.11
dependabot[bot] Nov 4, 2024
9eb0ed7
Bump caniuse-lite from 1.0.30001673 to 1.0.30001677
dependabot[bot] Nov 4, 2024
16e1488
Bump @testing-library/jest-dom from 6.6.2 to 6.6.3
dependabot[bot] Nov 4, 2024
624ea00
Merge pull request #5454 from alphagov/dependabot/npm_and_yarn/canius…
domoscargin Nov 4, 2024
4ee4a08
Refactor gulp watch tasks of govuk-frontend
romaricpascal Nov 4, 2024
8b80780
Allow disabling CSS and JavaScript linting in `govuk-frontend`'s watch
romaricpascal Nov 4, 2024
ec1036f
Refactor gulp watch tasks of the review app
romaricpascal Nov 5, 2024
daa393f
Allow disabling CSS and JavaScript linting in `@govuk-frontend/review…
romaricpascal Nov 5, 2024
741d746
Document the environment variable for disabling linting
romaricpascal Nov 5, 2024
a6d6eef
Merge pull request #5470 from alphagov/disable-dev-linting
romaricpascal Nov 5, 2024
a9f5e15
Merge pull request #5442 from alphagov/dependabot/npm_and_yarn/sass-e…
owenatgov Nov 8, 2024
76d092d
Merge pull request #5455 from alphagov/dependabot/npm_and_yarn/testin…
owenatgov Nov 8, 2024
dbfb935
Merge pull request #5451 from alphagov/dependabot/npm_and_yarn/typedo…
owenatgov Nov 8, 2024
156b04c
Update our deprecated libsass tests to use node 6 instead of 4
owenatgov Nov 11, 2024
719dd90
Merge pull request #5491 from alphagov/upgrade-libsass-test
owenatgov Nov 11, 2024
d76a418
Move config specific helpers to new file
patrickpatrickpatrick Nov 6, 2024
d82e3e9
Change `extractConfigNamespace` parameters
patrickpatrickpatrick Nov 7, 2024
19a96b1
Add `GOVUKFrontendComponentConfigurable`
patrickpatrickpatrick Nov 7, 2024
b9910e3
Accordion extends the configurable Component class
patrickpatrickpatrick Nov 7, 2024
083028e
Bump marked-smartypants from 1.1.8 to 1.1.9
dependabot[bot] Nov 11, 2024
fe67a93
Bump caniuse-lite from 1.0.30001677 to 1.0.30001680
dependabot[bot] Nov 11, 2024
2ba0c6d
Bump postcss from 8.4.47 to 8.4.48 in the postcss group
dependabot[bot] Nov 11, 2024
35e89aa
Bump sass-loader from 16.0.2 to 16.0.3
dependabot[bot] Nov 11, 2024
9e50527
Merge pull request #5490 from alphagov/dependabot/npm_and_yarn/marked…
owenatgov Nov 11, 2024
f7ad4cd
Bump marked-linkify-it from 3.1.11 to 3.1.12
dependabot[bot] Nov 11, 2024
5248e5f
Merge pull request #5489 from alphagov/dependabot/npm_and_yarn/canius…
owenatgov Nov 11, 2024
1f8e9b3
Merge pull request #5486 from alphagov/dependabot/npm_and_yarn/postcs…
owenatgov Nov 11, 2024
06f0515
Merge pull request #5452 from alphagov/dependabot/npm_and_yarn/sass-l…
owenatgov Nov 11, 2024
1c7f67d
Merge pull request #5488 from alphagov/dependabot/npm_and_yarn/marked…
owenatgov Nov 11, 2024
a343c28
Bump mini-css-extract-plugin from 2.9.1 to 2.9.2
dependabot[bot] Nov 11, 2024
bd44ccf
Merge pull request #5475 from alphagov/add-config-helpers
patrickpatrickpatrick Nov 11, 2024
77b67bf
Button extends Configurable class
patrickpatrickpatrick Nov 11, 2024
c67cfa4
ErrorSummary extends Configurable class
patrickpatrickpatrick Nov 11, 2024
3d53cab
ExitThisPage extends Configurable class
patrickpatrickpatrick Nov 11, 2024
58fdd9c
NotificationBanner extends Configurable class
patrickpatrickpatrick Nov 11, 2024
561ffcb
PasswordInput extends Configurable class
patrickpatrickpatrick Nov 11, 2024
4a28075
Merge pull request #5453 from alphagov/dependabot/npm_and_yarn/mini-c…
owenatgov Nov 11, 2024
9189857
Merge pull request #5485 from alphagov/add-config-helpers-to-button
patrickpatrickpatrick Nov 11, 2024
d1fa1e5
Bump @types/node in the types group across 1 directory
dependabot[bot] Nov 11, 2024
409527b
Update silenced warnings for Sass compiler
romaricpascal Nov 11, 2024
eba858d
Centralise configuration for handling Sass deprecations
romaricpascal Nov 11, 2024
d6c8ed8
Rename generic `T` to the more explicit `ComponentClass`
romaricpascal Nov 12, 2024
fef3a86
Refactor access to component's configuration in its own type
romaricpascal Nov 12, 2024
3c4cb8c
Use ConstructorParameters to get the type of the components config
romaricpascal Nov 12, 2024
e070827
Config override support in Configurable class
patrickpatrickpatrick Nov 12, 2024
79ad500
Character count extends Configurable class
patrickpatrickpatrick Nov 12, 2024
f0dc5be
Merge pull request #5495 from alphagov/char-count-config
patrickpatrickpatrick Nov 13, 2024
2e8e59b
Merge pull request #5487 from alphagov/dependabot/npm_and_yarn/types-…
romaricpascal Nov 14, 2024
a657b0e
Merge pull request #5496 from alphagov/createall-type-no-defaults
romaricpascal Nov 14, 2024
ee76a60
Bump the percy group with 2 updates
dependabot[bot] Nov 18, 2024
98f3fcd
Bump postcss from 8.4.48 to 8.4.49 in the postcss group
dependabot[bot] Nov 18, 2024
f865684
Bump marked from 14.1.3 to 15.0.1
dependabot[bot] Nov 18, 2024
8ff0d24
Bump sass-embedded from 1.80.4 to 1.81.0
dependabot[bot] Nov 18, 2024
c4dab26
Bump typedoc-plugin-missing-exports from 3.0.0 to 3.0.2
dependabot[bot] Nov 18, 2024
216d24e
Merge pull request #5507 from alphagov/dependabot/npm_and_yarn/percy-…
domoscargin Nov 18, 2024
6c4c8bd
Merge pull request #5509 from alphagov/dependabot/npm_and_yarn/postcs…
domoscargin Nov 18, 2024
11e02a7
Bump cross-spawn from 7.0.3 to 7.0.5
dependabot[bot] Nov 18, 2024
6b9f0fc
Bump html-validate from 8.24.2 to 8.25.0
dependabot[bot] Nov 18, 2024
6fb4d41
Merge pull request #5513 from alphagov/dependabot/npm_and_yarn/typedo…
domoscargin Nov 18, 2024
997b812
Merge pull request #5512 from alphagov/dependabot/npm_and_yarn/html-v…
domoscargin Nov 18, 2024
7d24700
Merge pull request #5511 from alphagov/dependabot/npm_and_yarn/sass-e…
domoscargin Nov 18, 2024
d7fd939
Merge pull request #5514 from alphagov/dependabot/npm_and_yarn/cross-…
domoscargin Nov 18, 2024
3c8fec3
Merge pull request #5510 from alphagov/dependabot/npm_and_yarn/marked…
romaricpascal Nov 18, 2024
11f6e24
Merge pull request #5494 from alphagov/silence-missed-sass-warnings
romaricpascal Nov 21, 2024
04b90a4
Upgrade test for deprecated LibSass to node-sass@5
romaricpascal Nov 21, 2024
0496828
Merge pull request #5522 from alphagov/upgrade-old-libsass-test
romaricpascal Nov 21, 2024
8df8a9c
Fix broken external links in yml docs
owenatgov Oct 24, 2024
9a0db93
Rename `GOVUKFrontendComponentConfigurable`
patrickpatrickpatrick Nov 14, 2024
574ac1b
Export `ConfigurableComponent``
patrickpatrickpatrick Nov 14, 2024
81b8df2
Add to CHANGELOG.md
patrickpatrickpatrick Nov 20, 2024
19bea6b
Merge pull request #5499 from alphagov/export-configurable-class
patrickpatrickpatrick Nov 22, 2024
16f71d5
Make yaml link text clearer
owenatgov Nov 21, 2024
3ceb9f4
Replace remaining instances of WCAG 2.1 links with 2.2
owenatgov Nov 21, 2024
c53281d
Merge pull request #5428 from alphagov/fix-broken-external-links
owenatgov Nov 22, 2024
411d330
Bump @types/node from 22.9.0 to 22.9.3 in the types group
dependabot[bot] Nov 25, 2024
6a927fc
Bump marked from 15.0.1 to 15.0.2
dependabot[bot] Nov 25, 2024
a922053
Bump caniuse-lite from 1.0.30001680 to 1.0.30001684
dependabot[bot] Nov 25, 2024
8fda097
Bump html-validate from 8.25.0 to 8.25.1
dependabot[bot] Nov 25, 2024
2d9266f
Bump husky from 9.1.6 to 9.1.7
dependabot[bot] Nov 25, 2024
5bc9f7d
Bump typedoc-plugin-missing-exports from 3.0.2 to 3.1.0
dependabot[bot] Nov 25, 2024
542fe89
Merge pull request #5528 from alphagov/dependabot/npm_and_yarn/husky-…
querkmachine Nov 25, 2024
8a04859
Merge pull request #5527 from alphagov/dependabot/npm_and_yarn/html-v…
querkmachine Nov 25, 2024
df9926b
Merge pull request #5526 from alphagov/dependabot/npm_and_yarn/canius…
querkmachine Nov 25, 2024
9764cc6
Merge pull request #5529 from alphagov/dependabot/npm_and_yarn/typedo…
querkmachine Nov 25, 2024
5a750d7
Unhoist @types/node
querkmachine Nov 25, 2024
03a7205
Merge pull request #5524 from alphagov/dependabot/npm_and_yarn/types-…
querkmachine Nov 25, 2024
1ac6988
Merge pull request #5525 from alphagov/dependabot/npm_and_yarn/marked…
querkmachine Nov 25, 2024
6a93d78
Deprecate `govuk/all.scss` and only reference `govuk/index.scss` inte…
owenatgov Nov 20, 2024
ce87ed7
Merge pull request #5518 from alphagov/deprecate-govuk/all
owenatgov Nov 29, 2024
1fdd296
Fix UMD files overriding existing global
romaricpascal Nov 29, 2024
7022a8a
Add CHANGELOG entry
romaricpascal Nov 29, 2024
dc521ff
Bump marked from 15.0.2 to 15.0.3
dependabot[bot] Dec 2, 2024
20278c2
Bump html-validate from 8.25.1 to 8.27.0
dependabot[bot] Dec 2, 2024
14de4bc
Add more details on how to 'Tidy up issues'
romaricpascal Nov 25, 2024
8231659
Merge pull request #5532 from alphagov/update-release-issue-template
romaricpascal Dec 2, 2024
d156c6f
Bump actions/cache in /.github/workflows/actions/install-node
dependabot[bot] Dec 9, 2024
f9162d5
Bump express from 4.21.1 to 4.21.2
dependabot[bot] Dec 9, 2024
7c18639
Bump caniuse-lite from 1.0.30001684 to 1.0.30001687
dependabot[bot] Dec 9, 2024
05a4298
Bump the percy group with 2 updates
dependabot[bot] Dec 9, 2024
43a5bf0
Bump actions/cache in /.github/workflows/actions/build
dependabot[bot] Dec 9, 2024
db67c54
Bump actions/cache from 4.1.2 to 4.2.0
dependabot[bot] Dec 9, 2024
e3076a9
Merge pull request #5537 from alphagov/dependabot/npm_and_yarn/marked…
querkmachine Dec 9, 2024
237604e
Merge pull request #5539 from alphagov/dependabot/npm_and_yarn/html-v…
querkmachine Dec 9, 2024
6c9db27
Merge pull request #5543 from alphagov/dependabot/github_actions/dot-…
querkmachine Dec 9, 2024
03d1fe7
Merge pull request #5544 from alphagov/dependabot/npm_and_yarn/expres…
querkmachine Dec 9, 2024
8032a46
Merge pull request #5545 from alphagov/dependabot/npm_and_yarn/canius…
querkmachine Dec 9, 2024
e735fa2
Merge pull request #5547 from alphagov/dependabot/github_actions/dot-…
querkmachine Dec 9, 2024
0e25eb3
Merge pull request #5548 from alphagov/dependabot/github_actions/acti…
querkmachine Dec 9, 2024
680b8d5
Merge pull request #5534 from alphagov/dependabot/npm_and_yarn/percy-…
romaricpascal Dec 9, 2024
0bfcfd0
Bump @types/node from 22.9.3 to 22.10.1 in the types group
dependabot[bot] Dec 9, 2024
47be23e
Merge pull request #5535 from alphagov/dependabot/npm_and_yarn/types-…
romaricpascal Dec 13, 2024
a67dd24
Enable skipLibCheck
romaricpascal Dec 13, 2024
0474437
Bump the percy group with 2 updates
dependabot[bot] Dec 16, 2024
ac00c43
Bump @types/node from 22.10.1 to 22.10.2 in the types group
dependabot[bot] Dec 16, 2024
1b4dfa9
Bump caniuse-lite from 1.0.30001687 to 1.0.30001689
dependabot[bot] Dec 16, 2024
aeb86b8
Bump sass-loader from 16.0.3 to 16.0.4
dependabot[bot] Dec 16, 2024
3042aa6
Bump webpack-dev-server from 5.1.0 to 5.2.0
dependabot[bot] Dec 16, 2024
014e6ce
Merge pull request #5556 from alphagov/dependabot/npm_and_yarn/sass-l…
querkmachine Dec 16, 2024
6543d95
Merge pull request #5555 from alphagov/dependabot/npm_and_yarn/canius…
querkmachine Dec 16, 2024
80c20e0
Unhoist types dependency
querkmachine Dec 16, 2024
5b616e0
Merge pull request #5554 from alphagov/dependabot/npm_and_yarn/types-…
querkmachine Dec 16, 2024
5f4f0c9
Merge pull request #5552 from alphagov/dependabot/npm_and_yarn/percy-…
querkmachine Dec 16, 2024
838d2f6
Merge pull request #5557 from alphagov/dependabot/npm_and_yarn/webpac…
querkmachine Dec 16, 2024
b224935
Merge pull request #5550 from alphagov/ts-skiplibcheck
romaricpascal Dec 16, 2024
ba15d9a
Bump the lint group across 1 directory with 5 updates
dependabot[bot] Dec 9, 2024
7c7b77c
Run updated Prettier defaults on project
querkmachine Dec 9, 2024
5b11dc4
Merge pull request #5542 from alphagov/dependabot/npm_and_yarn/lint-4…
romaricpascal Dec 16, 2024
b316dc7
Bump stylelint in the lint group across 1 directory
dependabot[bot] Dec 16, 2024
509851a
Bump typedoc from 0.26.11 to 0.27.5
dependabot[bot] Dec 16, 2024
ea40687
Merge pull request #5560 from alphagov/dependabot/npm_and_yarn/typedo…
romaricpascal Dec 16, 2024
0afb279
Merge pull request #5559 from alphagov/dependabot/npm_and_yarn/lint-5…
romaricpascal Dec 16, 2024
6a0fd3f
Merge pull request #5533 from alphagov/umd-extend-object
romaricpascal Dec 17, 2024
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
Prev Previous commit
Next Next commit
Rename $module to $root in Notification Banner
  • Loading branch information
romaricpascal committed Oct 8, 2024
commit cfe10936f9a6decacf913c2072491a064ce983d7
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs'
*/
export class NotificationBanner extends GOVUKFrontendComponent {
/** @private */
$module
$root

/**
* @private
@@ -19,26 +19,26 @@ export class NotificationBanner extends GOVUKFrontendComponent {
config

/**
* @param {Element | null} $module - HTML element to use for notification banner
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
*/
constructor($module, config = {}) {
super($module)
constructor($root, config = {}) {
super($root)

if (!($module instanceof HTMLElement)) {
if (!($root instanceof HTMLElement)) {
throw new ElementError({
componentName: 'Notification banner',
element: $module,
identifier: 'Root element (`$module`)'
element: $root,
identifier: 'Root element (`$root`)'
})
}

this.$module = $module
this.$root = $root

this.config = mergeConfigs(
NotificationBanner.defaults,
config,
normaliseDataset(NotificationBanner, $module.dataset)
normaliseDataset(NotificationBanner, $root.dataset)
)

/**
@@ -53,10 +53,10 @@ export class NotificationBanner extends GOVUKFrontendComponent {
* element which should be focused when the page loads.
*/
if (
this.$module.getAttribute('role') === 'alert' &&
this.$root.getAttribute('role') === 'alert' &&
!this.config.disableAutoFocus
) {
setFocus(this.$module)
setFocus(this.$root)
}
}

Original file line number Diff line number Diff line change
@@ -241,9 +241,9 @@ describe('Notification banner', () => {
it('throws when initialised twice', async () => {
await expect(
render(page, 'notification-banner', examples.default, {
async afterInitialisation($module) {
async afterInitialisation($root) {
const { NotificationBanner } = await import('govuk-frontend')
new NotificationBanner($module)
new NotificationBanner($root)
}
})
).rejects.toMatchObject({
@@ -253,34 +253,34 @@ describe('Notification banner', () => {
})
})

it('throws when $module is not set', async () => {
it('throws when $root is not set', async () => {
await expect(
render(page, 'notification-banner', examples.default, {
beforeInitialisation($module) {
$module.remove()
beforeInitialisation($root) {
$root.remove()
}
})
).rejects.toMatchObject({
cause: {
name: 'ElementError',
message: 'Notification banner: Root element (`$module`) not found'
message: 'Notification banner: Root element (`$root`) not found'
}
})
})

it('throws when receiving the wrong type for $module', async () => {
it('throws when receiving the wrong type for $root', async () => {
await expect(
render(page, 'notification-banner', examples.default, {
beforeInitialisation($module) {
beforeInitialisation($root) {
// Replace with an `<svg>` element which is not an `HTMLElement` in the DOM (but an `SVGElement`)
$module.outerHTML = `<svg data-module="govuk-notification-banner"></svg>`
$root.outerHTML = `<svg data-module="govuk-notification-banner"></svg>`
}
})
).rejects.toMatchObject({
cause: {
name: 'ElementError',
message:
'Notification banner: Root element (`$module`) is not of type HTMLElement'
'Notification banner: Root element (`$root`) is not of type HTMLElement'
}
})
})