Skip to content

Commit

Permalink
Merge branch 'main' into UHF-8910_menu_publish
Browse files Browse the repository at this point in the history
  • Loading branch information
rpnykanen authored Oct 4, 2023
2 parents a40cd58 + f560477 commit d7e9877
Show file tree
Hide file tree
Showing 34 changed files with 309 additions and 62 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ This repository holds configuration for the Hel.fi platform.
## Contact

Slack: #helfi-drupal (http://helsinkicity.slack.com/)

Mail: `[email protected]`
4 changes: 2 additions & 2 deletions assets/js/genesys_kymp.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
);
var currentPage = window.location;
var shibbolethString =
"https://chat-proxy.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
"https://asiointi.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
shibbolethString += "target=";
shibbolethString +=
"https://chat-proxy.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
"https://asiointi.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
/*
shibbolethString += "%3ForigPage%3D" + "https://www.hel.fi/helsinki/fi/sosiaali-ja-terveyspalvelut/terveyspalvelut/hammashoito/transfer?dir%3Din%26gcLoginButtonState%3D1%26errcode%3d0";
*/
Expand Down
4 changes: 2 additions & 2 deletions assets/js/genesys_neuvonta.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
);
var currentPage = window.location;
var shibbolethString =
"https://chat-proxy.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
"https://asiointi.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
shibbolethString += "target=";
shibbolethString +=
"https://chat-proxy.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
"https://asiointi.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
/*
shibbolethString += "%3ForigPage%3D" + "https://www.hel.fi/helsinki/fi/sosiaali-ja-terveyspalvelut/terveyspalvelut/hammashoito/transfer?dir%3Din%26gcLoginButtonState%3D1%26errcode%3d0";
*/
Expand Down
4 changes: 2 additions & 2 deletions assets/js/genesys_suunte.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ var gcReturnSessionId = '';
);
var currentPage = window.location;
var shibbolethString =
"https://chat-proxy.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
"https://asiointi.hel.fi/chat/tunnistus/Shibboleth.sso/KAPALogin?";
shibbolethString += "target=";
shibbolethString +=
"https://chat-proxy.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
"https://asiointi.hel.fi/chat/tunnistus/MagicPage/ReturnProcessor";
/*
shibbolethString += "%3ForigPage%3D" + "https://www.hel.fi/helsinki/fi/sosiaali-ja-terveyspalvelut/terveyspalvelut/hammashoito/transfer?dir%3Din%26gcLoginButtonState%3D1%26errcode%3d0";
*/
Expand Down
6 changes: 3 additions & 3 deletions helfi_platform_config.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ smartti_chatbot:
assets/css/smartti_chat.css: {}

