From 618d86cf19b376e6e20dea118e2fa3e71a8f8395 Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Thu, 5 Sep 2024 17:46:22 -0400 Subject: [PATCH 01/10] DIG-5025 Hide YouTube channel question in 'video' component --- .../default/field.field.paragraph.video.field_is_channel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/default/field.field.paragraph.video.field_is_channel.yml b/config/default/field.field.paragraph.video.field_is_channel.yml index 62dee29380..5e5dcbfd64 100644 --- a/config/default/field.field.paragraph.video.field_is_channel.yml +++ b/config/default/field.field.paragraph.video.field_is_channel.yml @@ -15,7 +15,9 @@ label: 'Is a Youtube channel?' description: '' required: true translatable: false -default_value: { } +default_value: + - + value: 'false' default_value_callback: '' settings: { } field_type: list_string From b08a25333c80ef377f3cd78df5d18ed4210cab3f Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Thu, 5 Sep 2024 17:59:08 -0400 Subject: [PATCH 02/10] DIG-5025 Hide YouTube channel question in 'video' component --- .../modules/bos_video/bos_video.module | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module index b66e38bdf6..74bdee2eeb 100644 --- a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module +++ b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module @@ -8,6 +8,7 @@ use Drupal\bos_core\BackgroundResponsiveImage; use Drupal\Component\Utility\Html; use Drupal\Core\Render\Element; +use Drupal\Core\Form\FormStateInterface; /** * Implements hook_theme(). @@ -109,3 +110,25 @@ function template_preprocess_paragraph__video(array &$variables) { } } + +/** + * Implements hook_form_alter(). + */ +function bos_video_form_alter(array &$form, FormStateInterface $form_state, $form_id) { + + //if (isset($form['field_is_channel']['#access']) + //&& !in_array('administrator', Drupal::currentUser()->getRoles())) { + //$form['field_is_channel']['#access'] = false; + //} + if ($form_id == 'node_article_form') { + $form['field_is_channel']['#access'] = \Drupal::currentUser()->hasRole('administrator'); + } + +} + +/** + * Implements hook_inline_entity_form_entity_form_alter(). + */ +//function bos_video_inline_entity_form_entity_form_alter(&$entity_form, FormStateInterface $form_state) { + //$entity_form['fields']['field_is_channel']['#access'] = FALSE; +//} From b3f0f6eb4fc949478b7a072246bdf166984e4f93 Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Thu, 5 Sep 2024 21:15:42 -0400 Subject: [PATCH 03/10] DIG-5025 Hide YouTube channel question in 'video' component --- .../bos_components/modules/bos_video/bos_video.module | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module index 74bdee2eeb..c13c112ea6 100644 --- a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module +++ b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module @@ -120,15 +120,9 @@ function bos_video_form_alter(array &$form, FormStateInterface $form_state, $for //&& !in_array('administrator', Drupal::currentUser()->getRoles())) { //$form['field_is_channel']['#access'] = false; //} - if ($form_id == 'node_article_form') { + //if (isset($form['field_is_channel']['#access'])) { $form['field_is_channel']['#access'] = \Drupal::currentUser()->hasRole('administrator'); - } + //} } -/** - * Implements hook_inline_entity_form_entity_form_alter(). - */ -//function bos_video_inline_entity_form_entity_form_alter(&$entity_form, FormStateInterface $form_state) { - //$entity_form['fields']['field_is_channel']['#access'] = FALSE; -//} From b7a1f05dc05595494e7bbce4b70dc0642f1ac328 Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Fri, 6 Sep 2024 12:19:04 -0400 Subject: [PATCH 04/10] DIG-5025 Hide YouTube channel question in 'video' component --- .../modules/bos_video/bos_video.module | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module index c13c112ea6..4fdebfe339 100644 --- a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module +++ b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module @@ -115,14 +115,11 @@ function template_preprocess_paragraph__video(array &$variables) { * Implements hook_form_alter(). */ function bos_video_form_alter(array &$form, FormStateInterface $form_state, $form_id) { - - //if (isset($form['field_is_channel']['#access']) - //&& !in_array('administrator', Drupal::currentUser()->getRoles())) { - //$form['field_is_channel']['#access'] = false; - //} - //if (isset($form['field_is_channel']['#access'])) { - $form['field_is_channel']['#access'] = \Drupal::currentUser()->hasRole('administrator'); - //} + foreach(Drupal\Core\Render\Element::children($form["field_components"]["widget"]) as $item){ + if (is_numeric($item) && $form["field_components"]["widget"][$item]['#paragraph_type']=='video'){ + $form["field_components"]["widget"][$item]["subform"]["field_is_channel"]['#access'] = \Drupal::currentUser()->hasRole('administrator'); + } + } } From 149fc2b4d3ff00fe6d69090f6bde57a03ee79d3e Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Fri, 6 Sep 2024 12:21:39 -0400 Subject: [PATCH 05/10] DIG-5025 Hide YouTube channel question in 'video' component --- .../bos_components/modules/bos_video/bos_video.module | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module index 4fdebfe339..ef47ad10c1 100644 --- a/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module +++ b/docroot/modules/custom/bos_components/modules/bos_video/bos_video.module @@ -115,11 +115,13 @@ function template_preprocess_paragraph__video(array &$variables) { * Implements hook_form_alter(). */ function bos_video_form_alter(array &$form, FormStateInterface $form_state, $form_id) { - foreach(Drupal\Core\Render\Element::children($form["field_components"]["widget"]) as $item){ - if (is_numeric($item) && $form["field_components"]["widget"][$item]['#paragraph_type']=='video'){ - $form["field_components"]["widget"][$item]["subform"]["field_is_channel"]['#access'] = \Drupal::currentUser()->hasRole('administrator'); + if (!empty($form["field_components"])) { + foreach (Drupal\Core\Render\Element::children($form["field_components"]["widget"]) as $item) { + if (is_numeric($item) && $form["field_components"]["widget"][$item]['#paragraph_type'] == 'video') { + $form["field_components"]["widget"][$item]["subform"]["field_is_channel"]['#access'] = \Drupal::currentUser() + ->hasRole('administrator'); + } } } - } From 8a41637b52cf158b4cc636041782ab096526d572 Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Fri, 20 Sep 2024 13:42:44 -0400 Subject: [PATCH 06/10] DIG-5116 Remove Covid 19 statements from website --- .../modules/bos_translate/js/translate.js | 120 ++---------------- 1 file changed, 10 insertions(+), 110 deletions(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js b/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js index 77fdd0bad0..54316c9189 100644 --- a/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js +++ b/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js @@ -88,17 +88,7 @@ let translate = function(d){ h+="
  • Finally, press Contribute to contribute your suggested edits.
  • "; h+="

    More information about contributing to Google Translate can be found here.

    "; h+="

    Please note that DoIT does not control the process by which contributed translations are incorporated into the Google web translator.

    "; - h+="

    The City of Boston is committed to improving the quality and breadth of multilingual content on our website. Critical information regarding Boston’s response to the coronavirus emergency is already available in multiple languages and can be found here:

    "; - h+="

    Spanish: boston.gov/covid19-es

    "; - h+="

    Haitian Creole: boston.gov/covid19-hc

    "; - h+="

    Cape Verdean: boston.gov/covid19-cv

    "; - h+="

    Portuguese: boston.gov/covid19-pt

    "; - h+="

    French: boston.gov/covid19-fr

    "; - h+="

    Chinese: boston.gov/covid19-zh

    "; - h+="

    Vietnamese: boston.gov/covid19-vi

    "; - h+="

    Russian: boston.gov/covid19-ru

    "; - h+="

    Somali: boston.gov/covid19-so

    "; - h+="

    Arabic: boston.gov/covid19-ar

    "; + h+="

    The City of Boston is committed to improving the quality and breadth of multilingual content on our website.

    ""; let j=' "; + j+="

    La Ciudad de Boston se compromete a mejorar la calidad y la amplitud del contenido multilingüe en nuestro sitio web.

    "; let e='"; + e+="

    波士顿市致力于提高我们网站上多语种内容的质量和广度。

    "; let f='"; + f+="

    Vil Boston pran angajman pou amelyore kalite ak lajè kontni pale plizyè lang sou sit entènèt nou an.

    "; let m='"; + m+="

    A cidade de Boston está comprometida em melhorar a qualidade e a abrangência do conteúdo multilíngue em nosso site.

    "; let n='"; + n+="

    La ville de Boston s'est engagée à améliorer la qualité et l'étendue du contenu multilingue sur notre site Web.

    "; let o='"; + o+="

    hành phố Boston cam kết cải thiện chất lượng và độ rộng của nội dung đa ngôn ngữ trên trang web của chúng tôi.

    "; let p='"; + p+="

    Город Бостон стремится улучшить качество и широту многоязычного контента на нашем веб-сайте.

    "; let q='"; + q+="

    agaalada Boston waxa ka go'an inay hagaajiso tayada iyo ballaadhka waxyaabaha ku qoran luqadaha badan luqadaha kala duwan.

    "; let r='"; + r+="

    زم مدينة بوسطن بتحسين جودة واتساع المحتوى متعدد اللغات على موقعنا.

    "; g+=h; g+=j; g+=e; From 2de02e6bb1e553c44e4ac6064c93bcb1d2813ad8 Mon Sep 17 00:00:00 2001 From: "stella.ubaha@boston.gov" Date: Fri, 20 Sep 2024 13:48:43 -0400 Subject: [PATCH 07/10] DIG-5116 Remove Covid 19 statements from website --- .../custom/bos_components/modules/bos_translate/js/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js b/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js index 54316c9189..4a25c0dd99 100644 --- a/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js +++ b/docroot/modules/custom/bos_components/modules/bos_translate/js/translate.js @@ -88,7 +88,7 @@ let translate = function(d){ h+="
  • Finally, press Contribute to contribute your suggested edits.
  • "; h+="

    More information about contributing to Google Translate can be found here.

    "; h+="

    Please note that DoIT does not control the process by which contributed translations are incorporated into the Google web translator.

    "; - h+="

    The City of Boston is committed to improving the quality and breadth of multilingual content on our website.

    ""; + h+="

    The City of Boston is committed to improving the quality and breadth of multilingual content on our website.

    "; let j='"; j+=""; - j+='
    '+this.writeDisclaimer()+"
    "; + j+='
    '+this.writeDisclaimer()+"
    "; let e=jQuery("#overlay"); e.html(j) } diff --git a/docroot/themes/custom/bos_theme/templates/snippets/secondary-nav.html.twig b/docroot/themes/custom/bos_theme/templates/snippets/secondary-nav.html.twig index da8ddbe66e..cc0c7912c2 100644 --- a/docroot/themes/custom/bos_theme/templates/snippets/secondary-nav.html.twig +++ b/docroot/themes/custom/bos_theme/templates/snippets/secondary-nav.html.twig @@ -32,7 +32,7 @@ Where: Secondary Menu. What: New Google Translate. Note: Dropdown of languages #} -
  • +
  • English Español @@ -41,8 +41,8 @@ français 简体中文 -
    -
    +
    +
  • {% if search %}
  • From f9dda9ba999dbde8378b1794bf438cd736eb6fc8 Mon Sep 17 00:00:00 2001 From: David Upton Date: Fri, 20 Sep 2024 17:02:26 -0400 Subject: [PATCH 09/10] DIG-5124 Add published and updated dates properly to metatags and structured data --- .../default/metatag.metatag_defaults.global.yml | 2 +- config/default/metatag.metatag_defaults.node.yml | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config/default/metatag.metatag_defaults.global.yml b/config/default/metatag.metatag_defaults.global.yml index 704c165725..4aa172b6b0 100644 --- a/config/default/metatag.metatag_defaults.global.yml +++ b/config/default/metatag.metatag_defaults.global.yml @@ -7,7 +7,7 @@ _core: id: global label: Global tags: - generator: 'Drupal 9 (http://drupal.org)' + generator: 'Drupal 10 (http://drupal.org)' canonical_url: '[current-page:url:absolute]' title: '[current-page:title] | [current-page:pager][site:name]' shortlink: '[current-page:url:unaliased]' diff --git a/config/default/metatag.metatag_defaults.node.yml b/config/default/metatag.metatag_defaults.node.yml index c634343924..40c413cdc1 100644 --- a/config/default/metatag.metatag_defaults.node.yml +++ b/config/default/metatag.metatag_defaults.node.yml @@ -7,20 +7,22 @@ _core: id: node label: Content tags: + article_modified_time: '[node:changed:html_datetime]' + article_published_time: '[node:published:html_datetime]' canonical_url: '[node:url]' description: '[node:summary]' - title: '[node:title] | [site:name]' og_description: '[node:summary]' - og_updated_time: '[node:changed:custom:c]' - article_modified_time: '[node:created:custom:c]' - article_published_time: '[node:created:custom:c]' - og_url: '[current-page:url:absolute]' og_image: 'https://patterns.boston.gov/images/global/icons/seal_dark_1000x1000.png' og_title: '[node:title]' - twitter_cards_description: '[node:summary]' + og_updated_time: '[node:changed:html_datetime]' + og_url: '[current-page:url:absolute]' + schema_article_date_modified: '[node:changed:html_datetime]' + schema_article_date_published: '[node:published:html_datetime]' + title: '[node:title] | [site:name]' twitter_cards_creator: '@CityOfBoston' - twitter_cards_type: summary twitter_cards_creator_id: '124455872' + twitter_cards_description: '[node:summary]' twitter_cards_site: '@CityOfBoston' twitter_cards_site_id: '124455872' twitter_cards_title: '[node:title]' + twitter_cards_type: summary From 96564a9cbbac5d86ae4ca81bd3a7bd89050cceb4 Mon Sep 17 00:00:00 2001 From: David Upton Date: Fri, 20 Sep 2024 19:15:24 -0400 Subject: [PATCH 10/10] chore reload js --- .../modules/bos_translate/bos_translate.libraries.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docroot/modules/custom/bos_components/modules/bos_translate/bos_translate.libraries.yml b/docroot/modules/custom/bos_components/modules/bos_translate/bos_translate.libraries.yml index d7462905a4..cadc4a06c4 100644 --- a/docroot/modules/custom/bos_components/modules/bos_translate/bos_translate.libraries.yml +++ b/docroot/modules/custom/bos_components/modules/bos_translate/bos_translate.libraries.yml @@ -1,12 +1,12 @@ bos_translate_js: - version: 2.x + version: 2.x.12345 js: js/translate.js: {} dependencies: - core/drupalSettings bos_translate_css: - version: 1.x + version: 1.x.12456 css: theme: css/translate.css: {}