diff --git a/composer.json b/composer.json index 41bb22b98a..fec7c8f504 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "drupal/entityqueue": "^1.2", "drupal/error_page": "^1.0", "drupal/facets": "1.6.0", + "drupal/facets_form": "dev-1.x", "drupal/field_delimiter": "^1.1", "drupal/field_formatter_range": "^1.1", "drupal/field_group": "^3.1", @@ -91,6 +92,7 @@ "drupal/video_embed_field": "^2", "drupal/view_unpublished": "^1.0", "drupal/views_autosubmit": "^1.2", + "drupal/views_block_area": "^1.0@beta", "drupal/views_bulk_operations": "^4", "drupal/views_data_export": "^1.0", "drupal/views_multiple_permissions": "^1.0", @@ -357,6 +359,9 @@ "drupal/views_autosubmit": { "The views plugin options are missing schema @see https://www.drupal.org/i/3195213": "https://git.drupalcode.org/project/views_autosubmit/-/merge_requests/2.diff" }, + "drupal/views_block_area": { + "Views block area missing schema @see https://www.drupal.org/project/views_block_area/issues/3157188": "https://www.drupal.org/files/issues/2020-07-06/views_block_area-missing_schema-3157188-2.patch" + }, "openeuropa/oe_bootstrap_theme": { "Preserve link attributes in navigation menus @see https://github.com/openeuropa/oe_bootstrap_theme/pull/38": "https://patch-diff.githubusercontent.com/raw/openeuropa/oe_bootstrap_theme/pull/38.diff" }, diff --git a/composer.lock b/composer.lock index 38b257e5ab..e1a7add8df 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "aac8408e1fc877d1838d5e2b77145a05", + "content-hash": "d84b68fa25515d08182f6deebe6892f9", "packages": [ { "name": "SEMICeu/adms-ap_validator", @@ -3940,7 +3940,8 @@ "patches_applied": { "Facet Summary for Facet Items with a set dependency. @see https://www.drupal.org/node/2873480": "resources/patch/facet_summary_for_facet-2873480-18.patch", "Configurable dropdown child prefix. @see https://www.drupal.org/project/facets/issues/3214662": "https://git.drupalcode.org/project/facets/-/merge_requests/20.diff", - "SA-CONTRIB-2021-008. @see https://www.drupal.org/sa-contrib-2021-008": "https://www.drupal.org/files/issues/2021-05-17/3213582-facets-1.6-1.7.patch" + "SA-CONTRIB-2021-008. @see https://www.drupal.org/sa-contrib-2021-008": "https://www.drupal.org/files/issues/2021-05-17/3213582-facets-1.6-1.7.patch", + "https://www.drupal.org/project/facets/issues/3223956": "https://git.drupalcode.org/project/facets/-/merge_requests/25.diff" } }, "notification-url": "https://packages.drupal.org/8/downloads", @@ -3977,6 +3978,65 @@ "irc": "irc://irc.freenode.org/drupal-search-api" } }, + { + "name": "drupal/facets_form", + "version": "dev-1.x", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/facets_form.git", + "reference": "52d624f6b32986941e1df77c6dd0c5eab77f6391" + }, + "require": { + "cweagans/composer-patches": "^1.7", + "drupal/core": "^8.9 || ^9.1", + "drupal/facets": "^1.6" + }, + "require-dev": { + "drupal/facets_summary": "*", + "drupal/search_api": "^1.13" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "1.x-dev", + "datestamp": "1632837046", + "security-coverage": { + "status": "not-covered", + "message": "Dev releases are not covered by Drupal security advisories." + } + }, + "enable-patching": true, + "patches": { + "drupal/facets": { + "https://www.drupal.org/project/facets/issues/3223956": "https://git.drupalcode.org/project/facets/-/merge_requests/25.diff" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Claudiu Cristea", + "homepage": "https://www.drupal.org/u/claudiucristea" + }, + { + "name": "Andras Szilagyi", + "homepage": "https://www.drupal.org/u/andras_szilagyi" + } + ], + "description": "Place the facets of a given facets source in a form", + "homepage": "https://www.drupal.org/project/facets_form", + "support": { + "source": "https://git.drupalcode.org/project/facets_form", + "issues": "https://www.drupal.org/project/issues/facets_form" + }, + "time": "2021-09-30T10:52:24+00:00" + }, { "name": "drupal/field_delimiter", "version": "1.1.0", @@ -8193,6 +8253,61 @@ "issues": "https://www.drupal.org/project/issues/views_autosubmit" } }, + { + "name": "drupal/views_block_area", + "version": "1.0.0-beta3", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/views_block_area.git", + "reference": "8.x-1.0-beta3" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/views_block_area-8.x-1.0-beta3.zip", + "reference": "8.x-1.0-beta3", + "shasum": "bfc4a4b2c85545ef53f91f5f6633f7465c655494" + }, + "require": { + "drupal/core": "^8 || ^9" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.0-beta3", + "datestamp": "1592206687", + "security-coverage": { + "status": "not-covered", + "message": "Beta releases are not covered by Drupal security advisories." + } + }, + "patches_applied": { + "Views block area missing schema @see https://www.drupal.org/project/views_block_area/issues/3157188": "https://www.drupal.org/files/issues/2020-07-06/views_block_area-missing_schema-3157188-2.patch" + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Leon Kessler", + "homepage": "https://www.drupal.org/user/595374" + }, + { + "name": "cafuego", + "homepage": "https://www.drupal.org/user/218525" + }, + { + "name": "nils.destoop", + "homepage": "https://www.drupal.org/user/361625" + } + ], + "description": "Exposes all blocks as a views area.", + "homepage": "https://www.drupal.org/project/views_block_area", + "support": { + "source": "https://git.drupalcode.org/project/views_block_area" + } + }, { "name": "drupal/views_bulk_operations", "version": "4.0.0", @@ -9295,7 +9410,7 @@ "reference": "master" }, "type": "drupal-theme-library", - "time": "2018-10-31T20:10:45+00:00" + "time": "2021-06-30T06:04:10+00:00" }, { "name": "kub-at/php-simple-html-dom-parser", @@ -10143,14 +10258,9 @@ { "name": "openeuropa/oe_bootstrap_theme", "version": "0.71.0", - "source": { - "type": "git", - "url": "https://github.com/openeuropa/oe_bootstrap_theme.git", - "reference": "acaf97ddaa159dc827622a2ede554336dc2afe63" - }, "dist": { - "type": "zip", - "url": "https://api.github.com/repos/openeuropa/oe_bootstrap_theme/zipball/acaf97ddaa159dc827622a2ede554336dc2afe63", + "type": "tar", + "url": "https://github.com/openeuropa/oe_bootstrap_theme/releases/download/0.71.0/oe_bootstrap_theme-0.71.0.tar.gz", "reference": "acaf97ddaa159dc827622a2ede554336dc2afe63", "shasum": "" }, @@ -10168,6 +10278,7 @@ "drupal/drupal-extension": "^4.1", "drupal/styleguide": "^1.0@alpha", "drush/drush": "^10.3", + "openeuropa/task-runner": "dev-php-7.1 as 1.0.0-beta7", "phpspec/prophecy-phpunit": "^1 || ^2" }, "type": "drupal-theme", @@ -10212,7 +10323,7 @@ "EUPL-1.2" ], "description": "OpenEuropa Bootstrap base theme.", - "time": "2021-10-22T14:56:33+00:00" + "time": "2021-10-22T15:17:24+00:00" }, { "name": "openeuropa/oe_webtools", @@ -11579,7 +11690,7 @@ "reference": "master" }, "type": "library", - "time": "2020-08-03T19:59:39+00:00" + "time": "2020-10-26T14:41:29+00:00" }, { "name": "stack/builder", @@ -15906,7 +16017,7 @@ "extra": { "drupal": { "version": "8.x-1.0", - "datestamp": "1633781924", + "datestamp": "1633781890", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -20673,6 +20784,7 @@ "stability-flags": { "dkarv/mdl-chip-input": 20, "drupal/config_ignore": 20, + "drupal/facets_form": 20, "drupal/menu_link_destination": 20, "drupal/og": 20, "drupal/page_manager": 10, @@ -20681,6 +20793,7 @@ "drupal/site_verify": 20, "drupal/subpathauto": 20, "drupal/swiftmailer": 20, + "drupal/views_block_area": 10, "ec-europa/joinup-tallinn-dashboard": 20, "ec-europa/material-design-lite": 20, "jacklmoore/autosize": 20, diff --git a/config/sync/block.block.entity_bundle_facet.yml b/config/sync/block.block.entity_bundle_facet.yml deleted file mode 100644 index e143fead9f..0000000000 --- a/config/sync/block.block.entity_bundle_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 5d10248b-fb61-4515-b58a-97d58639df37 -langcode: en -status: true -dependencies: - config: - - facets.facet.type - module: - - facets - - joinup_core - theme: - - joinup_theme -id: entity_bundle_facet -theme: joinup_theme -region: sidebar_left -weight: -18 -provider: null -plugin: 'facet_block:type' -settings: - id: 'facet_block:type' - label: 'Content types' - provider: facets - label_display: '1' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.facetform_viewsearch.yml b/config/sync/block.block.facetform_viewsearch.yml new file mode 100644 index 0000000000..0dbe7f99c1 --- /dev/null +++ b/config/sync/block.block.facetform_viewsearch.yml @@ -0,0 +1,32 @@ +uuid: 29b2c3a6-e0e5-4b77-9d02-1d7b52ce0511 +langcode: en +status: true +dependencies: + module: + - facets_form + - joinup_core + theme: + - ventuno +id: facetform_viewsearch +theme: ventuno +region: sidebar +weight: 0 +provider: null +plugin: 'facets_form:search_api:views_page__search__page_1' +settings: + id: 'facets_form:search_api:views_page__search__page_1' + label: 'Facet form: View Search, display Page' + provider: facets_form + label_display: '0' + button: + label: + submit: Search + reset: 'Clear filters' + facets: { } +visibility: + request_route: + id: request_route + routes: + - view.search.page_1 + negate: false + context_mapping: { } diff --git a/config/sync/block.block.facetformviewsearchdisplaypage.yml b/config/sync/block.block.facetformviewsearchdisplaypage.yml new file mode 100644 index 0000000000..c09b923e35 --- /dev/null +++ b/config/sync/block.block.facetformviewsearchdisplaypage.yml @@ -0,0 +1,37 @@ +uuid: 33e5f26c-41da-4f9b-85a8-144a7b0bfe07 +langcode: en +status: true +dependencies: + config: + - facets.facet.creation_date + - facets.facet.group + - facets.facet.spatial_coverage + - facets.facet.topic + - facets.facet.type + module: + - facets_form + - system + theme: + - joinup_theme +id: facetformviewsearchdisplaypage +theme: joinup_theme +region: sidebar_left +weight: 0 +provider: null +plugin: 'facets_form:search_api:views_page__search__page_1' +settings: + id: 'facets_form:search_api:views_page__search__page_1' + label: 'Facet form: View Search, display Page' + provider: facets_form + label_display: '0' + button: + label: + submit: Search + reset: 'Clear filters' + facets: { } +visibility: + request_path: + id: request_path + pages: "/search\r\n/search/*" + negate: false + context_mapping: { } diff --git a/config/sync/block.block.group_facet.yml b/config/sync/block.block.group_facet.yml deleted file mode 100644 index d383dd0cc3..0000000000 --- a/config/sync/block.block.group_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: cf94fd0f-8d17-4fbf-9f2f-388da1a3db5b -langcode: en -status: true -dependencies: - config: - - facets.facet.group - module: - - facets - - joinup_core - theme: - - joinup_theme -id: group_facet -theme: joinup_theme -region: sidebar_left -weight: -17 -provider: null -plugin: 'facet_block:group' -settings: - id: 'facet_block:group' - label: 'Search page - Group facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.spatial_coverage_facet.yml b/config/sync/block.block.spatial_coverage_facet.yml deleted file mode 100644 index 9c056bba23..0000000000 --- a/config/sync/block.block.spatial_coverage_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 1da70601-9a66-4756-9564-d4b2f3e5e81d -langcode: en -status: true -dependencies: - config: - - facets.facet.spatial_coverage - module: - - facets - - joinup_core - theme: - - joinup_theme -id: spatial_coverage_facet -theme: joinup_theme -region: sidebar_left -weight: -15 -provider: null -plugin: 'facet_block:spatial_coverage' -settings: - id: 'facet_block:spatial_coverage' - label: 'Search page - Geographical coverage facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.three_dots_menu.yml b/config/sync/block.block.three_dots_menu.yml index 0392828e5f..07ccb91c0d 100644 --- a/config/sync/block.block.three_dots_menu.yml +++ b/config/sync/block.block.three_dots_menu.yml @@ -2,6 +2,8 @@ uuid: 998c6074-0e67-43ac-b241-615239dee76a langcode: en status: true dependencies: + module: + - joinup_core theme: - joinup_theme id: three_dots_menu diff --git a/config/sync/block.block.topic_facet.yml b/config/sync/block.block.topic_facet.yml deleted file mode 100644 index 8d28878d23..0000000000 --- a/config/sync/block.block.topic_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 976857e9-05a8-4454-8ec8-8974fd527045 -langcode: en -status: true -dependencies: - config: - - facets.facet.topic - module: - - facets - - joinup_core - theme: - - joinup_theme -id: topic_facet -theme: joinup_theme -region: sidebar_left -weight: -16 -provider: null -plugin: 'facet_block:topic' -settings: - id: 'facet_block:topic' - label: 'Search page - Topic facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.ventuno_entity_bundle_facet.yml b/config/sync/block.block.ventuno_entity_bundle_facet.yml deleted file mode 100644 index a77e44c53c..0000000000 --- a/config/sync/block.block.ventuno_entity_bundle_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: c655a719-0864-4dcf-bc0a-5e624e4484e8 -langcode: en -status: true -dependencies: - config: - - facets.facet.type - module: - - facets - - joinup_core - theme: - - ventuno -id: ventuno_entity_bundle_facet -theme: ventuno -region: sidebar -weight: -22 -provider: null -plugin: 'facet_block:type' -settings: - id: 'facet_block:type' - label: 'Content types' - provider: facets - label_display: '1' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.ventuno_group_facet.yml b/config/sync/block.block.ventuno_group_facet.yml deleted file mode 100644 index 5a3497168b..0000000000 --- a/config/sync/block.block.ventuno_group_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: ad14eb15-5005-494e-a0f3-673b83a9af32 -langcode: en -status: true -dependencies: - config: - - facets.facet.group - module: - - facets - - joinup_core - theme: - - ventuno -id: ventuno_group_facet -theme: ventuno -region: sidebar -weight: -21 -provider: null -plugin: 'facet_block:group' -settings: - id: 'facet_block:group' - label: 'Search page - Group facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.ventuno_spatial_coverage_facet.yml b/config/sync/block.block.ventuno_spatial_coverage_facet.yml deleted file mode 100644 index 074741b38c..0000000000 --- a/config/sync/block.block.ventuno_spatial_coverage_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 02e4583d-5f4b-4d31-abb0-4357444f493f -langcode: en -status: true -dependencies: - config: - - facets.facet.spatial_coverage - module: - - facets - - joinup_core - theme: - - ventuno -id: ventuno_spatial_coverage_facet -theme: ventuno -region: sidebar -weight: -19 -provider: null -plugin: 'facet_block:spatial_coverage' -settings: - id: 'facet_block:spatial_coverage' - label: 'Search page - Geographical coverage facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/block.block.ventuno_topic_facet.yml b/config/sync/block.block.ventuno_topic_facet.yml deleted file mode 100644 index 7250cab83a..0000000000 --- a/config/sync/block.block.ventuno_topic_facet.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: ed460e0f-8b15-4e00-aff6-a63cfda3de1c -langcode: en -status: true -dependencies: - config: - - facets.facet.topic - module: - - facets - - joinup_core - theme: - - ventuno -id: ventuno_topic_facet -theme: ventuno -region: sidebar -weight: -20 -provider: null -plugin: 'facet_block:topic' -settings: - id: 'facet_block:topic' - label: 'Search page - Topic facet' - provider: facets - label_display: '0' -visibility: - request_route: - id: request_route - routes: - - view.search.page_1 - negate: false - context_mapping: { } diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 4a61f28912..79d3322808 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -47,6 +47,9 @@ module: eu_sic: 0 eupl: 0 facets: 0 + facets_form: 0 + facets_form_date_range: 0 + facets_summary: 0 field: 0 field_delimiter: 0 field_formatter_range: 0 @@ -213,6 +216,7 @@ module: video_embed_wysiwyg: 0 view_unpublished: 0 views_autosubmit: 0 + views_block_area: 0 views_bulk_operations: 0 views_data_export: 0 views_multiple_permissions: 0 diff --git a/config/sync/facets.facet.creation_date.yml b/config/sync/facets.facet.creation_date.yml new file mode 100644 index 0000000000..18d2af5bea --- /dev/null +++ b/config/sync/facets.facet.creation_date.yml @@ -0,0 +1,63 @@ +uuid: d23291d8-c77d-4c38-a3ae-d6c6d900d0c3 +langcode: en +status: true +dependencies: + config: + - search_api.index.published + - views.view.search + module: + - search_api +id: creation_date +name: 'Creation Date' +url_alias: creation_date +weight: 0 +min_count: 1 +show_only_one_result: true +field_identifier: rdf_created +facet_source_id: 'search_api:views_page__search__page_1' +widget: + type: facets_form_date_range + config: + date_type: date + label: + from: 'Date from' + to: 'Date to' + date_format: + type: date_only + custom: '' + show_numbers: false +query_operator: or +use_hierarchy: false +expand_hierarchy: false +enable_parent_when_child_gets_disabled: true +hard_limit: 0 +exclude: false +only_visible_when_facet_source_is_visible: true +processor_configs: + active_widget_order: + processor_id: active_widget_order + weights: + sort: -10 + settings: + sort: DESC + count_widget_order: + processor_id: count_widget_order + weights: + sort: -10 + settings: + sort: DESC + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: -10 + settings: + sort: ASC + url_processor_handler: + processor_id: url_processor_handler + weights: + pre_query: 50 + build: -10 + settings: { } +empty_behavior: + behavior: none +show_title: true diff --git a/config/sync/facets.facet.group.yml b/config/sync/facets.facet.group.yml index 92794194b4..5ddc191e5e 100644 --- a/config/sync/facets.facet.group.yml +++ b/config/sync/facets.facet.group.yml @@ -16,11 +16,12 @@ show_only_one_result: true field_identifier: entity_groups facet_source_id: 'search_api:views_page__search__page_1' widget: - type: dropdown + type: facets_form_dropdown config: - show_numbers: true default_option_label: 'Any Collection or Solution' - arbitrary_facet_plugin: _none + child_items_prefix: '-' + disabled_on_empty: false + show_numbers: true query_operator: or use_hierarchy: false expand_hierarchy: false @@ -34,7 +35,7 @@ processor_configs: weights: sort: -2 settings: - sort: DESC + sort: ASC aggregated_entity_reference_label: processor_id: aggregated_entity_reference_label weights: @@ -52,7 +53,7 @@ processor_configs: weights: sort: -1 settings: - sort: DESC + sort: ASC display_value_widget_order: processor_id: display_value_widget_order weights: diff --git a/config/sync/facets.facet.spatial_coverage.yml b/config/sync/facets.facet.spatial_coverage.yml index 054557114b..7f1e943a2d 100644 --- a/config/sync/facets.facet.spatial_coverage.yml +++ b/config/sync/facets.facet.spatial_coverage.yml @@ -10,17 +10,18 @@ dependencies: id: spatial_coverage name: 'Geographic coverage' url_alias: spatial_coverage -weight: 0 +weight: -1 min_count: 1 show_only_one_result: true field_identifier: spatial_coverage facet_source_id: 'search_api:views_page__search__page_1' widget: - type: dropdown + type: facets_form_dropdown config: - show_numbers: true default_option_label: 'Any location' - arbitrary_facet_plugin: _none + child_items_prefix: '-' + disabled_on_empty: false + show_numbers: true query_operator: or use_hierarchy: false expand_hierarchy: false @@ -34,36 +35,36 @@ processor_configs: weights: sort: -8 settings: - sort: DESC + sort: ASC aggregated_entity_reference_label: processor_id: aggregated_entity_reference_label weights: - build: 0 + build: -10 settings: { } count_limit: processor_id: count_limit weights: - build: -2 + build: 5 settings: minimum_items: 1 maximum_items: null count_widget_order: processor_id: count_widget_order weights: - sort: -9 + sort: -10 settings: - sort: DESC + sort: ASC display_value_widget_order: processor_id: display_value_widget_order weights: - sort: -10 + sort: -8 settings: sort: ASC url_processor_handler: processor_id: url_processor_handler weights: pre_query: -10 - build: -1 + build: 5 settings: { } empty_behavior: behavior: none diff --git a/config/sync/facets.facet.topic.yml b/config/sync/facets.facet.topic.yml index 1423892fe3..92400d080b 100644 --- a/config/sync/facets.facet.topic.yml +++ b/config/sync/facets.facet.topic.yml @@ -8,24 +8,24 @@ dependencies: module: - search_api id: topic -name: Topic +name: Topics url_alias: topic -weight: 0 +weight: -3 min_count: 1 show_only_one_result: true field_identifier: topic facet_source_id: 'search_api:views_page__search__page_1' widget: - type: dropdown + type: facets_form_dropdown config: - show_numbers: false default_option_label: 'Any topic' - child_prefix: ' ' - arbitrary_facet_plugin: _none + child_items_prefix: '-' + disabled_on_empty: false + show_numbers: false query_operator: or use_hierarchy: true expand_hierarchy: true -enable_parent_when_child_gets_disabled: true +enable_parent_when_child_gets_disabled: false hard_limit: 0 exclude: false only_visible_when_facet_source_is_visible: true @@ -35,36 +35,36 @@ processor_configs: weights: sort: -8 settings: - sort: DESC + sort: ASC aggregated_entity_reference_label: processor_id: aggregated_entity_reference_label weights: - build: -1 + build: 5 settings: { } count_limit: processor_id: count_limit weights: - build: 0 + build: -10 settings: minimum_items: 1 maximum_items: null count_widget_order: processor_id: count_widget_order weights: - sort: -9 + sort: -10 settings: - sort: DESC + sort: ASC display_value_widget_order: processor_id: display_value_widget_order weights: - sort: -10 + sort: -8 settings: sort: ASC url_processor_handler: processor_id: url_processor_handler weights: pre_query: -10 - build: -2 + build: 5 settings: { } empty_behavior: behavior: none diff --git a/config/sync/facets.facet.type.yml b/config/sync/facets.facet.type.yml index b3f228235f..763987f5d6 100644 --- a/config/sync/facets.facet.type.yml +++ b/config/sync/facets.facet.type.yml @@ -8,25 +8,20 @@ dependencies: module: - search_api id: type -name: Type +name: 'Content types' url_alias: type -weight: 0 +weight: -2 min_count: 1 show_only_one_result: false field_identifier: entity_bundle facet_source_id: 'search_api:views_page__search__page_1' widget: - type: checkbox + type: facets_form_dropdown config: + default_option_label: Choose + child_items_prefix: '-' + disabled_on_empty: false show_numbers: true - soft_limit: 0 - soft_limit_settings: - show_less_label: 'Show less' - show_more_label: 'Show more' - show_reset_link: false - reset_text: 'Show all' - hide_reset_when_no_selection: false - arbitrary_facet_plugin: _none query_operator: or use_hierarchy: false expand_hierarchy: false @@ -38,7 +33,7 @@ processor_configs: aggregated_entity_bundle_label: processor_id: aggregated_entity_bundle_label weights: - build: -10 + build: 5 settings: plural_count_label: enabled: true @@ -46,10 +41,16 @@ processor_configs: count_limit: processor_id: count_limit weights: - build: 0 + build: -10 settings: minimum_items: 1 maximum_items: null + display_value_widget_order: + processor_id: display_value_widget_order + weights: + sort: 40 + settings: + sort: ASC joinup_search_content_type_fixed_order: processor_id: joinup_search_content_type_fixed_order weights: @@ -64,4 +65,4 @@ processor_configs: settings: { } empty_behavior: behavior: none -show_title: false +show_title: true diff --git a/config/sync/facets_summary.facets_summary.search_facets_summary.yml b/config/sync/facets_summary.facets_summary.search_facets_summary.yml new file mode 100644 index 0000000000..c4dcc371c2 --- /dev/null +++ b/config/sync/facets_summary.facets_summary.search_facets_summary.yml @@ -0,0 +1,43 @@ +uuid: 0a4c553f-2c75-4e3c-9d41-68bc0043edd9 +langcode: en +status: true +dependencies: + config: + - search_api.index.published + - views.view.search + module: + - search_api +id: search_facets_summary +name: 'Search facets summary' +facets: + spatial_coverage: + checked: true + label: 'Geographic coverage' + separator: ', ' + weight: 0 + show_count: false + topic: + checked: true + label: Topic + separator: ', ' + weight: 0 + show_count: false + type: + checked: true + label: Type + separator: ', ' + weight: 0 + show_count: false + group: + checked: true + label: Collection/Solution + separator: ', ' + weight: 0 + show_count: false +facet_source_id: 'search_api:views_page__search__page_1' +processor_configs: + hide_when_not_rendered: + processor_id: hide_when_not_rendered + weights: + build: '45' + settings: { } diff --git a/config/sync/field.field.message.group_content_subscription.field_group_content.yml b/config/sync/field.field.message.group_content_subscription.field_group_content.yml index f724c9f74c..2f5813f9bd 100644 --- a/config/sync/field.field.message.group_content_subscription.field_group_content.yml +++ b/config/sync/field.field.message.group_content_subscription.field_group_content.yml @@ -272,4 +272,7 @@ settings: responsive_image_style: handler: 'default:responsive_image_style' handler_settings: { } + facets_summary: + handler: 'default:facets_summary' + handler_settings: { } field_type: dynamic_entity_reference diff --git a/config/sync/filter.format.essential_html.yml b/config/sync/filter.format.essential_html.yml index 99960e75ec..efb030f24e 100644 --- a/config/sync/filter.format.essential_html.yml +++ b/config/sync/filter.format.essential_html.yml @@ -56,12 +56,3 @@ filters: status: true weight: 0 settings: { } - media_embed: - id: media_embed - provider: media - status: false - weight: 100 - settings: - default_view_mode: default - allowed_media_types: { } - allowed_view_modes: { } diff --git a/config/sync/theme_rule.rule.search.yml b/config/sync/theme_rule.rule.search.yml new file mode 100644 index 0000000000..8212a6da6f --- /dev/null +++ b/config/sync/theme_rule.rule.search.yml @@ -0,0 +1,18 @@ +uuid: d829d7dc-4cc7-4988-9f6b-1db7ef4901ce +langcode: en +status: true +dependencies: + module: + - joinup_core + theme: + - ventuno +id: search +label: Search +theme: ventuno +weight: 0 +conditions: + request_route: + id: request_route + routes: + - view.search.page_1 + negate: false diff --git a/config/sync/views.view.search.yml b/config/sync/views.view.search.yml index fdb879274d..9581a4d890 100644 --- a/config/sync/views.view.search.yml +++ b/config/sync/views.view.search.yml @@ -8,6 +8,7 @@ dependencies: - joinup_material_design - search_api - views_autosubmit + - views_block_area _core: default_config_hash: IZ_1De9xX5-8975-JeHxZJ0f_58o9R3nM9pxnxboN_k id: search @@ -386,7 +387,27 @@ display: identifier: last-updated-date plugin_id: search_api title: '' - header: { } + header: + result: + id: result + table: views + field: result + relationship: none + group_type: group + admin_label: '' + empty: false + content: 'Search Results (@total)' + plugin_id: result + views_block_area: + id: views_block_area + table: views + field: views_block_area + relationship: none + group_type: group + admin_label: '' + empty: false + block_id: 'facets_summary_block:search_facets_summary' + plugin_id: views_block_area footer: { } empty: area_text_custom: diff --git a/tests/behat.yml.dist b/tests/behat.yml.dist index edaab95926..2762c00791 100644 --- a/tests/behat.yml.dist +++ b/tests/behat.yml.dist @@ -132,6 +132,7 @@ default: Plus button menu: 'div.add-content-menu' Primary menu: '.region-primary-menu' Related solutions: '.field--name-field-is-related-solutions' + Search bar: 'div.search-bar' SevenHeader: '.region-header' Statistics: '#block-statistics, #block-ventuno-statistics' Table of contents: '#block-table-of-contents' diff --git a/tests/features/collection/collection_overview.feature b/tests/features/collection/collection_overview.feature index 218eea9d15..37f3af8baa 100644 --- a/tests/features/collection/collection_overview.feature +++ b/tests/features/collection/collection_overview.feature @@ -3,8 +3,8 @@ Feature: Collections Overview Scenario: Check visibility of "Collections" menu link. Given I am an anonymous user - # The homepage no longer has a link to the collections overview. Let's try another page. - When I am on the search page + # The homepage and search no longer has a link to the collections overview. Let's try another page. + When I visit "/keep-up-to-date" Then I should see the link "Collections" When I click "Collections" Then I should see the heading "Collections" diff --git a/tests/features/featured_entities.feature b/tests/features/featured_entities.feature index 533ae5ffe1..fa5001388d 100644 --- a/tests/features/featured_entities.feature +++ b/tests/features/featured_entities.feature @@ -91,9 +91,9 @@ Feature: Featuring content site-wide Scenario Outline: Moderators can feature and unfeature collections and solutions site-wide. When I am an anonymous user - # The homepage no longer shows links to the collection and solution overview + # The homepage and search no longer shows links to the collection and solution overview # pages. Let's do this from another page. - And I am on the search page + And I am on "/keep-up-to-date" And I click "
" Then I should see the following tiles in the correct order: | | diff --git a/tests/features/homepage.feature b/tests/features/homepage.feature index a489c49ee2..89866e4575 100644 --- a/tests/features/homepage.feature +++ b/tests/features/homepage.feature @@ -48,7 +48,7 @@ Feature: Homepage # page instead. When I click "Finance in EU" Then I should be on the advanced search page - And the option with text "Finance in EU" from select facet "topic" is selected + And the option with text "Finance in EU" from select facet form "topic" is selected # There is a "More news" link that for the moment leads to the search page # pre-filtered on news articles. In the future this will become a dedicated @@ -56,7 +56,7 @@ Feature: Homepage Given I am on the homepage When I click "More news" Then I should be on the advanced search page - And the "News" content checkbox item should be selected + And I should see the following facet summary "News" And the page should show the tiles "Current biodiversity crisis, Environmental stewardship, Spatial reconstruction, Earlier transformations" @terms @@ -108,7 +108,7 @@ Feature: Homepage And I should see the link "More solutions" When I click "More solutions" Then I should be on the advanced search page - And the "Solution" content checkbox item should be selected + And I should see the following facet summary "Solution" Scenario: An event can be highlighted on the homepage Given event content: @@ -152,7 +152,7 @@ Feature: Homepage Given I am on the homepage When I click "More events" Then I should be on the advanced search page - And the "Event" content checkbox item should be selected + And I should see the following facet summary "Event" And I should see the "Florentine steak festival" tile @version @@ -203,7 +203,7 @@ Feature: Homepage And I should see the link "E-justice" in the "Discover topics block" When I click "E-justice" Then I should be on the advanced search page - And the option with text "E-justice" from select facet "topic" is selected + And the option with text "E-justice" from select facet form "topic" is selected # See more topics modal. When I am on the homepage @@ -231,7 +231,7 @@ Feature: Homepage | Social and Political | When I click "E-health Dpt." in the "Modal content" Then I should be on the advanced search page - And the option with text "E-health Dpt." from select facet "topic" is selected + And the option with text "E-health Dpt." from select facet form "topic" is selected And the page should show the tiles "Internet medicine" Examples: @@ -354,19 +354,19 @@ Feature: Homepage When I click "See more solutions" Then I should be on the advanced search page - And the "Solutions" content checkbox item should be selected + And I should see the following facet summary "Solutions" When I am on the homepage And I click "See more collections" Then I should be on the advanced search page - And the "Collections" content checkbox item should be selected + And I should see the following facet summary "Collections" When I am on the homepage And I click "See more news" Then I should be on the advanced search page - And the "News" content checkbox item should be selected + And I should see the following facet summary "News" When I am on the homepage And I click "See more events" Then I should be on the advanced search page - And the "Events" content checkbox item should be selected + And I should see the following facet summary "Events" diff --git a/tests/features/joinup_core/page_destination.feature b/tests/features/joinup_core/page_destination.feature index 15b5cddb6a..68fdbe3149 100644 --- a/tests/features/joinup_core/page_destination.feature +++ b/tests/features/joinup_core/page_destination.feature @@ -24,8 +24,7 @@ Feature: Scenario: A user logging in from another page should return to that page after login. When I am on "/search?keys=how+to+redirect" - And I open the account menu - And I click "Sign in" + And I click "Sign in" in the "Navigation bar" And I fill in "E-mail address" with "mr.redirect@example.com" And I fill in "Password" with "Mr Redirect" And I press "Log in" @@ -34,8 +33,7 @@ Feature: Scenario: Only the destination parameter should be carried over if one exists outside the user pages. When I am on "/search?keys=how+to+redirect&destination=/contact" - And I open the account menu - And I click "Sign in" + And I click "Sign in" in the "Navigation bar" And I fill in "E-mail address" with "mr.redirect@example.com" And I fill in "Password" with "Mr Redirect" And I press "Log in" diff --git a/tests/features/joinup_search/group_search.feature b/tests/features/joinup_search/group_search.feature index 56f1c83f87..3e15d81704 100644 --- a/tests/features/joinup_search/group_search.feature +++ b/tests/features/joinup_search/group_search.feature @@ -71,7 +71,7 @@ Feature: Search inside groups # as a chip in the search field the search results should be filtered and # only show the content of the collection. When I submit the search by pressing enter - Then the option with text "Chalet construction (6)" from select facet "collection/solution" is selected + Then the option with text "Chalet construction (6)" from select facet form "collection/solution" is selected And the page should show the tiles "Room sizes, Ground plan, Opening of the winter season, Natural materials, Resources, Inclined foundations" # Check that other types of pages in the collection also show the collection @@ -117,7 +117,7 @@ Feature: Search inside groups # as a chip in the search field the search results should be filtered and # only show the content of the solution. When I submit the search by pressing enter - Then the option with text "Inclined foundations (6)" from select facet "collection/solution" is selected + Then the option with text "Inclined foundations (6)" from select facet form "collection/solution" is selected Then the page should show the tiles "Pre-alpha, Presenting DrillMaster X88, Rock types, Still frozen, Geography, Terrace?" # Do a search with a keyword. The chip for the solution should be present @@ -127,7 +127,7 @@ Feature: Search inside groups Then the page should show the following chip: | Inclined foundations | When I enter "ground" in the search bar and press enter - Then the option with text "Inclined foundations (2)" from select facet "collection/solution" is selected + Then the option with text "Inclined foundations (2)" from select facet form "collection/solution" is selected And the page should show the tiles "Pre-alpha, Presenting DrillMaster X88" # Do a search with a keyword after removing the chip for the solution. The @@ -136,7 +136,6 @@ Feature: Search inside groups When I open the search bar by clicking on the search icon And I press the remove button on the chip "Inclined foundations" And I enter "ground" in the search bar and press enter - Then the option with text "Any Collection or Solution" from select facet "collection/solution" is selected Then the page should show the tiles "Ground plan, Pre-alpha, Natural materials, Presenting DrillMaster X88" # Do a search with a keyword and removing the chip for the solution after @@ -219,36 +218,33 @@ Feature: Search inside groups Then the page should show the following chip: | Chalet construction | When I enter "ground" in the search bar and press enter - Then the option with text "Chalet construction (2)" from select facet "collection/solution" is selected + Then the option with text "Chalet construction (2)" from select facet form "collection/solution" is selected And the page should show the tiles "Ground plan, Natural materials" - And the page should show the following chip: - | Chalet construction | - When I press the remove button on the chip "Chalet construction" - And I submit the search by pressing enter - Then the page should not contain any chips + And I should see the following facet summary "Chalet construction" + When I should remove the following facet summary "Chalet construction" + Then the page should not contain any facet summary And the page should show the tiles "Ground plan, Pre-alpha, Natural materials, Presenting DrillMaster X88" @javascript - Scenario: Group filter chips appear in search bar after selecting them in facets + Scenario: Group facet summary appear in search after selecting them in facets When I visit the search page - Then the option with text "Any Collection or Solution" from select facet "collection/solution" is selected And I should see 12 tiles When I open the search bar by clicking on the search icon Then the page should not contain any chips - When I select "Inclined foundations" from the "collection/solution" select facet - Then the option with text "Inclined foundations (6)" from select facet "collection/solution" is selected + When I select "Inclined foundations" from the "collection/solution" select facet form + And I click Search in facets form + Then the option with text "Inclined foundations (6)" from select facet form "collection/solution" is selected And I should see 6 tiles When I open the search bar by clicking on the search icon - Then the page should show the following chip: - | Inclined foundations | + And I should see the following facet summary "Inclined foundations" - # The filter chip should remain active when doing another search. + # The filter facets summary shouldn't remain active when doing another search. When I enter "ground" in the search bar and press enter - Then the option with text "Inclined foundations (2)" from select facet "collection/solution" is selected + Then I select "Inclined foundations" from the "collection/solution" select facet form + And I click Search in facets form And I should see 2 tiles When I open the search bar by clicking on the search icon - Then the page should show the following chip: - | Inclined foundations | + And I should see the following facet summary "Inclined foundations" diff --git a/tests/features/joinup_search/search.feature b/tests/features/joinup_search/search.feature index 3ea65dd704..036dfd04c3 100644 --- a/tests/features/joinup_search/search.feature +++ b/tests/features/joinup_search/search.feature @@ -38,32 +38,29 @@ Feature: Global search And I should see the "El Celler de Can Roca" tile And I should see the "Spherification" tile And I should see the "Foam" tile - # Facets should be in place. - And the option with text "Any topic" from select facet "topic" is selected # Terms are sorted alphabetically - And the "topic" select facet should contain the following options: + And the "topic" select facet form should contain the following options: | Any topic | # Parent term. | Info | # Child term. - | Statistics and Analysis | + | - Statistics and Analysis | # Parent term. | Social and Political | # Child terms. - | Demography | - | E-inclusion | + | - Demography | + | - E-inclusion | # Since the topics are indented by a whitespace, and the whitespaces are trimmed in the step above, we are testing # the full response in order to ensure that the results are indented properly. The   character below is the # printable space character. - # @todo and WARNING. The following   character is supported by the old 3.4 selenium server. Change this in the + # @todo and WARNING. The following character is supported by the old 3.4 selenium server. Change this in the # new infrastructure with the   encoded character. - And the response should contain "" - And the response should contain "" - And the response should contain "" - And the response should contain "" - And the response should contain "" - And the option with text "Any location" from select facet "spatial coverage" is selected - And the "spatial coverage" select facet should contain the following options: + And the response should contain "" + And the response should contain "" + And the response should contain "" + And the response should contain "" + And the response should contain "" + And the "spatial coverage" select facet form should contain the following options: | Any location | | Belgium (1) | | European Union (1) | @@ -72,15 +69,16 @@ Feature: Global search # Joinup there were two search fields, but this was confusing users. And there should be exactly 1 "search field" on the page - When I select "Social and Political" from the "topic" select facet - Then the option with text "Social and Political" from select facet "topic" is selected - And the "topic" select facet should contain the following options: - | Any topic | - | Info | - | Statistics and Analysis | - | Social and Political | - | Demography | - | E-inclusion | + When I select "Social and Political" from the "topic" select facet form + And I click Search in facets form + Then the option with text "Social and Political" from select facet form "topic" is selected + And the "topic" select facet form should contain the following options: + | Any topic | + | Info | + | - Statistics and Analysis | + | Social and Political | + | - Demography | + | - E-inclusion | # The tiles appear because the parent term is selected even though they do not have a direct reference there. And I should see the "Dummy news 1" tile And I should see the "Dummy news 2" tile @@ -88,19 +86,20 @@ Feature: Global search And I should see the "Dummy news 4" tile # Test the topic facet. The space prefixing "Demography" is due to the hierarchy. - When I select " Demography" from the "topic" select facet - Then the option with text "Demography" from select facet "topic" is selected + When I select " Demography" from the "topic" select facet form + And I click Search in facets form + Then the option with text "- Demography" from select facet form "topic" is selected # The selected option moves to the last position by default. - And the "topic" select facet should contain the following options: - | Any topic | - | Info | - | Statistics and Analysis | - | Social and Political | - | Demography | - | E-inclusion | - - Then the option with text "Any location" from select facet "spatial coverage" is selected - And the "spatial coverage" select facet should contain the following options: + And the "topic" select facet form should contain the following options: + | Any topic | + | Info | + | - Statistics and Analysis | + | Social and Political | + | - Demography | + | - E-inclusion | + + #Then the option with text "Any location" from select facet form "spatial coverage" is selected + And the "spatial coverage" select facet form should contain the following options: | Any location | | Belgium (1) | | European Union (1) | @@ -110,43 +109,48 @@ Feature: Global search And I should not see the "Foam" tile # Test the spatial coverage facet. - When I select "Belgium" from the "spatial coverage" select facet - Then the option with text "Belgium (1)" from select facet "spatial coverage" is selected - And the "spatial coverage" select facet should contain the following options: + When I select "Belgium" from the "spatial coverage" select facet form + And I click Search in facets form + Then the option with text "Belgium (1)" from select facet form "spatial coverage" is selected + And the "spatial coverage" select facet form should contain the following options: | Any location | | Belgium (1) | | European Union (1) | - Then the option with text "Demography" from select facet "topic" is selected - And the "topic" select facet should contain the following options: + Then the option with text "- Demography" from select facet form "topic" is selected + And the "topic" select facet form should contain the following options: | Any topic | | Social and Political | - | Demography | + | - Demography | And I should see the "Molecular cooking collection" tile But I should not see the "El Celler de Can Roca" tile And I should not see the "Spherification" tile And I should not see the "Foam" tile - # Reset the search by visiting again the search page. - Given I am on the search page - Then I should see the text "Content types" in the "Left sidebar" region - # Select link in the 'type' facet. - When I check the "News (5)" checkbox from the "Content types" facet - Then the "News" content checkbox item should be selected - And the "Content types" checkbox facet should allow selecting the following values "Collection (1), Solutions (2), News (5)" - - When I check the "Solutions (2)" checkbox from the "Content types" facet - Then the "Solutions" content checkbox item should be selected - And the "News" content checkbox item should be selected - Then the "Content types" checkbox facet should allow selecting the following values "Collection (1), Solutions (2), News (5)" - And the "topic" select facet should contain the following options: - | Any topic | - | Info | - | Statistics and Analysis | - | Social and Political | - | Demography | - | E-inclusion | - And the "spatial coverage" select facet should contain the following options: + Given I am on the search page + When I select "News (5)" from the "Content types" select facet form + And I click Search in facets form + Then the option with text "News (5)" from select facet form "Content types" is selected + And the "Content types" select facet form should contain the following options: + | Collection (1) | + | News (5) | + | Solutions (2) | + + When I select "Solutions (2)" option in the "Content types" select facet form + And I click Search in facets form + And I should see the following facet summary "News, Solutions" + And the "Content types" select facet form should contain the following options: + | Collection (1) | + | News (5) | + | Solutions (2) | + And the "topic" select facet form should contain the following options: + | Any topic | + | Info | + | - Statistics and Analysis | + | Social and Political | + | - Demography | + | - E-inclusion | + And the "spatial coverage" select facet form should contain the following options: | Any location | | European Union (1) | | Luxembourg (5) | @@ -184,17 +188,19 @@ Feature: Global search | Document omega | Document | Document short delta | A document consists of epsilon strings. | Luxembourg | Alphabet | Collection alpha | validated | When I visit the search page - And the "spatial coverage" select facet should contain the following options: + And the "spatial coverage" select facet form should contain the following options: | Any location | - | Greece (1) | - | Luxembourg (2) | - When I select "Luxembourg" from the "spatial coverage" select facet - Then the option with text "Luxembourg (2)" from select facet "spatial coverage" is selected + | Greece (1) | + | Luxembourg (2) | + When I select "Luxembourg" from the "spatial coverage" select facet form + And I click Search in facets form + Then the option with text "Luxembourg (2)" from select facet form "spatial coverage" is selected + And I should see the text "Search Results (2)" # The countries are still sorted alphabetically even though the Luxembourg value is selected and has more results. - And the "spatial coverage" select facet should contain the following options: + And the "spatial coverage" select facet form should contain the following options: | Any location | - | Greece (1) | - | Luxembourg (2) | + | Greece (1) | + | Luxembourg (2) | Scenario: Content can be found with a full-text search. Given the following owner: @@ -244,20 +250,33 @@ Feature: Global search | ulyssesfrees | ulysses.freeman@example.com | Ulysses | Freeman | Omero snc | When I visit the search page - Then the "Content types" checkbox facet should allow selecting the following values "Collections (2), Solution (1), News (1), Events (2), Document (1), Discussion (1), Release (1), Custom page (1), Licence (1), Video (1)" + And the "Content types" select facet form should contain the following options: + | Collections (2) | + | Custom page (1) | + | Discussion (1) | + | Document (1) | + | Events (2) | + | Licence (1) | + | News (1) | + | Release (1) | + | Solution (1) | + | Video (1) | # "Alpha" is used in all the rdf entities titles. When I enter "Alpha" in the search bar and press enter - Then the page should show the tiles "Collection alpha, Solution alpha, Release Alpha, Licence Alpha, Video alpha" + Then I should see the text "Search Results (5)" + And the page should show the tiles "Collection alpha, Solution alpha, Release Alpha, Licence Alpha, Video alpha" # "Omega" is used in all the node entities titles. Since the content of # custom pages is added to their collection, we also match the collection. When I enter "omega" in the search bar and press enter - Then the page should show the tiles "Collection alpha, News omega, Event Omega, Document omega, Discussion omega, Page omega" + Then I should see the text "Search Results (6)" + And the page should show the tiles "Collection alpha, News omega, Event Omega, Document omega, Discussion omega, Page omega" # "Beta" is used in all the rdf entities body fields. When I enter "beta" in the search bar and press enter - Then the page should show the tiles "Collection alpha, Solution alpha, Release Alpha, Licence Alpha" + Then I should see the text "Search Results (4)" + And the page should show the tiles "Collection alpha, Solution alpha, Release Alpha, Licence Alpha" # "Epsilon" is used in all the node entities body fields. When I enter "epsilon" in the search bar and press enter @@ -296,14 +315,15 @@ Feature: Global search Then the page should show the tiles "Solution alpha, Release Alpha" # Users should be found by first name, family name and organisation. - When I enter "Jenessa" in the search bar and press enter - Then the page should show the tiles "Jenessa Carlyle" - When I enter "freeman" in the search bar and press enter - Then the page should show the tiles "Ulysses Freeman" - When I enter "clyffco" in the search bar and press enter - Then the page should show the tiles "Jenessa Carlyle" - When I enter "Omero+snc" in the search bar and press enter - Then the page should show the tiles "Ulysses Freeman" + # @todo Enable when this ticket is implemented ISAICP-6575. + # When I enter "Jenessa" in the search bar and press enter + # Then the page should show the tiles "Jenessa Carlyle" + # When I enter "freeman" in the search bar and press enter + # Then the page should show the tiles "Ulysses Freeman" + # When I enter "clyffco" in the search bar and press enter + # Then the page should show the tiles "Jenessa Carlyle" + # When I enter "Omero+snc" in the search bar and press enter + # Then the page should show the tiles "Ulysses Freeman" Scenario: Advanced search # An advanced search link is shown in the header, except on the search page. @@ -352,7 +372,8 @@ Feature: Global search | Chickens are small birds | | Bird spotting | | Best place to find an exotic bird | - | Bird Birdman | + # @todo Enable when this ticket is implemented ISAICP-6575. + # | Bird Birdman | @clearStaticCache Scenario: Solutions and/or releases are found by their distribution keyword. @@ -411,7 +432,8 @@ Feature: Global search When I enter "ubermensch" in the search bar and press enter Then I should see "No content found for your search." When I enter "zzolu-distro" in the search bar and press enter - Then I should see "No content found for your search." + Then I should not see the text "Search Results" + And I should see "No content found for your search." When I enter "apache" in the search bar and press enter Then the page should show only the tiles "Apache-2.0" When I enter "HTML" in the search bar and press enter @@ -566,22 +588,66 @@ Feature: Global search When I am on the homepage And I enter "Relativity" in the search bar and press enter Then the option "Relevance" should be selected + And I should see the text "Search Results (3)" And I should see the following tiles in the correct order: | Relativity news: Relativity theory | | Relativity is the word | | Absolutely nonesense | And I should be on "/search?keys=Relativity&sort_by=relevance" - Given I select "Creation Date" from "Sort by" - Then I should see the following tiles in the correct order: - | Absolutely nonesense | - | Relativity news: Relativity theory | - | Relativity is the word | - And I should be on "/search?keys=Relativity&sort_by=creation-date" + # @todo Enable when this ticket is implemented ISAICP-6575. + # When I select "Creation Date" from "Sort by" + # And I should see the following tiles in the correct order: + # | Absolutely nonesense | + # | Relativity news: Relativity theory | + # | Relativity is the word | + # And I should be on "/search?keys=Relativity&sort_by=creation-date" + # + # When I select "Last Updated Date" from "Sort by" + # And I should see the following tiles in the correct order: + # | Relativity is the word | + # | Relativity news: Relativity theory | + # | Absolutely nonesense | + # And I should be on "/search?keys=Relativity&sort_by=last-updated-date" - Given I select "Last Updated Date" from "Sort by" - Then I should see the following tiles in the correct order: - | Relativity is the word | - | Relativity news: Relativity theory | - | Absolutely nonesense | - And I should be on "/search?keys=Relativity&sort_by=last-updated-date" + @javascript + Scenario: Anonymous user can find facets summary + Given the following collection: + | title | Radio cooking collection | + | logo | logo.png | + | moderation | no | + | topic | Demography | + | spatial coverage | Belgium | + | state | validated | + And the following solutions: + | title | collection | description | topic | spatial coverage | state | + | Spheres | Radio cooking collection | Spherification is the culinary process of shaping a liquid into spheres | Demography | European Union | validated | + | Movistar | Radio cooking collection | "The use of foam in cuisine has been used in many forms in the history of cooking:whipped cream, meringue, and mousse are all foams" | | | validated | + And news content: + | title | body | collection | topic | spatial coverage | state | + | El Cabo da Roca | The best in town | Radio cooking collection | Statistics and Analysis | Luxembourg | validated | + | Funny news 1 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated | + | Funny news 2 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated | + | Funny news 3 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated | + | Funny news 4 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated | + + Given I am logged in as a user with the "authenticated" role + When I visit the search page + And I select "Solutions (2)" from the "Content types" select facet form + And I select "News (5)" option in the "Content types" select facet form + And I click Search in facets form + And I should see the following facet summary "News, Solutions" + + Then I click "Clear filters" + And I select "News (5)" from the "Content types" select facet form + And I click Search in facets form + And I should see the following facet summary "News" + + # Check if facet summary was remove correctly. + Then I click "Clear filters" + And I select "News (5)" from the "Content types" select facet form + And I select "Collection (1)" option in the "Content types" select facet form + And I click Search in facets form + And I should see the following facet summary "Collection, News" + Then I should remove the following facet summary "News" + And the page should show only the tiles "Radio cooking collection" diff --git a/tests/features/machine_translation.feature b/tests/features/machine_translation.feature index 7f649cc4df..5158483bc9 100644 --- a/tests/features/machine_translation.feature +++ b/tests/features/machine_translation.feature @@ -85,8 +85,12 @@ Feature: Machine translation # Pages that primarily list content should not be translatable. When I go to the homepage Then I should not see any Webtools eTrans elements + # The search no longer has a link to the collections, solutions and + # keep up to date. Let's try another page. When I visit the search page Then I should not see any Webtools eTrans elements + When I visit "/keep-up-to-date" + Then I should not see any Webtools eTrans elements When I click "Collections" in the "Header menu" region Then I should not see any Webtools eTrans elements When I click "Solutions" in the "Header menu" region diff --git a/tests/features/solution/homepage.feature b/tests/features/solution/homepage.feature index b585279ab8..0f36fb957d 100644 --- a/tests/features/solution/homepage.feature +++ b/tests/features/solution/homepage.feature @@ -176,5 +176,5 @@ Feature: Solution homepage And I should not see the link "Supplier exchange" When I click "HR" Then the url should match "/search" - Then the option with text "HR" from select facet "topic" is selected - Then the "Solution" content checkbox item should be selected + Then the option with text "- HR" from select facet form "topic" is selected + Then I should see the following facet summary "HR, Solution" diff --git a/tests/src/Context/JoinupContext.php b/tests/src/Context/JoinupContext.php index 2647b8fdb3..adb11e906f 100644 --- a/tests/src/Context/JoinupContext.php +++ b/tests/src/Context/JoinupContext.php @@ -2741,72 +2741,6 @@ public function assertElementCount(string $count, string $element_name): void { Assert::assertEquals((int) $count, count($this->getElementsMatchingElementAlias($element_name))); } - /** - * Returns selectors used to find elements with a human readable identifier. - * - * @param string $alias - * A human readable element identifier. - * - * @return array[] - * An indexed array of selectors intended to be used with Mink's `find()` - * methods. Each value is a tuple containing two strings: - * - 0: the selector, e.g. 'css' or 'xpath'. - * - 1: the locator. - * - * @throws \InvalidArgumentException - * Thrown when the element name is not defined. - */ - protected function getSelectorsMatchingElementAlias(string $alias): array { - $elements = [ - // The various search input fields. - [ - 'names' => [ - 'search bar', - 'search bars', - 'search field', - 'search fields', - ], - 'selectors' => [ - // The site-wide search field in the top right corner. - ['css', 'input#search-bar__input'], - // The search field on the search result pages. - ['css', '#block-exposed-form-search-page input.form-text'], - ], - ], - ]; - - foreach ($elements as $element) { - if (in_array($alias, $element['names'])) { - return $element['selectors']; - } - } - - throw new \InvalidArgumentException("No selectors are defined for the element named '$alias'."); - } - - /** - * Returns elements that match the given human readable identifier. - * - * @param string $alias - * A human readable element identifier. - * - * @return \Behat\Mink\Element\NodeElement[] - * The elements matching the identifier. - * - * @throws \InvalidArgumentException - * Thrown when the element name is not defined. - */ - protected function getElementsMatchingElementAlias(string $alias): array { - $elements = []; - - foreach ($this->getSelectorsMatchingElementAlias($alias) as $selector_tuple) { - [$selector, $locator] = $selector_tuple; - $elements = array_merge($elements, $this->getSession()->getPage()->findAll($selector, $locator)); - } - - return $elements; - } - /** * Asserts that a paragraph containing the given text is present in the page. * diff --git a/tests/src/Context/JoinupSearchContext.php b/tests/src/Context/JoinupSearchContext.php index 960755b98b..ba20b9113c 100644 --- a/tests/src/Context/JoinupSearchContext.php +++ b/tests/src/Context/JoinupSearchContext.php @@ -273,6 +273,42 @@ public function iSelectAnOptionFromFacet(string $select, string $facet): void { $facet->selectOption($select); } + /** + * Clicks a facet item in an inline facet form. + * + * @param string $select + * The option to select. + * @param string $facet + * The facet alias. + * + * @throws \Exception + * Thrown when the facet or the link inside the facet is not found. + * + * @When I select :option from the :facet select facet form + */ + public function iSelectAnOptionFromFacetForm(string $select, string $facet): void { + $facet = $this->findFacetByAlias($facet, NULL, 'select', TRUE); + $facet->selectOption($select); + } + + /** + * Clicks in more facet items in an inline facet form. + * + * @param string $select + * The option to select. + * @param string $facet + * The facet alias. + * + * @throws \Exception + * Thrown when the facet or the link inside the facet is not found. + * + * @When I select :option option in the :facet select facet form + */ + public function iSelectOtherOptionFromFacetForm(string $select, string $facet): void { + $facet = $this->findFacetByAlias($facet, NULL, 'select', TRUE); + $facet->selectOption($select, TRUE); + } + /** * Asserts a selected option in the . * @@ -311,6 +347,40 @@ public function assertSelectFacetOptionSelected(string $option, string $select): } } + /** + * Asserts a selected option in the select facets form. + * + * @param string $option + * Text value of the option to find. + * @param string $select + * Title of the select field. + * + * @throws \Exception + * Throws an exception when the select is not found in page. + * + * @Then the option with text :option from select facet form :select is selected + */ + public function assertSelectFacetFormOptionSelected(string $option, string $select): void { + $element = $this->findFacetByAlias($select, NULL, 'select', TRUE); + if (!$element) { + throw new \Exception(sprintf('The select "%s" was not found in the page %s', $select, $this->getSession()->getCurrentUrl())); + } + if ($this->browserSupportsJavaScript()) { + $this->assertSelectedOption($element, $option); + } + else { + $selected_option = $element->find('css', 'a.is-active'); + if ($selected_option instanceof NodeElement) { + $text = $selected_option->getText(); + // Selected facet options are prefixed with '(-) '. Strip this. + $text = preg_replace('/^\(-\) /', '', $text); + // Ignore duplicate whitespace. + $option = preg_replace('/\s{2,}/', ' ', $option); + Assert::assertSame($option, $text, sprintf('The option "%s" is selected in the "%s" facet, but the option "%s" was expected.', $text, $select, $option)); + } + } + } + /** * Asserts the list of available options in a select facet. * @@ -347,6 +417,25 @@ public function assertSelectOptionsAsList($select, TableNode $table) { $this->assertSelectAvailableOptions($element, $table); } + /** + * Asserts the list of available options in a facet form select box. + * + * @param string $select + * The name of the field element. + * @param \Behat\Gherkin\Node\TableNode $table + * The available list of options. + * + * @throws \Exception + * Throws an exception when the select is not found or options are not + * identical. + * + * @Then the :select select facet form should contain the following options: + */ + public function assertSelectFacetFormOptionsAsList($select, TableNode $table) { + $element = $this->findFacetByAlias($select, NULL, 'select', TRUE); + $this->assertSelectAvailableOptions($element, $table); + } + /** * Checks a checkbox link in a facet. * @@ -374,6 +463,47 @@ public function checkCheckboxFacet(string $option, string $facet_type): void { throw new \Exception("The option '{$option}' was not found in the '{$facet_type}' facet."); } + /** + * Checks a checkbox in a facet form. + * + * @param string $option + * The label of the checkbox. + * @param string $facet_type + * The label of the facet. + * + * @throws \Exception + * Thrown when the checkbox is not found. + * + * @Given I check the :option checkbox from the :facet_type facet form + */ + public function checkCheckboxFacetForm(string $option, string $facet_type): void { + $facet = $this->findFacetByAlias($facet_type, NULL, '*', TRUE); + /** @var \Behat\Mink\Element\NodeElement[] $node_elements */ + $node_elements = $facet->findAll('xpath', '//option'); + foreach ($node_elements as $node_element) { + if ($node_element->getText() === $option) { + $node_element->click(); + return; + } + } + + throw new \Exception("The option '{$option}' was not found in the '{$facet_type}' facet."); + } + + /** + * Facets form action buttons. + * + * @param string $name + * The label of the input. + * + * @Given I click :name in facets form + */ + public function iClickActionsInFacetsForm(string $name) { + $region = $this->getSession()->getPage(); + $element = $region->find('xpath', "//input[@value='{$name}']"); + $element->click(); + } + /** * Opens the dropdown for the given facet element. * @@ -630,4 +760,79 @@ protected function getSearchBarElement(): NodeElement { return reset($elements); } + /** + * Asserts that certain facet summary items are shown on the page. + * + * @param string $labels + * A comma-separated list of facet item labels. + * + * @throws \Exception + * Thrown when a wanted facet item is not shown in the page. + * + * @When I should see the following facet summary :labels + */ + public function assertFacetSummary(string $labels): void { + $labels = $this->explodeCommaSeparatedStepArgument($labels); + $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' block-facets-summary-blocksearch-facets-summary ')]//li[contains(concat(' ', normalize-space(@class), ' '), ' facet-summary-item--facet ')]"; + $elements = $this->getSession()->getPage()->findAll('xpath', $xpath); + $present = $present_labels = []; + + /** @var \Behat\Mink\Element\NodeElement $element */ + foreach ($elements as $element) { + $present[] = $element->getText(); + } + + // Add label close in front of label. + foreach ($labels as $label) { + $present_labels[] = $label . ' close'; + } + + $present = array_map('trim', $present); + $present_labels = array_map('trim', $present_labels); + Assert::assertEquals($present_labels, $present); + } + + /** + * Remove facet summary item that are on the page. + * + * @param string $label + * A facet summary item label. + * + * @throws \Exception + * Thrown when a wanted facet item is not shown in the page. + * + * @When I should remove the following facet summary :label + */ + public function removeFacetSummary(string $label): void { + + $xpath = '//div[contains(concat(" ", normalize-space(@class), " "), " block-facets-summary-blocksearch-facets-summary ")]//span[text()="' . $label . '"]'; + $element = $this->getSession()->getPage()->find('xpath', $xpath); + + if (empty($element)) { + throw new \Exception("The $label facet summary item was not found in the page."); + } + + $element->click(); + } + + /** + * Asserts that the expected number of summaries are shown. + * + * @param string|null $number + * The expected number of summaries. This is a string rather than an integer + * because step definitions are represented in text. + * + * @throws \Exception + * Thrown when the region is not found. + * + * @Then the page should contain :number facet(s) summary/summaries + * @Then the page should not contain any facet summary + */ + public function assertFacetsSummaryCount(?string $number = NULL): void { + $number = $number === 'one' ? 1 : (int) $number; + $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' block-facets-summary-blocksearch-facets-summary ')]//li[contains(concat(' ', normalize-space(@class), ' '), ' facet-summary-item--facet ')]"; + $elements = $this->getSession()->getPage()->findAll('xpath', $xpath); + Assert::assertCount($number, $elements); + } + } diff --git a/tests/src/Traits/TraversingTrait.php b/tests/src/Traits/TraversingTrait.php index 69ca17ba98..8ec24f302e 100644 --- a/tests/src/Traits/TraversingTrait.php +++ b/tests/src/Traits/TraversingTrait.php @@ -329,6 +329,8 @@ protected function getListingByHeading(string $type, string $heading): NodeEleme * This can be useful in cases where the data drupal facet id is placed in * more than one html tag e.g. the dropdown has the id placed in both the *
  • tag of links as well as the