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..a1c21d877 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 @@ -8,7 +8,6 @@ dependencies: - helfi_tpr - text - user - - views_infinite_scroll id: service_list label: 'Service list' module: views @@ -23,7 +22,67 @@ display: display_plugin: default position: 0 display_options: +<<<<<<< HEAD title: '' +======= + 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: 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 + pager: + type: full + options: + items_per_page: 4 + offset: 0 + id: 0 + total_pages: null + 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 + style: + type: default + options: + row_class: '' + default_row_class: true + uses_fields: false + row: + type: 'entity:tpr_service' + options: + relationship: none + view_mode: teaser +>>>>>>> 102e8c7 (UHF-7298: Removed infinity scroll from unit search and service list views) fields: name: id: name 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..74a30e88e 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 @@ -40,23 +39,25 @@ display: exposed_form: type: basic options: - submit_button: Käytä + submit_button: Use reset_button: false - reset_button_label: Palauta - exposed_sorts_label: Lajittele + reset_button_label: Reset + exposed_sorts_label: Sort expose_sort_order: true - sort_asc_label: Nousevasti - sort_desc_label: Laskevasti + sort_asc_label: Ascending + sort_desc_label: Descending pager: - type: infinite_scroll + type: full options: items_per_page: 5 offset: 0 id: 0 total_pages: null tags: - previous: '‹ Previous' - next: 'Next ›' + next: Next + previous: Previous + first: First + last: Last expose: items_per_page: false items_per_page_label: 'Items per page' @@ -65,10 +66,7 @@ display: 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 + quantity: 9 style: type: default options: 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..5c3dbb3d7 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 @@ -12,13 +12,19 @@ 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 -' +<<<<<<< HEAD views_infinite_scroll: button_text: 'Lataa lisää palveluita' +======= + offset_label: Offset +>>>>>>> 102e8c7 (UHF-7298: Removed infinity scroll from unit search and service list views) arguments: id: exception: 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/sv/views.view.service_list.yml b/helfi_features/helfi_tpr_config/config/language/sv/views.view.service_list.yml index a1dfac5d3..5e16dd36e 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 @@ -28,3 +28,8 @@ display: expose: label: 'Rådgivningstjänstens namn eller sökterm' placeholder: 't.ex. Socialrådgivning, hälsa eller digitalt Sök' + tags: + next: Nästa + previous: Föregående + first: Första + last: Sista 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/update/helfi_tpr_config_update_9029.yml b/helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9029.yml new file mode 100644 index 000000000..d7b31fea5 --- /dev/null +++ b/helfi_features/helfi_tpr_config/config/update/helfi_tpr_config_update_9029.yml @@ -0,0 +1,78 @@ +views.view.service_list: + expected_config: + dependencies: + module: + - helfi_tpr + - user + - views_infinite_scroll + display: + default: + display_options: + pager: + type: infinite_scroll + options: + tags: + previous: '‹ Previous' + next: 'Next ›' + views_infinite_scroll: + button_text: 'Load more services' + automatically_load_content: false + initially_load_all_pages: false + update_actions: + change: + dependencies: + module: + - helfi_tpr + - user + display: + default: + display_options: + pager: + type: full + options: + tags: + next: Next + previous: Previous + first: First + last: Last + quantity: 9 +views.view.unit_search: + expected_config: + dependencies: + module: + - address + - helfi_tpr + - user + - views_infinite_scroll + display: + default: + display_options: + pager: + type: infinite_scroll + options: + tags: + previous: '‹ Previous' + next: 'Next ›' + views_infinite_scroll: + button_text: 'Load more results' + automatically_load_content: false + initially_load_all_pages: false + update_actions: + change: + dependencies: + module: + - address + - helfi_tpr + - user + display: + default: + display_options: + pager: + type: full + options: + tags: + next: Next + previous: Previous + first: First + last: Last + quantity: 9 diff --git a/helfi_features/helfi_tpr_config/helfi_tpr_config.install b/helfi_features/helfi_tpr_config/helfi_tpr_config.install index 320e71f51..f17483949 100644 --- a/helfi_features/helfi_tpr_config/helfi_tpr_config.install +++ b/helfi_features/helfi_tpr_config/helfi_tpr_config.install @@ -6,6 +6,7 @@ */ use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\field\Entity\FieldStorageConfig; use Drupal\helfi_platform_config\ConfigHelper; /** @@ -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 @@ -601,9 +603,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 +696,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 +725,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');