From 6dc09dd813585ae0e986a470f9c1b4f88bd62fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 3 May 2024 14:43:36 +0300 Subject: [PATCH 01/12] UHF-9739: Added 'news update' paragraph and it's configurations. --- ..._display.paragraph.news_update.default.yml | 54 +++++++++++++++++++ ..._display.paragraph.news_update.default.yml | 45 ++++++++++++++++ ...ews_item.field_news_item_updating_news.yml | 31 +++++++++++ ...aragraph.news_update.field_news_update.yml | 30 +++++++++++ ...aph.news_update.field_news_update_date.yml | 21 ++++++++ ...ph.news_update.field_news_update_title.yml | 19 +++++++ ...age.node.field_news_item_updating_news.yml | 21 ++++++++ ...ld.storage.paragraph.field_news_update.yml | 20 +++++++ ...orage.paragraph.field_news_update_date.yml | 20 +++++++ ...rage.paragraph.field_news_update_title.yml | 21 ++++++++ ...paragraphs.paragraphs_type.news_update.yml | 10 ++++ ..._display.paragraph.news_update.default.yml | 6 +++ ...ews_item.field_news_item_updating_news.yml | 1 + ...aragraph.news_update.field_news_update.yml | 1 + ...aph.news_update.field_news_update_date.yml | 2 + ...ph.news_update.field_news_update_title.yml | 2 + ...paragraphs.paragraphs_type.news_update.yml | 1 + .../helfi_etusivu/helfi_etusivu.install | 10 ++++ .../custom/helfi_etusivu/helfi_etusivu.module | 10 ++++ .../custom/helfi_etusivu/translations/fi.po | 4 ++ .../custom/helfi_etusivu/translations/sv.po | 4 ++ 21 files changed, 333 insertions(+) create mode 100644 public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml create mode 100644 public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml create mode 100644 public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..b43916460 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,54 @@ +uuid: 01df54cb-c5ac-4cab-bd27-787f2bdc93b1 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - paragraphs +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: paragraphs + weight: 2 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: text + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + convert: '0' + duplicate: duplicate + third_party_settings: { } + field_news_update_date: + type: datetime_default + weight: 1 + region: content + settings: { } + third_party_settings: { } + field_news_update_title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..5d605b29b --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml @@ -0,0 +1,45 @@ +uuid: a0d41678-10a0-4519-be98-d17f3051a687 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_default + label: above + settings: + timezone_override: '' + format_type: medium + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..8f1f7fa75 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1,31 @@ +uuid: badac28d-62bc-4e48-94de-9ccc20dc44a7 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_news_item_updating_news + - node.type.news_item + - paragraphs.paragraphs_type.news_update + module: + - entity_reference_revisions +id: node.news_item.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +bundle: news_item +label: Content +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + news_update: news_update + negate: 0 + target_bundles_drag_drop: + news_update: + weight: 52 + enabled: true +field_type: entity_reference_revisions diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..99c898052 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1,30 @@ +uuid: b50d682f-ff11-481c-af5b-51192a655696 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update + - paragraphs.paragraphs_type.banner + - paragraphs.paragraphs_type.image + - paragraphs.paragraphs_type.news_update + - paragraphs.paragraphs_type.remote_video + - paragraphs.paragraphs_type.text + module: + - entity_reference_revisions +id: paragraph.news_update.field_news_update +field_name: field_news_update +entity_type: paragraph +bundle: news_update +label: 'News update' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: { } + negate: 0 + target_bundles_drag_drop: { } +field_type: entity_reference_revisions diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..898f475cf --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,21 @@ +uuid: 23a03e5f-7f4d-45f0-ad8d-76320b4cb880 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_date + - paragraphs.paragraphs_type.news_update + module: + - datetime +id: paragraph.news_update.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +bundle: news_update +label: Date +description: 'The date will appear in the table of contents and below the title of the news update.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..e63792ffe --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,19 @@ +uuid: bf3f766e-4a12-450f-8ffc-d162e9f7511a +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_title + - paragraphs.paragraphs_type.news_update +id: paragraph.news_update.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +bundle: news_update +label: Title +description: 'Write the title of the news update. Remember to update the title of the page if necessary to reflect the updated content.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml new file mode 100644 index 000000000..13dd3f2f7 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml @@ -0,0 +1,21 @@ +uuid: cf9d1751-254b-4997-8688-746777df2498 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml new file mode 100644 index 000000000..72fcf1d47 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml @@ -0,0 +1,20 @@ +uuid: 21076eb0-779f-4178-a184-c8fd396219c1 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - paragraphs +id: paragraph.field_news_update +field_name: field_news_update +entity_type: paragraph +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml new file mode 100644 index 000000000..003c8cc4b --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml @@ -0,0 +1,20 @@ +uuid: 58a866e3-c277-40c2-ac1f-c55529be88e9 +langcode: en +status: true +dependencies: + module: + - datetime + - paragraphs +id: paragraph.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml new file mode 100644 index 000000000..4b580337c --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml @@ -0,0 +1,21 @@ +uuid: 8bdb9cc3-8deb-44f4-b936-39e9a745dd10 +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml b/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..c17fd17d3 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1,10 @@ +uuid: 85ec51ba-cfc6-491f-8528-3fa0ee65165f +langcode: en +status: true +dependencies: { } +id: news_update +label: 'News update' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..8d64f9268 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,6 @@ +content: + field_news_update: + type: paragraph + settings: + title: Lohko + title_plural: Lohkot diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9d61cbc9a --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1 @@ +label: Sisältö diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..6aee2db50 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,2 @@ +label: Ajankohta +description: 'Ajankohta näkyy sisällysluettelossa ja uutispäivityksen otsikon alla.' diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..224d385c6 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,2 @@ +label: Otsikko +description: 'Kirjoita uutispäivityksen otsikko. Muista päivittää tarvittaessa myös koko uutisen otsikko vastaamaan päivitettyä sisältöä.' diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/public/modules/custom/helfi_etusivu/helfi_etusivu.install b/public/modules/custom/helfi_etusivu/helfi_etusivu.install index c09af60d5..e0d21735f 100644 --- a/public/modules/custom/helfi_etusivu/helfi_etusivu.install +++ b/public/modules/custom/helfi_etusivu/helfi_etusivu.install @@ -216,3 +216,13 @@ function helfi_etusivu_update_9007() : void { function helfi_etusivu_update_9008(): void { helfi_platform_config_update_paragraph_target_types(); } + +/** + * UHF-9739: Add 'news update' paragraph to news item. + */ +function helfi_etusivu_update_9009(): void { + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_node_news_item'); + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_etusivu'); +} diff --git a/public/modules/custom/helfi_etusivu/helfi_etusivu.module b/public/modules/custom/helfi_etusivu/helfi_etusivu.module index 28a240119..05c542ca9 100644 --- a/public/modules/custom/helfi_etusivu/helfi_etusivu.module +++ b/public/modules/custom/helfi_etusivu/helfi_etusivu.module @@ -103,6 +103,16 @@ function helfi_etusivu_helfi_paragraph_types() : array { ], ], ], + 'paragraph' => [ + 'news_update' => [ + 'field_news_update' => [ + 'text' => 0, + 'image' => 1, + 'remote_video' => 2, + 'banner' => 3, + ], + ], + ], ]; $enabled = []; diff --git a/public/modules/custom/helfi_etusivu/translations/fi.po b/public/modules/custom/helfi_etusivu/translations/fi.po index 50e308eee..7595efd1a 100644 --- a/public/modules/custom/helfi_etusivu/translations/fi.po +++ b/public/modules/custom/helfi_etusivu/translations/fi.po @@ -11,3 +11,7 @@ msgstr "Pääuutisvirta" msgid "Organize top news feed" msgstr "Järjestä pääuutisvirtaa" + +msgctxt "Updating news" +msgid "Latest updates" +msgstr "Uusimmat päivitykset" diff --git a/public/modules/custom/helfi_etusivu/translations/sv.po b/public/modules/custom/helfi_etusivu/translations/sv.po index 33c68c60c..f9d2f5c5f 100644 --- a/public/modules/custom/helfi_etusivu/translations/sv.po +++ b/public/modules/custom/helfi_etusivu/translations/sv.po @@ -11,3 +11,7 @@ msgstr "Toppnyheterna" msgid "Organize top news feed" msgstr "Ordna toppnyheterna" + +msgctxt "Updating news" +msgid "Latest updates" +msgstr "Senaste uppdateringar" From 41f5f3c6d5a72c8dbe804ee34e2349cd9485d988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 3 May 2024 14:44:28 +0300 Subject: [PATCH 02/12] UHF-9739: Added config rewrites for the news items based on changes needed in 'news update' paragraphs. --- ...ty_form_display.node.news_item.default.yml | 38 +++++++++++++++++++ ...iew_display.node.news_item.card_teaser.yml | 24 ++++++++++++ ...ty_view_display.node.news_item.default.yml | 13 ++++++- ...w_display.node.news_item.medium_teaser.yml | 22 +++++++++++ ...ity_view_display.node.news_item.teaser.yml | 22 +++++++++++ ...iew_display.node.news_item.tiny_teaser.yml | 22 +++++++++++ ...ty_form_display.node.news_item.default.yml | 6 +++ 7 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml create mode 100644 public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml create mode 100644 public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml create mode 100644 public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml create mode 100644 public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml index 4308b52ae..771f02f18 100644 --- a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml @@ -10,6 +10,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -25,7 +26,44 @@ dependencies: - scheduler - select2 - radioactivity +third_party_settings: + field_group: + group_updating_news: + children: + - field_news_item_updating_news + label: 'Updating news' + region: content + parent_name: '' + weight: 17 + format_type: details + format_settings: + classes: '' + show_empty_fields: true + id: '' + open: false + description: "Leave the content region above the updating news blank if you are creating an updating news.
\r\nAdd the latest news update at the end. The system will display updates on the page in reverse order." + required_fields: false content: + field_news_item_updating_news: + type: paragraphs + weight: 17 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: _none + features: + add_above: '0' + collapse_edit_all: '0' + convert: '0' + duplicate: '0' + third_party_settings: { } field_news_groups: type: select2_entity_reference weight: 26 diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml new file mode 100644 index 000000000..3219b4c81 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml @@ -0,0 +1,24 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.card_teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - image.style.3_2_m + - node.type.news_item + module: + - media + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml index 5c9038a72..cca982c80 100644 --- a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml @@ -1,5 +1,5 @@ config_rewrite: - replace: ['dependencies','hidden'] + replace: ['dependencies'] dependencies: config: - field.field.node.news_item.field_content @@ -18,8 +18,8 @@ dependencies: - entity_reference_revisions - helfi_platform_config - link - - user - radioactivity + - user content: field_news_groups: type: entity_reference_label @@ -45,6 +45,15 @@ content: third_party_settings: { } weight: 12 region: content + field_news_item_updating_news: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 13 + region: content field_radioactivity: type: radioactivity_reference_emitter label: above diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml new file mode 100644 index 000000000..631debc7e --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.medium_teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml new file mode 100644 index 000000000..4b53f6767 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml new file mode 100644 index 000000000..4b53f6767 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml new file mode 100644 index 000000000..a7ca62d83 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml @@ -0,0 +1,6 @@ +third_party_settings: + field_group: + group_updating_news: + label: 'Päivittyvä uutinen' + format_settings: + description: "Jätä sisältöalue tyhjäksi päivittyvän uutisen yläpuolelta, jos luot päivittyvän uutisen.
Lisää uusin uutispäivitys viimeiseksi. Järjestelmä näyttää päivitykset sivulla käänteisessä järjestyksessä." From 199c4526e2e51cf2c55eefe07896eacaa5d8f0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 3 May 2024 15:05:44 +0300 Subject: [PATCH 03/12] UHF-9739: Fixed configuration translation. --- .../core.entity_form_display.paragraph.news_update.default.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml index 8d64f9268..f95720cc1 100644 --- a/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml @@ -1,6 +1,5 @@ content: field_news_update: - type: paragraph settings: title: Lohko title_plural: Lohkot From 0ed2753f4c7690ba3624449c5c50985015c3261f Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Mon, 13 May 2024 17:27:24 +0300 Subject: [PATCH 04/12] UHF-9739: Hide the labels on updating news items, change the timestamp to correct format --- ....entity_view_display.paragraph.news_update.default.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml index 5d605b29b..6f07f4645 100644 --- a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml @@ -17,7 +17,7 @@ mode: default content: field_news_update: type: entity_reference_revisions_entity_view - label: above + label: hidden settings: view_mode: default link: '' @@ -26,16 +26,16 @@ content: region: content field_news_update_date: type: datetime_default - label: above + label: hidden settings: timezone_override: '' - format_type: medium + format_type: publication_date_format third_party_settings: { } weight: 1 region: content field_news_update_title: type: string - label: above + label: hidden settings: link_to_entity: false third_party_settings: { } From f30be77116610fc934c5dcc67b07db7552a38f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 16 May 2024 13:09:42 +0300 Subject: [PATCH 05/12] UHF-9739: Moved the updating news templates from hdbt to hdbt_subtheme. --- .../hdbt_subtheme/templates/content/.keepme | 0 .../content/node--news-item.html.twig | 7 +++ .../hdbt_subtheme/templates/field/.keepme | 0 ...e--field-news-item-updating-news.html.twig | 55 +++++++++++++++++++ .../paragraph--news-update.html.twig | 18 ++++++ 5 files changed, 80 insertions(+) delete mode 100644 public/themes/custom/hdbt_subtheme/templates/content/.keepme create mode 100644 public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig delete mode 100644 public/themes/custom/hdbt_subtheme/templates/field/.keepme create mode 100644 public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig create mode 100644 public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig diff --git a/public/themes/custom/hdbt_subtheme/templates/content/.keepme b/public/themes/custom/hdbt_subtheme/templates/content/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig b/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig new file mode 100644 index 000000000..d313a094d --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig @@ -0,0 +1,7 @@ +{% extends '@hdbt/module/helfi-news-item/node--news-item.html.twig' %} + +{% block after_content %} + {% if content.field_news_item_updating_news|render|striptags|trim is not empty %} + {{ content.field_news_item_updating_news }} + {% endif %} +{% endblock after_content %} diff --git a/public/themes/custom/hdbt_subtheme/templates/field/.keepme b/public/themes/custom/hdbt_subtheme/templates/field/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig b/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig new file mode 100644 index 000000000..24fde56b0 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig @@ -0,0 +1,55 @@ +{% + set classes = [ + 'paragraph-content', + 'components', + ] +%} + +{% if items|length > 1 %} +
+
+ {% set title_attributes = { + 'class': [ + 'table-of-contents__title', + ] + } + %} + {% if alternative_language %} + {% set title_attributes = title_attributes|merge({ + 'dir': lang_attributes.fallback_dir, + 'lang': lang_attributes.fallback_lang + }) + %} + {% endif %} +