genesys_kymp:
version: 1.0.x
version: 1.0.1
header: true
js:
'https://apps.mypurecloud.ie/widgets/9.0/cxbus.min.js' : {
Expand Down Expand Up @@ -51,7 +51,7 @@ clear_localstorage:
- core/drupal

genesys_suunte:
version: 1.0.x
version: 1.0.1
header: true
js:
'https://apps.mypurecloud.ie/widgets/9.0/cxbus.min.js' : {
Expand Down Expand Up @@ -92,7 +92,7 @@ genesys_auth_redirect:
- core/drupalSettings

genesys_neuvonta:
version: 1.0.x
version: 1.0.1
header: true
js:
'https://apps.mypurecloud.ie/widgets/9.0/cxbus.min.js' : {
Expand Down
6 changes: 6 additions & 0 deletions helfi_platform_config.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ services:
- '@language_manager'
tags:
- { name: event_subscriber }

logger.channel.helfi_platform_config:
parent: logger.channel_base
arguments:
- 'helfi_platform_config'

21 changes: 21 additions & 0 deletions modules/helfi_base_content/helfi_base_content.install
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,24 @@ function helfi_base_content_update_9004() : void {
$config_factory->getEditable('block.block.brandingnavigation')->delete();
$config_factory->getEditable('block.block.hdbt_subtheme_brandingnavigation')->delete();
}

/**
* UHF-8955 simple_sitemap - do not process menu_link_content entities.
*/
function helfi_base_content_update_9005() : void {
$config_factory = Drupal::configFactory();

// Remove menu_link_content from enabled entity types:
$config = $config_factory->getEditable('simple_sitemap.settings');
if (!$config->isNew()) {
$enabled_entity_types = $config->get('enabled_entity_types');
$enabled_entity_types = array_values(array_filter($enabled_entity_types, static fn ($item) => $item !== 'menu_link_content'));
$config->set('enabled_entity_types', $enabled_entity_types);
$config->save();
}

// Remove remaining menu_link_content related settings.
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.main')->delete();
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.branding-navigation')->delete();
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.account')->delete();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ field_mapper_config:
value: '$.attributes["field_announcement_link"]["title"]'
announcement_link_url:
value: '$.attributes["field_announcement_link"]["uri"]'
announcement_assistive_technology_close_button_title:
value: '$.attributes["field_announcement_title"]'
storage_client_id: helfi_announcements
storage_client_config: { }
persistent_cache_max_age: -1
persistent_cache_max_age: 600
annotation_entity_type_id: null
annotation_bundle_id: null
annotation_field_name: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ function helfi_global_announcement_update_9001() : void {
}

/**
* Re-install configuration to update cache lifetime.
* Re-install configuration to add new field.
*/
function helfi_global_announcement_update_9002() : void {
function helfi_global_announcement_update_9003() : void {
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_global_announcement');
}
22 changes: 22 additions & 0 deletions modules/helfi_global_announcement/helfi_global_announcement.module
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

declare(strict_types = 1);

use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\entity\BundleFieldDefinition;
use Drupal\helfi_global_announcement\Plugin\ExternalEntities\StorageClient\Announcements;

/**
* Gets the block configurations.
Expand Down Expand Up @@ -80,6 +82,7 @@ function helfi_global_announcement_entity_bundle_field_info_alter(
'announcement_type' => new TranslatableMarkup('Announcement type'),
'announcement_link_text' => new TranslatableMarkup('Announcement link text'),
'announcement_link_url' => new TranslatableMarkup('Announcement link url'),
'announcement_assistive_technology_close_button_title' => new TranslatableMarkup('Assistive technology close button title'),
];

foreach ($entity_info_fields as $field_name => $field_label) {
Expand All @@ -91,3 +94,22 @@ function helfi_global_announcement_entity_bundle_field_info_alter(
}
}
}

/**
* Implements hook_cron().
*/
function helfi_global_announcement_cron(): void {
$store = \Drupal::service('tempstore.shared')->get('global_announcement');
$globalEntityStorage = \Drupal::entityTypeManager()
->getStorage('helfi_announcements');

$externalAnnouncements = $globalEntityStorage
->loadMultiple();

$newHash = hash('sha256', serialize($externalAnnouncements));
$hash = $store->get('announcements');
if ($hash !== $newHash) {
$store->set('announcements', $newHash);
Cache::invalidateTags([Announcements::$customCacheTag]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function build(): array {
'body' => Xss::filter($announcement->get('body')->value),
'title' => Xss::filter($announcement->get('title')->value),
'status' => $announcement->get('status')->value,
'field_announcement_title' => $announcement->get('announcement_assistive_technology_close_button_title')->value,
]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
langcode: en
status: true
dependencies:
config:
- node.type.announcement
id: node.announcement.title
field_name: title
entity_type: node
bundle: announcement
label: 'Administrative title'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.field.node.announcement.field_announcement_all_pages
- field.field.node.announcement.field_announcement_content_pages
- field.field.node.announcement.field_announcement_link
- field.field.node.announcement.field_announcement_title
- field.field.node.announcement.field_announcement_type
- node.type.announcement
module:
Expand All @@ -23,7 +24,7 @@ mode: default
content:
body:
type: text_textarea_with_summary
weight: 15
weight: 18
region: content
settings:
rows: 9
Expand All @@ -39,14 +40,14 @@ content:
third_party_settings: { }
field_announcement_all_pages:
type: boolean_checkbox
weight: 11
weight: 13
region: content
settings:
display_label: true
third_party_settings: { }
field_announcement_content_pages:
type: select2_entity_reference
weight: 12
weight: 14
region: content
settings:
width: 100%
Expand All @@ -56,32 +57,40 @@ content:
third_party_settings: { }
field_announcement_link:
type: link_default
weight: 16
weight: 19
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_announcement_service_pages:
type: select2_entity_reference
weight: 14
weight: 16
region: content
settings:
width: 100%
autocomplete: true
match_operator: CONTAINS
match_limit: 20
third_party_settings: { }
field_announcement_title:
type: string_textfield
weight: 17
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_announcement_type:
type: select2
weight: 10
weight: 11
region: content
settings:
width: 100%
third_party_settings: { }
field_announcement_unit_pages:
type: select2_entity_reference
weight: 13
weight: 15
region: content
settings:
width: 100%
Expand Down Expand Up @@ -120,10 +129,10 @@ content:
settings: { }
third_party_settings: { }
simple_sitemap:
weight: 10
weight: 12
region: content
settings: { }
third_party_settings: { }
region: content
status:
type: boolean_checkbox
weight: 9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- field.field.node.announcement.field_announcement_all_pages
- field.field.node.announcement.field_announcement_content_pages
- field.field.node.announcement.field_announcement_link
- field.field.node.announcement.field_announcement_title
- field.field.node.announcement.field_announcement_type
- node.type.announcement
module:
Expand Down Expand Up @@ -37,6 +38,14 @@ content:
third_party_settings: { }
weight: 3
region: content
field_announcement_title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 4
region: content
field_announcement_type:
type: list_default
label: hidden
Expand All @@ -55,4 +64,5 @@ hidden:
field_announcement_service_pages: true
field_announcement_unit_pages: true
langcode: true
published_at: true
toc_enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- field.field.node.announcement.field_announcement_all_pages
- field.field.node.announcement.field_announcement_content_pages
- field.field.node.announcement.field_announcement_link
- field.field.node.announcement.field_announcement_title
- field.field.node.announcement.field_announcement_type
- node.type.announcement
module:
Expand Down Expand Up @@ -35,7 +36,9 @@ hidden:
field_announcement_content_pages: true
field_announcement_link: true
field_announcement_service_pages: true
field_announcement_title: true
field_announcement_type: true
field_announcement_unit_pages: true
langcode: true
published_at: true
toc_enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_announcement_title
- node.type.announcement
id: node.announcement.field_announcement_title
field_name: field_announcement_title
entity_type: node
bundle: announcement
label: 'Announcement title'
description: 'This title is only available to users of assistive technology. '
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
langcode: en
status: true
dependencies:
module:
- node
id: node.field_announcement_title
field_name: field_announcement_title
entity_type: node
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Poikkeusilmoituksen otsikko'
description: 'Tämä otsikko on avustavan teknologian käyttäjiä varten.'
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ function helfi_node_announcement_update_9002() : void {
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_node_announcement');
}

/**
* Add new field announcement_title for screenreaders.
*/
function helfi_node_announcement_update_9003() : void {
// Re-import configuration.
\Drupal::service('helfi_platform_config.config_update_helper')
->update('helfi_node_announcement');
}
Loading

0 comments on commit d7e9877

Please sign in to comment.