From 2a6c2199f885fe25a876e8dc4174cfcf30b8ffda Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 28 Nov 2023 13:09:56 +0200 Subject: [PATCH 1/9] UHF-9249: Added description override field and hid it by default from form and view. --- ...form_display.tpr_unit.tpr_unit.default.yml | 1 + ...view_display.tpr_unit.tpr_unit.default.yml | 1 + ...view_display.tpr_unit.tpr_unit.minimal.yml | 1 + ..._view_display.tpr_unit.tpr_unit.teaser.yml | 1 + ...ay.tpr_unit.tpr_unit.teaser_with_image.yml | 1 + ..._display.tpr_unit.tpr_unit.wide_teaser.yml | 1 + .../helfi_tpr_config/helfi_tpr_config.install | 21 +++++++++++++++++++ .../helfi_tpr_config/helfi_tpr_config.module | 12 ++++++++++- 8 files changed, 38 insertions(+), 1 deletion(-) diff --git a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml index 84c353d4b..cab432654 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml @@ -403,6 +403,7 @@ content: third_party_settings: { } hidden: created: true + description_override: true hide_description: true ontologyword_ids: true show_www: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml index e3f355ee8..2fedb3f6b 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml @@ -282,6 +282,7 @@ content: region: content hidden: created: true + description_override: true field_unit_type: true hide_description: true langcode: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml index bb98746ba..5e103923d 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml @@ -47,6 +47,7 @@ hidden: call_charge_info: true created: true description: true + description_override: true email: true field_content: true field_lower_content: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml index 42138863a..ad113376f 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml @@ -67,6 +67,7 @@ hidden: call_charge_info: true created: true description: true + description_override: true email: true field_content: true field_lower_content: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml index 9562ced4f..37fd91f24 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml @@ -68,6 +68,7 @@ hidden: call_charge_info: true created: true description: true + description_override: true email: true field_content: true field_lower_content: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml index 7f0b44025..c0e36d13d 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml @@ -83,6 +83,7 @@ hidden: call_charge_info: true created: true description: true + description_override: true email: true field_content: true field_lower_content: true diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index c4ef37525..5f6b4acbc 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -358,3 +358,24 @@ function helfi_tpr_config_update_9050(): void { function helfi_tpr_config_update_9051(): void { helfi_platform_config_update_paragraph_target_types(); } + +/** + * UHF-9249: Add an override field for description. + */ +function helfi_tpr_config_update_9052() : void { + $description_override = BaseFieldDefinition::create('text_long') + ->setTranslatable(TRUE) + ->setRevisionable(FALSE) + ->setLabel(new TranslatableMarkup('Description override')) + ->setDescription(new TranslatableMarkup('Overrides the description.')) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayConfigurable('view', TRUE) + ->setSetting('allowed_formats', [0 => 'full_html']); + + \Drupal::entityDefinitionUpdateManager() + ->installFieldStorageDefinition('description_override', 'tpr_unit', 'helfi_tpr_config', $description_override); + + // Re-import 'helfi_tpr_config' configuration. + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_tpr_config'); +} diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 783f3a7ed..98b2d2bd5 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -504,7 +504,17 @@ function helfi_tpr_config_entity_base_field_info(EntityTypeInterface $entity_typ 'weight' => 5, ]) ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); + ->setDisplayConfigurable('view', TRUE) + ->setSetting('allowed_formats', [0 => 'plain_text']); + + $fields['description_override'] = BaseFieldDefinition::create('text_long') + ->setTranslatable(TRUE) + ->setRevisionable(FALSE) + ->setLabel(new TranslatableMarkup('Description override')) + ->setDescription(new TranslatableMarkup('Overrides the description.')) + ->setDisplayConfigurable('form', TRUE) + ->setDisplayConfigurable('view', TRUE) + ->setSetting('allowed_formats', [0 => 'full_html']); } return $fields; } From b12b068be084cfd416dc78e54ec91a3a96573986 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:39:42 +0200 Subject: [PATCH 2/9] UHF-9249: Changed the field type. --- modules/helfi_tpr_config/helfi_tpr_config.install | 2 +- modules/helfi_tpr_config/helfi_tpr_config.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index 5f6b4acbc..35428ff80 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -363,7 +363,7 @@ function helfi_tpr_config_update_9051(): void { * UHF-9249: Add an override field for description. */ function helfi_tpr_config_update_9052() : void { - $description_override = BaseFieldDefinition::create('text_long') + $description_override = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) ->setLabel(new TranslatableMarkup('Description override')) diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 98b2d2bd5..00d3f14d3 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -507,7 +507,7 @@ function helfi_tpr_config_entity_base_field_info(EntityTypeInterface $entity_typ ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'plain_text']); - $fields['description_override'] = BaseFieldDefinition::create('text_long') + $fields['description_override'] = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) ->setLabel(new TranslatableMarkup('Description override')) From e36b2ee48c0ed54932357c05a130119cbd041a02 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Tue, 5 Dec 2023 15:40:54 +0200 Subject: [PATCH 3/9] UHF-9249: Added final texts and translations for the field label and description. --- modules/helfi_tpr_config/helfi_tpr_config.install | 4 ++-- modules/helfi_tpr_config/helfi_tpr_config.module | 4 ++-- modules/helfi_tpr_config/translations/fi.po | 6 ++++++ modules/helfi_tpr_config/translations/sv.po | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index 35428ff80..f8d6448d4 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -366,8 +366,8 @@ function helfi_tpr_config_update_9052() : void { $description_override = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) - ->setLabel(new TranslatableMarkup('Description override')) - ->setDescription(new TranslatableMarkup('Overrides the description.')) + ->setLabel(new TranslatableMarkup('Override: Description')) + ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this will overwrite it.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'full_html']); diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 00d3f14d3..3a3a446ab 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -510,8 +510,8 @@ function helfi_tpr_config_entity_base_field_info(EntityTypeInterface $entity_typ $fields['description_override'] = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) - ->setLabel(new TranslatableMarkup('Description override')) - ->setDescription(new TranslatableMarkup('Overrides the description.')) + ->setLabel(new TranslatableMarkup('Override: Description')) + ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this will overwrite it.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'full_html']); diff --git a/modules/helfi_tpr_config/translations/fi.po b/modules/helfi_tpr_config/translations/fi.po index 0a4499def..a095426a5 100644 --- a/modules/helfi_tpr_config/translations/fi.po +++ b/modules/helfi_tpr_config/translations/fi.po @@ -6,3 +6,9 @@ msgstr "Piilota palvelupaikkojen listaus" msgid "Select this if you link from the page to a filter search or another listing." msgstr "Valitse tämä, jos linkität sivulta palvelupaikkojen suodatushakuun tai muuhun listaukseen." + +msgid "Override: Description" +msgstr "Ylikirjoita: Kuvaus" + +msgid "Add or overwrite the description text. If a description is provided by TPR, this will overwrite it." +msgstr "Lisää tai ylikirjoita kuvausteksti. Jos TPR:stä tulee kuvausteksti, tämä ylikirjoittaa sen." diff --git a/modules/helfi_tpr_config/translations/sv.po b/modules/helfi_tpr_config/translations/sv.po index 64c6879b9..9051c6b29 100644 --- a/modules/helfi_tpr_config/translations/sv.po +++ b/modules/helfi_tpr_config/translations/sv.po @@ -6,3 +6,9 @@ msgstr "Dölj listan om serviceställen" msgid "Select this if you link from the page to a filter search or another listing." msgstr "Välj detta om du länkar från sidan till en filtersökning eller till en separat lista." + +msgid "Override: Description" +msgstr "Skriv över: Beskrivning" + +msgid "Add or overwrite the description text. If a description is provided by TPR, this will overwrite it." +msgstr "Lägg till eller skriv över beskrivningstexten. Om en beskrivning finns från TPR kommer den att skrivas över av denna." From 1158ac6f8af3668562fd45f26258e6be82f94ace Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:24:52 +0200 Subject: [PATCH 4/9] UHF-9249: Display description override field in all instances. Switched the text format to plain text. --- ...core.entity_form_display.tpr_unit.tpr_unit.default.yml | 8 ++++++++ ...core.entity_view_display.tpr_unit.tpr_unit.default.yml | 7 +++++++ modules/helfi_tpr_config/helfi_tpr_config.install | 2 +- modules/helfi_tpr_config/helfi_tpr_config.module | 4 ++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml index cab432654..78ff3f995 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml @@ -100,6 +100,14 @@ content: formatter_settings: { } show_description: false third_party_settings: { } + description_override: + type: text_textarea + weight: 19 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } email: type: readonly_field_widget weight: 10 diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml index 2fedb3f6b..b2377ece4 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml @@ -92,6 +92,13 @@ content: third_party_settings: { } weight: 2 region: content + description_override: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content email: type: string label: hidden diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index f8d6448d4..b2f6908d0 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -370,7 +370,7 @@ function helfi_tpr_config_update_9052() : void { ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this will overwrite it.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) - ->setSetting('allowed_formats', [0 => 'full_html']); + ->setSetting('allowed_formats', [0 => 'plain_text']); \Drupal::entityDefinitionUpdateManager() ->installFieldStorageDefinition('description_override', 'tpr_unit', 'helfi_tpr_config', $description_override); diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 3a3a446ab..8cbd4f5d7 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -511,10 +511,10 @@ function helfi_tpr_config_entity_base_field_info(EntityTypeInterface $entity_typ ->setTranslatable(TRUE) ->setRevisionable(FALSE) ->setLabel(new TranslatableMarkup('Override: Description')) - ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this will overwrite it.')) + ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this field does not do anything.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) - ->setSetting('allowed_formats', [0 => 'full_html']); + ->setSetting('allowed_formats', [0 => 'plain_text']); } return $fields; } From 405c9102e2d1a01e448ee633ffe6bfc2373cf4bc Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:27:18 +0200 Subject: [PATCH 5/9] UHF-9249: Renamed the field and updated the texts. --- ...y_form_display.tpr_unit.tpr_unit.default.yml | 17 ++++++++--------- ...y_view_display.tpr_unit.tpr_unit.default.yml | 15 +++++++-------- ...y_view_display.tpr_unit.tpr_unit.minimal.yml | 2 +- ...ty_view_display.tpr_unit.tpr_unit.teaser.yml | 2 +- ...play.tpr_unit.tpr_unit.teaser_with_image.yml | 2 +- ...ew_display.tpr_unit.tpr_unit.wide_teaser.yml | 2 +- .../helfi_tpr_config/helfi_tpr_config.install | 8 ++++---- .../helfi_tpr_config/helfi_tpr_config.module | 6 +++--- modules/helfi_tpr_config/translations/fi.po | 8 ++++---- modules/helfi_tpr_config/translations/sv.po | 4 ++-- 10 files changed, 32 insertions(+), 34 deletions(-) diff --git a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml index 78ff3f995..8d2f1922c 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml @@ -100,14 +100,6 @@ content: formatter_settings: { } show_description: false third_party_settings: { } - description_override: - type: text_textarea - weight: 19 - region: content - settings: - rows: 5 - placeholder: '' - third_party_settings: { } email: type: readonly_field_widget weight: 10 @@ -118,6 +110,14 @@ content: formatter_settings: { } show_description: false third_party_settings: { } + enrich_description: + type: text_textarea + weight: 19 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } field_content: type: paragraphs weight: 28 @@ -411,7 +411,6 @@ content: third_party_settings: { } hidden: created: true - description_override: true hide_description: true ontologyword_ids: true show_www: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml index b2377ece4..c1953c5d2 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.default.yml @@ -92,13 +92,6 @@ content: third_party_settings: { } weight: 2 region: content - description_override: - type: text_default - label: hidden - settings: { } - third_party_settings: { } - weight: 3 - region: content email: type: string label: hidden @@ -107,6 +100,13 @@ content: third_party_settings: { } weight: 8 region: content + enrich_description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content field_content: type: entity_reference_revisions_entity_view label: hidden @@ -289,7 +289,6 @@ content: region: content hidden: created: true - description_override: true field_unit_type: true hide_description: true langcode: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml index 5e103923d..a96442340 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.minimal.yml @@ -47,8 +47,8 @@ hidden: call_charge_info: true created: true description: true - description_override: true email: true + enrich_description: true field_content: true field_lower_content: true field_metatags: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml index ad113376f..288b4deb8 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser.yml @@ -67,8 +67,8 @@ hidden: call_charge_info: true created: true description: true - description_override: true email: true + enrich_description: true field_content: true field_lower_content: true field_metatags: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml index 37fd91f24..f4504044b 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.teaser_with_image.yml @@ -68,8 +68,8 @@ hidden: call_charge_info: true created: true description: true - description_override: true email: true + enrich_description: true field_content: true field_lower_content: true field_metatags: true diff --git a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml index c0e36d13d..110449244 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_view_display.tpr_unit.tpr_unit.wide_teaser.yml @@ -83,8 +83,8 @@ hidden: call_charge_info: true created: true description: true - description_override: true email: true + enrich_description: true field_content: true field_lower_content: true field_metatags: true diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index b2f6908d0..8d1cca44e 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -363,17 +363,17 @@ function helfi_tpr_config_update_9051(): void { * UHF-9249: Add an override field for description. */ function helfi_tpr_config_update_9052() : void { - $description_override = BaseFieldDefinition::create('text_with_summary') + $enrich_description = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) - ->setLabel(new TranslatableMarkup('Override: Description')) - ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this will overwrite it.')) + ->setLabel(new TranslatableMarkup('Long description (replacing missing information')) + ->setDescription(new TranslatableMarkup('Note! The content is displayed on the website only if the long description is missing from the data source.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'plain_text']); \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('description_override', 'tpr_unit', 'helfi_tpr_config', $description_override); + ->installFieldStorageDefinition('enrich_description', 'tpr_unit', 'helfi_tpr_config', $enrich_description); // Re-import 'helfi_tpr_config' configuration. \Drupal::service('helfi_platform_config.config_update_helper') diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 8cbd4f5d7..a1510b2ac 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -507,11 +507,11 @@ function helfi_tpr_config_entity_base_field_info(EntityTypeInterface $entity_typ ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'plain_text']); - $fields['description_override'] = BaseFieldDefinition::create('text_with_summary') + $fields['enrich_description'] = BaseFieldDefinition::create('text_with_summary') ->setTranslatable(TRUE) ->setRevisionable(FALSE) - ->setLabel(new TranslatableMarkup('Override: Description')) - ->setDescription(new TranslatableMarkup('Add or overwrite the description text. If a description is provided by TPR, this field does not do anything.')) + ->setLabel(new TranslatableMarkup('Long description (replacing missing information)')) + ->setDescription(new TranslatableMarkup('Note! The content is displayed on the website only if the long description is missing from the data source.')) ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) ->setSetting('allowed_formats', [0 => 'plain_text']); diff --git a/modules/helfi_tpr_config/translations/fi.po b/modules/helfi_tpr_config/translations/fi.po index a095426a5..8a16ee46a 100644 --- a/modules/helfi_tpr_config/translations/fi.po +++ b/modules/helfi_tpr_config/translations/fi.po @@ -7,8 +7,8 @@ msgstr "Piilota palvelupaikkojen listaus" msgid "Select this if you link from the page to a filter search or another listing." msgstr "Valitse tämä, jos linkität sivulta palvelupaikkojen suodatushakuun tai muuhun listaukseen." -msgid "Override: Description" -msgstr "Ylikirjoita: Kuvaus" +msgid "Long description (replacing missing information)" +msgstr "Pitkä kuvaus (vain puuttuvalle tiedolle)" -msgid "Add or overwrite the description text. If a description is provided by TPR, this will overwrite it." -msgstr "Lisää tai ylikirjoita kuvausteksti. Jos TPR:stä tulee kuvausteksti, tämä ylikirjoittaa sen." +msgid "Note! The content is displayed on the website only if the long description is missing from the data source." +msgstr "Huom! Kentän sisältö näytetään verkkosivulla vain, jos pitkä kuvaus puuttuu kokonaan lähdejärjestelmästä." diff --git a/modules/helfi_tpr_config/translations/sv.po b/modules/helfi_tpr_config/translations/sv.po index 9051c6b29..a152aab8c 100644 --- a/modules/helfi_tpr_config/translations/sv.po +++ b/modules/helfi_tpr_config/translations/sv.po @@ -8,7 +8,7 @@ msgid "Select this if you link from the page to a filter search or another listi msgstr "Välj detta om du länkar från sidan till en filtersökning eller till en separat lista." msgid "Override: Description" -msgstr "Skriv över: Beskrivning" +msgstr "Lång beskrivning (ersätter saknad information)" msgid "Add or overwrite the description text. If a description is provided by TPR, this will overwrite it." -msgstr "Lägg till eller skriv över beskrivningstexten. Om en beskrivning finns från TPR kommer den att skrivas över av denna." +msgstr "Observera! Innehållet visas på webbplatsen endast om den långa beskrivningen saknas från datakäll." From b2e9059d79d8c1c52eed2f528c069eebbb5cad81 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:37:01 +0200 Subject: [PATCH 6/9] UHF-9249: Updated the update hook description. --- modules/helfi_tpr_config/helfi_tpr_config.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/helfi_tpr_config/helfi_tpr_config.install b/modules/helfi_tpr_config/helfi_tpr_config.install index 8d1cca44e..5c2a71b48 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.install +++ b/modules/helfi_tpr_config/helfi_tpr_config.install @@ -360,7 +360,7 @@ function helfi_tpr_config_update_9051(): void { } /** - * UHF-9249: Add an override field for description. + * UHF-9249: Add an long description field for filling missing data. */ function helfi_tpr_config_update_9052() : void { $enrich_description = BaseFieldDefinition::create('text_with_summary') From 829b550970f8ad363a740b11a011cf1af25f78e6 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 13:52:27 +0200 Subject: [PATCH 7/9] UHF-9249: Hide help and guidelines. --- .../core.entity_form_display.tpr_unit.tpr_unit.default.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml index 8d2f1922c..d661bc182 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml @@ -117,7 +117,10 @@ content: settings: rows: 5 placeholder: '' - third_party_settings: { } + third_party_settings: + allowed_formats: + hide_help: '1' + hide_guidelines: '1' field_content: type: paragraphs weight: 28 From 36bdee85468e6fbe24ea9b273691e752bfa948ab Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:42:34 +0200 Subject: [PATCH 8/9] UHF-9249: Correct the translation id in Swedish translation. --- modules/helfi_tpr_config/translations/sv.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/helfi_tpr_config/translations/sv.po b/modules/helfi_tpr_config/translations/sv.po index a152aab8c..6b0b3416f 100644 --- a/modules/helfi_tpr_config/translations/sv.po +++ b/modules/helfi_tpr_config/translations/sv.po @@ -7,8 +7,8 @@ msgstr "Dölj listan om serviceställen" msgid "Select this if you link from the page to a filter search or another listing." msgstr "Välj detta om du länkar från sidan till en filtersökning eller till en separat lista." -msgid "Override: Description" +msgid "Long description (replacing missing information)" msgstr "Lång beskrivning (ersätter saknad information)" -msgid "Add or overwrite the description text. If a description is provided by TPR, this will overwrite it." +msgid "Note! The content is displayed on the website only if the long description is missing from the data source." msgstr "Observera! Innehållet visas på webbplatsen endast om den långa beskrivningen saknas från datakäll." From 1b946399101dc23490a82423ff5a319265659ba0 Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:46:58 +0200 Subject: [PATCH 9/9] UHF-9249: Change the order of address and enrich_description fields. --- .../core.entity_form_display.tpr_unit.tpr_unit.default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml index d661bc182..37d47d280 100644 --- a/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml +++ b/modules/helfi_tpr_config/config/install/core.entity_form_display.tpr_unit.tpr_unit.default.yml @@ -52,7 +52,7 @@ content: third_party_settings: { } address: type: readonly_field_widget - weight: 19 + weight: 20 region: content settings: label: above