{{ 'Latest updates'|t({}, {'context': 'Updating news'}) }}

+ +
+ +
+{% endif %} + + + {% for item in items|reverse %} + {{ item.content }} + {% endfor %} + diff --git a/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig b/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig new file mode 100644 index 000000000..8e94faae5 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig @@ -0,0 +1,18 @@ +{% block paragraph %} + {% embed "@hdbt/misc/component.twig" with + { + component_classes: [ 'component--news-update' ], + component_title: content.field_news_update_title, + component_content_class: 'news-update', + component_content_tag: 'div', + } + %} + {% block component_tags %} + {{ content.field_news_update_date }} + {% endblock component_tags %} + + {% block component_content %} + {{ content.field_news_update }} + {% endblock component_content %} + {% endembed %} +{% endblock paragraph %} From d1f405d78921ba86ef9ed850a8f9d36f18854f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 16 May 2024 13:10:27 +0300 Subject: [PATCH 06/12] UHF-9739: Moved the updating news related styles from hdbt to hdbt_subtheme. --- .../src/scss/06_components/__index.scss | 1 + .../scss/06_components/navigation/_index.scss | 1 + .../navigation/_table-of-contents.scss | 98 +++++++++++++++++++ .../scss/06_components/paragraphs/_index.scss | 1 + .../paragraphs/_news-update.scss | 31 ++++++ 5 files changed, 132 insertions(+) create mode 100644 public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss create mode 100644 public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss create mode 100644 public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss index 96650aaec..3c399dcc0 100644 --- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss @@ -1,3 +1,4 @@ @import 'block/_index'; +@import 'navigation/index'; @import 'pages/_index'; @import 'paragraphs/index'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss new file mode 100644 index 000000000..9e523ccfd --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss @@ -0,0 +1 @@ +@import 'table-of-contents'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss new file mode 100644 index 000000000..5869da57b --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss @@ -0,0 +1,98 @@ +// This implementation is very close to phasing component but not totally the same. +.table-of-contents--news-update { + @include component-side-padding; + --item-title-lineheight: #{1.5 * get-font-size('h4')}; + + .table-of-contents__container { + // Hide the border that the default TOC has on the left. + border-inline-start: none; + } + + .table-of-contents__title + .table-of-contents__content { + padding-top: $spacing; + } + + .table-of-contents__item { + @include font('special.large_link'); + display: flex; + flex-direction: column; + padding-block: $spacing; + padding-inline: $spacing; + position: relative; + + @include breakpoint($breakpoint-m) { + flex-direction: row; + } + + &::before, + &::after { + content: ''; + display: block; + inset-inline-start: calc($spacing * 0.5); + position: absolute; + + &:dir(rtl) { + right: calc($spacing * 0.5); + } + } + + &::after { + background-color: $color-black; + height: calc(100% + $spacing-double + $spacing-half); + top: -#{$spacing}; + transform: translateX(calc(var(--lang-direction) * -50%)); + width: 2px; + z-index: 0; + } + + &:first-of-type::after { + height: 100%; + top: calc($spacing + var(--item-title-lineheight) * 0.5); + } + + &:last-of-type::after { + height: calc($spacing + var(--item-title-lineheight) * 0.5); + } + + &:only-child::after { + display: none; + } + + &::before { + background-color: $color-white; + border: 3px solid $color-black; + border-radius: 50%; + height: $spacing; + top: calc($spacing + var(--item-title-lineheight) * 0.5); + transform: translate(calc(var(--lang-direction) * -50%), -50%); + width: $spacing; + z-index: 1; + } + } + + time { + padding-left: $spacing; + + &:dir(rtl) { + padding-left: 0; + padding-right: $spacing; + } + } + + .table-of-contents__link { + margin-left: $spacing; + + @include breakpoint($breakpoint-m) { + margin-left: $spacing-double; + } + + &:dir(rtl) { + margin-left: 0; + margin-right: $spacing; + + @include breakpoint($breakpoint-m) { + margin-right: $spacing-double; + } + } + } +} diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss index cdb90535d..fc606c379 100644 --- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss @@ -1,2 +1,3 @@ @import 'current'; @import 'latest-news'; +@import 'news-update'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss new file mode 100644 index 000000000..5a36a5603 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss @@ -0,0 +1,31 @@ +.component--news-update { + border-bottom: 1px solid $color-black-20; + padding-bottom: $spacing-double; + + @include breakpoint($breakpoint-m) { + padding-bottom: $spacing-triple; + } + + time { + @include font('body'); + display: inline-block; + margin-top: $spacing; + } + + .component__content { + margin-top: $spacing-double; + + @include breakpoint($breakpoint-m) { + margin-top: $spacing-triple; + } + } +} + +* ~ .component--news-update, +.component--news-update ~ .component--news-update { + margin-top: $spacing-double; + + @include breakpoint($breakpoint-m) { + margin-top: $spacing-triple; + } +} From 4bb6fef90becd361fe7403162e12a7d920e2aeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 16 May 2024 13:11:01 +0300 Subject: [PATCH 07/12] UHF-9739: Moved the updating news related translations from hdbt to helfi_etusivu module. --- public/modules/custom/helfi_etusivu/translations/fi.po | 4 ++++ public/modules/custom/helfi_etusivu/translations/sv.po | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/public/modules/custom/helfi_etusivu/translations/fi.po b/public/modules/custom/helfi_etusivu/translations/fi.po index 7595efd1a..eb02a5d64 100644 --- a/public/modules/custom/helfi_etusivu/translations/fi.po +++ b/public/modules/custom/helfi_etusivu/translations/fi.po @@ -15,3 +15,7 @@ msgstr "Järjestä pääuutisvirtaa" msgctxt "Updating news" msgid "Latest updates" msgstr "Uusimmat päivitykset" + +msgctxt "Updating news" +msgid "News update published" +msgstr "Uutispäivityksen julkaisuaika" diff --git a/public/modules/custom/helfi_etusivu/translations/sv.po b/public/modules/custom/helfi_etusivu/translations/sv.po index f9d2f5c5f..1481bff5e 100644 --- a/public/modules/custom/helfi_etusivu/translations/sv.po +++ b/public/modules/custom/helfi_etusivu/translations/sv.po @@ -15,3 +15,7 @@ msgstr "Ordna toppnyheterna" msgctxt "Updating news" msgid "Latest updates" msgstr "Senaste uppdateringar" + +msgctxt "Updating news" +msgid "News update published time" +msgstr "Uppdatering publicerad tid" From b5ce78a8854f46a8424d6e839ac5d75e3610cb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Thu, 16 May 2024 13:35:48 +0300 Subject: [PATCH 08/12] UHF-9739: Updated news update configurations. --- ..._display.paragraph.news_update.default.yml | 8 ++-- ..._display.paragraph.news_update.preview.yml | 46 +++++++++++++++++++ ...aph.news_update.field_news_update_date.yml | 5 +- 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml index 5d605b29b..6f07f4645 100644 --- a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml @@ -17,7 +17,7 @@ mode: default content: field_news_update: type: entity_reference_revisions_entity_view - label: above + label: hidden settings: view_mode: default link: '' @@ -26,16 +26,16 @@ content: region: content field_news_update_date: type: datetime_default - label: above + label: hidden settings: timezone_override: '' - format_type: medium + format_type: publication_date_format third_party_settings: { } weight: 1 region: content field_news_update_title: type: string - label: above + label: hidden settings: link_to_entity: false third_party_settings: { } diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml new file mode 100644 index 000000000..b0282a7a0 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml @@ -0,0 +1,46 @@ +uuid: e6f7408a-1e53-4af0-97eb-5122f611d019 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.paragraph.preview + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +id: paragraph.news_update.preview +targetEntityType: paragraph +bundle: news_update +mode: preview +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_custom + label: hidden + settings: + timezone_override: '' + date_format: U + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml index 898f475cf..321619c5a 100644 --- a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml @@ -15,7 +15,10 @@ label: Date description: 'The date will appear in the table of contents and below the title of the news update.' required: true translatable: false -default_value: { } +default_value: + - + default_date_type: now + default_date: now default_value_callback: '' settings: { } field_type: datetime From 75ab6eb38ed923f3b7d54ee4b8fe8f246d04e29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 17 May 2024 12:34:31 +0300 Subject: [PATCH 09/12] UHF-9739: Added Updating news table of contents javascript. --- .../hdbt_subtheme/hdbt_subtheme.libraries.yml | 8 ++ .../custom/hdbt_subtheme/hdbt_subtheme.theme | 16 ++++ .../custom/hdbt_subtheme/src/js/.keepme | 0 .../src/js/updatingNewsTableOfContents.js | 76 +++++++++++++++++++ 4 files changed, 100 insertions(+) delete mode 100644 public/themes/custom/hdbt_subtheme/src/js/.keepme create mode 100644 public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml index c41df7056..ef35eb84b 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml @@ -3,3 +3,11 @@ global-styling: css: theme: dist/css/styles.min.css: {} + +updating-news-table-of-contents: + js: + dist/js/updatingNewsTableOfContents.min.js: {} + version: 1.0 + dependencies: + - core/once + - helfi_toc/table_of_contents diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index 6253c0b33..facbe2e26 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -8,6 +8,7 @@ declare(strict_types=1); use Drupal\Core\Url; +use Drupal\node\NodeInterface; /** * Implements hook_preprocess_HOOK(). @@ -210,3 +211,18 @@ function hdbt_subtheme_preprocess_views_view_row_rss(&$variables) : void { } } } + +/** + * Implements hook_preprocess_HOOK(). + */ +function hdbt_subtheme_preprocess_node(array &$variables): void { + if ( + !$variables['node'] instanceof NodeInterface || + $variables['node']->bundle() !== 'news_item' + ) { + return; + } + + // Attach the updating news table of contents library to the news item page. + $variables['#attached']['library'][] = 'hdbt_subtheme/updating-news-table-of-contents'; +} diff --git a/public/themes/custom/hdbt_subtheme/src/js/.keepme b/public/themes/custom/hdbt_subtheme/src/js/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js new file mode 100644 index 000000000..c6b0b6c40 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js @@ -0,0 +1,76 @@ +'use strict'; + +(function (Drupal, once) { + Drupal.behaviors.updating_news_table_of_contents = { + attach: function attach() { + + const tableOfContentsNewsUpdates = document.getElementById('helfi-toc-table-of-contents-news-updates'); + + // Bail if table of contents is not enabled. + if (!tableOfContentsNewsUpdates) { + return; + } + + const tableOfContentsList = document.querySelector('#helfi-toc-table-of-contents-list > ul'); + const mainContent = document.querySelector('main.layout-main-wrapper'); + const reservedElems = document.querySelectorAll('[id]'); + reservedElems.forEach(function (elem) { + Drupal.tableOfContents.reservedIds.push(elem.id); + }); + let exclusions = Drupal.tableOfContents.exclusions(); + + // Add exclusions for the news updates table of contents. + exclusions += + ':not(.components--upper *)' + + ':not(.component--remote-video *)' + + ':not(.component--text *)' + + ':not(.component--banner *)' + + ':not(.component--image *)' + + ':not(.block--news-of-interest *)' + + ':not(#helfi-toc-table-of-contents-news-updates *)'; + + // Craft table of contents for news item. + once('updating-news-table-of-contents', Drupal.tableOfContents.titleComponents(exclusions).join(','), mainContent) + .forEach(function (content) { + + const { nodeName, anchorName} = Drupal.tableOfContents.createTableOfContentElements(content, []); + + // On updating news there is published date under the title that we want to display in the + // table of contents news update version. For normal table of contents this remains empty. + let contentPublishDate = ''; + + if (tableOfContentsNewsUpdates && content.nextSibling && content.nextElementSibling.nodeName === 'TIME') { + let contentPublishDateStamp = new Date(content.nextElementSibling.dateTime); + contentPublishDate = `${contentPublishDateStamp.getDate()}.${contentPublishDateStamp.getMonth() + 1}.${contentPublishDateStamp.getFullYear()}`; + } + + // Create table of contents if component is enabled. + if (tableOfContentsList && nodeName === 'h2') { + let listItem = document.createElement('li'); + listItem.classList.add('table-of-contents__item'); + + // Add content publish date and its wrapper to list items only if they exist. + if (contentPublishDate) { + let publishDate = document.createElement('time'); + publishDate.dateTime = content.nextElementSibling.dateTime; + publishDate.textContent = contentPublishDate; + listItem.appendChild(publishDate); + } + + let link = document.createElement('a'); + link.classList.add('table-of-contents__link'); + link.href = `#${anchorName}`; + link.textContent = content.textContent.trim(); + + listItem.appendChild(link); + tableOfContentsList.appendChild(listItem); + } + } + ); + + if (tableOfContentsNewsUpdates) { + Drupal.tableOfContents.updateTOC(tableOfContentsNewsUpdates); + } + }, + }; +})(Drupal, once); From 03ba93b6988a4c5d1ea5b59be0bda803fb7eda9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 17 May 2024 12:35:06 +0300 Subject: [PATCH 10/12] UHF-9739: Added dist. --- .../custom/hdbt_subtheme/dist/css/styles.min.css | 2 +- .../dist/js/updatingNewsTableOfContents.min.js | 1 + public/themes/custom/hdbt_subtheme/package-lock.json | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js diff --git a/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css b/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css index f3c8378a9..53b7534f8 100644 --- a/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css +++ b/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css @@ -1 +1 @@ -.block--news-of-interest,.block--main-news{padding-left:16px;padding-right:16px;max-width:1296px;margin-top:32px;margin:auto;width:100%}@media(min-width: 768px){.block--news-of-interest,.block--main-news{padding-left:32px;padding-right:32px}}@media(min-width: 768px){.block--news-of-interest,.block--main-news{max-width:1328px}}@media(min-width: 992px){.block--news-of-interest,.block--main-news{margin-top:64px}}.block--news-of-interest h2,.block--main-news h2{margin-bottom:48px;margin-top:0}.component--current{background-color:var(--hdbt-color-palette--secondary);color:var(--hdbt-color-palette-text--secondary)}.current__content{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;max-width:1264px}@media(min-width: 768px){.current__content{flex-direction:row}}.current__links-container{padding-bottom:16px;padding-top:16px}@media(min-width: 576px){.current__links-container{padding-bottom:24px;padding-top:24px}}@media(min-width: 768px){.current__links-container{padding-right:16px}}@media(min-width: 992px){.current__links-container{padding-bottom:48px;padding-top:48px}}@media(min-width: 992px){.current__links-container{padding-bottom:64px;padding-top:64px}}.current{display:flex;flex-direction:column}@media(min-width: 768px){.current__illustration-container{margin-left:auto;margin-top:-32px}}@media(min-width: 992px){.current__illustration-container{margin-top:-48px}}@media(min-width: 1248px){.current__illustration-container{margin-top:-64px}}.current__seasonal-illustration{aspect-ratio:1;display:block;width:258px}@media(min-width: 992px){.current__seasonal-illustration{width:378px}}@media(min-width: 1248px){.current__seasonal-illustration{width:486px}}.component--latest-news .hds-button .hel-icon{transition:transform .2s linear;transform:scaleX(1);transform:scaleX(var(--lang-direction, 1))}@media(prefers-reduced-motion){.component--latest-news .hds-button .hel-icon{transition:none}}[dir="ltr"] .component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin-right:8px}[dir="rtl"] .component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin-left:8px}.component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin:0}.component--latest-news .hds-button:focus .hel-icon,.component--latest-news .hds-button:hover .hel-icon{transform:scaleX(1) translateX(4px);transform:scaleX(var(--lang-direction, 1)) translateX(4px)}@media(prefers-reduced-motion){.component--latest-news .hds-button:focus .hel-icon,.component--latest-news .hds-button:hover .hel-icon{transform:none}} +.table-of-contents--news-update{padding-left:16px;padding-right:16px;--item-title-lineheight: 1.875rem}@media(min-width: 768px){.table-of-contents--news-update{padding-left:32px;padding-right:32px}}[dir="ltr"] .table-of-contents--news-update .table-of-contents__container{border-left:none}[dir="rtl"] .table-of-contents--news-update .table-of-contents__container{border-right:none}.table-of-contents--news-update .table-of-contents__title+.table-of-contents__content{padding-top:16px}.table-of-contents--news-update .table-of-contents__item{--line-height: 1.5;font-size:1.25rem;font-weight:500;line-height:var(--line-height);display:flex;flex-direction:column;padding-top:16px;padding-bottom:16px;padding-left:16px;padding-right:16px;position:relative}@media(min-width: 768px){.table-of-contents--news-update .table-of-contents__item{flex-direction:row}}[dir="ltr"] .table-of-contents--news-update .table-of-contents__item::before,[dir="ltr"] .table-of-contents--news-update .table-of-contents__item::after{left:8px}[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::before,[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::after{right:8px}.table-of-contents--news-update .table-of-contents__item::before,.table-of-contents--news-update .table-of-contents__item::after{content:"";display:block;position:absolute}[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::before,[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::after{right:8px}.table-of-contents--news-update .table-of-contents__item::after{background-color:#000;height:calc(100% + 32px + 8px);top:-16px;transform:translateX(calc(var(--lang-direction) * -50%));width:2px;z-index:0}.table-of-contents--news-update .table-of-contents__item:first-of-type::after{height:100%;top:calc(16px + var(--item-title-lineheight)*.5)}.table-of-contents--news-update .table-of-contents__item:last-of-type::after{height:calc(16px + var(--item-title-lineheight)*.5)}.table-of-contents--news-update .table-of-contents__item:only-child::after{display:none}.table-of-contents--news-update .table-of-contents__item::before{background-color:#fff;border:3px solid #000;border-radius:50%;height:16px;top:calc(16px + var(--item-title-lineheight)*.5);transform:translate(calc(var(--lang-direction) * -50%), -50%);width:16px;z-index:1}.table-of-contents--news-update time{padding-left:16px}[dir="rtl"] .table-of-contents--news-update time{padding-left:0;padding-right:16px}.table-of-contents--news-update .table-of-contents__link{margin-left:16px}@media(min-width: 768px){.table-of-contents--news-update .table-of-contents__link{margin-left:32px}}[dir="rtl"] .table-of-contents--news-update .table-of-contents__link{margin-left:0;margin-right:16px}@media(min-width: 768px){[dir="rtl"] .table-of-contents--news-update .table-of-contents__link{margin-right:32px}}.block--news-of-interest,.block--main-news{padding-left:16px;padding-right:16px;max-width:1296px;margin-top:32px;margin:auto;width:100%}@media(min-width: 768px){.block--news-of-interest,.block--main-news{padding-left:32px;padding-right:32px}}@media(min-width: 768px){.block--news-of-interest,.block--main-news{max-width:1328px}}@media(min-width: 992px){.block--news-of-interest,.block--main-news{margin-top:64px}}.block--news-of-interest h2,.block--main-news h2{margin-bottom:48px;margin-top:0}.component--current{background-color:var(--hdbt-color-palette--secondary);color:var(--hdbt-color-palette-text--secondary)}.current__content{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;max-width:1264px}@media(min-width: 768px){.current__content{flex-direction:row}}.current__links-container{padding-bottom:16px;padding-top:16px}@media(min-width: 576px){.current__links-container{padding-bottom:24px;padding-top:24px}}@media(min-width: 768px){.current__links-container{padding-right:16px}}@media(min-width: 992px){.current__links-container{padding-bottom:48px;padding-top:48px}}@media(min-width: 992px){.current__links-container{padding-bottom:64px;padding-top:64px}}.current{display:flex;flex-direction:column}@media(min-width: 768px){.current__illustration-container{margin-left:auto;margin-top:-32px}}@media(min-width: 992px){.current__illustration-container{margin-top:-48px}}@media(min-width: 1248px){.current__illustration-container{margin-top:-64px}}.current__seasonal-illustration{aspect-ratio:1;display:block;width:258px}@media(min-width: 992px){.current__seasonal-illustration{width:378px}}@media(min-width: 1248px){.current__seasonal-illustration{width:486px}}.component--latest-news .hds-button .hel-icon{transition:transform .2s linear;transform:scaleX(1);transform:scaleX(var(--lang-direction, 1))}@media(prefers-reduced-motion){.component--latest-news .hds-button .hel-icon{transition:none}}[dir="ltr"] .component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin-right:8px}[dir="rtl"] .component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin-left:8px}.component--latest-news .hds-button .hel-icon:last-of-type:not(:first-of-type){margin:0}.component--latest-news .hds-button:focus .hel-icon,.component--latest-news .hds-button:hover .hel-icon{transform:scaleX(1) translateX(4px);transform:scaleX(var(--lang-direction, 1)) translateX(4px)}@media(prefers-reduced-motion){.component--latest-news .hds-button:focus .hel-icon,.component--latest-news .hds-button:hover .hel-icon{transform:none}}.component--news-update{border-bottom:1px solid #ccc;padding-bottom:32px}@media(min-width: 768px){.component--news-update{padding-bottom:48px}}.component--news-update time{--line-height: 1.5555555556;font-size:1.125rem;font-weight:400;line-height:var(--line-height);display:inline-block;margin-top:16px}.component--news-update .component__content{margin-top:32px}@media(min-width: 768px){.component--news-update .component__content{margin-top:48px}}*~.component--news-update,.component--news-update~.component--news-update{margin-top:32px}@media(min-width: 768px){*~.component--news-update,.component--news-update~.component--news-update{margin-top:48px}} diff --git a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js new file mode 100644 index 000000000..ae105e822 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js @@ -0,0 +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 l=Drupal.tableOfContents.exclusions();l+=":not(.components--upper *):not(.component--remote-video *):not(.component--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(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 diff --git a/public/themes/custom/hdbt_subtheme/package-lock.json b/public/themes/custom/hdbt_subtheme/package-lock.json index 31abbcc53..765f4e3b0 100644 --- a/public/themes/custom/hdbt_subtheme/package-lock.json +++ b/public/themes/custom/hdbt_subtheme/package-lock.json @@ -3343,9 +3343,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001564", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz", - "integrity": "sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==", + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==", "funding": [ { "type": "opencollective", @@ -13196,9 +13196,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001564", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz", - "integrity": "sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==" + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==" }, "chalk": { "version": "2.4.2", From bfd6f75130b9676f08bd8b2dd7928c4e3168e178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 17 May 2024 13:02:48 +0300 Subject: [PATCH 11/12] UHF-9739: Added configurations for updating news items. --- ...ty_form_display.node.news_item.default.yml | 40 ++++++++++++- ..._display.paragraph.news_update.default.yml | 56 +++++++++++++++++++ ...iew_display.node.news_item.card_teaser.yml | 4 +- ...ty_view_display.node.news_item.default.yml | 14 ++++- ...w_display.node.news_item.medium_teaser.yml | 4 +- ...ity_view_display.node.news_item.teaser.yml | 4 +- ...iew_display.node.news_item.tiny_teaser.yml | 4 +- ..._display.paragraph.news_update.default.yml | 47 ++++++++++++++++ ..._display.paragraph.news_update.preview.yml | 48 ++++++++++++++++ ...ews_item.field_news_item_updating_news.yml | 33 +++++++++++ ...aragraph.news_update.field_news_update.yml | 48 ++++++++++++++++ ...aph.news_update.field_news_update_date.yml | 26 +++++++++ ...ph.news_update.field_news_update_title.yml | 21 +++++++ ...orage.node.field_news_item_links_title.yml | 2 +- ...age.node.field_news_item_updating_news.yml | 23 ++++++++ .../field.storage.node.field_short_title.yml | 2 +- ...ld.storage.paragraph.field_news_update.yml | 22 ++++++++ ...orage.paragraph.field_news_update_date.yml | 22 ++++++++ ...rage.paragraph.field_news_update_title.yml | 23 ++++++++ ...ty_form_display.node.news_item.default.yml | 4 ++ ..._display.paragraph.news_update.default.yml | 5 ++ ...ode.news_item.field_main_image_caption.yml | 2 +- ...e.news_item.field_news_item_links_link.yml | 2 +- ...ews_item.field_news_item_updating_news.yml | 1 + ...aragraph.news_update.field_news_update.yml | 1 + ...aph.news_update.field_news_update_date.yml | 2 + ...ph.news_update.field_news_update_title.yml | 2 + ...paragraphs.paragraphs_type.news_update.yml | 1 + ...paragraphs.paragraphs_type.news_update.yml | 12 ++++ 29 files changed, 463 insertions(+), 12 deletions(-) create mode 100644 conf/cmi/core.entity_form_display.paragraph.news_update.default.yml create mode 100644 conf/cmi/core.entity_view_display.paragraph.news_update.default.yml create mode 100644 conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml create mode 100644 conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml create mode 100644 conf/cmi/field.field.paragraph.news_update.field_news_update.yml create mode 100644 conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml create mode 100644 conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml create mode 100644 conf/cmi/field.storage.node.field_news_item_updating_news.yml create mode 100644 conf/cmi/field.storage.paragraph.field_news_update.yml create mode 100644 conf/cmi/field.storage.paragraph.field_news_update_date.yml create mode 100644 conf/cmi/field.storage.paragraph.field_news_update_title.yml create mode 100644 conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml create mode 100644 conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml create mode 100644 conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml create mode 100644 conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml create mode 100644 conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml create mode 100644 conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml create mode 100644 conf/cmi/paragraphs.paragraphs_type.news_update.yml diff --git a/conf/cmi/core.entity_form_display.node.news_item.default.yml b/conf/cmi/core.entity_form_display.node.news_item.default.yml index 4d12f36bd..778eed0d8 100644 --- a/conf/cmi/core.entity_form_display.node.news_item.default.yml +++ b/conf/cmi/core.entity_form_display.node.news_item.default.yml @@ -11,6 +11,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -23,9 +24,9 @@ dependencies: - paragraphs - path - publication_date + - radioactivity - scheduler - select2 - - radioactivity third_party_settings: field_group: group_news_item_links: @@ -74,8 +75,23 @@ third_party_settings: open: false description: '' required_fields: true + group_updating_news: + children: + - field_news_item_updating_news + label: 'Updating news' + region: content + parent_name: '' + weight: 17 + format_type: details + format_settings: + classes: '' + show_empty_fields: true + id: '' + open: false + description: "Leave the content region above the updating news blank if you are creating an updating news.
\r\nAdd the latest news update at the end. The system will display updates on the page in reverse order." + required_fields: false _core: - default_config_hash: RHDFf9pvwgV2FvoelXlH7dXXBoWkziCZI1FWuQS94k8 + default_config_hash: dW1Kmx2dOCHZosI85sWLQGupPRXvS8NL-lmM_O44boc id: node.news_item.default targetEntityType: node bundle: news_item @@ -167,6 +183,26 @@ content: match_operator: CONTAINS match_limit: 10 third_party_settings: { } + field_news_item_updating_news: + type: paragraphs + weight: 17 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: _none + features: + add_above: '0' + collapse_edit_all: '0' + convert: '0' + duplicate: '0' + third_party_settings: { } field_news_neighbourhoods: type: select2_entity_reference weight: 27 diff --git a/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml b/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..583d33106 --- /dev/null +++ b/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,56 @@ +uuid: 01df54cb-c5ac-4cab-bd27-787f2bdc93b1 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - paragraphs +_core: + default_config_hash: XYIUl3_cuml3-BGICqIzW8RWixphDQihgi01ZCJMBig +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: paragraphs + weight: 2 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: text + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + convert: '0' + duplicate: duplicate + third_party_settings: { } + field_news_update_date: + type: datetime_default + weight: 1 + region: content + settings: { } + third_party_settings: { } + field_news_update_title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml index 8d1a4d170..1e3799493 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -21,7 +22,7 @@ dependencies: - media - user _core: - default_config_hash: rw0HQtg75-HvNXykEGQqCuDsOe_-6GcUpKGnrZVOnSs + default_config_hash: Mr1QBPHLSABqi-fUL-8TBc8xRHxfVs5cf0QbTjXomDc id: node.news_item.card_teaser targetEntityType: node bundle: news_item @@ -83,6 +84,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.default.yml b/conf/cmi/core.entity_view_display.node.news_item.default.yml index 399b748a4..caac56fee 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.default.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.default.yml @@ -11,6 +11,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -19,10 +20,10 @@ dependencies: - entity_reference_revisions - helfi_platform_config - link - - user - radioactivity + - user _core: - default_config_hash: fHNnwg186A981K7d578If1MCkuYBmQqaxabpDSAZwIc + default_config_hash: SfHQKCP8IzTidLziyYN4o4WUK7vzqFrvkFtTa01dQYE id: node.news_item.default targetEntityType: node bundle: news_item @@ -96,6 +97,15 @@ content: third_party_settings: { } weight: 11 region: content + field_news_item_updating_news: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 13 + region: content field_news_neighbourhoods: type: entity_reference_label label: above diff --git a/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml index 72c3c323c..b42539cbc 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -19,7 +20,7 @@ dependencies: module: - user _core: - default_config_hash: iOyy_v6RDb2ia9ioF-Q-IJqILz-pPRMc9MgQTbvggIM + default_config_hash: fjYLz2RVZIouftKpPNS0o-JnsSAxBe8YiUDps3NbhSg id: node.news_item.medium_teaser targetEntityType: node bundle: news_item @@ -73,6 +74,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.teaser.yml index 38c929cb5..1273ee9ca 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.teaser.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -19,7 +20,7 @@ dependencies: module: - user _core: - default_config_hash: y7-XNi5JaI60YIxmANoDIqzZ09lyzAiFwhYNEyO4nDc + default_config_hash: gOi3OpZskrzmvZPMzBgPX5pDCAgJhTEQKkR3Ka66jfY id: node.news_item.teaser targetEntityType: node bundle: news_item @@ -81,6 +82,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml index ede7393a4..77c6915af 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -19,7 +20,7 @@ dependencies: module: - user _core: - default_config_hash: k8a-Ho8gCsq1hUA_KlWab29egZov57JPtywUawPbYHU + default_config_hash: GZ4RFPkRq0OjD31t8jG9R5KZvzi7xhjM1-7kONczzrA id: node.news_item.tiny_teaser targetEntityType: node bundle: news_item @@ -69,6 +70,7 @@ hidden: field_news_item_links_link: true field_news_item_links_title: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml b/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..f6291b972 --- /dev/null +++ b/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml @@ -0,0 +1,47 @@ +uuid: a0d41678-10a0-4519-be98-d17f3051a687 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +_core: + default_config_hash: 4u5e96aoW-RpNubuc3W4Hy-4UbKXdL-iIQU9bINu8X0 +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_default + label: hidden + settings: + timezone_override: '' + format_type: publication_date_format + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml b/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml new file mode 100644 index 000000000..8de987f3f --- /dev/null +++ b/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml @@ -0,0 +1,48 @@ +uuid: e6f7408a-1e53-4af0-97eb-5122f611d019 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.paragraph.preview + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +_core: + default_config_hash: 4u5e96aoW-RpNubuc3W4Hy-4UbKXdL-iIQU9bINu8X0 +id: paragraph.news_update.preview +targetEntityType: paragraph +bundle: news_update +mode: preview +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_custom + label: hidden + settings: + timezone_override: '' + date_format: U + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml b/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9e73cb66b --- /dev/null +++ b/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1,33 @@ +uuid: badac28d-62bc-4e48-94de-9ccc20dc44a7 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_news_item_updating_news + - node.type.news_item + - paragraphs.paragraphs_type.news_update + module: + - entity_reference_revisions +_core: + default_config_hash: tBaSkG3CaeSEpEZhLsNOBP58k2UVhfIMU0Y-kMr929w +id: node.news_item.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +bundle: news_item +label: Content +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + news_update: news_update + negate: 0 + target_bundles_drag_drop: + news_update: + weight: 52 + enabled: true +field_type: entity_reference_revisions diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..5203de307 --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1,48 @@ +uuid: b50d682f-ff11-481c-af5b-51192a655696 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update + - paragraphs.paragraphs_type.banner + - paragraphs.paragraphs_type.image + - paragraphs.paragraphs_type.news_update + - paragraphs.paragraphs_type.remote_video + - paragraphs.paragraphs_type.text + module: + - entity_reference_revisions +_core: + default_config_hash: yLDIO76pewsWmipYIxaOo5H7QA-p9My_0OBLAQkiaX8 +id: paragraph.news_update.field_news_update +field_name: field_news_update +entity_type: paragraph +bundle: news_update +label: 'News update' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + text: text + image: image + remote_video: remote_video + banner: banner + negate: 0 + target_bundles_drag_drop: + banner: + weight: 3 + enabled: true + image: + weight: 1 + enabled: true + remote_video: + weight: 2 + enabled: true + text: + weight: 0 + enabled: true +field_type: entity_reference_revisions diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..0701e0331 --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,26 @@ +uuid: 23a03e5f-7f4d-45f0-ad8d-76320b4cb880 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_date + - paragraphs.paragraphs_type.news_update + module: + - datetime +_core: + default_config_hash: Ly1VkuFJwtrKK5cwC3KPYiQHnu-7yMIdtRYg30y4X04 +id: paragraph.news_update.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +bundle: news_update +label: Date +description: 'The date will appear in the table of contents and below the title of the news update.' +required: true +translatable: false +default_value: + - + default_date_type: now + default_date: now +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..af864296d --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,21 @@ +uuid: bf3f766e-4a12-450f-8ffc-d162e9f7511a +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_title + - paragraphs.paragraphs_type.news_update +_core: + default_config_hash: JuvEWSSqz85sOqrdphxrT8zpS15NvTaKqykZBoH3dYU +id: paragraph.news_update.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +bundle: news_update +label: Title +description: 'Write the title of the news update. Remember to update the title of the page if necessary to reflect the updated content.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/conf/cmi/field.storage.node.field_news_item_links_title.yml b/conf/cmi/field.storage.node.field_news_item_links_title.yml index 76188743f..41f4e1343 100644 --- a/conf/cmi/field.storage.node.field_news_item_links_title.yml +++ b/conf/cmi/field.storage.node.field_news_item_links_title.yml @@ -12,8 +12,8 @@ entity_type: node type: string settings: max_length: 255 - case_sensitive: false is_ascii: false + case_sensitive: false module: core locked: false cardinality: 1 diff --git a/conf/cmi/field.storage.node.field_news_item_updating_news.yml b/conf/cmi/field.storage.node.field_news_item_updating_news.yml new file mode 100644 index 000000000..e683a54ea --- /dev/null +++ b/conf/cmi/field.storage.node.field_news_item_updating_news.yml @@ -0,0 +1,23 @@ +uuid: cf9d1751-254b-4997-8688-746777df2498 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +_core: + default_config_hash: KRgdSbSbLnaEGg2e1iOD-YPYnwEzKwefSjXZ9KkDjzc +id: node.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.node.field_short_title.yml b/conf/cmi/field.storage.node.field_short_title.yml index 5be8525d5..69a4287b7 100644 --- a/conf/cmi/field.storage.node.field_short_title.yml +++ b/conf/cmi/field.storage.node.field_short_title.yml @@ -12,8 +12,8 @@ entity_type: node type: string settings: max_length: 255 - case_sensitive: false is_ascii: false + case_sensitive: false module: core locked: false cardinality: 1 diff --git a/conf/cmi/field.storage.paragraph.field_news_update.yml b/conf/cmi/field.storage.paragraph.field_news_update.yml new file mode 100644 index 000000000..e344f7a46 --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update.yml @@ -0,0 +1,22 @@ +uuid: 21076eb0-779f-4178-a184-c8fd396219c1 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - paragraphs +_core: + default_config_hash: 4efvUKxnJHXJ6D143bvXle9gbX7HrDBqel69jmMR6QY +id: paragraph.field_news_update +field_name: field_news_update +entity_type: paragraph +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.paragraph.field_news_update_date.yml b/conf/cmi/field.storage.paragraph.field_news_update_date.yml new file mode 100644 index 000000000..526a78edc --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update_date.yml @@ -0,0 +1,22 @@ +uuid: 58a866e3-c277-40c2-ac1f-c55529be88e9 +langcode: en +status: true +dependencies: + module: + - datetime + - paragraphs +_core: + default_config_hash: pzDCwWp6M4gXZ7clZAJssm3h9PCyqfoqWBCM8eoou70 +id: paragraph.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.paragraph.field_news_update_title.yml b/conf/cmi/field.storage.paragraph.field_news_update_title.yml new file mode 100644 index 000000000..7bc05ce62 --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update_title.yml @@ -0,0 +1,23 @@ +uuid: 8bdb9cc3-8deb-44f4-b936-39e9a745dd10 +langcode: en +status: true +dependencies: + module: + - paragraphs +_core: + default_config_hash: s12tguXB_l2uSjVPAiZ2a0arAi8q9airYPeXJ3cgMwQ +id: paragraph.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml b/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml index ddec27707..e215e02c2 100644 --- a/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml +++ b/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml @@ -6,6 +6,10 @@ third_party_settings: label: Linkit group_main_image: label: Pääkuva + group_updating_news: + label: 'Päivittyvä uutinen' + format_settings: + description: 'Jätä sisältöalue tyhjäksi päivittyvän uutisen yläpuolelta, jos luot päivittyvän uutisen.
Lisää uusin uutispäivitys viimeiseksi. Järjestelmä näyttää päivitykset sivulla käänteisessä järjestyksessä.' content: field_content: settings: diff --git a/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml b/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..f95720cc1 --- /dev/null +++ b/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,5 @@ +content: + field_news_update: + settings: + title: Lohko + title_plural: Lohkot diff --git a/conf/cmi/language/fi/field.field.node.news_item.field_main_image_caption.yml b/conf/cmi/language/fi/field.field.node.news_item.field_main_image_caption.yml index d6356d8ad..85cbb7acb 100644 --- a/conf/cmi/language/fi/field.field.node.news_item.field_main_image_caption.yml +++ b/conf/cmi/language/fi/field.field.node.news_item.field_main_image_caption.yml @@ -1,2 +1,2 @@ label: Kuvateksti -description: 'Voit halutessasi kirjoittaa kuvatekstin kuvalle tähän.' +description: 'Kirjoita aina kuvateksti. Kuvaajan nimi ja kuvan alt-teksti tulevat kuvan tiedoista, joten niitä ei kirjoiteta tähän.' diff --git a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml index 4d8e877fd..6f8993a9a 100644 --- a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml +++ b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml @@ -1,2 +1,2 @@ label: Linkki -description: 'Lisää sisäisen tai ulkoisen linkin URL-osoite sekä sivulla näkyvä linkkiteksti.' +description: 'Sisäinen tai ulkoinen linkki haluttuun kohteeseen. Linkin teksti -kentän arvo näytetään sivuston käyttäjälle.' diff --git a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9d61cbc9a --- /dev/null +++ b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1 @@ +label: Sisältö diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..6aee2db50 --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,2 @@ +label: Ajankohta +description: 'Ajankohta näkyy sisällysluettelossa ja uutispäivityksen otsikon alla.' diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..224d385c6 --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,2 @@ +label: Otsikko +description: 'Kirjoita uutispäivityksen otsikko. Muista päivittää tarvittaessa myös koko uutisen otsikko vastaamaan päivitettyä sisältöä.' diff --git a/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml b/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/conf/cmi/paragraphs.paragraphs_type.news_update.yml b/conf/cmi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..2086c1348 --- /dev/null +++ b/conf/cmi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1,12 @@ +uuid: 85ec51ba-cfc6-491f-8528-3fa0ee65165f +langcode: en +status: true +dependencies: { } +_core: + default_config_hash: p0PyOpRZeZXz95QAVZLj0GnUPD8P3dRYAxtxIJSQqb0 +id: news_update +label: 'News update' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } From 34de314f6def41470fc0e63820353a4875eac08d Mon Sep 17 00:00:00 2001 From: hel-platta-automation <95360595+hel-platta-automation@users.noreply.github.com> Date: Mon, 20 May 2024 09:49:23 +0000 Subject: [PATCH 12/12] Update configuration --- composer.lock | 66 +++++++++++------------ docker/openshift/entrypoints/20-deploy.sh | 11 ++-- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/composer.lock b/composer.lock index 28dbd1e77..dc1e9313b 100644 --- a/composer.lock +++ b/composer.lock @@ -3823,16 +3823,16 @@ }, { "name": "drupal/hdbt", - "version": "6.5.10", + "version": "6.5.11", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "a1158717f670b8ff61243af8cefb51f557722edf" + "reference": "1bceace4bc51d2a6ebfc368434485cbea20c1d52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/a1158717f670b8ff61243af8cefb51f557722edf", - "reference": "a1158717f670b8ff61243af8cefb51f557722edf", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/1bceace4bc51d2a6ebfc368434485cbea20c1d52", + "reference": "1bceace4bc51d2a6ebfc368434485cbea20c1d52", "shasum": "" }, "require": { @@ -3850,23 +3850,23 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/6.5.10", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/6.5.11", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2024-05-07T08:17:22+00:00" + "time": "2024-05-20T09:37:47+00:00" }, { "name": "drupal/hdbt_admin", - "version": "3.1.6", + "version": "3.1.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt-admin.git", - "reference": "96f29332a57540bda695cd53e5b288bc96960076" + "reference": "33a217058068330c90b049e539e91b19d24d933d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt-admin/zipball/96f29332a57540bda695cd53e5b288bc96960076", - "reference": "96f29332a57540bda695cd53e5b288bc96960076", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt-admin/zipball/33a217058068330c90b049e539e91b19d24d933d", + "reference": "33a217058068330c90b049e539e91b19d24d933d", "shasum": "" }, "require": { @@ -3885,10 +3885,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt-admin/tree/3.1.6", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt-admin/tree/3.1.7", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt-admin/issues" }, - "time": "2024-04-11T13:46:53+00:00" + "time": "2024-05-20T09:40:02+00:00" }, { "name": "drupal/health_check", @@ -4147,16 +4147,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "4.3.54", + "version": "4.3.55", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "7e54899eea80996a9438465f247336fc2ebc0695" + "reference": "20d94f8c39b204768df18d4af0e521aa9efb0b37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/7e54899eea80996a9438465f247336fc2ebc0695", - "reference": "7e54899eea80996a9438465f247336fc2ebc0695", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/20d94f8c39b204768df18d4af0e521aa9efb0b37", + "reference": "20d94f8c39b204768df18d4af0e521aa9efb0b37", "shasum": "" }, "require": { @@ -4267,10 +4267,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.3.54", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.3.55", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2024-05-17T09:48:32+00:00" + "time": "2024-05-20T09:41:13+00:00" }, { "name": "drupal/helfi_proxy", @@ -8486,16 +8486,16 @@ }, { "name": "fileeye/mimemap", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/FileEye/MimeMap.git", - "reference": "4ea9ac8d7fc599fffe7108f8821a7b324b5d0af4" + "reference": "7992d33502de8a82065fd9fe2d2e2b1f7f33d1ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FileEye/MimeMap/zipball/4ea9ac8d7fc599fffe7108f8821a7b324b5d0af4", - "reference": "4ea9ac8d7fc599fffe7108f8821a7b324b5d0af4", + "url": "https://api.github.com/repos/FileEye/MimeMap/zipball/7992d33502de8a82065fd9fe2d2e2b1f7f33d1ce", + "reference": "7992d33502de8a82065fd9fe2d2e2b1f7f33d1ce", "shasum": "" }, "require": { @@ -8538,9 +8538,9 @@ ], "support": { "issues": "https://github.com/FileEye/MimeMap/issues", - "source": "https://github.com/FileEye/MimeMap/tree/2.1.0" + "source": "https://github.com/FileEye/MimeMap/tree/2.1.1" }, - "time": "2024-04-06T13:00:52+00:00" + "time": "2024-05-17T19:22:06+00:00" }, { "name": "fileeye/pel", @@ -8605,26 +8605,26 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.0", + "version": "v6.10.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" + "reference": "500501c2ce893c824c801da135d02661199f60c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5", + "reference": "500501c2ce893c824c801da135d02661199f60c5", "shasum": "" }, "require": { - "php": "^7.4||^8.0" + "php": "^8.0" }, "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", + "guzzlehttp/guzzle": "^7.4", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", + "psr/cache": "^2.0||^3.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0" }, @@ -8662,9 +8662,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.10.1" }, - "time": "2023-12-01T16:26:39+00:00" + "time": "2024-05-18T18:05:11+00:00" }, { "name": "galbar/jsonpath", diff --git a/docker/openshift/entrypoints/20-deploy.sh b/docker/openshift/entrypoints/20-deploy.sh index 6a0982412..4c02d6f1d 100644 --- a/docker/openshift/entrypoints/20-deploy.sh +++ b/docker/openshift/entrypoints/20-deploy.sh @@ -1,5 +1,11 @@ #!/bin/bash +# Skip deployment script if ENV var is true +if [ "$SKIP_DEPLOY_SCRIPTS" = "true" ]; then + echo "SKIP_DEPLOY_SCRIPTS is true. Skipping the steps." + return +fi + source /init.sh function rollback_deployment { @@ -36,10 +42,9 @@ if [ "$CURRENT_DEPLOY_ID" != "$OPENSHIFT_BUILD_NAME" ]; then # @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/deploy-hooks.md drush helfi:pre-deploy || true # Run maintenance tasks (config import, database updates etc) - drush deploy - + OUTPUT=$(sh -c '(drush deploy); exit $?' 2>&1) if [ $? -ne 0 ]; then - rollback_deployment "drush deploy failed with {$?} exit code. See logs for more information." $CURRENT_DEPLOY_ID + rollback_deployment "drush deploy failed with {$?} exit code. ${OUTPUT}" $CURRENT_DEPLOY_ID exit 1 fi # Run post-deploy tasks.