From 5700c53b8912f25d9e9530aaab6cf937f12b9153 Mon Sep 17 00:00:00 2001 From: Mikko Tapionlinna Date: Thu, 15 Aug 2024 14:27:30 +0300 Subject: [PATCH 1/3] UHF-10451: Remove survey contents and similar from news listings (toc) --- .../hdbt_subtheme/hdbt_subtheme.libraries.yml | 2 +- .../src/js/updatingNewsTableOfContents.js | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml index ef35eb84b..bb6d88f70 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml @@ -7,7 +7,7 @@ global-styling: updating-news-table-of-contents: js: dist/js/updatingNewsTableOfContents.min.js: {} - version: 1.0 + version: 1.0.1 dependencies: - core/once - helfi_toc/table_of_contents diff --git a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js index ad376ec74..a97b3c7ac 100644 --- a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js +++ b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js @@ -17,21 +17,13 @@ reservedElems.forEach(function (elem) { Drupal.tableOfContents.reservedIds.push(elem.id); }); - let exclusions = Drupal.tableOfContents.exclusions(); - // Add exclusions for the news updates table of contents. NOTICE: The text paragraph is the only one that - // has paragraph as a prefix, so it might look a bit silly compared to the other selectors. - exclusions += - ':not(.components--upper *)' + - ':not(.component--remote-video *)' + - ':not(.component--paragraph-text *)' + - ':not(.component--banner *)' + - ':not(.component--image *)' + - ':not(.block--news-of-interest *)' + - ':not(#helfi-toc-table-of-contents-news-updates *)'; + // Instead of targeting all headings on page, lets focus on only news update headings. + // This will generate selector like: .component--news-update h2.component__title, .component--news-update h3.component__title... + const titleComponents = Drupal.tableOfContents.titleComponents('.component__title').map(el => '.component--news-update ' + el); // Craft table of contents for news item. - once('updating-news-table-of-contents', Drupal.tableOfContents.titleComponents(exclusions).join(','), mainContent) + once('updating-news-table-of-contents', titleComponents.join(','), mainContent) .forEach(function (content) { const { nodeName, anchorName} = Drupal.tableOfContents.createTableOfContentElements(content, []); From 12a3d54f3087ea82be4f273626711a1ad108b89d Mon Sep 17 00:00:00 2001 From: Mikko Tapionlinna Date: Thu, 15 Aug 2024 14:28:35 +0300 Subject: [PATCH 2/3] UHF-10451: Add subtheme dist --- .../hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js index fdd64be8b..b001dfb0b 100644 --- a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js +++ b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js @@ -1 +1 @@ -!function(){"use strict";!function(Drupal,e){Drupal.behaviors.updating_news_table_of_contents={attach:function(){const t=document.getElementById("helfi-toc-table-of-contents-news-updates");if(!t)return;const n=document.querySelector("#helfi-toc-table-of-contents-list > ul"),o=document.querySelector("main.layout-main-wrapper");document.querySelectorAll("[id]").forEach((function(e){Drupal.tableOfContents.reservedIds.push(e.id)}));let a=Drupal.tableOfContents.exclusions();a+=":not(.components--upper *):not(.component--remote-video *):not(.component--paragraph-text *):not(.component--banner *):not(.component--image *):not(.block--news-of-interest *):not(#helfi-toc-table-of-contents-news-updates *)",e("updating-news-table-of-contents",Drupal.tableOfContents.titleComponents(a).join(","),o).forEach((function(e){const{nodeName:o,anchorName:a}=Drupal.tableOfContents.createTableOfContentElements(e,[]);let l="";if(t&&e.nextSibling&&"TIME"===e.nextElementSibling.nodeName){let t=new Date(e.nextElementSibling.dateTime);l=`${t.getDate()}.${t.getMonth()+1}.${t.getFullYear()}`}if(n&&"h2"===o){let t=document.createElement("li");if(t.classList.add("table-of-contents__item"),l){let n=document.createElement("time");n.dateTime=e.nextElementSibling.dateTime,n.textContent=l,t.appendChild(n)}let o=document.createElement("a");o.classList.add("table-of-contents__link"),o.href=`#${a}`,o.textContent=e.textContent.trim(),t.appendChild(o),n.appendChild(t)}})),t&&Drupal.tableOfContents.updateTOC(t)}}}(Drupal,once)}(); \ No newline at end of file +!function(){"use strict";!function(Drupal,e){Drupal.behaviors.updating_news_table_of_contents={attach:function(){const t=document.getElementById("helfi-toc-table-of-contents-news-updates");if(!t)return;const n=document.querySelector("#helfi-toc-table-of-contents-list > ul"),o=document.querySelector("main.layout-main-wrapper");document.querySelectorAll("[id]").forEach((function(e){Drupal.tableOfContents.reservedIds.push(e.id)}));const l=Drupal.tableOfContents.titleComponents(".component__title").map((e=>".component--news-update "+e));e("updating-news-table-of-contents",l.join(","),o).forEach((function(e){const{nodeName:o,anchorName:l}=Drupal.tableOfContents.createTableOfContentElements(e,[]);let a="";if(t&&e.nextSibling&&"TIME"===e.nextElementSibling.nodeName){let t=new Date(e.nextElementSibling.dateTime);a=`${t.getDate()}.${t.getMonth()+1}.${t.getFullYear()}`}if(n&&"h2"===o){let t=document.createElement("li");if(t.classList.add("table-of-contents__item"),a){let n=document.createElement("time");n.dateTime=e.nextElementSibling.dateTime,n.textContent=a,t.appendChild(n)}let o=document.createElement("a");o.classList.add("table-of-contents__link"),o.href=`#${l}`,o.textContent=e.textContent.trim(),t.appendChild(o),n.appendChild(t)}})),t&&Drupal.tableOfContents.updateTOC(t)}}}(Drupal,once)}(); \ No newline at end of file From 5cbe69422f3b572600cdd5b89f52723a4801d000 Mon Sep 17 00:00:00 2001 From: hyrsky <732227+hyrsky@users.noreply.github.com> Date: Fri, 16 Aug 2024 09:29:06 +0000 Subject: [PATCH 3/3] Update configuration --- .platform/schema | 2 +- composer.json | 1 - composer.lock | 69 ++++++++++++++++++++++++++---------------------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/.platform/schema b/.platform/schema index c7930257d..301160a93 100644 --- a/.platform/schema +++ b/.platform/schema @@ -1 +1 @@ -7 \ No newline at end of file +8 \ No newline at end of file diff --git a/composer.json b/composer.json index 018552f5c..e47af5f5e 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ "drupal/raven": "^5.0", "drupal/redis": "^1.5", "drupal/search_api": "^1.23", - "drupal/stage_file_proxy": "^2.0", "drupal/ultimate_cron": "^2.0@alpha", "drupal/views_rss": "^2.0@RC", "drush/drush": "^12", diff --git a/composer.lock b/composer.lock index 4d7ab870f..b3ec18cd2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "558a4131ad55789fc0cadeaade58fbc1", + "content-hash": "82dc12833d4cac7d1b6fed7c48a30ea4", "packages": [ { "name": "asm89/stack-cors", @@ -4407,22 +4407,25 @@ }, { "name": "drupal/helfi_azure_fs", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-azure-fs.git", - "reference": "bfd7671b58300db948d8cd230b4756ecca73c237" + "reference": "25c7b80d6d1dc71176a576102665704b7e8fedeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-azure-fs/zipball/bfd7671b58300db948d8cd230b4756ecca73c237", - "reference": "bfd7671b58300db948d8cd230b4756ecca73c237", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-azure-fs/zipball/25c7b80d6d1dc71176a576102665704b7e8fedeb", + "reference": "25c7b80d6d1dc71176a576102665704b7e8fedeb", "shasum": "" }, "require": { "drupal/flysystem": "^2.1@RC", "microsoft/azure-storage-blob": "^1.1" }, + "conflict": { + "drupal/core": "<10.3" + }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "drupal/coder": "^8.3" @@ -4440,10 +4443,10 @@ ], "description": "Helfi - Azure FS", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-azure-fs/tree/2.0.2", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-azure-fs/tree/2.0.3", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-azure-fs/issues" }, - "time": "2023-11-21T07:23:44+00:00" + "time": "2024-08-16T08:49:23+00:00" }, { "name": "drupal/helfi_drupal_tools", @@ -4451,12 +4454,12 @@ "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-tools.git", - "reference": "eadca37ff757c3de0b1a309d37ddd2c6d4910740" + "reference": "5c46212ec813932eb9f8e94bbf2d14e1e92b2a39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/eadca37ff757c3de0b1a309d37ddd2c6d4910740", - "reference": "eadca37ff757c3de0b1a309d37ddd2c6d4910740", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/5c46212ec813932eb9f8e94bbf2d14e1e92b2a39", + "reference": "5c46212ec813932eb9f8e94bbf2d14e1e92b2a39", "shasum": "" }, "require": { @@ -4528,7 +4531,7 @@ "source": "https://github.com/City-of-Helsinki/drupal-tools/tree/main", "issues": "https://github.com/City-of-Helsinki/drupal-tools/issues" }, - "time": "2024-08-12T09:17:00+00:00" + "time": "2024-08-16T09:24:27+00:00" }, { "name": "drupal/helfi_navigation", @@ -4566,16 +4569,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "4.4.8", + "version": "4.4.10", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "10ca013c3e13c112eb9827fd1b91ed52833b2712" + "reference": "97338d748ace88329505d3a79eb3e03d98ef648f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/10ca013c3e13c112eb9827fd1b91ed52833b2712", - "reference": "10ca013c3e13c112eb9827fd1b91ed52833b2712", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/97338d748ace88329505d3a79eb3e03d98ef648f", + "reference": "97338d748ace88329505d3a79eb3e03d98ef648f", "shasum": "" }, "require": { @@ -4630,6 +4633,7 @@ "drupal/simple_sitemap": "^4.0", "drupal/siteimprove": "^2.0", "drupal/social_media": "^2.0", + "drupal/stage_file_proxy": "^2", "drupal/stomp": "^2.0", "drupal/tfa": "^1.7", "drupal/token": "^1.9", @@ -4647,6 +4651,7 @@ "drupal/ctools": "<3.11 || ^4.0.1", "drupal/gin_toolbar": ">1.0.0-rc6", "drupal/helfi_media_map": "*", + "drupal/stage_file_proxy": "<2.1.5", "drush/drush": "<12" }, "type": "drupal-module", @@ -4690,10 +4695,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.4.8", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.4.10", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2024-08-12T09:33:04+00:00" + "time": "2024-08-16T08:50:18+00:00" }, { "name": "drupal/helfi_proxy", @@ -6649,17 +6654,17 @@ }, { "name": "drupal/raven", - "version": "5.0.16", + "version": "5.0.17", "source": { "type": "git", "url": "https://git.drupalcode.org/project/raven.git", - "reference": "5.0.16" + "reference": "5.0.17" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/raven-5.0.16.zip", - "reference": "5.0.16", - "shasum": "cd4d545b74ad7d22691dd06177a164bc12074201" + "url": "https://ftp.drupal.org/files/projects/raven-5.0.17.zip", + "reference": "5.0.17", + "shasum": "3be77024ab4edac4964ed5a4590f4e9eb5031346" }, "require": { "drupal/core": "^10.1 || ^11", @@ -6674,8 +6679,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "5.0.16", - "datestamp": "1723001088", + "version": "5.0.17", + "datestamp": "1723776489", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7462,7 +7467,7 @@ "role": "Maintainer" }, { - "name": "WalkingDexter", + "name": "walkingdexter", "homepage": "https://www.drupal.org/user/3251330" } ], @@ -7660,17 +7665,17 @@ }, { "name": "drupal/stage_file_proxy", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://git.drupalcode.org/project/stage_file_proxy.git", - "reference": "2.1.4" + "reference": "2.1.5" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/stage_file_proxy-2.1.4.zip", - "reference": "2.1.4", - "shasum": "85f8451f123fcfb1b272f5a0cc11e6bd1673476c" + "url": "https://ftp.drupal.org/files/projects/stage_file_proxy-2.1.5.zip", + "reference": "2.1.5", + "shasum": "6f5974c106d45211e54945e4d9f5bbf8ec6699de" }, "require": { "drupal/core": "^9 || ^10", @@ -7683,8 +7688,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.1.4", - "datestamp": "1706627704", + "version": "2.1.5", + "datestamp": "1719499510", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy"