From e9cb63a826bcd3ea838983a4e9c03565845546fe Mon Sep 17 00:00:00 2001 From: Sonia Hussain Date: Fri, 20 Sep 2024 10:15:32 +0100 Subject: [PATCH 01/20] WIP --- app/presenters/content_item/contents_list.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/presenters/content_item/contents_list.rb b/app/presenters/content_item/contents_list.rb index 85cbfb70d..a8d0a9a39 100644 --- a/app/presenters/content_item/contents_list.rb +++ b/app/presenters/content_item/contents_list.rb @@ -19,9 +19,24 @@ def contents_items end def show_contents_list? + # puts "Number of content items: #{contents_items.count}" + # puts "Contents items: #{contents_items.inspect}" + + puts "exclude_contents_list_for_manual_section? #{exclude_contents_list_for_manual_section?}" + puts "contents_items.count #{contents_items.count}" + puts "contents_items: #{contents_items}" + puts "no_first_item? #{no_first_item?}" + puts "first_item_has_long_content? #{first_item_has_long_content?}" + puts "first_item_has_long_table? #{first_item_has_long_table?}" + puts "first_item_has_image_and_long_content? #{first_item_has_image_and_long_content?}" + puts "first_item_has_image_and_long_table? #{first_item_has_image_and_long_table?}" + return false if exclude_contents_list_for_manual_section? - return false if contents_items.count < 2 - return true if contents_items.count > 2 + # return false if contents_items.count < 1 + # return true if contents_items.count >= 1 + return false if contents_items.empty? + # return true if contents_items.any? + return true if contents_items.count > 1 return false if no_first_item? first_item_has_long_content? || From 436e891d04a74f4ca1f7084b14d054873f524b43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:16:30 +0000 Subject: [PATCH 02/20] Bump jasmine-core from 5.2.0 to 5.3.0 Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/jasmine/jasmine/releases) - [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md) - [Commits](https://github.com/jasmine/jasmine/compare/v5.2.0...v5.3.0) --- updated-dependencies: - dependency-name: jasmine-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9f606fbc0..0955bbc57 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "jasmine-browser-runner": "^2.5.0", - "jasmine-core": "^5.2.0", + "jasmine-core": "^5.3.0", "standardx": "^7.0.0", "stylelint": "^16.9.0", "stylelint-config-gds": "^2.0.0" diff --git a/yarn.lock b/yarn.lock index 40280d3a6..cdf515092 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1479,7 +1479,7 @@ __metadata: resolution: "government-frontend@workspace:." dependencies: jasmine-browser-runner: ^2.5.0 - jasmine-core: ^5.2.0 + jasmine-core: ^5.3.0 standardx: ^7.0.0 stylelint: ^16.9.0 stylelint-config-gds: ^2.0.0 @@ -1809,10 +1809,10 @@ __metadata: languageName: node linkType: hard -"jasmine-core@npm:^5.2.0": - version: 5.2.0 - resolution: "jasmine-core@npm:5.2.0" - checksum: e97e8f1fdc4468fe73f228157964095580c60c215971b45464e79c41482aa215c9a8cfb8cac27c25c8a1592348f520c44042ce1216a335fb88f9f732ff9053dd +"jasmine-core@npm:^5.3.0": + version: 5.3.0 + resolution: "jasmine-core@npm:5.3.0" + checksum: 5dbb8c026b683d01872b793902b684ff9f8f097c94062666e13f466fa5a7b4a409670973868e5b9f5bbd47bf2e69bfbe037cc4c31f7cea0b78d45eb2a0b997fd languageName: node linkType: hard From 20b23a7f9de2990df5dbfc7ceb1baff28cbfd712 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:38:34 +0000 Subject: [PATCH 03/20] Bump express from 4.19.2 to 4.20.0 Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.20.0. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 223 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 197 insertions(+), 26 deletions(-) diff --git a/yarn.lock b/yarn.lock index cdf515092..2ff42e1da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -353,9 +353,9 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.2": - version: 1.20.2 - resolution: "body-parser@npm:1.20.2" +"body-parser@npm:1.20.3": + version: 1.20.3 + resolution: "body-parser@npm:1.20.3" dependencies: bytes: 3.1.2 content-type: ~1.0.5 @@ -365,11 +365,11 @@ __metadata: http-errors: 2.0.0 iconv-lite: 0.4.24 on-finished: 2.4.1 - qs: 6.11.0 + qs: 6.13.0 raw-body: 2.5.2 type-is: ~1.6.18 unpipe: 1.0.0 - checksum: 14d37ec638ab5c93f6099ecaed7f28f890d222c650c69306872e00b9efa081ff6c596cd9afb9930656aae4d6c4e1c17537bea12bb73c87a217cb3cfea8896737 + checksum: 1a35c59a6be8d852b00946330141c4f142c6af0f970faa87f10ad74f1ee7118078056706a05ae3093c54dabca9cd3770fa62a170a85801da1a4324f04381167d languageName: node linkType: hard @@ -418,6 +418,19 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.7": + version: 1.0.7 + resolution: "call-bind@npm:1.0.7" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + set-function-length: ^1.2.1 + checksum: 295c0c62b90dd6522e6db3b0ab1ce26bdf9e7404215bda13cfee25b626b5ff1a7761324d58d38b1ef1607fc65aca2d06e44d2e18d0dfc6c14b465b00d8660029 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -647,6 +660,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.1.4": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: ^1.0.0 + es-errors: ^1.3.0 + gopd: ^1.0.1 + checksum: 8068ee6cab694d409ac25936eb861eea704b7763f7f342adbdfe337fc27c78d7ae0eff2364b2917b58c508d723c7a074326d068eef2e45c4edcd85cf94d0313b + languageName: node + linkType: hard + "define-properties@npm:^1.1.3": version: 1.1.3 resolution: "define-properties@npm:1.1.3" @@ -760,6 +784,13 @@ __metadata: languageName: node linkType: hard +"encodeurl@npm:~2.0.0": + version: 2.0.0 + resolution: "encodeurl@npm:2.0.0" + checksum: abf5cd51b78082cf8af7be6785813c33b6df2068ce5191a40ca8b1afe6a86f9230af9a9ce694a5ce4665955e5c1120871826df9c128a642e09c58d592e2807fe + languageName: node + linkType: hard + "enquirer@npm:^2.3.5": version: 2.3.6 resolution: "enquirer@npm:2.3.6" @@ -824,6 +855,22 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: ^1.2.4 + checksum: f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: ec1414527a0ccacd7f15f4a3bc66e215f04f595ba23ca75cdae0927af099b5ec865f9f4d33e9d7e86f512f252876ac77d4281a7871531a50678132429b1271b5 + languageName: node + linkType: hard + "es-to-primitive@npm:^1.2.1": version: 1.2.1 resolution: "es-to-primitive@npm:1.2.1" @@ -1118,41 +1165,41 @@ __metadata: linkType: hard "express@npm:^4.19.2": - version: 4.19.2 - resolution: "express@npm:4.19.2" + version: 4.20.0 + resolution: "express@npm:4.20.0" dependencies: accepts: ~1.3.8 array-flatten: 1.1.1 - body-parser: 1.20.2 + body-parser: 1.20.3 content-disposition: 0.5.4 content-type: ~1.0.4 cookie: 0.6.0 cookie-signature: 1.0.6 debug: 2.6.9 depd: 2.0.0 - encodeurl: ~1.0.2 + encodeurl: ~2.0.0 escape-html: ~1.0.3 etag: ~1.8.1 finalhandler: 1.2.0 fresh: 0.5.2 http-errors: 2.0.0 - merge-descriptors: 1.0.1 + merge-descriptors: 1.0.3 methods: ~1.1.2 on-finished: 2.4.1 parseurl: ~1.3.3 - path-to-regexp: 0.1.7 + path-to-regexp: 0.1.10 proxy-addr: ~2.0.7 qs: 6.11.0 range-parser: ~1.2.1 safe-buffer: 5.2.1 - send: 0.18.0 - serve-static: 1.15.0 + send: 0.19.0 + serve-static: 1.16.0 setprototypeof: 1.2.0 statuses: 2.0.1 type-is: ~1.6.18 utils-merge: 1.0.1 vary: ~1.1.2 - checksum: 212dbd6c2c222a96a61bc927639c95970a53b06257080bb9e2838adb3bffdb966856551fdad1ab5dd654a217c35db94f987d0aa88d48fb04d306340f5f34dca5 + checksum: faa11bffa16be97b26d9f38187e569378c01cad0b92fbd02094fb4e35a224dc5177cc9cc6849141702da80d2d8cbe857c60a7e622e8106695405dc27e38fb3ee languageName: node linkType: hard @@ -1361,6 +1408,13 @@ __metadata: languageName: node linkType: hard +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 + languageName: node + linkType: hard + "functional-red-black-tree@npm:^1.0.1": version: 1.0.1 resolution: "functional-red-black-tree@npm:1.0.1" @@ -1379,6 +1433,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: ^1.3.0 + function-bind: ^1.1.2 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + checksum: 414e3cdf2c203d1b9d7d33111df746a4512a1aa622770b361dadddf8ed0b5aeb26c560f49ca077e24bfafb0acb55ca908d1f709216ccba33ffc548ec8a79a951 + languageName: node + linkType: hard + "get-stdin@npm:^8.0.0": version: 8.0.0 resolution: "get-stdin@npm:8.0.0" @@ -1474,6 +1541,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: ^1.1.3 + checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 + languageName: node + linkType: hard + "government-frontend@workspace:.": version: 0.0.0-use.local resolution: "government-frontend@workspace:." @@ -1507,6 +1583,22 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.2": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: ^1.0.0 + checksum: fcbb246ea2838058be39887935231c6d5788babed499d0e9d0cc5737494c48aba4fe17ba1449e0d0fbbb1e36175442faa37f9c427ae357d6ccb1d895fbcd3de3 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: fe7c3d50b33f50f3933a04413ed1f69441d21d2d2944f81036276d30635cad9279f6b43bc8f32036c31ebdfcf6e731150f46c1907ad90c669ffe9b066c3ba5c4 + languageName: node + linkType: hard + "has-symbols@npm:^1.0.1": version: 1.0.1 resolution: "has-symbols@npm:1.0.1" @@ -1514,6 +1606,13 @@ __metadata: languageName: node linkType: hard +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 + languageName: node + linkType: hard + "has@npm:^1.0.3": version: 1.0.3 resolution: "has@npm:1.0.3" @@ -1523,6 +1622,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0": + version: 2.0.2 + resolution: "hasown@npm:2.0.2" + dependencies: + function-bind: ^1.1.2 + checksum: e8516f776a15149ca6c6ed2ae3110c417a00b62260e222590e54aa367cbcd6ed99122020b37b7fbdf05748df57b265e70095d7bf35a47660587619b15ffb93db + languageName: node + linkType: hard + "hosted-git-info@npm:^2.1.4": version: 2.8.9 resolution: "hosted-git-info@npm:2.8.9" @@ -2091,10 +2199,10 @@ __metadata: languageName: node linkType: hard -"merge-descriptors@npm:1.0.1": - version: 1.0.1 - resolution: "merge-descriptors@npm:1.0.1" - checksum: 5abc259d2ae25bb06d19ce2b94a21632583c74e2a9109ee1ba7fd147aa7362b380d971e0251069f8b3eb7d48c21ac839e21fa177b335e82c76ec172e30c31a26 +"merge-descriptors@npm:1.0.3": + version: 1.0.3 + resolution: "merge-descriptors@npm:1.0.3" + checksum: 52117adbe0313d5defa771c9993fe081e2d2df9b840597e966aadafde04ae8d0e3da46bac7ca4efc37d4d2b839436582659cd49c6a43eacb3fe3050896a105d1 languageName: node linkType: hard @@ -2269,6 +2377,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.13.1": + version: 1.13.2 + resolution: "object-inspect@npm:1.13.2" + checksum: 9f850b3c045db60e0e97746e809ee4090d6ce62195af17dd1e9438ac761394a7d8ec4f7906559aea5424eaf61e35d3e53feded2ccd5f62fcc7d9670d3c8eb353 + languageName: node + linkType: hard + "object-inspect@npm:^1.8.0, object-inspect@npm:^1.9.0": version: 1.9.0 resolution: "object-inspect@npm:1.9.0" @@ -2505,10 +2620,10 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.7": - version: 0.1.7 - resolution: "path-to-regexp@npm:0.1.7" - checksum: 69a14ea24db543e8b0f4353305c5eac6907917031340e5a8b37df688e52accd09e3cebfe1660b70d76b6bd89152f52183f28c74813dbf454ba1a01c82a38abce +"path-to-regexp@npm:0.1.10": + version: 0.1.10 + resolution: "path-to-regexp@npm:0.1.10" + checksum: ab7a3b7a0b914476d44030340b0a65d69851af2a0f33427df1476100ccb87d409c39e2182837a96b98fb38c4ef2ba6b87bdad62bb70a2c153876b8061760583c languageName: node linkType: hard @@ -2710,6 +2825,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:6.13.0": + version: 6.13.0 + resolution: "qs@npm:6.13.0" + dependencies: + side-channel: ^1.0.6 + checksum: e9404dc0fc2849245107108ce9ec2766cde3be1b271de0bf1021d049dc5b98d1a2901e67b431ac5509f865420a7ed80b7acb3980099fe1c118a1c5d2e1432ad8 + languageName: node + linkType: hard + "range-parser@npm:~1.2.1": version: 1.2.1 resolution: "range-parser@npm:1.2.1" @@ -2948,15 +3072,50 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:1.15.0": - version: 1.15.0 - resolution: "serve-static@npm:1.15.0" +"send@npm:0.19.0": + version: 0.19.0 + resolution: "send@npm:0.19.0" + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: ~1.0.2 + escape-html: ~1.0.3 + etag: ~1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: ~1.2.1 + statuses: 2.0.1 + checksum: 5ae11bd900c1c2575525e2aa622e856804e2f96a09281ec1e39610d089f53aa69e13fd8db84b52f001d0318cf4bb0b3b904ad532fc4c0014eb90d32db0cff55f + languageName: node + linkType: hard + +"serve-static@npm:1.16.0": + version: 1.16.0 + resolution: "serve-static@npm:1.16.0" dependencies: encodeurl: ~1.0.2 escape-html: ~1.0.3 parseurl: ~1.3.3 send: 0.18.0 - checksum: af57fc13be40d90a12562e98c0b7855cf6e8bd4c107fe9a45c212bf023058d54a1871b1c89511c3958f70626fff47faeb795f5d83f8cf88514dbaeb2b724464d + checksum: a479dfe7e9fa7e8cb3ceccb0d944a3c72bb8f88d78472e30989f58fe15a92cfc909ab05a5c7cda2d1a6aa2663ab503ad1e2f40653740346e53e72b3ba41b6951 + languageName: node + linkType: hard + +"set-function-length@npm:^1.2.1": + version: 1.2.2 + resolution: "set-function-length@npm:1.2.2" + dependencies: + define-data-property: ^1.1.4 + es-errors: ^1.3.0 + function-bind: ^1.1.2 + get-intrinsic: ^1.2.4 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.2 + checksum: a8248bdacdf84cb0fab4637774d9fb3c7a8e6089866d04c817583ff48e14149c87044ce683d7f50759a8c50fb87c7a7e173535b06169c87ef76f5fb276dfff72 languageName: node linkType: hard @@ -3001,6 +3160,18 @@ __metadata: languageName: node linkType: hard +"side-channel@npm:^1.0.6": + version: 1.0.6 + resolution: "side-channel@npm:1.0.6" + dependencies: + call-bind: ^1.0.7 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.4 + object-inspect: ^1.13.1 + checksum: bfc1afc1827d712271453e91b7cd3878ac0efd767495fd4e594c4c2afaa7963b7b510e249572bfd54b0527e66e4a12b61b80c061389e129755f34c493aad9b97 + languageName: node + linkType: hard + "signal-exit@npm:^4.0.1": version: 4.0.2 resolution: "signal-exit@npm:4.0.2" From 3f7d547722154124213d80c361c6e5079a96bb8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:26:30 +0000 Subject: [PATCH 04/20] Bump govuk_publishing_components from 43.1.0 to 43.1.1 Bumps [govuk_publishing_components](https://github.com/alphagov/govuk_publishing_components) from 43.1.0 to 43.1.1. - [Changelog](https://github.com/alphagov/govuk_publishing_components/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_publishing_components/compare/v43.1.0...v43.1.1) --- updated-dependencies: - dependency-name: govuk_publishing_components dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index da56550f8..b8f678f98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,7 +164,7 @@ GEM govuk_personalisation (1.0.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (43.1.0) + govuk_publishing_components (43.1.1) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown @@ -530,7 +530,7 @@ GEM rdoc (6.7.0) psych (>= 4.0.0) regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) From 3b69caa84a3f63e74ad9bb20d86b29e022521553 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Thu, 22 Aug 2024 13:03:26 +0100 Subject: [PATCH 05/20] Upgrade Rails version to 7.2.1 --- Gemfile | 2 +- Gemfile.lock | 133 +++++++++++++++++++++++++-------------------------- 2 files changed, 67 insertions(+), 68 deletions(-) diff --git a/Gemfile b/Gemfile index f91e2a02f..2a78d06e1 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" ruby "~> 3.2.0" -gem "rails", "7.1.3.4" +gem "rails", "7.2.1" gem "bootsnap", require: false gem "dalli" diff --git a/Gemfile.lock b/Gemfile.lock index b8f678f98..22919d457 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,80 +1,76 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.2.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ansi (1.5.0) @@ -211,6 +207,7 @@ GEM rexml language_server-protocol (3.17.0.3) link_header (0.0.8) + logger (1.6.0) logstasher (2.1.5) activesupport (>= 5.2) request_store @@ -484,20 +481,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.2.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -517,10 +514,10 @@ GEM csv (~> 3.2) i18n-tasks rails-i18n - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -584,6 +581,7 @@ GEM sass-embedded (1.77.8) google-protobuf (~> 4.26) rake (>= 13) + securerandom (0.3.1) selenium-webdriver (4.21.1) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) @@ -628,6 +626,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + useragent (0.16.10) webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -667,7 +666,7 @@ DEPENDENCIES mocha plek pry-byebug - rails (= 7.1.3.4) + rails (= 7.2.1) rails-controller-testing rails-i18n rails_translation_manager From d0f992af8d9d0a818c2aeb743cf3444e2599a2c6 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Thu, 22 Aug 2024 14:09:50 +0100 Subject: [PATCH 06/20] Update config based on rails app:update --- bin/brakeman | 7 ++ bin/rubocop | 8 +++ bin/setup | 6 +- config/application.rb | 7 +- config/environments/development.rb | 11 +-- config/environments/production.rb | 21 +++--- config/environments/test.rb | 5 +- .../new_framework_defaults_7_2.rb | 70 +++++++++++++++++++ config/initializers/permissions_policy.rb | 20 +++--- public/404.html | 12 ++-- public/406-unsupported-browser.html | 66 +++++++++++++++++ public/422.html | 12 ++-- public/500.html | 12 ++-- 13 files changed, 214 insertions(+), 43 deletions(-) create mode 100755 bin/brakeman create mode 100755 bin/rubocop create mode 100644 config/initializers/new_framework_defaults_7_2.rb create mode 100644 public/406-unsupported-browser.html diff --git a/bin/brakeman b/bin/brakeman new file mode 100755 index 000000000..ace1c9ba0 --- /dev/null +++ b/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 000000000..40330c0ff --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/setup b/bin/setup index cf2acd188..c1d57b6c5 100755 --- a/bin/setup +++ b/bin/setup @@ -1,8 +1,8 @@ #!/usr/bin/env ruby require "fileutils" -# path to your application root. APP_ROOT = File.expand_path("..", __dir__) +APP_NAME = "government-frontend" def system!(*args) system(*args, exception: true) @@ -22,4 +22,8 @@ FileUtils.chdir APP_ROOT do puts "\n== Restarting application server ==" system! "bin/rails restart" + + # puts "\n== Configuring puma-dev ==" + # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" + # system "curl -Is https://#{APP_NAME}.test/up | head -n 1" end diff --git a/config/application.rb b/config/application.rb index b2abf63d5..69e2ff117 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,13 +23,18 @@ class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 7.1 + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w[assets tasks]) + # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. # Custom directories with classes and modules you want to be autoloadable. - config.autoload_paths += %W[#{config.root}/lib] + config.autoload_paths += %W[#{config.root}/lib/helpers] # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] diff --git a/config/environments/development.rb b/config/environments/development.rb index 214a3ee8d..77abae0e9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -14,7 +14,7 @@ # Show full error reports. config.consider_all_requests_local = true - # Enable server timing + # Enable server timing. config.server_timing = true # Enable/disable caching. By default caching is disabled. @@ -52,10 +52,13 @@ # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true + config.action_view.annotate_rendered_view_with_filenames = true config.hosts.clear - # Uncomment if you wish to allow Action Cable access from any origin. - # config.action_cable.disable_request_forgery_protection = true + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = false + + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + config.generators.apply_rubocop_autocorrect_after_generate! end diff --git a/config/environments/production.rb b/config/environments/production.rb index d3222bf1e..5e0ef543d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -13,15 +13,14 @@ config.eager_load = true # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false + config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). # config.require_master_key = true - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Compress JS using a preprocessor. @@ -47,18 +46,22 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Include generic and useful information about system operation, but avoid logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :info) + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } # Prepend all log lines with the following tags. config.log_tags = [:request_id] + # "info" includes generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + # Use a different cache store in production. config.cache_store = :mem_cache_store, nil, { namespace: :government_frontend, compress: true } # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque + # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "government_frontend_production" # Enable locale fallbacks for I18n (makes lookups for any locale fall back to diff --git a/config/environments/test.rb b/config/environments/test.rb index 04e791737..42d4062ae 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -24,7 +24,7 @@ } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store @@ -48,4 +48,7 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = false end diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb new file mode 100644 index 000000000..b549c4a25 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_2.rb @@ -0,0 +1,70 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.2 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `7.2`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +### +# Controls whether Active Job's `#perform_later` and similar methods automatically defer +# the job queuing to after the current Active Record transaction is committed. +# +# Example: +# Topic.transaction do +# topic = Topic.create(...) +# NewTopicNotificationJob.perform_later(topic) +# end +# +# In this example, if the configuration is set to `:never`, the job will +# be enqueued immediately, even though the `Topic` hasn't been committed yet. +# Because of this, if the job is picked up almost immediately, or if the +# transaction doesn't succeed for some reason, the job will fail to find this +# topic in the database. +# +# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter +# will define the behaviour. +# +# Note: Active Job backends can disable this feature. This is generally done by +# backends that use the same database as Active Record as a queue, hence they +# don't need this feature. +#++ +# Rails.application.config.active_job.enqueue_after_transaction_commit = :default + +### +# Adds image/webp to the list of content types Active Storage considers as an image +# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. +# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support +# WebP. Requires imagemagick/libvips built with WebP support. +#++ +# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] + +### +# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError +# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp +# associated with the current time. This is done to prevent forward-dating of migration files, which can +# impact migration generation and other migration commands. +# +# Applications with existing timestamped migrations that do not adhere to the +# expected format can disable validation by setting this config to `false`. +#++ +# Rails.application.config.active_record.validate_migration_timestamps = true + +### +# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. +# +# Example: +# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date +# +# This query used to return a `String`. +#++ +# Rails.application.config.active_record.postgresql_adapter_decode_dates = true + +### +# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are +# deploying to a memory constrained environment you may want to set this to `false`. +#++ +# Rails.application.config.yjit = true diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index 00f64d71b..7db3b9577 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,11 +1,13 @@ +# Be sure to restart your server when you modify this file. + # Define an application-wide HTTP permissions policy. For further -# information see https://developers.google.com/web/updates/2018/06/feature-policy -# -# Rails.application.config.permissions_policy do |f| -# f.camera :none -# f.gyroscope :none -# f.microphone :none -# f.usb :none -# f.fullscreen :self -# f.payment :self, "https://secure.example.com" +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" # end diff --git a/public/404.html b/public/404.html index b612547fc..2be3af26f 100644 --- a/public/404.html +++ b/public/404.html @@ -4,7 +4,7 @@ The page you were looking for doesn't exist (404) - +
diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html new file mode 100644 index 000000000..7cf1e168e --- /dev/null +++ b/public/406-unsupported-browser.html @@ -0,0 +1,66 @@ + + + + Your browser is not supported (406) + + + + + + +
+
+

