From 431f138f56c4e0bcaf3cfd9c3c5a35514d9f86de Mon Sep 17 00:00:00 2001 From: ovidiu Date: Mon, 20 Feb 2023 16:37:40 +0200 Subject: [PATCH] Merge branch 'main' of github.com:City-of-Helsinki/drupal-helfi-platform-config --- composer.json | 4 +- .../install/filter.format.full_html.yml | 8 - .../config/install/filter.format.minimal.yml | 8 - .../config/install/user.role.admin.yml | 6 - .../install/user.role.content_producer.yml | 4 - .../config/install/user.role.editor.yml | 6 - .../helfi_content/helfi_content.info.yml | 1 - .../helfi_content/helfi_content.install | 24 + ..._form_display.media.soundcloud.default.yml | 71 --- ...display.media.soundcloud.media_library.yml | 32 -- ..._view_display.media.soundcloud.default.yml | 25 - ...display.media.soundcloud.media_library.yml | 30 -- ...edia.soundcloud.field_media_soundcloud.yml | 18 - ...d.storage.media.field_media_soundcloud.yml | 20 - ...uage.content_settings.media.soundcloud.yml | 15 - .../config/install/media.type.soundcloud.yml | 14 - .../helfi_media/helfi_media.info.yml | 1 - .../helfi_media/helfi_media.install | 20 + .../src/HelfiExternalEntityBase.php | 4 +- .../helfi_react_search.module | 12 +- .../search_api/processor/Coordinates.php | 68 +++ .../Plugin/search_api/processor/IsSchool.php | 22 +- .../src/SupportsUnitIndexTrait.php | 32 ++ .../helfi_react_search/translations/fi.po | 8 +- .../helfi_react_search/translations/sv.po | 8 +- .../helfi_toc/assets/js/tableOfContents.js | 37 -- ...display.paragraph.service_list.default.yml | 43 +- ..._display.paragraph.unit_search.default.yml | 46 +- ...display.paragraph.service_list.default.yml | 24 +- ..._display.paragraph.unit_search.default.yml | 36 +- ..._list.field_service_list_meta_load_mor.yml | 20 - ...earch.field_unit_search_meta_load_more.yml | 20 - ...graph.field_service_list_meta_load_mor.yml | 20 - ...graph.field_unit_search_meta_load_more.yml | 20 - .../install/views.view.service_list.yml | 508 +++++++++--------- .../config/install/views.view.unit_search.yml | 398 +++++++------- ..._list.field_service_list_meta_load_mor.yml | 4 - ...earch.field_unit_search_meta_load_more.yml | 4 - .../language/fi/views.view.service_list.yml | 18 +- .../language/fi/views.view.service_units.yml | 31 ++ .../language/fi/views.view.unit_search.yml | 15 +- .../language/fi/views.view.unit_services.yml | 28 + .../language/sv/views.view.service_list.yml | 15 +- .../language/sv/views.view.service_units.yml | 31 ++ .../language/sv/views.view.unit_search.yml | 13 +- .../language/sv/views.view.unit_services.yml | 28 + .../optional/views.view.service_units.yml | 346 ++++++++++++ .../optional/views.view.unit_services.yml | 333 ++++++++++++ .../update/helfi_tpr_config_update_9006.yml | 18 - .../helfi_tpr_config.info.yml | 1 - .../helfi_tpr_config/helfi_tpr_config.install | 76 ++- helfi_platform_config.libraries.yml | 17 + src/ConfigHelper.php | 21 +- src/Plugin/Block/ChatLeijuke.php | 1 + 54 files changed, 1592 insertions(+), 1041 deletions(-) delete mode 100644 helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.default.yml delete mode 100644 helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.media_library.yml delete mode 100644 helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.default.yml delete mode 100644 helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.media_library.yml delete mode 100644 helfi_features/helfi_media/config/install/field.field.media.soundcloud.field_media_soundcloud.yml delete mode 100644 helfi_features/helfi_media/config/install/field.storage.media.field_media_soundcloud.yml delete mode 100644 helfi_features/helfi_media/config/install/language.content_settings.media.soundcloud.yml delete mode 100644 helfi_features/helfi_media/config/install/media.type.soundcloud.yml create mode 100644 helfi_features/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php create mode 100644 helfi_features/helfi_react_search/src/SupportsUnitIndexTrait.php delete mode 100644 helfi_features/helfi_tpr_config/config/install/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml delete mode 100644 helfi_features/helfi_tpr_config/config/install/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml delete mode 100644 helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_service_list_meta_load_mor.yml delete mode 100644 helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_unit_search_meta_load_more.yml delete mode 100644 helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml delete mode 100644 helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml create mode 100644 helfi_features/helfi_tpr_config/config/language/fi/views.view.service_units.yml create mode 100644 helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_services.yml create mode 100644 helfi_features/helfi_tpr_config/config/language/sv/views.view.service_units.yml create mode 100644 helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_services.yml create mode 100644 helfi_features/helfi_tpr_config/config/optional/views.view.service_units.yml create mode 100644 helfi_features/helfi_tpr_config/config/optional/views.view.unit_services.yml delete mode 100644 helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9006.yml diff --git a/composer.json b/composer.json index b7e8fdc98..794c0bdbf 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,6 @@ "drupal/config_rewrite": "^1.4", "drupal/config_replace": "^2.0", "drupal/content_lock": "^2.2", - "drupal/core-recommended": ">=9.3", "drupal/crop": "^2.1", "drupal/default_content": "^2.0.0-alpha2", "drupal/diff": "^1.0", @@ -61,7 +60,8 @@ "drupal/update_helper": "^2.0", "drupal/view_unpublished": "^1.0", "drupal/views_bulk_edit": "^2.7", - "drupal/views_bulk_operations": "^4.1" + "drupal/views_bulk_operations": "^4.1", + "ext-curl": "*" }, "conflict": { "drupal/core-recommended": "<9.5", diff --git a/helfi_features/helfi_content/config/install/filter.format.full_html.yml b/helfi_features/helfi_content/config/install/filter.format.full_html.yml index ce1a7de39..9452274d1 100644 --- a/helfi_features/helfi_content/config/install/filter.format.full_html.yml +++ b/helfi_features/helfi_content/config/install/filter.format.full_html.yml @@ -5,7 +5,6 @@ dependencies: - editor - linkit - media - - token_filter name: HTML format: full_html weight: 0 @@ -84,13 +83,6 @@ filters: default_view_mode: default allowed_view_modes: { } allowed_media_types: { } - token_filter: - id: token_filter - provider: token_filter - status: true - weight: -47 - settings: - replace_empty: '1' helfi_link_converter: id: helfi_link_converter provider: helfi_api_base diff --git a/helfi_features/helfi_content/config/install/filter.format.minimal.yml b/helfi_features/helfi_content/config/install/filter.format.minimal.yml index 8ed29ea2c..d8877305e 100644 --- a/helfi_features/helfi_content/config/install/filter.format.minimal.yml +++ b/helfi_features/helfi_content/config/install/filter.format.minimal.yml @@ -5,7 +5,6 @@ dependencies: - editor - linkit - media - - token_filter name: Minimal format: minimal weight: 0 @@ -84,13 +83,6 @@ filters: default_view_mode: default allowed_view_modes: { } allowed_media_types: { } - token_filter: - id: token_filter - provider: token_filter - status: true - weight: -43 - settings: - replace_empty: '1' helfi_link_converter: id: helfi_link_converter provider: helfi_api_base diff --git a/helfi_features/helfi_content/config/install/user.role.admin.yml b/helfi_features/helfi_content/config/install/user.role.admin.yml index 2562bf4e1..a54b79ad5 100644 --- a/helfi_features/helfi_content/config/install/user.role.admin.yml +++ b/helfi_features/helfi_content/config/install/user.role.admin.yml @@ -43,7 +43,6 @@ permissions: - 'create paragraph library item' - 'create remote entities' - 'create remote_video media' - - 'create soundcloud media' - 'create terms in keywords' - 'create url aliases' - 'delete all revisions' @@ -53,7 +52,6 @@ permissions: - 'delete any media' - 'delete any page content' - 'delete any remote_video media' - - 'delete any soundcloud media' - 'delete content translations' - 'delete landing_page revisions' - 'delete media' @@ -62,7 +60,6 @@ permissions: - 'delete own landing_page content' - 'delete own page content' - 'delete own remote_video media' - - 'delete own soundcloud media' - 'delete page revisions' - 'delete remote entities' - 'delete terms in keywords' @@ -71,13 +68,11 @@ permissions: - 'edit any landing_page content' - 'edit any page content' - 'edit any remote_video media' - - 'edit any soundcloud media' - 'edit own file media' - 'edit own image media' - 'edit own landing_page content' - 'edit own page content' - 'edit own remote_video media' - - 'edit own soundcloud media' - 'edit paragraph library item' - 'edit remote entities' - 'edit terms in keywords' @@ -98,7 +93,6 @@ permissions: - 'translate menu_link_content' - 'translate page node' - 'translate remote_video media' - - 'translate soundcloud media' - 'update any media' - 'update content translations' - 'update media' diff --git a/helfi_features/helfi_content/config/install/user.role.content_producer.yml b/helfi_features/helfi_content/config/install/user.role.content_producer.yml index 4dd1d300e..5f4ec4c87 100644 --- a/helfi_features/helfi_content/config/install/user.role.content_producer.yml +++ b/helfi_features/helfi_content/config/install/user.role.content_producer.yml @@ -25,7 +25,6 @@ permissions: - 'create page content' - 'create paragraph library item' - 'create remote_video media' - - 'create soundcloud media' - 'create terms in keywords' - 'create url aliases' - 'delete media' @@ -34,19 +33,16 @@ permissions: - 'delete own landing_page content' - 'delete own page content' - 'delete own remote_video media' - - 'delete own soundcloud media' - 'edit any file media' - 'edit any image media' - 'edit any landing_page content' - 'edit any page content' - 'edit any remote_video media' - - 'edit any soundcloud media' - 'edit own file media' - 'edit own image media' - 'edit own landing_page content' - 'edit own page content' - 'edit own remote_video media' - - 'edit own soundcloud media' - 'edit paragraph library item' - 'edit terms in keywords' - 'revert landing_page revisions' diff --git a/helfi_features/helfi_content/config/install/user.role.editor.yml b/helfi_features/helfi_content/config/install/user.role.editor.yml index c843a6bed..a86f01601 100644 --- a/helfi_features/helfi_content/config/install/user.role.editor.yml +++ b/helfi_features/helfi_content/config/install/user.role.editor.yml @@ -31,7 +31,6 @@ permissions: - 'create paragraph library item' - 'create remote entities' - 'create remote_video media' - - 'create soundcloud media' - 'create terms in keywords' - 'create url aliases' - 'delete any file media' @@ -40,7 +39,6 @@ permissions: - 'delete any media' - 'delete any page content' - 'delete any remote_video media' - - 'delete any soundcloud media' - 'delete content translations' - 'delete landing_page revisions' - 'delete media' @@ -49,7 +47,6 @@ permissions: - 'delete own landing_page content' - 'delete own page content' - 'delete own remote_video media' - - 'delete own soundcloud media' - 'delete page revisions' - 'delete remote entities' - 'delete terms in keywords' @@ -58,13 +55,11 @@ permissions: - 'edit any landing_page content' - 'edit any page content' - 'edit any remote_video media' - - 'edit any soundcloud media' - 'edit own file media' - 'edit own image media' - 'edit own landing_page content' - 'edit own page content' - 'edit own remote_video media' - - 'edit own soundcloud media' - 'edit paragraph library item' - 'edit remote entities' - 'edit terms in keywords' @@ -83,7 +78,6 @@ permissions: - 'translate menu_link_content' - 'translate page node' - 'translate remote_video media' - - 'translate soundcloud media' - 'update any media' - 'update content translations' - 'update media' diff --git a/helfi_features/helfi_content/helfi_content.info.yml b/helfi_features/helfi_content/helfi_content.info.yml index 134831c6f..c28b1f0c4 100644 --- a/helfi_features/helfi_content/helfi_content.info.yml +++ b/helfi_features/helfi_content/helfi_content.info.yml @@ -40,7 +40,6 @@ dependencies: - 'select2:select2' - 'select2_icon:select2_icon' - 'social_media:social_media' - - 'token_filter:token_filter' - 'update_helper:update_helper' package: HELfi 'interface translation project': helfi_content diff --git a/helfi_features/helfi_content/helfi_content.install b/helfi_features/helfi_content/helfi_content.install index 19641cf52..1dc089d80 100644 --- a/helfi_features/helfi_content/helfi_content.install +++ b/helfi_features/helfi_content/helfi_content.install @@ -1003,3 +1003,27 @@ function helfi_content_update_9039() { // Output logged messages to related channel of update execution. return $updateHelper->logger()->output(); } + +/** + * Uninstall token_filter and aet modules. + */ +function helfi_content_update_9040() : void { + if (\Drupal::moduleHandler()->moduleExists('token_filter')) { + $formatters = \Drupal::entityTypeManager() + ->getStorage('filter_format') + ->loadMultiple(); + + /** @var \Drupal\filter\Entity\FilterFormat $format */ + foreach ($formatters as $format) { + $format->setFilterConfig('token_filter', [ + 'status' => FALSE, + ]) + ->save(); + } + + Drupal::service('module_installer')->uninstall([ + 'token_filter', + 'aet', + ]); + } +} diff --git a/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.default.yml b/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.default.yml deleted file mode 100644 index 51b340f41..000000000 --- a/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.default.yml +++ /dev/null @@ -1,71 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.media.soundcloud.field_media_soundcloud - - media.type.soundcloud - module: - - path -id: media.soundcloud.default -targetEntityType: media -bundle: soundcloud -mode: default -content: - created: - type: datetime_timestamp - weight: 10 - region: content - settings: { } - third_party_settings: { } - field_media_soundcloud: - weight: 0 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - langcode: - type: language_select - weight: 2 - region: content - settings: - include_locked: true - third_party_settings: { } - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - path: - type: path - weight: 30 - region: content - settings: { } - third_party_settings: { } - status: - type: boolean_checkbox - settings: - display_label: true - weight: 100 - region: content - third_party_settings: { } - translation: - weight: 10 - settings: { } - third_party_settings: { } - region: content - uid: - type: entity_reference_autocomplete - weight: 5 - settings: - match_operator: CONTAINS - size: 60 - placeholder: '' - match_limit: 10 - region: content - third_party_settings: { } -hidden: { } diff --git a/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.media_library.yml b/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.media_library.yml deleted file mode 100644 index 08fe998e9..000000000 --- a/helfi_features/helfi_media/config/install/core.entity_form_display.media.soundcloud.media_library.yml +++ /dev/null @@ -1,32 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_form_mode.media.media_library - - field.field.media.soundcloud.field_media_soundcloud - - media.type.soundcloud -id: media.soundcloud.media_library -targetEntityType: media -bundle: soundcloud -mode: media_library -content: - name: - type: string_textfield - settings: - size: 60 - placeholder: '' - weight: 0 - third_party_settings: { } - region: content - translation: - weight: 10 - settings: { } - third_party_settings: { } - region: content -hidden: - created: true - field_media_soundcloud: true - langcode: true - path: true - status: true - uid: true diff --git a/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.default.yml b/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.default.yml deleted file mode 100644 index b7b43b960..000000000 --- a/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.default.yml +++ /dev/null @@ -1,25 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.field.media.soundcloud.field_media_soundcloud - - media.type.soundcloud -id: media.soundcloud.default -targetEntityType: media -bundle: soundcloud -mode: default -content: - field_media_soundcloud: - label: visually_hidden - weight: 0 - settings: - link_to_entity: false - third_party_settings: { } - type: string - region: content -hidden: - created: true - langcode: true - name: true - thumbnail: true - uid: true diff --git a/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.media_library.yml b/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.media_library.yml deleted file mode 100644 index 39a424ddc..000000000 --- a/helfi_features/helfi_media/config/install/core.entity_view_display.media.soundcloud.media_library.yml +++ /dev/null @@ -1,30 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.media.media_library - - field.field.media.soundcloud.field_media_soundcloud - - image.style.medium - - media.type.soundcloud - module: - - image -id: media.soundcloud.media_library -targetEntityType: media -bundle: soundcloud -mode: media_library -content: - thumbnail: - type: image - label: hidden - settings: - image_style: medium - image_link: '' - weight: 0 - third_party_settings: { } - region: content -hidden: - created: true - field_media_soundcloud: true - langcode: true - name: true - uid: true diff --git a/helfi_features/helfi_media/config/install/field.field.media.soundcloud.field_media_soundcloud.yml b/helfi_features/helfi_media/config/install/field.field.media.soundcloud.field_media_soundcloud.yml deleted file mode 100644 index 8248f546c..000000000 --- a/helfi_features/helfi_media/config/install/field.field.media.soundcloud.field_media_soundcloud.yml +++ /dev/null @@ -1,18 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.media.field_media_soundcloud - - media.type.soundcloud -id: media.soundcloud.field_media_soundcloud -field_name: field_media_soundcloud -entity_type: media -bundle: soundcloud -label: Soundcloud -description: '' -required: true -translatable: true -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/helfi_features/helfi_media/config/install/field.storage.media.field_media_soundcloud.yml b/helfi_features/helfi_media/config/install/field.storage.media.field_media_soundcloud.yml deleted file mode 100644 index 631de7b0d..000000000 --- a/helfi_features/helfi_media/config/install/field.storage.media.field_media_soundcloud.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - media -id: media.field_media_soundcloud -field_name: field_media_soundcloud -entity_type: media -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/helfi_features/helfi_media/config/install/language.content_settings.media.soundcloud.yml b/helfi_features/helfi_media/config/install/language.content_settings.media.soundcloud.yml deleted file mode 100644 index 694ff98ca..000000000 --- a/helfi_features/helfi_media/config/install/language.content_settings.media.soundcloud.yml +++ /dev/null @@ -1,15 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - media.type.soundcloud - module: - - content_translation -third_party_settings: - content_translation: - enabled: true -id: media.soundcloud -target_entity_type_id: media -target_bundle: soundcloud -default_langcode: fi -language_alterable: true diff --git a/helfi_features/helfi_media/config/install/media.type.soundcloud.yml b/helfi_features/helfi_media/config/install/media.type.soundcloud.yml deleted file mode 100644 index 6a3a380a3..000000000 --- a/helfi_features/helfi_media/config/install/media.type.soundcloud.yml +++ /dev/null @@ -1,14 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - media_entity_soundcloud -id: soundcloud -label: SoundCloud -description: 'Media type for adding SoundCloud items.' -source: soundcloud -queue_thumbnail_downloads: false -new_revision: false -source_configuration: - source_field: field_media_soundcloud -field_map: { } diff --git a/helfi_features/helfi_media/helfi_media.info.yml b/helfi_features/helfi_media/helfi_media.info.yml index b773293f8..e55c810f1 100644 --- a/helfi_features/helfi_media/helfi_media.info.yml +++ b/helfi_features/helfi_media/helfi_media.info.yml @@ -15,7 +15,6 @@ dependencies: - 'drupal:responsive_image' - 'focal_point:focal_point' - 'image_style_quality:image_style_quality' - - 'media_entity_soundcloud:media_entity_soundcloud' - 'oembed_providers:oembed_providers' - 'update_helper:update_helper' package: HELfi diff --git a/helfi_features/helfi_media/helfi_media.install b/helfi_features/helfi_media/helfi_media.install index b6a731b81..78fa1e2eb 100644 --- a/helfi_features/helfi_media/helfi_media.install +++ b/helfi_features/helfi_media/helfi_media.install @@ -175,3 +175,23 @@ function helfi_media_update_9009() { ConfigHelper::updateExistingConfig($updateLocation, 'system.image'); } } + +/** + * Uninstall media_entity_soundcloud module. + */ +function helfi_media_update_9011() : void { + if (!Drupal::moduleHandler()->moduleExists('media_entity_soundcloud')) { + return; + } + $count = \Drupal::database()->select('media') + ->condition('bundle', 'soundcloud') + ->countQuery() + ->execute() + ->fetchField(); + + if ($count > 0) { + \Drupal::messenger()->addWarning('The "media_entity_soundcloud" dependency will be removed from helfi_platform_config module in next major release. To continue using it, run "composer require drupal/media_entity_soundcloud" in your project root.'); + return; + } + Drupal::service('module_installer')->uninstall(['media_entity_soundcloud']); +} diff --git a/helfi_features/helfi_news_feed/src/HelfiExternalEntityBase.php b/helfi_features/helfi_news_feed/src/HelfiExternalEntityBase.php index 9509e3428..626a9d3db 100644 --- a/helfi_features/helfi_news_feed/src/HelfiExternalEntityBase.php +++ b/helfi_features/helfi_news_feed/src/HelfiExternalEntityBase.php @@ -173,7 +173,9 @@ protected function request( \GuzzleHttp\http_build_query($parameters), ]); - $content = $this->client->request('GET', $uri); + $content = $this->client->request('GET', $uri, [ + 'curl' => [CURLOPT_TCP_KEEPALIVE => TRUE], + ]); $json = \GuzzleHttp\json_decode($content->getBody()->getContents(), TRUE); return $json['data']; } diff --git a/helfi_features/helfi_react_search/helfi_react_search.module b/helfi_features/helfi_react_search/helfi_react_search.module index e76834604..24734785f 100644 --- a/helfi_features/helfi_react_search/helfi_react_search.module +++ b/helfi_features/helfi_react_search/helfi_react_search.module @@ -1,5 +1,10 @@ getType(); $config = \Drupal::config('elastic_proxy.settings'); diff --git a/helfi_features/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php b/helfi_features/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php new file mode 100644 index 000000000..16e767f4b --- /dev/null +++ b/helfi_features/helfi_react_search/src/Plugin/search_api/processor/Coordinates.php @@ -0,0 +1,68 @@ + $this->t('Coordinates'), + 'description' => $this->t('Indexes coordinates of tpr_unit entity as geo_point field to elastic.'), + 'type' => 'object', + 'processor_id' => $this->getPluginId(), + ]; + + $properties['coordinates'] = new ProcessorProperty($definition); + } + + return $properties; + } + + /** + * {@inheritdoc} + */ + public function addFieldValues(ItemInterface $item): void { + $object = $item->getOriginalObject()->getValue(); + + $indexableValue = [ + 'lat' => $object->get('latitude')->value, + 'lon' => $object->get('longitude')->value, + ]; + + $itemFields = $item->getFields(); + $itemFields = $this->getFieldsHelper() + ->filterForPropertyPath($itemFields, NULL, 'coordinates'); + foreach ($itemFields as $itemField) { + $itemField->addValue($indexableValue); + } + } + +} diff --git a/helfi_features/helfi_react_search/src/Plugin/search_api/processor/IsSchool.php b/helfi_features/helfi_react_search/src/Plugin/search_api/processor/IsSchool.php index 4d4ebd6b1..7e37135e0 100644 --- a/helfi_features/helfi_react_search/src/Plugin/search_api/processor/IsSchool.php +++ b/helfi_features/helfi_react_search/src/Plugin/search_api/processor/IsSchool.php @@ -4,8 +4,8 @@ namespace Drupal\helfi_react_search\Plugin\search_api\processor; +use Drupal\helfi_react_search\SupportsUnitIndexTrait; use Drupal\search_api\Processor\ProcessorPluginBase; -use Drupal\search_api\IndexInterface; use Drupal\search_api\Item\ItemInterface; /** @@ -22,6 +22,8 @@ */ class IsSchool extends ProcessorPluginBase { + use SupportsUnitIndexTrait; + /** * Checks the entity against these to determine if it should index. * @@ -32,24 +34,6 @@ class IsSchool extends ProcessorPluginBase { '3106', ]; - /** - * {@inheritdoc} - */ - public static function supportsIndex(IndexInterface $index): bool { - foreach ($index->getDatasources() as $datasource) { - $entityTypeId = $datasource->getEntityTypeId(); - if (!$entityTypeId) { - continue; - } - - if ($entityTypeId === 'tpr_unit') { - return TRUE; - } - } - - return FALSE; - } - /** * {@inheritdoc} */ diff --git a/helfi_features/helfi_react_search/src/SupportsUnitIndexTrait.php b/helfi_features/helfi_react_search/src/SupportsUnitIndexTrait.php new file mode 100644 index 000000000..b45aa9476 --- /dev/null +++ b/helfi_features/helfi_react_search/src/SupportsUnitIndexTrait.php @@ -0,0 +1,32 @@ +getDatasources() as $datasource) { + $entityTypeId = $datasource->getEntityTypeId(); + if (!$entityTypeId) { + continue; + } + + if ($entityTypeId === 'tpr_unit') { + return TRUE; + } + } + + return FALSE; + } + +} diff --git a/helfi_features/helfi_react_search/translations/fi.po b/helfi_features/helfi_react_search/translations/fi.po index 5162e5576..5a5f8fa9b 100644 --- a/helfi_features/helfi_react_search/translations/fi.po +++ b/helfi_features/helfi_react_search/translations/fi.po @@ -28,7 +28,7 @@ msgctxt "Event search: search form title" msgid "Filter events" msgstr "Etsi tapahtumia" -msgctxt "Event search: all available options" +msgctxt "React search: all available options" msgid "All" msgstr "Kaikki" @@ -38,18 +38,18 @@ msgstr "Jos haluat etsiä etätapahtumia, valitse vaihtoehto 'Internet (etätapa msgid "Select a venue" msgstr "Valitse tapahtumapaikka" -msgctxt "Event search: remove item aria label" +msgctxt "React search: remove item aria label" msgid "Remove item" msgstr "Poista valinta" -msgctxt "Event search: clear button aria label" +msgctxt "React search: clear selections" msgid "Clear selections" msgstr "Tyhjennä kaikki valinnat" msgid "Use the format D.M.YYYY" msgstr "Käytä muotoa P.K.VVVV" -msgctxt "Event search: date selection label" +msgctxt "React search: date selection label" msgid "Date" msgstr "Ajankohta" diff --git a/helfi_features/helfi_react_search/translations/sv.po b/helfi_features/helfi_react_search/translations/sv.po index 63c50243f..82bb866dd 100644 --- a/helfi_features/helfi_react_search/translations/sv.po +++ b/helfi_features/helfi_react_search/translations/sv.po @@ -34,7 +34,7 @@ msgctxt "Event search: search form title" msgid "Filter events" msgstr "Filtrera evenemang" -msgctxt "Event search: all available options" +msgctxt "React search: all available options" msgid "All" msgstr "Alla" @@ -44,18 +44,18 @@ msgstr "Om du vill söka evenemang på distans, välj endast alternativet 'Inter msgid "Select a venue" msgstr "Välj tidpunkt" -msgctxt "Event search: remove item aria label" +msgctxt "React search: remove item aria label" msgid "Remove item" msgstr "Töm valda" -msgctxt "Event search: clear button aria label" +msgctxt "React search: clear selections" msgid "Clear selections" msgstr "Rensa alla" msgid "Use the format D.M.YYYY" msgstr "Ange i formen D.M.ÅÅÅÅ" -msgctxt "Event search: date selection label" +msgctxt "React search: date selection label" msgid "Date" msgstr "Tidsperiod" diff --git a/helfi_features/helfi_toc/assets/js/tableOfContents.js b/helfi_features/helfi_toc/assets/js/tableOfContents.js index 9e4830b55..35382ff36 100644 --- a/helfi_features/helfi_toc/assets/js/tableOfContents.js +++ b/helfi_features/helfi_toc/assets/js/tableOfContents.js @@ -93,43 +93,6 @@ // Remove loading text. $('.js-remove', tableOfContents).remove(); - - // Open accordions that contain linked anchors - function handleAccordionAnchors() { - var hash = window.location.hash; - if (!hash) return; - - var hashTarget = document.getElementById(hash.replace('#', '')); - if (!hashTarget) return; - - var hashParent = hashTarget.closest('.handorgel__content'); - if (!hashParent) return; - - if (document.readyState === 'complete') { // if document has already been loaded - - if (!window.handorgel_accordions) return; // We need access to the accordion objects to open them - - window.handorgel_accordions.forEach(function (accordion) { - accordion.folds.forEach(function (fold) { - if (fold.id === hashParent.id.replace('-content','')) { - fold.open(false); // false prevents animation - hashTarget.scrollIntoView(); - } - }); - }); - hashTarget.scrollIntoView(); - - } else { // If we have not yet loaded the document - hashParent.setAttribute('data-open', ''); - window.addEventListener('DOMContentLoaded', function () { - window.setTimeout(function () { - hashTarget.scrollIntoView(); - }, 1000); - }) - } - } - handleAccordionAnchors(); - window.addEventListener('popstate', handleAccordionAnchors); //popstate instead of hashchange to handle re-click }, }; })(jQuery, Drupal); diff --git a/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.service_list.default.yml b/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.service_list.default.yml index 5b1032dbb..df491d884 100644 --- a/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.service_list.default.yml +++ b/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.service_list.default.yml @@ -3,70 +3,43 @@ status: true dependencies: config: - field.field.paragraph.service_list.field_service_list_description - - field.field.paragraph.service_list.field_service_list_meta_load_mor - field.field.paragraph.service_list.field_service_list_services - field.field.paragraph.service_list.field_service_list_title - paragraphs.paragraphs_type.service_list module: - - field_group - select2 - text -third_party_settings: - field_group: - group_service_list_meta: - children: - - field_service_list_meta_load_mor - parent_name: '' - weight: 3 - format_type: details - region: content - format_settings: - show_empty_fields: false - id: '' - classes: '' - description: '' - open: false - required_fields: true - label: 'Meta information' id: paragraph.service_list.default targetEntityType: paragraph bundle: service_list mode: default content: field_service_list_description: - weight: 2 - settings: - rows: 5 - placeholder: '' - third_party_settings: { } type: text_textarea + weight: 2 region: content - field_service_list_meta_load_mor: - weight: 4 settings: - size: 60 + rows: 5 placeholder: '' third_party_settings: { } - type: string_textfield - region: content field_service_list_services: + type: select2_entity_reference weight: 1 + region: content settings: + width: 100% + autocomplete: false match_operator: CONTAINS match_limit: 10 - autocomplete: false - width: 100% third_party_settings: { } - type: select2_entity_reference - region: content field_service_list_title: + type: string_textfield weight: 0 + region: content settings: size: 60 placeholder: '' third_party_settings: { } - type: string_textfield - region: content hidden: created: true status: true diff --git a/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.unit_search.default.yml b/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.unit_search.default.yml index 7a0368473..8a76e0ac9 100644 --- a/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.unit_search.default.yml +++ b/helfi_features/helfi_tpr_config/config/install/core.entity_form_display.paragraph.unit_search.default.yml @@ -5,7 +5,6 @@ dependencies: - field.field.paragraph.unit_search.field_unit_search_description - field.field.paragraph.unit_search.field_unit_search_meta_button - field.field.paragraph.unit_search.field_unit_search_meta_label - - field.field.paragraph.unit_search.field_unit_search_meta_load_more - field.field.paragraph.unit_search.field_unit_search_meta_placehold - field.field.paragraph.unit_search.field_unit_search_title - field.field.paragraph.unit_search.field_unit_search_units @@ -21,81 +20,72 @@ third_party_settings: - field_unit_search_meta_label - field_unit_search_meta_placehold - field_unit_search_meta_button - - field_unit_search_meta_load_more + label: 'Meta information' + region: content parent_name: '' weight: 3 format_type: details - region: content format_settings: - description: '' - required_fields: true - id: '' classes: '' + id: '' open: false - label: 'Meta information' + description: '' + required_fields: true id: paragraph.unit_search.default targetEntityType: paragraph bundle: unit_search mode: default content: field_unit_search_description: + type: text_textarea weight: 2 + region: content settings: rows: 5 placeholder: '' third_party_settings: { } - type: text_textarea - region: content field_unit_search_meta_button: - weight: 6 - settings: - size: 60 - placeholder: '' - third_party_settings: { } type: string_textfield + weight: 6 region: content - field_unit_search_meta_label: - weight: 4 settings: size: 60 placeholder: '' third_party_settings: { } + field_unit_search_meta_label: type: string_textfield + weight: 4 region: content - field_unit_search_meta_load_more: - weight: 7 settings: size: 60 placeholder: '' third_party_settings: { } - type: string_textfield - region: content field_unit_search_meta_placehold: + type: string_textfield weight: 5 + region: content settings: size: 60 placeholder: '' third_party_settings: { } - type: string_textfield - region: content field_unit_search_title: + type: string_textfield weight: 0 + region: content settings: size: 60 placeholder: '' third_party_settings: { } - type: string_textfield - region: content field_unit_search_units: + type: select2_entity_reference weight: 1 + region: content settings: + width: 100% + autocomplete: false match_operator: CONTAINS match_limit: 20 - autocomplete: false - width: 100% third_party_settings: { } - type: select2_entity_reference - region: content hidden: created: true status: true diff --git a/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.service_list.default.yml b/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.service_list.default.yml index 6a02bea03..8e87c448c 100644 --- a/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.service_list.default.yml +++ b/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.service_list.default.yml @@ -3,7 +3,6 @@ status: true dependencies: config: - field.field.paragraph.service_list.field_service_list_description - - field.field.paragraph.service_list.field_service_list_meta_load_mor - field.field.paragraph.service_list.field_service_list_services - field.field.paragraph.service_list.field_service_list_title - paragraphs.paragraphs_type.service_list @@ -15,33 +14,26 @@ bundle: service_list mode: default content: field_service_list_description: - weight: 1 - label: hidden - settings: { } - third_party_settings: { } type: text_default - region: content - field_service_list_meta_load_mor: - weight: 3 label: hidden - settings: - link_to_entity: false + settings: { } third_party_settings: { } - type: string + weight: 1 region: content field_service_list_services: - weight: 2 + type: entity_reference_entity_id label: hidden settings: { } third_party_settings: { } - type: entity_reference_entity_id + weight: 2 region: content field_service_list_title: - weight: 0 + type: string label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 0 region: content -hidden: { } +hidden: + search_api_excerpt: true diff --git a/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.unit_search.default.yml b/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.unit_search.default.yml index 8b2f053d7..4269757c6 100644 --- a/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.unit_search.default.yml +++ b/helfi_features/helfi_tpr_config/config/install/core.entity_view_display.paragraph.unit_search.default.yml @@ -5,7 +5,6 @@ dependencies: - field.field.paragraph.unit_search.field_unit_search_description - field.field.paragraph.unit_search.field_unit_search_meta_button - field.field.paragraph.unit_search.field_unit_search_meta_label - - field.field.paragraph.unit_search.field_unit_search_meta_load_more - field.field.paragraph.unit_search.field_unit_search_meta_placehold - field.field.paragraph.unit_search.field_unit_search_title - field.field.paragraph.unit_search.field_unit_search_units @@ -18,57 +17,50 @@ bundle: unit_search mode: default content: field_unit_search_description: - weight: 2 + type: text_default label: hidden settings: { } third_party_settings: { } - type: text_default + weight: 2 region: content field_unit_search_meta_button: - weight: 5 + type: string label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 5 region: content field_unit_search_meta_label: - weight: 3 - label: hidden - settings: - link_to_entity: false - third_party_settings: { } type: string - region: content - field_unit_search_meta_load_more: - weight: 6 - label: above + label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 3 region: content field_unit_search_meta_placehold: - weight: 4 + type: string label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 4 region: content field_unit_search_title: - weight: 0 + type: string label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 0 region: content field_unit_search_units: - weight: 1 + type: entity_reference_entity_id label: hidden settings: { } third_party_settings: { } - type: entity_reference_entity_id + weight: 1 region: content -hidden: { } +hidden: + search_api_excerpt: true diff --git a/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml b/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml deleted file mode 100644 index 3a3c98b50..000000000 --- a/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.paragraph.field_service_list_meta_load_mor - - paragraphs.paragraphs_type.service_list -id: paragraph.service_list.field_service_list_meta_load_mor -field_name: field_service_list_meta_load_mor -entity_type: paragraph -bundle: service_list -label: 'Load more label' -description: '' -required: false -translatable: false -default_value: - - - value: 'Load more services' -default_value_callback: '' -settings: { } -field_type: string diff --git a/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml b/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml deleted file mode 100644 index 2cb1cbc26..000000000 --- a/helfi_features/helfi_tpr_config/config/install/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.paragraph.field_unit_search_meta_load_more - - paragraphs.paragraphs_type.unit_search -id: paragraph.unit_search.field_unit_search_meta_load_more -field_name: field_unit_search_meta_load_more -entity_type: paragraph -bundle: unit_search -label: 'Load more label' -description: '' -required: false -translatable: false -default_value: - - - value: 'Load more units' -default_value_callback: '' -settings: { } -field_type: string diff --git a/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_service_list_meta_load_mor.yml b/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_service_list_meta_load_mor.yml deleted file mode 100644 index a8d08dbba..000000000 --- a/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_service_list_meta_load_mor.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - paragraphs -id: paragraph.field_service_list_meta_load_mor -field_name: field_service_list_meta_load_mor -entity_type: paragraph -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_unit_search_meta_load_more.yml b/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_unit_search_meta_load_more.yml deleted file mode 100644 index 1883d1b2e..000000000 --- a/helfi_features/helfi_tpr_config/config/install/field.storage.paragraph.field_unit_search_meta_load_more.yml +++ /dev/null @@ -1,20 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - paragraphs -id: paragraph.field_unit_search_meta_load_more -field_name: field_unit_search_meta_load_more -entity_type: paragraph -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/helfi_features/helfi_tpr_config/config/install/views.view.service_list.yml b/helfi_features/helfi_tpr_config/config/install/views.view.service_list.yml index f0632a22c..de8548891 100644 --- a/helfi_features/helfi_tpr_config/config/install/views.view.service_list.yml +++ b/helfi_features/helfi_tpr_config/config/install/views.view.service_list.yml @@ -3,12 +3,9 @@ status: true dependencies: config: - core.entity_view_mode.tpr_service.teaser - - core.entity_view_mode.tpr_service.teaser_search_result module: - helfi_tpr - - text - user - - views_infinite_scroll id: service_list label: 'Service list' module: views @@ -104,15 +101,17 @@ display: entity_field: name_override plugin_id: field pager: - type: infinite_scroll + type: full options: offset: 0 - items_per_page: 8 + items_per_page: 4 total_pages: null id: 0 tags: - next: 'Next ›' - previous: '‹ Previous' + next: Next + previous: Previous + first: First + last: Last expose: items_per_page: false items_per_page_label: 'Items per page' @@ -121,10 +120,7 @@ display: items_per_page_options_all_label: '- All -' offset: false offset_label: Offset - views_infinite_scroll: - button_text: 'Load more services' - automatically_load_content: false - initially_load_all_pages: false + quantity: 9 exposed_form: type: basic options: @@ -328,8 +324,7 @@ display: display_plugin: block position: 1 display_options: - display_extenders: - metatag_display_extender: { } + display_extenders: { } cache_metadata: max-age: -1 contexts: @@ -339,6 +334,232 @@ display: - url.query_args - user.permissions tags: { } + entity_reference_1: + id: entity_reference_1 + display_title: 'Entity Reference' + display_plugin: entity_reference + position: 2 + display_options: + fields: + name_override: + id: name_override + table: tpr_service_field_data + field: name_override + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: name_override + plugin_id: field + label: '' + exclude: true + alter: + alter_text: true + text: '({{ id }}) {{ name }}' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: true + trim: false + preserve_tags: '' + html: false + element_type: '0' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: false + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + id: + id: id + table: tpr_service_field_data + field: id + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: id + plugin_id: field + label: '' + exclude: false + alter: + alter_text: true + text: '{{ id__value }} ' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: true + trim: false + preserve_tags: '' + html: false + element_type: '0' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + name: + id: name + table: tpr_service_field_data + field: name + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: name + plugin_id: field + label: '' + exclude: false + alter: + alter_text: true + text: ' {{ name__value }}' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: true + trim: false + preserve_tags: '' + html: false + element_type: '0' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: false + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + pager: + type: some + options: + offset: 0 + items_per_page: 40 + arguments: { } + style: + type: entity_reference + options: + search_fields: + name_override: name_override + id: id + name: name + defaults: + fields: false + arguments: false + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - user.permissions + tags: { } block_search: id: block_search display_title: Block @@ -403,7 +624,7 @@ display: settings: link_to_entity: false group_column: value - group_columns: { } + group_columns: { } group_rows: true delta_limit: 0 delta_offset: 0 @@ -465,9 +686,9 @@ display: hide_alter_empty: true click_sort_column: value type: basic_string - settings: { } + settings: { } group_column: value - group_columns: { } + group_columns: { } group_rows: true delta_limit: 0 delta_offset: 0 @@ -529,9 +750,9 @@ display: hide_alter_empty: true click_sort_column: value type: text_default - settings: { } + settings: { } group_column: value - group_columns: { } + group_columns: { } group_rows: true delta_limit: 0 delta_offset: 0 @@ -596,7 +817,7 @@ display: settings: link_to_entity: false group_column: value - group_columns: { } + group_columns: { } group_rows: true delta_limit: 0 delta_offset: 0 @@ -701,7 +922,7 @@ display: validate: type: none fail: 'not found' - validate_options: { } + validate_options: { } filters: content_translation_status: id: content_translation_status @@ -715,7 +936,7 @@ display: expose: operator: '' operator_limit_selection: false - operator_list: { } + operator_list: { } langcode: id: langcode table: tpr_service_field_data @@ -738,7 +959,7 @@ display: use_operator: false operator: '' operator_limit_selection: false - operator_list: { } + operator_list: { } identifier: '' required: false remember: false @@ -756,8 +977,8 @@ display: multiple: false remember: false default_group: All - default_group_multiple: { } - group_items: { } + default_group_multiple: { } + group_items: { } combine: id: combine table: views @@ -777,7 +998,7 @@ display: use_operator: false operator: combine_op operator_limit_selection: false - operator_list: { } + operator_list: { } identifier: combine required: false remember: false @@ -800,8 +1021,8 @@ display: multiple: false remember: false default_group: All - default_group_multiple: { } - group_items: { } + default_group_multiple: { } + group_items: { } fields: name: name name_synonyms: name_synonyms @@ -834,10 +1055,10 @@ display: arguments: false filters: false filter_groups: false - relationships: { } + relationships: { } display_extenders: metatag_display_extender: - metatags: { } + metatags: { } tokenize: false cache_metadata: max-age: -1 @@ -847,231 +1068,4 @@ display: - url - url.query_args - user.permissions - tags: { } - entity_reference_1: - id: entity_reference_1 - display_title: 'Entity Reference' - display_plugin: entity_reference - position: 2 - display_options: - fields: - name_override: - id: name_override - table: tpr_service_field_data - field: name_override - relationship: none - group_type: group - admin_label: '' - entity_type: tpr_service - entity_field: name_override - plugin_id: field - label: '' - exclude: true - alter: - alter_text: true - text: '({{ id }}) {{ name }}' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: true - trim: false - preserve_tags: '' - html: false - element_type: '0' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: false - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - id: - id: id - table: tpr_service_field_data - field: id - relationship: none - group_type: group - admin_label: '' - entity_type: tpr_service - entity_field: id - plugin_id: field - label: '' - exclude: false - alter: - alter_text: true - text: '{{ id__value }} ' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: true - trim: false - preserve_tags: '' - html: false - element_type: '0' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - name: - id: name - table: tpr_service_field_data - field: name - relationship: none - group_type: group - admin_label: '' - entity_type: null - entity_field: name - plugin_id: field - label: '' - exclude: false - alter: - alter_text: true - text: ' {{ name__value }}' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: true - trim: false - preserve_tags: '' - html: false - element_type: '0' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: false - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - pager: - type: some - options: - offset: 0 - items_per_page: 40 - arguments: { } - style: - type: entity_reference - options: - search_fields: - name_override: name_override - id: id - name: name - defaults: - fields: false - arguments: false - display_extenders: - metatag_display_extender: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } + tags: { } diff --git a/helfi_features/helfi_tpr_config/config/install/views.view.unit_search.yml b/helfi_features/helfi_tpr_config/config/install/views.view.unit_search.yml index 9ac59e5a5..4128d6f73 100644 --- a/helfi_features/helfi_tpr_config/config/install/views.view.unit_search.yml +++ b/helfi_features/helfi_tpr_config/config/install/views.view.unit_search.yml @@ -7,7 +7,6 @@ dependencies: - address - helfi_tpr - user - - views_infinite_scroll id: unit_search label: 'Unit search' module: views @@ -17,80 +16,23 @@ base_table: tpr_unit_field_data base_field: id display: default: - display_plugin: default id: default display_title: Default + display_plugin: default position: 0 display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Käytä - reset_button: false - reset_button_label: Palauta - exposed_sorts_label: Lajittele - expose_sort_order: true - sort_asc_label: Nousevasti - sort_desc_label: Laskevasti - pager: - type: infinite_scroll - options: - items_per_page: 5 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ Previous' - next: 'Next ›' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - views_infinite_scroll: - button_text: 'Load more results' - automatically_load_content: false - initially_load_all_pages: false - style: - type: default - options: - row_class: '' - default_row_class: true - uses_fields: true - row: - type: 'entity:tpr_unit' - options: - relationship: none - view_mode: teaser_with_image + title: '' fields: name: + id: name table: tpr_unit_field_data field: name - id: name - entity_type: null - entity_field: name - plugin_id: field relationship: none group_type: group admin_label: '' + entity_type: null + entity_field: name + plugin_id: field label: '' exclude: false alter: @@ -152,6 +94,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: address + plugin_id: field label: '' exclude: true alter: @@ -206,9 +151,6 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: tpr_unit - entity_field: address - plugin_id: field address__address_line1: id: address__address_line1 table: tpr_unit_field_data @@ -216,6 +158,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: address + plugin_id: field label: '' exclude: true alter: @@ -270,9 +215,6 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: tpr_unit - entity_field: address - plugin_id: field address__address_line2: id: address__address_line2 table: tpr_unit_field_data @@ -280,6 +222,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: address + plugin_id: field label: '' exclude: true alter: @@ -334,9 +279,134 @@ display: multi_type: separator separator: ', ' field_api_classes: false + pager: + type: full + options: + offset: 0 + items_per_page: 5 + total_pages: null + id: 0 + tags: + next: Next + previous: Previous + first: First + last: Last + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + exposed_form: + type: basic + options: + submit_button: Use + reset_button: false + reset_button_label: Reset + exposed_sorts_label: Sort + expose_sort_order: true + sort_asc_label: Ascending + sort_desc_label: Descending + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + empty: + area: + id: area + table: views + field: area + relationship: none + group_type: group + admin_label: '' + plugin_id: text + empty: true + content: + value: 'No results' + format: full_html + tokenize: false + sorts: + name: + id: name + table: tpr_unit_field_data + field: name + relationship: none + group_type: group + admin_label: '' entity_type: tpr_unit - entity_field: address - plugin_id: field + entity_field: name + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name + exposed: false + name_override: + id: name_override + table: tpr_unit_field_data + field: name_override + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: name_override + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name_override + exposed: false + arguments: + id: + id: id + table: tpr_unit_field_data + field: id + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: id + plugin_id: string + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: node + default_argument_options: { } + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + override: false + items_per_page: 25 + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:tpr_unit' + fail: 'not found' + validate_options: + bundles: { } + access: false + operation: view + multiple: 1 + glossary: false + limit: 0 + case: none + path_case: none + transform_dash: false + break_phrase: true filters: combine: id: combine @@ -345,6 +415,7 @@ display: relationship: none group_type: group admin_label: '' + plugin_id: combine operator: allwords value: '' group: 1 @@ -387,7 +458,6 @@ display: address__postal_code: address__postal_code address__address_line1: address__address_line1 address__address_line2: address__address_line2 - plugin_id: combine content_translation_status: id: content_translation_status table: tpr_unit_field_data @@ -395,6 +465,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: content_translation_status + plugin_id: boolean operator: '=' value: '1' group: 1 @@ -425,9 +498,6 @@ display: default_group: All default_group_multiple: { } group_items: { } - entity_type: tpr_unit - entity_field: content_translation_status - plugin_id: boolean langcode: id: langcode table: tpr_unit_field_data @@ -435,6 +505,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: langcode + plugin_id: language operator: in value: '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' @@ -467,103 +540,30 @@ display: default_group: All default_group_multiple: { } group_items: { } - entity_type: tpr_unit - entity_field: langcode - plugin_id: language - sorts: - name: - id: name - table: tpr_unit_field_data - field: name - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: tpr_unit - entity_field: name - plugin_id: standard - name_override: - id: name_override - table: tpr_unit_field_data - field: name_override + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: true + row: + type: 'entity:tpr_unit' + options: relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: tpr_unit - entity_field: name_override - plugin_id: standard - title: '' + view_mode: teaser_with_image + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + replica: false + query_tags: { } + relationships: { } + use_ajax: true header: { } footer: { } - empty: - area: - id: area - table: views - field: area - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: - value: 'No results' - format: full_html - plugin_id: text - relationships: { } - arguments: - id: - id: id - table: tpr_unit_field_data - field: id - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: node - default_argument_options: { } - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:tpr_unit' - fail: 'not found' - validate_options: - operation: view - multiple: 1 - access: false - bundles: { } - glossary: false - limit: 0 - case: none - path_case: none - transform_dash: false - break_phrase: true - entity_type: tpr_unit - entity_field: id - plugin_id: string display_extenders: { } - use_ajax: true cache_metadata: max-age: -1 contexts: @@ -574,13 +574,13 @@ display: - user.permissions tags: { } block: - display_plugin: block id: block display_title: Block + display_plugin: block position: 1 display_options: - display_extenders: { } rendering_language: '***LANGUAGE_entity_translation***' + display_extenders: { } cache_metadata: max-age: -1 contexts: @@ -591,12 +591,11 @@ display: - user.permissions tags: { } entity_reference: - display_plugin: entity_reference id: entity_reference display_title: 'Entity Reference' + display_plugin: entity_reference position: 2 display_options: - display_extenders: { } fields: name_override: id: name_override @@ -605,6 +604,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: name_override + plugin_id: field label: '' exclude: true alter: @@ -660,9 +662,6 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: tpr_unit - entity_field: name_override - plugin_id: field id: id: id table: tpr_unit_field_data @@ -670,6 +669,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: id + plugin_id: field label: '' exclude: false alter: @@ -725,9 +727,6 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: tpr_unit - entity_field: id - plugin_id: field name: id: name table: tpr_unit_field_data @@ -735,6 +734,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: null + entity_field: name + plugin_id: field label: '' exclude: false alter: @@ -790,14 +792,12 @@ display: multi_type: separator separator: ', ' field_api_classes: false - entity_type: null - entity_field: name - plugin_id: field - defaults: - fields: false - filters: false - filter_groups: false - arguments: false + pager: + type: some + options: + offset: 0 + items_per_page: 40 + arguments: { } filters: content_translation_status: id: content_translation_status @@ -806,6 +806,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: content_translation_status + plugin_id: boolean operator: '=' value: '1' group: 1 @@ -836,9 +839,6 @@ display: default_group: All default_group_multiple: { } group_items: { } - entity_type: tpr_unit - entity_field: content_translation_status - plugin_id: boolean langcode: id: langcode table: tpr_unit_field_data @@ -846,6 +846,9 @@ display: relationship: none group_type: group admin_label: '' + entity_type: tpr_unit + entity_field: langcode + plugin_id: language operator: in value: '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' @@ -878,14 +881,10 @@ display: default_group: All default_group_multiple: { } group_items: { } - entity_type: tpr_unit - entity_field: langcode - plugin_id: language filter_groups: operator: AND groups: 1: AND - arguments: { } style: type: entity_reference options: @@ -893,11 +892,12 @@ display: name: name id: id name_override: name_override - pager: - type: some - options: - items_per_page: 40 - offset: 0 + defaults: + fields: false + arguments: false + filters: false + filter_groups: false + display_extenders: { } cache_metadata: max-age: -1 contexts: diff --git a/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml b/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml deleted file mode 100644 index 391309c05..000000000 --- a/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.service_list.field_service_list_meta_load_mor.yml +++ /dev/null @@ -1,4 +0,0 @@ -label: 'Lataa lisää - otsikko' -default_value: - - - value: 'Lataa lisää palveluita' diff --git a/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml b/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml deleted file mode 100644 index 3af0e26f4..000000000 --- a/helfi_features/helfi_tpr_config/config/language/fi/field.field.paragraph.unit_search.field_unit_search_meta_load_more.yml +++ /dev/null @@ -1,4 +0,0 @@ -label: 'Lataa lisää - otsikko' -default_value: - - - value: 'Lataa lisää toimipisteitä' diff --git a/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_list.yml b/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_list.yml index b86f70bb2..d73e53921 100644 --- a/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_list.yml +++ b/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_list.yml @@ -1,10 +1,10 @@ display: default: - display_title: Oletus + display_title: Isäntä display_options: exposed_form: options: - submit_button: Etsi + submit_button: Käytä reset_button_label: Palauta exposed_sorts_label: Lajittele sort_asc_label: Nousevasti @@ -12,22 +12,18 @@ display: pager: options: tags: - previous: '‹ Edellinen' - next: 'Seuraava ›' + next: Seuraava + previous: Edellinen + first: Ensimmäinen + last: Viimeinen expose: items_per_page_label: 'Merkintöjä sivua kohti' items_per_page_options_all_label: '- Kaikki -' - views_infinite_scroll: - button_text: 'Lataa lisää palveluita' + offset_label: Offset arguments: id: exception: title: Kaikki - empty: - area: - content: - value: "

Ei tuloksia

\r\n" - format: full_html block_search: display_options: exposed_form: diff --git a/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_units.yml b/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_units.yml new file mode 100644 index 000000000..0d18f7a38 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/language/fi/views.view.service_units.yml @@ -0,0 +1,31 @@ +display: + default: + display_title: Oletus + display_options: + exposed_form: + options: + submit_button: Käytä + reset_button_label: Palauta + exposed_sorts_label: Lajittele + sort_asc_label: Nousevasti + sort_desc_label: Laskevasti + pager: + options: + tags: + next: Seuraava + previous: Edellinen + first: Ensimmäinen + last: Viimeinen + expose: + items_per_page_label: 'Merkintöjä sivua kohti' + items_per_page_options_all_label: '- Kaikki -' + offset_label: Offset + fields: + name: + separator: ', ' + arguments: + id: + exception: + title: Kaikki + service_units: + display_title: Lohko diff --git a/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_search.yml b/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_search.yml index 19b18c58c..593ca3d37 100644 --- a/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_search.yml +++ b/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_search.yml @@ -12,17 +12,24 @@ display: area: content: value: "

Ei tuloksia

\r\n" + exposed_form: + options: + submit_button: Käytä + reset_button_label: Palauta + exposed_sorts_label: Järjestä + sort_asc_label: Nouseva + sort_desc_label: Laskeva pager: options: tags: - previous: '‹ Edellinen' - next: 'Seuraava ›' + next: Seuraava + previous: Edellinen + first: Ensimmäinen + last: Viimeinen expose: items_per_page_label: 'Merkintöjä sivua kohti' items_per_page_options_all_label: '- Kaikki -' offset_label: Offset - views_infinite_scroll: - button_text: 'Lataa lisää' arguments: id: exception: diff --git a/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_services.yml b/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_services.yml new file mode 100644 index 000000000..76c2da3f6 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/language/fi/views.view.unit_services.yml @@ -0,0 +1,28 @@ +display: + default: + display_title: Oletus + display_options: + exposed_form: + options: + submit_button: Käytä + reset_button_label: Palauta + exposed_sorts_label: Lajittele + sort_asc_label: Nousevasti + sort_desc_label: Laskevasti + pager: + options: + tags: + next: Seuraava + previous: Edellinen + first: Ensimmäinen + last: Viimeinen + expose: + items_per_page_label: 'Merkintöjä sivua kohti' + items_per_page_options_all_label: '- Kaikki -' + offset_label: Offset + arguments: + id: + exception: + title: Kaikki + unit_services: + display_title: Lohko diff --git a/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_list.yml b/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_list.yml index a1dfac5d3..917883e7f 100644 --- a/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_list.yml +++ b/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_list.yml @@ -3,16 +3,11 @@ display: display_options: pager: options: - views_infinite_scroll: - button_text: 'Ladda fler tjänster' - empty: - area: - content: - value: "

Inga resultat

\r\n" - format: full_html - exposed_form: - options: - submit_button: Sök + tags: + next: Nästa + previous: Föregående + first: Första + last: Sista block_search: display_options: exposed_form: diff --git a/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_units.yml b/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_units.yml new file mode 100644 index 000000000..ff02698a0 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_units.yml @@ -0,0 +1,31 @@ +display: + default: + display_title: Förvald + display_options: + exposed_form: + options: + submit_button: Verkställ + reset_button_label: Återställ + exposed_sorts_label: 'Sortera efter' + sort_asc_label: Stigande + sort_desc_label: Fallande + pager: + options: + tags: + next: Nästa + previous: Föregående + first: Första + last: Sista + expose: + items_per_page_label: 'Inlägg per sida' + items_per_page_options_all_label: '- Alla -' + offset_label: Kompensera + fields: + name: + separator: ', ' + arguments: + id: + exception: + title: Alla + service_units: + display_title: Block diff --git a/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_search.yml b/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_search.yml index 69731995e..8161ff66a 100644 --- a/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_search.yml +++ b/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_search.yml @@ -2,11 +2,20 @@ display: default: display_title: Förvald display_options: + exposed_form: + options: + submit_button: Verkställ + reset_button_label: Återställ + exposed_sorts_label: 'Sortera efter' + sort_asc_label: Stigande + sort_desc_label: Fallande pager: options: tags: - previous: '‹ Föregående' - next: 'Nästa ›' + next: Nästa + previous: Föregående + first: Första + last: Sista expose: items_per_page_label: 'Inlägg per sida' items_per_page_options_all_label: '- Alla -' diff --git a/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_services.yml b/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_services.yml new file mode 100644 index 000000000..c345918f4 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/language/sv/views.view.unit_services.yml @@ -0,0 +1,28 @@ +display: + default: + display_title: Förvald + display_options: + exposed_form: + options: + submit_button: Verkställ + reset_button_label: Återställ + exposed_sorts_label: 'Sortera efter' + sort_asc_label: Stigande + sort_desc_label: Fallande + pager: + options: + tags: + next: Nästa + previous: Föregående + first: Första + last: Sista + expose: + items_per_page_label: 'Inlägg per sida' + items_per_page_options_all_label: '- Alla -' + offset_label: Kompensera + arguments: + id: + exception: + title: Alla + unit_services: + display_title: Block diff --git a/helfi_features/helfi_tpr_config/config/optional/views.view.service_units.yml b/helfi_features/helfi_tpr_config/config/optional/views.view.service_units.yml new file mode 100644 index 000000000..af759ce16 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/optional/views.view.service_units.yml @@ -0,0 +1,346 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.tpr_unit.teaser_with_image + module: + - helfi_tpr + - user +id: service_units +label: 'Service units' +module: views +description: 'Lists all published units that offer the service' +tag: '' +base_table: tpr_unit_field_data +base_field: id +display: + default: + id: default + display_title: Master + display_plugin: default + position: 0 + display_options: + title: '' + fields: + name: + id: name + table: tpr_unit_field_data + field: name + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: name + plugin_id: field + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: { } + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + pager: + type: full + options: + offset: 0 + items_per_page: 8 + total_pages: null + id: 0 + tags: + next: Next + previous: Previous + first: First + last: Last + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + empty: { } + sorts: + name: + id: name + table: tpr_unit_field_data + field: name + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: name + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name + exposed: false + name_override: + id: name_override + table: tpr_unit_field_data + field: name_override + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: name_override + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name_override + exposed: false + arguments: + id: + id: id + table: tpr_service_field_data + field: id + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: id + plugin_id: string + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: raw + default_argument_options: + index: 1 + use_alias: false + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + override: false + items_per_page: 25 + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:tpr_service' + fail: 'not found' + validate_options: + bundles: { } + access: false + operation: view + multiple: 0 + glossary: false + limit: 0 + case: none + path_case: none + transform_dash: false + break_phrase: false + filters: + content_translation_status: + id: content_translation_status + table: tpr_unit_field_data + field: content_translation_status + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: content_translation_status + plugin_id: boolean + operator: '=' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + langcode: + id: langcode + table: tpr_unit_field_data + field: langcode + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: langcode + plugin_id: language + operator: in + value: + '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + style: + type: default + row: + type: 'entity:tpr_unit' + options: + relationship: none + view_mode: teaser_with_image + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: true + replica: false + query_tags: { } + relationships: + services_target_id: + id: services_target_id + table: tpr_unit__services + field: services_target_id + relationship: none + group_type: group + admin_label: 'TPR - Service' + entity_type: tpr_unit + entity_field: services + plugin_id: standard + required: true + use_ajax: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: { } + service_units: + id: service_units + display_title: Block + display_plugin: block + position: 1 + display_options: + rendering_language: '***LANGUAGE_entity_translation***' + display_extenders: + metatag_display_extender: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: { } diff --git a/helfi_features/helfi_tpr_config/config/optional/views.view.unit_services.yml b/helfi_features/helfi_tpr_config/config/optional/views.view.unit_services.yml new file mode 100644 index 000000000..6b6b485e5 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/optional/views.view.unit_services.yml @@ -0,0 +1,333 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.tpr_service.teaser + module: + - helfi_tpr + - user +id: unit_services +label: 'Unit services' +module: views +description: 'Lists all published services attached to a unit' +tag: '' +base_table: tpr_unit_field_data +base_field: id +display: + default: + id: default + display_title: Master + display_plugin: default + position: 0 + display_options: + title: '' + fields: + rendered_entity: + id: rendered_entity + table: tpr_service + field: rendered_entity + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + plugin_id: rendered_entity + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + view_mode: teaser + pager: + type: full + options: + offset: 0 + items_per_page: 4 + total_pages: null + id: 0 + tags: + next: Next + previous: Previous + first: First + last: Last + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + empty: { } + sorts: + name: + id: name + table: tpr_service_field_data + field: name + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: name + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name + exposed: false + name_override: + id: name_override + table: tpr_service_field_data + field: name_override + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: name_override + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: name_override + exposed: false + arguments: + id: + id: id + table: tpr_unit_field_data + field: id + relationship: none + group_type: group + admin_label: '' + entity_type: tpr_unit + entity_field: id + plugin_id: string + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: raw + default_argument_options: + index: 1 + use_alias: false + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + override: false + items_per_page: 25 + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: true + validate: + type: 'entity:tpr_unit' + fail: 'not found' + validate_options: + bundles: { } + access: false + operation: view + multiple: 0 + glossary: false + limit: 0 + case: none + path_case: none + transform_dash: false + break_phrase: false + filters: + content_translation_status: + id: content_translation_status + table: tpr_service_field_data + field: content_translation_status + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: content_translation_status + plugin_id: boolean + operator: '=' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + langcode: + id: langcode + table: tpr_service_field_data + field: langcode + relationship: services_target_id + group_type: group + admin_label: '' + entity_type: tpr_service + entity_field: langcode + plugin_id: language + operator: in + value: + '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + style: + type: default + row: + type: fields + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: true + replica: false + query_tags: { } + relationships: + services_target_id: + id: services_target_id + table: tpr_unit__services + field: services_target_id + relationship: none + group_type: group + admin_label: 'TPR - Service' + entity_type: tpr_unit + entity_field: services + plugin_id: standard + required: true + use_ajax: true + group_by: false + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:core.entity_view_display.tpr_service.tpr_service.default' + - 'config:core.entity_view_display.tpr_service.tpr_service.teaser' + unit_services: + id: unit_services + display_title: Block + display_plugin: block + position: 1 + display_options: + rendering_language: '***LANGUAGE_entity_translation***' + display_extenders: + metatag_display_extender: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:core.entity_view_display.tpr_service.tpr_service.default' + - 'config:core.entity_view_display.tpr_service.tpr_service.teaser' diff --git a/helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9006.yml b/helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9006.yml deleted file mode 100644 index 224403acf..000000000 --- a/helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9006.yml +++ /dev/null @@ -1,18 +0,0 @@ -views.view.service_units: - expected_config: - display: - default: - display_options: - pager: - options: - views_infinite_scroll: - button_text: 'Load more service locations' - update_actions: - change: - display: - default: - display_options: - pager: - options: - views_infinite_scroll: - button_text: 'Load more service points' diff --git a/helfi_features/helfi_tpr_config/helfi_tpr_config.info.yml b/helfi_features/helfi_tpr_config/helfi_tpr_config.info.yml index 470ec045d..dcdf6ab66 100755 --- a/helfi_features/helfi_tpr_config/helfi_tpr_config.info.yml +++ b/helfi_features/helfi_tpr_config/helfi_tpr_config.info.yml @@ -21,6 +21,5 @@ dependencies: - 'readonly_field_widget:readonly_field_widget' - 'select2:select2' - 'update_helper:update_helper' - - 'views_infinite_scroll:views_infinite_scroll' 'interface translation project': helfi_tpr_config 'interface translation server pattern': modules/contrib/helfi_platform_config/helfi_features/helfi_tpr_config/translations/%language.po diff --git a/helfi_features/helfi_tpr_config/helfi_tpr_config.install b/helfi_features/helfi_tpr_config/helfi_tpr_config.install index 320e71f51..55fe5c4fc 100644 --- a/helfi_features/helfi_tpr_config/helfi_tpr_config.install +++ b/helfi_features/helfi_tpr_config/helfi_tpr_config.install @@ -7,6 +7,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\helfi_platform_config\ConfigHelper; +use Drupal\field\Entity\FieldStorageConfig; /** * Implements hook_install(). @@ -28,6 +29,7 @@ function helfi_tpr_config_install($is_syncing) { helfi_tpr_config_update_9022(); helfi_tpr_config_update_9023(); helfi_tpr_config_update_9025(); + helfi_tpr_config_update_9029(); } // If HELfi Announcements module is installed, install also @@ -179,20 +181,6 @@ function helfi_tpr_config_update_9005() { return $updateHelper->logger()->output(); } -/** - * Update label for Unit views load more button. - */ -function helfi_tpr_config_update_9006() { - /** @var \Drupal\update_helper\Updater $updateHelper */ - $updateHelper = \Drupal::service('update_helper.updater'); - - // Execute configuration update definitions with logging of success. - $updateHelper->executeUpdate('helfi_tpr_config', 'helfi_tpr_config_update_9006'); - - // Output logged messages to related channel of update execution. - return $updateHelper->logger()->output(); -} - /** * Show five (5) Service points instead of eight (8) in Service page. */ @@ -601,9 +589,63 @@ function helfi_tpr_config_update_9028() { } /** - * Installing configuration files for paragraph type Service List Search and its fields. + * Remove infinite scroll from service list and unit search paragraphs and replace it with full pager. */ function helfi_tpr_config_update_9029() { + // Handle the configuration update manually. + $configLocation = dirname(__FILE__) . '/config/install/'; + $configTranslationLocation = dirname(__FILE__) . '/config/language/'; + + $configurations = [ + 'views.view.service_list', + 'views.view.unit_search', + ]; + + // Install configurations and translations. + foreach ($configurations as $configuration) { + ConfigHelper::installNewConfig($configLocation, $configuration); + ConfigHelper::installNewConfigTranslation($configTranslationLocation, $configuration); + } + + // Remove the meta load more label field because load more pager is not used anymore. + if ($field_service_list_meta_load_mor = FieldStorageConfig::loadByName('paragraph', 'field_service_list_meta_load_mor')) { + $field_service_list_meta_load_mor->delete(); + } + + // Remove the meta load more label field because load more pager is not used anymore. + if ($field_unit_search_meta_load_more = FieldStorageConfig::loadByName('paragraph', 'field_unit_search_meta_load_more')) { + $field_unit_search_meta_load_more->delete(); + } +} + +/** + * Remove infinite scroll from TPR service units and unit services views and replace it with full pager. + */ +function helfi_tpr_config_update_9030() { + // Handle the configuration update manually. + $configLocation = dirname(__FILE__) . '/config/optional/'; + $configTranslationLocation = dirname(__FILE__) . '/config/language/'; + + $configurations = [ + 'views.view.service_units', + 'views.view.unit_services', + ]; + + // Install configurations and translations. + foreach ($configurations as $configuration) { + ConfigHelper::installNewConfig($configLocation, $configuration); + ConfigHelper::installNewConfigTranslation($configTranslationLocation, $configuration); + } + + // Manually uninstall views_infinite_scroll module. + $installer = Drupal::service('module_installer'); + $installer->uninstall(['views_infinite_scroll']); +} + +/** + * Installing configuration files for paragraph type Service List Search and its fields. + */ +function helfi_tpr_config_update_9031() { /** @var \Drupal\update_helper\Updater $updateHelper */ $updateHelper = \Drupal::service('update_helper.updater'); @@ -640,7 +682,7 @@ function helfi_tpr_config_update_9029() { /** * Creating new view mode teaser search result. */ -function helfi_tpr_config_update_9030() { +function helfi_tpr_config_update_9032() { /** @var \Drupal\update_helper\Updater $updateHelper */ $updateHelper = \Drupal::service('update_helper.updater'); @@ -669,7 +711,7 @@ function helfi_tpr_config_update_9030() { /** * Add new display for service list view with labels translations. */ -function helfi_tpr_config_update_9031() { +function helfi_tpr_config_update_9033() { /** @var \Drupal\update_helper\Updater $updateHelper */ $updateHelper = \Drupal::service('update_helper.updater'); diff --git a/helfi_platform_config.libraries.yml b/helfi_platform_config.libraries.yml index c24b1ace7..a5b935e93 100644 --- a/helfi_platform_config.libraries.yml +++ b/helfi_platform_config.libraries.yml @@ -139,6 +139,23 @@ watson_sote: minified: true } +watson_talpa: + version: 1.0.x + header: false + js: + 'https://coh-chat-app-prod.ow6i4n9pdzm.eu-de.codeengine.appdomain.cloud/widget.min.js': { + type: external, + minified: true + } + 'https://coh-chat-app-prod.ow6i4n9pdzm.eu-de.codeengine.appdomain.cloud/static/talpa/custom.widget.min.js?tenantId=www-hel-fi-prod&assistantId=talpa': { + type: external, + minified: true + } + 'https://coh-chat-app-prod.ow6i4n9pdzm.eu-de.codeengine.appdomain.cloud/default.min.js': { + type: external, + minified: true + } + genesys_neuvonta: version: 1.0.x header: true diff --git a/src/ConfigHelper.php b/src/ConfigHelper.php index f8d129d38..f48e2b71a 100644 --- a/src/ConfigHelper.php +++ b/src/ConfigHelper.php @@ -23,13 +23,24 @@ class ConfigHelper { */ public static function installNewConfig(string $config_location, string $config_name): void { $config_factory = \Drupal::configFactory(); + $active_config = $config_factory->getEditable($config_name); $filepath = "{$config_location}{$config_name}.yml"; - if (file_exists($filepath)) { - $data = Yaml::parse(file_get_contents($filepath)); - if (is_array($data)) { - $config_factory->getEditable($config_name)->setData($data)->save(TRUE); - } + + // Return if file is not found or it is empty. + if ( + !file_exists($filepath) || + empty($data = Yaml::parse(file_get_contents($filepath))) + ) { + return; } + + // Retain possible active configuration uuid. + if (!empty($active_config->get('uuid'))) { + $data = ['uuid' => $active_config->get('uuid')] + $data; + } + + // Save the configuration. + $active_config->setData($data)->save(TRUE); } /** diff --git a/src/Plugin/Block/ChatLeijuke.php b/src/Plugin/Block/ChatLeijuke.php index 66ed51873..9370fdb10 100644 --- a/src/Plugin/Block/ChatLeijuke.php +++ b/src/Plugin/Block/ChatLeijuke.php @@ -37,6 +37,7 @@ public function blockForm($form, FormStateInterface $form_state) { 'watson_chatbot' => 'Asunnonhakubotti (watson)', 'kuura_health_chat' => 'Kuura Health Chat', 'watson_sote' => 'Hester/Sotebotti (watson)', + 'watson_talpa' => 'Talbotti (watson)', ], ];