Skip to content

Commit

Permalink
Merge pull request #876 from City-of-Helsinki/UHF-9507
Browse files Browse the repository at this point in the history
UHF-9507: UHF-9507: Replace unit contact card title with a radio button selection
  • Loading branch information
teroelonen authored Jan 7, 2025
2 parents b55b2bd + 598a58a commit 79f2675
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_contact_card.field_unit_contact_title
- field.field.paragraph.unit_contact_card.field_unit_contact_heading
- field.field.paragraph.unit_contact_card.field_unit_contact_unit
- field.field.paragraph.unit_contact_card.field_unit_contact_use_address
- field.field.paragraph.unit_contact_card.field_unit_contact_use_details
Expand All @@ -19,14 +19,12 @@ targetEntityType: paragraph
bundle: unit_contact_card
mode: default
content:
field_unit_contact_title:
type: string_textfield
field_unit_contact_heading:
type: options_buttons
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
settings: { }
third_party_settings: { }
field_unit_contact_unit:
type: entity_reference_autocomplete
weight: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_contact_card.field_unit_contact_title
- field.field.paragraph.unit_contact_card.field_unit_contact_heading
- field.field.paragraph.unit_contact_card.field_unit_contact_unit
- field.field.paragraph.unit_contact_card.field_unit_contact_use_address
- field.field.paragraph.unit_contact_card.field_unit_contact_use_details
Expand All @@ -19,14 +19,6 @@ targetEntityType: paragraph
bundle: unit_contact_card
mode: default
content:
field_unit_contact_title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
field_unit_contact_unit:
type: entity_reference_label
label: hidden
Expand All @@ -36,6 +28,7 @@ content:
weight: 1
region: content
hidden:
field_unit_contact_heading: true
field_unit_contact_use_address: true
field_unit_contact_use_details: true
field_unit_contact_use_link: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 6c99f53c-3860-4a4f-adde-0e465d98e131
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_heading
- paragraphs.paragraphs_type.unit_contact_card
module:
- options
id: paragraph.unit_contact_card.field_unit_contact_heading
field_name: field_unit_contact_heading
entity_type: paragraph
bundle: unit_contact_card
label: Heading
description: " The default heading for the component is “Contact information”. Choose the unit name as the heading if it is not clear which unit's contact information is being referred to."
required: true
translatable: false
default_value:
-
value: default
default_value_callback: ''
settings: { }
field_type: list_string

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
uuid: 5e3d0bce-6114-40f1-b778-8fece473c972
langcode: en
status: true
dependencies:
module:
- options
- paragraphs
id: paragraph.field_unit_contact_heading
field_name: field_unit_contact_heading
entity_type: paragraph
type: list_string
settings:
allowed_values:
-
value: default
label: 'Contact information'
-
value: unit_name
label: 'The unit name'
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Otsikko
description: 'Komponentin oletusotsikko on ”Yhteystiedot”. Valitse otsikoksi kyseisen toimipisteen nimi, jos ei ole ilmeistä, minkä toimipisteen yhteystiedoista on kyse.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
settings:
allowed_values:
-
label: Yhteystiedot
-
label: 'Kyseisen toimipisteen nimi'
10 changes: 8 additions & 2 deletions modules/helfi_tpr_config/helfi_tpr_config.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare(strict_types=1);
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\linkit\Entity\Profile;
use Drupal\field\Entity\FieldStorageConfig;

/**
* Grants required permissions.
Expand Down Expand Up @@ -381,9 +382,14 @@ function helfi_tpr_config_update_9052() : void {
}

/**
* UHF-10555: Update TPR Unit wide teaser display.
* UHF-9507: Replace unit contact title with heading selector.
*/
function helfi_tpr_config_update_9072(): void {
function helfi_tpr_config_update_9074(): void {
$field = FieldStorageConfig::loadByName('paragraph', 'field_unit_contact_title');
if ($field) {
$field->delete();
}

\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_tpr_config');
}

0 comments on commit 79f2675

Please sign in to comment.