Your browser is not supported.

+

Please upgrade your browser to continue.

+
+
+ + diff --git a/public/422.html b/public/422.html index a21f82b3b..c08eac0d1 100644 --- a/public/422.html +++ b/public/422.html @@ -4,7 +4,7 @@ The change you wanted was rejected (422) - +
diff --git a/public/500.html b/public/500.html index 061abc587..78a030af2 100644 --- a/public/500.html +++ b/public/500.html @@ -4,7 +4,7 @@ We're sorry, but something went wrong (500) - +
From 508ab8a22b495f005a9da4b76a45970ac8897a8a Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Thu, 22 Aug 2024 14:58:10 +0100 Subject: [PATCH 07/20] Enable new Rails 7.2 configuration --- config/application.rb | 2 +- .../new_framework_defaults_7_2.rb | 70 ------------------- 2 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_7_2.rb diff --git a/config/application.rb b/config/application.rb index 69e2ff117..dfa0fed8b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,7 +21,7 @@ module GovernmentFrontend class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb deleted file mode 100644 index b549c4a25..000000000 --- a/config/initializers/new_framework_defaults_7_2.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.2 framework defaults upgrade. -# -# Uncomment each configuration one by one to switch to the new default. -# Once your application is ready to run with all new defaults, you can remove -# this file and set the `config.load_defaults` to `7.2`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -### -# Controls whether Active Job's `#perform_later` and similar methods automatically defer -# the job queuing to after the current Active Record transaction is committed. -# -# Example: -# Topic.transaction do -# topic = Topic.create(...) -# NewTopicNotificationJob.perform_later(topic) -# end -# -# In this example, if the configuration is set to `:never`, the job will -# be enqueued immediately, even though the `Topic` hasn't been committed yet. -# Because of this, if the job is picked up almost immediately, or if the -# transaction doesn't succeed for some reason, the job will fail to find this -# topic in the database. -# -# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter -# will define the behaviour. -# -# Note: Active Job backends can disable this feature. This is generally done by -# backends that use the same database as Active Record as a queue, hence they -# don't need this feature. -#++ -# Rails.application.config.active_job.enqueue_after_transaction_commit = :default - -### -# Adds image/webp to the list of content types Active Storage considers as an image -# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. -# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support -# WebP. Requires imagemagick/libvips built with WebP support. -#++ -# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] - -### -# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError -# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp -# associated with the current time. This is done to prevent forward-dating of migration files, which can -# impact migration generation and other migration commands. -# -# Applications with existing timestamped migrations that do not adhere to the -# expected format can disable validation by setting this config to `false`. -#++ -# Rails.application.config.active_record.validate_migration_timestamps = true - -### -# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. -# -# Example: -# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date -# -# This query used to return a `String`. -#++ -# Rails.application.config.active_record.postgresql_adapter_decode_dates = true - -### -# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are -# deploying to a memory constrained environment you may want to set this to `false`. -#++ -# Rails.application.config.yjit = true From b24c4dc3f46c959635b15541b47f9d5dc0bddbfb Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Fri, 13 Sep 2024 13:01:11 +0100 Subject: [PATCH 08/20] Upgrade express and its dependecies --- yarn.lock | 66 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 48 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2ff42e1da..0dfec3e3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1165,8 +1165,8 @@ __metadata: linkType: hard "express@npm:^4.19.2": - version: 4.20.0 - resolution: "express@npm:4.20.0" + version: 4.21.0 + resolution: "express@npm:4.21.0" dependencies: accepts: ~1.3.8 array-flatten: 1.1.1 @@ -1180,7 +1180,7 @@ __metadata: encodeurl: ~2.0.0 escape-html: ~1.0.3 etag: ~1.8.1 - finalhandler: 1.2.0 + finalhandler: 1.3.1 fresh: 0.5.2 http-errors: 2.0.0 merge-descriptors: 1.0.3 @@ -1189,17 +1189,17 @@ __metadata: parseurl: ~1.3.3 path-to-regexp: 0.1.10 proxy-addr: ~2.0.7 - qs: 6.11.0 + qs: 6.13.0 range-parser: ~1.2.1 safe-buffer: 5.2.1 send: 0.19.0 - serve-static: 1.16.0 + serve-static: 1.16.2 setprototypeof: 1.2.0 statuses: 2.0.1 type-is: ~1.6.18 utils-merge: 1.0.1 vary: ~1.1.2 - checksum: faa11bffa16be97b26d9f38187e569378c01cad0b92fbd02094fb4e35a224dc5177cc9cc6849141702da80d2d8cbe857c60a7e622e8106695405dc27e38fb3ee + checksum: 1c5212993f665809c249bf00ab550b989d1365a5b9171cdfaa26d93ee2ef10cd8add520861ec8d5da74b3194d8374e1d9d53e85ef69b89fd9c4196b87045a5d4 languageName: node linkType: hard @@ -1302,18 +1302,18 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:1.2.0": - version: 1.2.0 - resolution: "finalhandler@npm:1.2.0" +"finalhandler@npm:1.3.1": + version: 1.3.1 + resolution: "finalhandler@npm:1.3.1" dependencies: debug: 2.6.9 - encodeurl: ~1.0.2 + encodeurl: ~2.0.0 escape-html: ~1.0.3 on-finished: 2.4.1 parseurl: ~1.3.3 statuses: 2.0.1 unpipe: ~1.0.0 - checksum: 92effbfd32e22a7dff2994acedbd9bcc3aa646a3e919ea6a53238090e87097f8ef07cced90aa2cc421abdf993aefbdd5b00104d55c7c5479a8d00ed105b45716 + checksum: a8c58cd97c9cd47679a870f6833a7b417043f5a288cd6af6d0f49b476c874a506100303a128b6d3b654c3d74fa4ff2ffed68a48a27e8630cda5c918f2977dcf4 languageName: node linkType: hard @@ -2816,15 +2816,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.11.0": - version: 6.11.0 - resolution: "qs@npm:6.11.0" - dependencies: - side-channel: ^1.0.4 - checksum: 6e1f29dd5385f7488ec74ac7b6c92f4d09a90408882d0c208414a34dd33badc1a621019d4c799a3df15ab9b1d0292f97c1dd71dc7c045e69f81a8064e5af7297 - languageName: node - linkType: hard - "qs@npm:6.13.0": version: 6.13.0 resolution: "qs@npm:6.13.0" @@ -3051,27 +3042,6 @@ __metadata: languageName: node linkType: hard -"send@npm:0.18.0": - version: 0.18.0 - resolution: "send@npm:0.18.0" - dependencies: - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - etag: ~1.8.1 - fresh: 0.5.2 - http-errors: 2.0.0 - mime: 1.6.0 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: ~1.2.1 - statuses: 2.0.1 - checksum: 74fc07ebb58566b87b078ec63e5a3e41ecd987e4272ba67b7467e86c6ad51bc6b0b0154133b6d8b08a2ddda360464f71382f7ef864700f34844a76c8027817a8 - languageName: node - linkType: hard - "send@npm:0.19.0": version: 0.19.0 resolution: "send@npm:0.19.0" @@ -3093,15 +3063,15 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:1.16.0": - version: 1.16.0 - resolution: "serve-static@npm:1.16.0" +"serve-static@npm:1.16.2": + version: 1.16.2 + resolution: "serve-static@npm:1.16.2" dependencies: - encodeurl: ~1.0.2 + encodeurl: ~2.0.0 escape-html: ~1.0.3 parseurl: ~1.3.3 - send: 0.18.0 - checksum: a479dfe7e9fa7e8cb3ceccb0d944a3c72bb8f88d78472e30989f58fe15a92cfc909ab05a5c7cda2d1a6aa2663ab503ad1e2f40653740346e53e72b3ba41b6951 + send: 0.19.0 + checksum: dffc52feb4cc5c68e66d0c7f3c1824d4e989f71050aefc9bd5f822a42c54c9b814f595fc5f2b717f4c7cc05396145f3e90422af31186a93f76cf15f707019759 languageName: node linkType: hard @@ -3149,7 +3119,7 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.2, side-channel@npm:^1.0.3, side-channel@npm:^1.0.4": +"side-channel@npm:^1.0.2, side-channel@npm:^1.0.3": version: 1.0.4 resolution: "side-channel@npm:1.0.4" dependencies: From bcee850a3a592b7130ccd473131337e32981bd60 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 16 Sep 2024 12:37:15 +0100 Subject: [PATCH 09/20] Fix main-content-container to work with govuk-frontend columns This commit removes some of the rules that were previously set for the `.main-content-container` and instead uses the column rules from `govuk-frontend`. The container has now been renamed as `contents-container` to be consistent with the `contents-list-container`. I had hoped to remove this class entirely, but it's required to apply different float rules when in RTL reading mode. This also adds the new class for collapsing columns to full width when printing. --- app/assets/stylesheets/views/_html-publication.scss | 11 +---------- app/views/content_items/html_publication.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/views/_html-publication.scss b/app/assets/stylesheets/views/_html-publication.scss index ef367ff35..aa5ca2b33 100644 --- a/app/assets/stylesheets/views/_html-publication.scss +++ b/app/assets/stylesheets/views/_html-publication.scss @@ -30,16 +30,7 @@ } } - .main-content-container { - width: 100%; - padding: 0 15px; - box-sizing: border-box; - - @include govuk-media-query($from: desktop) { - width: 75%; - float: right; - } - + .contents-container { .direction-rtl & { float: left; } diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 4f804de9f..8f00d8886 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -46,7 +46,7 @@ <% end %>
-
+
<% if @content_item.contents.any? %>
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true %> @@ -64,7 +64,7 @@
-
+
<%= render "govuk_publishing_components/components/govspeak_html_publication", { direction: page_text_direction } do %> <%= raw(@content_item.govspeak_body[:content]) %> <% end %> From 4d32c3ff66590cae1eae9918ecde9dad093de98d Mon Sep 17 00:00:00 2001 From: Keith Lawrence Date: Wed, 18 Sep 2024 14:55:46 +0100 Subject: [PATCH 10/20] Fix translation typo in Latin American locale --- config/locales/es-419.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/es-419.yml b/config/locales/es-419.yml index 4c70e712d..c719049bf 100644 --- a/config/locales/es-419.yml +++ b/config/locales/es-419.yml @@ -76,7 +76,7 @@ es-419: ways_to_respond: Formas de responder write_to: 'Escriba a:' contact: - access_and_opening_times: Acceso y horarios de aperturaAcceso y inicio + access_and_opening_times: Acceso y horarios de apertura contact_form: Formulario de contacto email: Email find_call_charges: Conozca las tarifas de las llamadas From c04e61acd0df66943766bff89c6e4e8d8c45fa59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:42:15 +0000 Subject: [PATCH 11/20] Bump slimmer from 18.6.1 to 18.6.2 Bumps [slimmer](https://github.com/alphagov/slimmer) from 18.6.1 to 18.6.2. - [Changelog](https://github.com/alphagov/slimmer/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/slimmer/compare/v18.6.1...v18.6.2) --- updated-dependencies: - dependency-name: slimmer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 22919d457..e5a91b467 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -224,7 +224,7 @@ GEM method_source (1.0.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0820) + mime-types-data (3.2024.0903) mini_mime (1.1.5) mini_portile2 (2.8.7) minitest (5.25.1) @@ -236,7 +236,6 @@ GEM mocha (2.4.5) ruby2_keywords (>= 0.0.5) msgpack (1.7.2) - mutex_m (0.2.0) net-imap (0.4.16) date net-protocol @@ -600,7 +599,7 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - slimmer (18.6.1) + slimmer (18.6.2) json nokogiri (~> 1.7) null_logger From 5a660b2d1ebe07a09eaab8f9a905f05900dd0c8f Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 19 Sep 2024 11:49:37 +0100 Subject: [PATCH 12/20] Collapse columns to full width when printing --- app/views/content_items/detailed_guide.html.erb | 4 ++-- app/views/content_items/guide.html+print.erb | 2 +- app/views/content_items/guide.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb index f62f9e50e..9c81cf657 100644 --- a/app/views/content_items/detailed_guide.html.erb +++ b/app/views/content_items/detailed_guide.html.erb @@ -7,7 +7,7 @@ <%= render 'shared/email_subscribe_unsubscribe_flash', { title: @content_item.title_and_context[:title] } %> -
+
<%= render 'govuk_publishing_components/components/title', @content_item.title_and_context %>
@@ -23,7 +23,7 @@ <% if @content_item.withdrawn? %> <%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %> <% end %> -
+
<% if @content_item.national_applicability.present? %> <%= render "govuk_publishing_components/components/devolved_nations", { diff --git a/app/views/content_items/guide.html+print.erb b/app/views/content_items/guide.html+print.erb index f2cd2b38f..73dba2d32 100644 --- a/app/views/content_items/guide.html+print.erb +++ b/app/views/content_items/guide.html+print.erb @@ -6,7 +6,7 @@ <% end %> -
+
<%= render 'govuk_publishing_components/components/title', { margin_bottom: 6, diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb index 1ac8a09a8..3fccbf517 100644 --- a/app/views/content_items/guide.html.erb +++ b/app/views/content_items/guide.html.erb @@ -19,7 +19,7 @@ <%= render 'shared/intervention_banner' %> -
+
<%= render 'govuk_publishing_components/components/title', { title: @content_item.content_title } %> From bf0682287f17704008d7a0d4d145d43a33646d1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:50:35 +0000 Subject: [PATCH 13/20] Bump govuk_publishing_components from 43.1.1 to 43.3.0 Bumps [govuk_publishing_components](https://github.com/alphagov/govuk_publishing_components) from 43.1.1 to 43.3.0. - [Changelog](https://github.com/alphagov/govuk_publishing_components/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_publishing_components/compare/v43.1.1...v43.3.0) --- updated-dependencies: - dependency-name: govuk_publishing_components dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e5a91b467..18168e2c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -129,10 +129,10 @@ GEM rest-client (~> 2.0) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (4.28.0) + google-protobuf (4.28.2) bigdecimal rake (>= 13) - googleapis-common-protos-types (1.15.0) + googleapis-common-protos-types (1.16.0) google-protobuf (>= 3.18, < 5.a) govspeak (8.3.4) actionview (>= 6) @@ -160,7 +160,7 @@ GEM govuk_personalisation (1.0.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (43.1.1) + govuk_publishing_components (43.3.0) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown @@ -183,7 +183,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.7) domain_name (~> 0.5) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) i18n-coverage (0.2.0) i18n-tasks (1.0.14) @@ -207,7 +207,7 @@ GEM rexml language_server-protocol (3.17.0.3) link_header (0.0.8) - logger (1.6.0) + logger (1.6.1) logstasher (2.1.5) activesupport (>= 5.2) request_store @@ -264,7 +264,7 @@ GEM opentelemetry-helpers-mysql (0.1.1) opentelemetry-api (~> 1.0) opentelemetry-common (~> 0.21) - opentelemetry-helpers-sql-obfuscation (0.1.1) + opentelemetry-helpers-sql-obfuscation (0.2.0) opentelemetry-common (~> 0.21) opentelemetry-instrumentation-action_mailer (0.1.0) opentelemetry-api (~> 1.0) @@ -467,7 +467,7 @@ GEM psych (5.1.2) stringio public_suffix (6.0.1) - puma (6.4.2) + puma (6.4.3) nio4r (~> 2.0) racc (1.8.1) rack (3.1.7) @@ -537,7 +537,7 @@ GEM netrc (~> 0.8) rexml (3.3.7) rinku (2.0.6) - rouge (4.3.0) + rouge (4.4.0) rss (0.3.1) rexml rubocop (1.64.1) From 69a5eec920ced7d7f24d8b3b67a6ae430e160b6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:50:56 +0000 Subject: [PATCH 14/20] Bump govuk_app_config from 9.14.0 to 9.14.1 Bumps [govuk_app_config](https://github.com/alphagov/govuk_app_config) from 9.14.0 to 9.14.1. - [Changelog](https://github.com/alphagov/govuk_app_config/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_app_config/compare/v9.14.0...v9.14.1) --- updated-dependencies: - dependency-name: govuk_app_config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 18168e2c1..e0b124e04 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,10 +145,10 @@ GEM rinku (~> 2.0) sanitize (~> 6) govuk_ab_testing (3.0.0) - govuk_app_config (9.14.0) + govuk_app_config (9.14.1) logstasher (~> 2.1) - opentelemetry-exporter-otlp (>= 0.25, < 0.29) - opentelemetry-instrumentation-all (>= 0.39.1, < 0.63.0) + opentelemetry-exporter-otlp (>= 0.25, < 0.30) + opentelemetry-instrumentation-all (>= 0.39.1, < 0.65.0) opentelemetry-sdk (~> 1.2) plek (>= 4, < 6) prometheus_exporter (~> 2.0) @@ -254,7 +254,7 @@ GEM opentelemetry-api (1.4.0) opentelemetry-common (0.21.0) opentelemetry-api (~> 1.0) - opentelemetry-exporter-otlp (0.28.1) + opentelemetry-exporter-otlp (0.29.0) google-protobuf (>= 3.18) googleapis-common-protos-types (~> 1.3) opentelemetry-api (~> 1.1) @@ -290,7 +290,7 @@ GEM opentelemetry-instrumentation-active_support (0.6.0) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-all (0.62.1) + opentelemetry-instrumentation-all (0.64.0) opentelemetry-instrumentation-active_model_serializers (~> 0.20.1) opentelemetry-instrumentation-aws_lambda (~> 0.1.0) opentelemetry-instrumentation-aws_sdk (~> 0.5.0) @@ -309,9 +309,9 @@ GEM opentelemetry-instrumentation-koala (~> 0.20.1) opentelemetry-instrumentation-lmdb (~> 0.22.1) opentelemetry-instrumentation-mongo (~> 0.22.1) - opentelemetry-instrumentation-mysql2 (~> 0.27.0) + opentelemetry-instrumentation-mysql2 (~> 0.28.0) opentelemetry-instrumentation-net_http (~> 0.22.1) - opentelemetry-instrumentation-pg (~> 0.27.0) + opentelemetry-instrumentation-pg (~> 0.29.0) opentelemetry-instrumentation-que (~> 0.8.0) opentelemetry-instrumentation-racecar (~> 0.3.0) opentelemetry-instrumentation-rack (~> 0.24.0) @@ -324,7 +324,7 @@ GEM opentelemetry-instrumentation-ruby_kafka (~> 0.21.0) opentelemetry-instrumentation-sidekiq (~> 0.25.0) opentelemetry-instrumentation-sinatra (~> 0.24.0) - opentelemetry-instrumentation-trilogy (~> 0.59.0) + opentelemetry-instrumentation-trilogy (~> 0.60.0) opentelemetry-instrumentation-aws_lambda (0.1.1) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) @@ -381,7 +381,7 @@ GEM opentelemetry-instrumentation-mongo (0.22.4) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-mysql2 (0.27.2) + opentelemetry-instrumentation-mysql2 (0.28.0) opentelemetry-api (~> 1.0) opentelemetry-helpers-mysql opentelemetry-helpers-sql-obfuscation @@ -389,7 +389,7 @@ GEM opentelemetry-instrumentation-net_http (0.22.7) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-pg (0.27.4) + opentelemetry-instrumentation-pg (0.29.0) opentelemetry-api (~> 1.0) opentelemetry-helpers-sql-obfuscation opentelemetry-instrumentation-base (~> 0.22.1) @@ -436,7 +436,7 @@ GEM opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) opentelemetry-instrumentation-rack (~> 0.21) - opentelemetry-instrumentation-trilogy (0.59.3) + opentelemetry-instrumentation-trilogy (0.60.0) opentelemetry-api (~> 1.0) opentelemetry-helpers-mysql opentelemetry-helpers-sql-obfuscation From 7a9fa5862733b752dcb0d403162a9d11d4d7ab45 Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Fri, 20 Sep 2024 14:18:31 +0100 Subject: [PATCH 15/20] Take down GOV.UK user research banner for MOD --- lib/data/recruitment_banners.yml | 6 ------ test/integration/recruitment_banner_test.rb | 22 --------------------- 2 files changed, 28 deletions(-) diff --git a/lib/data/recruitment_banners.yml b/lib/data/recruitment_banners.yml index 3896517b8..e7ba5ce40 100644 --- a/lib/data/recruitment_banners.yml +++ b/lib/data/recruitment_banners.yml @@ -9,12 +9,6 @@ # - /foreign-travel-advice banners: -- name: MOD banner 20/08/2024 - suggestion_text: "Help improve GOV.UK" - suggestion_link_text: "Take part in user research (opens in a new tab)" - survey_url: https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188 - page_paths: - - /guidance/medals-campaigns-descriptions-and-eligibility - name: HMRC banner 29/08/2024 suggestion_text: "Help improve GOV.UK" suggestion_link_text: "Sign up to take part in user research (opens in a new tab)" diff --git a/test/integration/recruitment_banner_test.rb b/test/integration/recruitment_banner_test.rb index 1ac1e297f..df391d26b 100644 --- a/test/integration/recruitment_banner_test.rb +++ b/test/integration/recruitment_banner_test.rb @@ -5,28 +5,6 @@ def hmrc_banner_survey_url "https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_CCG_Compliance" end - test "MOD banner 20/08/2024 is displayed on page of interest" do - detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide") - path = "/guidance/medals-campaigns-descriptions-and-eligibility" - - detailed_guide["base_path"] = path - stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json) - visit detailed_guide["base_path"] - - assert page.has_css?(".gem-c-intervention") - assert page.has_link?("Take part in user research", href: "https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188") - end - - test "MOD banner 20/08/2024 is not displayed on all pages" do - detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide") - detailed_guide["base_path"] = "/nothing-to-see-here" - stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json) - visit detailed_guide["base_path"] - - assert_not page.has_css?(".gem-c-intervention") - assert_not page.has_link?("Take part in user research", href: "https://submit.forms.service.gov.uk/form/3874/give-feedback-on-medals-information-on-gov-uk/13188") - end - test "HMRC banner 29/08/2024 is displayed on detailed guides of interest" do detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide") detailed_guide_paths = [ From c1d6bd2ed247f41d791ae3dcf93c525eef234f25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:37:23 +0000 Subject: [PATCH 16/20] Bump govuk_publishing_components from 43.3.0 to 43.4.1 Bumps [govuk_publishing_components](https://github.com/alphagov/govuk_publishing_components) from 43.3.0 to 43.4.1. - [Changelog](https://github.com/alphagov/govuk_publishing_components/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_publishing_components/compare/v43.3.0...v43.4.1) --- updated-dependencies: - dependency-name: govuk_publishing_components dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e0b124e04..87a344820 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -160,7 +160,7 @@ GEM govuk_personalisation (1.0.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (43.3.0) + govuk_publishing_components (43.4.1) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown From cd7cd9022c68c4647cc9e074ab0c28daaf57d18e Mon Sep 17 00:00:00 2001 From: Mateusz Grotek Date: Thu, 19 Sep 2024 16:25:59 +0100 Subject: [PATCH 17/20] Move breadcrumbs out of main --- .../_service_manual_breadcrumbs.html.erb | 8 ++++++++ .../content_items/hmrc_manual_section.html.erb | 3 ++- app/views/content_items/manual_section.html.erb | 1 + .../content_items/manuals/_breadcrumbs.html.erb | 11 +++++++++++ .../manuals/_manual_section_layout.html.erb | 11 ----------- .../content_items/service_manual_guide.html.erb | 11 ++++++----- .../service_manual_service_standard.html.erb | 14 ++++++++------ .../content_items/service_manual_topic.html.erb | 7 +++---- app/views/histories/10_downing_street.html.erb | 17 +++++------------ app/views/histories/11_downing_street.html.erb | 17 +++++------------ .../histories/1_horse_guards_road.html.erb | 17 +++++------------ app/views/histories/_breadcrumbs.html.erb | 14 ++++++++++++++ .../histories/king_charles_street.html.erb | 17 +++++------------ app/views/histories/lancaster_house.html.erb | 17 +++++------------ 14 files changed, 78 insertions(+), 87 deletions(-) create mode 100644 app/views/content_items/_service_manual_breadcrumbs.html.erb create mode 100644 app/views/content_items/manuals/_breadcrumbs.html.erb create mode 100644 app/views/histories/_breadcrumbs.html.erb diff --git a/app/views/content_items/_service_manual_breadcrumbs.html.erb b/app/views/content_items/_service_manual_breadcrumbs.html.erb new file mode 100644 index 000000000..e6129e256 --- /dev/null +++ b/app/views/content_items/_service_manual_breadcrumbs.html.erb @@ -0,0 +1,8 @@ +
+
+ <%= render "govuk_publishing_components/components/breadcrumbs", { + breadcrumbs: @content_item.breadcrumbs, + collapse_on_mobile: true + } %> +
+
diff --git a/app/views/content_items/hmrc_manual_section.html.erb b/app/views/content_items/hmrc_manual_section.html.erb index 471abbab8..b3f82e6bd 100644 --- a/app/views/content_items/hmrc_manual_section.html.erb +++ b/app/views/content_items/hmrc_manual_section.html.erb @@ -7,6 +7,7 @@ green_background: true, type: I18n.t("manuals.hmrc_manual_type"), } %> + <%= render partial: "content_items/manuals/breadcrumbs" %> <% end %> <%= render "content_items/manuals/manual_section_layout" do %> @@ -27,4 +28,4 @@
<%= render "govuk_publishing_components/components/previous_and_next_navigation", @content_item.previous_and_next_links %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/content_items/manual_section.html.erb b/app/views/content_items/manual_section.html.erb index 55aebc534..e949a444f 100644 --- a/app/views/content_items/manual_section.html.erb +++ b/app/views/content_items/manual_section.html.erb @@ -3,6 +3,7 @@ <%= render "content_items/manuals/header", { content_item: @content_item, heading_level: 1, margin_bottom: 6, } %> + <%= render partial: "content_items/manuals/breadcrumbs" %> <% end %> <%= render "content_items/manuals/manual_section_layout", { show_contents: true } do %> diff --git a/app/views/content_items/manuals/_breadcrumbs.html.erb b/app/views/content_items/manuals/_breadcrumbs.html.erb new file mode 100644 index 000000000..758005ef8 --- /dev/null +++ b/app/views/content_items/manuals/_breadcrumbs.html.erb @@ -0,0 +1,11 @@ +<% if @content_item.breadcrumbs.any? %> + <%= render "govuk_publishing_components/components/breadcrumbs", { + border: "bottom", + breadcrumbs: @content_item.breadcrumbs, + collapse_on_mobile: false } %> +<% else %> + <%= render "govuk_publishing_components/components/back_link", { + text: t("manuals.breadcrumb_contents"), + href: @content_item.base_path + } %> +<% end %> diff --git a/app/views/content_items/manuals/_manual_section_layout.html.erb b/app/views/content_items/manuals/_manual_section_layout.html.erb index d90f5020b..c152f9d71 100644 --- a/app/views/content_items/manuals/_manual_section_layout.html.erb +++ b/app/views/content_items/manuals/_manual_section_layout.html.erb @@ -1,17 +1,6 @@ <% show_contents ||= false %> <% content_for :main do %> - <% if @content_item.breadcrumbs.any? %> - <%= render "govuk_publishing_components/components/breadcrumbs", { - border: "bottom", - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: false } %> - <% else %> - <%= render "govuk_publishing_components/components/back_link", { - text: t("manuals.breadcrumb_contents"), - href: @content_item.base_path - } %> - <% end %>
<% if show_contents %> <%= render "govuk_publishing_components/components/contents_list", { diff --git a/app/views/content_items/service_manual_guide.html.erb b/app/views/content_items/service_manual_guide.html.erb index 5a0c8ba9a..4b343c3ab 100644 --- a/app/views/content_items/service_manual_guide.html.erb +++ b/app/views/content_items/service_manual_guide.html.erb @@ -11,12 +11,13 @@ <%= render "shared/custom_phase_message", phase: @content_item.phase %> <% end %> -
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> +
+ <%= render partial: "content_items/service_manual_breadcrumbs" %> +
+<% end %> +
diff --git a/app/views/content_items/service_manual_service_standard.html.erb b/app/views/content_items/service_manual_service_standard.html.erb index d97bdd93f..ca5ad7b0e 100644 --- a/app/views/content_items/service_manual_service_standard.html.erb +++ b/app/views/content_items/service_manual_service_standard.html.erb @@ -4,12 +4,14 @@ <% content_for :phase_message do %> <%= render 'shared/custom_phase_message', phase: @content_item.phase %> <% end %> -
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> +
+ <%= render partial: "content_items/service_manual_breadcrumbs" %> +
+<% end %> + +
@@ -62,4 +64,4 @@
-
\ No newline at end of file +
diff --git a/app/views/content_items/service_manual_topic.html.erb b/app/views/content_items/service_manual_topic.html.erb index 2b461ff83..7076093ed 100644 --- a/app/views/content_items/service_manual_topic.html.erb +++ b/app/views/content_items/service_manual_topic.html.erb @@ -5,10 +5,9 @@ <%= render 'shared/custom_phase_message', phase: @content_item.phase %> <% end %> - <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: @content_item.breadcrumbs, - collapse_on_mobile: true - } %> +<% content_for :header do %> + <%= render partial: "content_items/service_manual_breadcrumbs" %> +<% end %>
diff --git a/app/views/histories/10_downing_street.html.erb b/app/views/histories/10_downing_street.html.erb index a5745e24f..226e6967e 100644 --- a/app/views/histories/10_downing_street.html.erb +++ b/app/views/histories/10_downing_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "10 Downing Street", + margin_top: 0, } %>
diff --git a/app/views/histories/11_downing_street.html.erb b/app/views/histories/11_downing_street.html.erb index 64a3eb113..c77f9f8a3 100644 --- a/app/views/histories/11_downing_street.html.erb +++ b/app/views/histories/11_downing_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "11 Downing Street", + margin_top: 0, } %>
diff --git a/app/views/histories/1_horse_guards_road.html.erb b/app/views/histories/1_horse_guards_road.html.erb index 2fb5a4913..00944e6e9 100644 --- a/app/views/histories/1_horse_guards_road.html.erb +++ b/app/views/histories/1_horse_guards_road.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "1 Horse Guards Road", + margin_top: 0, } %>
diff --git a/app/views/histories/_breadcrumbs.html.erb b/app/views/histories/_breadcrumbs.html.erb new file mode 100644 index 000000000..691b1f774 --- /dev/null +++ b/app/views/histories/_breadcrumbs.html.erb @@ -0,0 +1,14 @@ +
+ <%= render "govuk_publishing_components/components/breadcrumbs", { + breadcrumbs: [ + { + title: "Home", + url: "/", + }, + { + title: "History of the UK Government", + url: "/government/history", + }, + ] + } %> +
diff --git a/app/views/histories/king_charles_street.html.erb b/app/views/histories/king_charles_street.html.erb index 62c9956e8..6c8b67037 100644 --- a/app/views/histories/king_charles_street.html.erb +++ b/app/views/histories/king_charles_street.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context: "History", title: "King Charles Street", + margin_top: 0, } %>
diff --git a/app/views/histories/lancaster_house.html.erb b/app/views/histories/lancaster_house.html.erb index f5a12e2ab..070210f3a 100644 --- a/app/views/histories/lancaster_house.html.erb +++ b/app/views/histories/lancaster_house.html.erb @@ -1,20 +1,13 @@ +<% content_for :header do %> + <%= render partial: "histories/breadcrumbs" %> +<% end %> +
- <%= render "govuk_publishing_components/components/breadcrumbs", { - breadcrumbs: [ - { - title: "Home", - url: "/", - }, - { - title: "History of the UK Government", - url: "/government/history", - }, - ] - } %> <%= render "govuk_publishing_components/components/title", { context:"History", title: "Lancaster House", + margin_top: 0, } %>
From 437f595d46fb97cd957446c3a90bd3c1cb4d63f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:04:46 +0000 Subject: [PATCH 18/20] Bump govuk_publishing_components from 43.4.1 to 43.5.0 Bumps [govuk_publishing_components](https://github.com/alphagov/govuk_publishing_components) from 43.4.1 to 43.5.0. - [Changelog](https://github.com/alphagov/govuk_publishing_components/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_publishing_components/compare/v43.4.1...v43.5.0) --- updated-dependencies: - dependency-name: govuk_publishing_components dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 87a344820..2a7f25c13 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -160,10 +160,11 @@ GEM govuk_personalisation (1.0.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (43.4.1) + govuk_publishing_components (43.5.0) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown + ostruct plek rails (>= 6) rouge @@ -451,6 +452,7 @@ GEM opentelemetry-semantic_conventions opentelemetry-semantic_conventions (1.10.1) opentelemetry-api (~> 1.0) + ostruct (0.6.0) parallel (1.25.1) parser (3.3.3.0) ast (~> 2.4.1) @@ -630,7 +632,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.1) + webrick (1.8.2) websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) From 9caa17d862d02fe37e635a6ce933280e913213d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:19:07 +0000 Subject: [PATCH 19/20] Bump govuk_app_config from 9.14.1 to 9.14.2 Bumps [govuk_app_config](https://github.com/alphagov/govuk_app_config) from 9.14.1 to 9.14.2. - [Changelog](https://github.com/alphagov/govuk_app_config/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/govuk_app_config/compare/v9.14.1...v9.14.2) --- updated-dependencies: - dependency-name: govuk_app_config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a7f25c13..3793f7aaf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,10 +145,10 @@ GEM rinku (~> 2.0) sanitize (~> 6) govuk_ab_testing (3.0.0) - govuk_app_config (9.14.1) + govuk_app_config (9.14.2) logstasher (~> 2.1) opentelemetry-exporter-otlp (>= 0.25, < 0.30) - opentelemetry-instrumentation-all (>= 0.39.1, < 0.65.0) + opentelemetry-instrumentation-all (>= 0.39.1, < 0.66.0) opentelemetry-sdk (~> 1.2) plek (>= 4, < 6) prometheus_exporter (~> 2.0) @@ -291,10 +291,10 @@ GEM opentelemetry-instrumentation-active_support (0.6.0) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-all (0.64.0) + opentelemetry-instrumentation-all (0.65.0) opentelemetry-instrumentation-active_model_serializers (~> 0.20.1) opentelemetry-instrumentation-aws_lambda (~> 0.1.0) - opentelemetry-instrumentation-aws_sdk (~> 0.5.0) + opentelemetry-instrumentation-aws_sdk (~> 0.6.0) opentelemetry-instrumentation-bunny (~> 0.21.0) opentelemetry-instrumentation-concurrent_ruby (~> 0.21.1) opentelemetry-instrumentation-dalli (~> 0.25.0) @@ -329,7 +329,7 @@ GEM opentelemetry-instrumentation-aws_lambda (0.1.1) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-aws_sdk (0.5.4) + opentelemetry-instrumentation-aws_sdk (0.6.0) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) opentelemetry-instrumentation-base (0.22.6) From 35b1da2a2b92ad1d8dcdd6777fd8a9d99c2ef236 Mon Sep 17 00:00:00 2001 From: Sonia Hussain Date: Fri, 27 Sep 2024 15:00:35 +0100 Subject: [PATCH 20/20] Handle nested divs in first_item_content Amended the first_item_content method so that it accounts for nested div elements and processes their child elements, so that there is sufficient content to consider rendering a list. --- app/presenters/content_item/contents_list.rb | 37 +++++++------------ .../content_item/contents_list_test.rb | 36 ++++++++++++++++++ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/app/presenters/content_item/contents_list.rb b/app/presenters/content_item/contents_list.rb index a8d0a9a39..9b334031b 100644 --- a/app/presenters/content_item/contents_list.rb +++ b/app/presenters/content_item/contents_list.rb @@ -19,24 +19,9 @@ def contents_items end def show_contents_list? - # puts "Number of content items: #{contents_items.count}" - # puts "Contents items: #{contents_items.inspect}" - - puts "exclude_contents_list_for_manual_section? #{exclude_contents_list_for_manual_section?}" - puts "contents_items.count #{contents_items.count}" - puts "contents_items: #{contents_items}" - puts "no_first_item? #{no_first_item?}" - puts "first_item_has_long_content? #{first_item_has_long_content?}" - puts "first_item_has_long_table? #{first_item_has_long_table?}" - puts "first_item_has_image_and_long_content? #{first_item_has_image_and_long_content?}" - puts "first_item_has_image_and_long_table? #{first_item_has_image_and_long_table?}" - return false if exclude_contents_list_for_manual_section? - # return false if contents_items.count < 1 - # return true if contents_items.count >= 1 - return false if contents_items.empty? - # return true if contents_items.any? - return true if contents_items.count > 1 + return false if contents_items.count < 2 + return true if contents_items.count > 2 return false if no_first_item? first_item_has_long_content? || @@ -62,14 +47,20 @@ def first_item_has_long_content? def first_item_content element = first_item first_item_text = "" - allowed_elements = %w[p ul ol] - - until element.name == "h2" - first_item_text += element.text if element.name.in?(allowed_elements) + allowed_elements = %w[p ul ol div] + + until element.nil? || element.name == "h2" + if element.name == "div" + element.children.each do |child| + first_item_text += child.text if child.name.in?(allowed_elements - %w[div]) + end + elsif element.name.in?(allowed_elements) + first_item_text += element.text + end element = element.next_element - break if element.nil? end - first_item_text + + first_item_text.strip end def first_item_character_count diff --git a/test/presenters/content_item/contents_list_test.rb b/test/presenters/content_item/contents_list_test.rb index f84048c39..6ae81a057 100644 --- a/test/presenters/content_item/contents_list_test.rb +++ b/test/presenters/content_item/contents_list_test.rb @@ -172,6 +172,42 @@ def body assert_not @contents_list.show_contents_list? end + test "#show_contents_list? returns true if the first item contains long content from nested elements" do + class << @contents_list + def body + "

One

+
+

#{Faker::Lorem.characters(number: 200)}

+
    +
  • #{Faker::Lorem.characters(number: 150)}
  • +
  • #{Faker::Lorem.characters(number: 150)}
  • +
+
+

Two

+ " + end + end + assert @contents_list.show_contents_list? + end + + test "#show_contents_list? returns false if the first item does not contain long content from nested elements" do + class << @contents_list + def body + "

One

+
+

#{Faker::Lorem.characters(number: 50)}

+
    +
  • #{Faker::Lorem.characters(number: 15)}
  • +
  • #{Faker::Lorem.characters(number: 15)}
  • +
+
+

Two

+ " + end + end + assert_not @contents_list.show_contents_list? + end + test "#show_contents_list? returns true if number of table rows in the first item is more than 13" do class << @contents_list def body