Skip to content

Commit

Permalink
Merge pull request #168 from City-of-Helsinki/UHF-9440
Browse files Browse the repository at this point in the history
UHF-9440: Add new field information for the service channel migration
  • Loading branch information
teroelonen committed Mar 1, 2024
2 parents 0571d41 + eeea5bc commit 44f69ad
Show file tree
Hide file tree
Showing 94 changed files with 118 additions and 93 deletions.
20 changes: 19 additions & 1 deletion helfi_tpr.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Contains helfi_tpr installation procedures.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\content_translation\ContentTranslationHandler;
use Drupal\Core\Field\BaseFieldDefinition;
Expand Down Expand Up @@ -319,3 +319,21 @@ function helfi_tpr_update_8046() : void {
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('subgroup', 'tpr_unit', 'helfi_tpr', $subgroup_field);
}

/**
* UHF-9940 Add information text field to Channel entity.
*/
function helfi_tpr_update_8047() : void {
$field = BaseFieldDefinition::create('text_long')
->setTranslatable(TRUE)
->setRevisionable(FALSE)
->setLabel(new TranslatableMarkup('Additional information'))
->setDisplayOptions('form', [
'type' => 'readonly_field_widget',
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);

\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('information', 'tpr_service_channel', 'helfi_tpr', $field);
}
2 changes: 1 addition & 1 deletion helfi_tpr.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Contains helfi_tpr.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Database\Query\AlterableInterface;
Expand Down
4 changes: 4 additions & 0 deletions migrations/tpr_service_channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ process:
payment_enabled: payment_enabled
for_personal_customer: for_personal_customer
for_corporate_customer: for_corporate_customer
information/value: information
information/format:
plugin: default_value
default_value: plain_text
destination:
plugin: translatable_entity:tpr_service_channel
default_values:
Expand Down
2 changes: 1 addition & 1 deletion modules/helfi_address_search/helfi_address_search.module
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Contains helfi_address_search.
*/

declare(strict_types = 1);
declare(strict_types=1);

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_address_search\Plugin\Field\FieldFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_address_search\Plugin\views\area;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_address_search\Plugin\views\field;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_address_search\Plugin\views\filter;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/BaseFieldTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
3 changes: 2 additions & 1 deletion src/Entity/Channel.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down Expand Up @@ -131,6 +131,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
'expiration_time' => new TranslatableMarkup('Expiration time'),
'authorization_code' => new TranslatableMarkup('Information'),
'call_charge_info' => new TranslatableMarkup('Call charge info'),
'information' => new TranslatableMarkup('Additional information'),
];
foreach ($text_fields as $name => $label) {
$fields[$name] = BaseFieldDefinition::create('text_long')
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ChannelType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ChannelTypeCollection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/DataFieldTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ErrandService.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Form/ContentEntityForm.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity\Form;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Listing/ListBuilder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity\Listing;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/OntologyWordDetails.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Service.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/TprEntityBase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/TranslationHandler.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Unit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Entity;

Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/MigrationConfigurationSubscriber.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\EventSubscriber;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Connection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Highlight.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Link.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/OpeningHour.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/OtherInfo.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/PhoneOrEmail.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Price.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Repository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Subgroup.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/Connection/Topical.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field\Connection;

Expand Down
2 changes: 1 addition & 1 deletion src/Field/FieldDefinition.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Field;

Expand Down
3 changes: 2 additions & 1 deletion src/Fixture/ErrandService.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Fixture;

Expand Down Expand Up @@ -71,6 +71,7 @@ public function getMockData() : array {
'email' => sprintf('%s.email.%s.%s@hel.fi', $id, $language, $channelId),
'phone' => sprintf('%s-123456-%s-%s', $id, $language, $channelId),
'call_charge_info' => sprintf('call_charge_info %s %s %s', $id, $language, $channelId),
'information' => sprintf('information %s %s %s', $id, $language, $channelId),
'availabilities' => [
[
'availability_string' => sprintf('0:%s:test %s %s', $id, $language, $channelId),
Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/OntologyWordDetails.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Fixture;

Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Service.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Fixture;

Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Unit.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Fixture;

Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/DataType/ConnectionData.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\DataType;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldFormatter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldFormatter;

Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Field/FieldFormatter/ServiceMapFormatter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldFormatter;

Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Field/FieldType/AccessibilitySentenceItem.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace Drupal\helfi_tpr\Plugin\Field\FieldType;

Expand Down
Loading

0 comments on commit 44f69ad

Please sign in to comment.