Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2517 from ec-europa/ISAICP-6440
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea authored Jul 12, 2021
2 parents ffab90f + aa7a596 commit f61f31d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 19 deletions.
6 changes: 3 additions & 3 deletions config/sync/facets.facet.spatial_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: -2
sort: -8
settings:
sort: DESC
aggregated_entity_reference_label:
Expand All @@ -50,13 +50,13 @@ processor_configs:
count_widget_order:
processor_id: count_widget_order
weights:
sort: -1
sort: -9
settings:
sort: DESC
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 0
sort: -10
settings:
sort: ASC
url_processor_handler:
Expand Down
2 changes: 1 addition & 1 deletion config/sync/search_api.index.published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- asset_distribution
- custom_page
- joinup_featured
- joinup_search
- meta_entity
- node
Expand Down Expand Up @@ -557,6 +556,7 @@ field_settings:
type: union
fields:
- 'entity:node/field_document_spatial_coverage'
- 'entity:node/field_event_spatial_coverage'
- 'entity:node/field_news_spatial_coverage'
- 'entity:rdf_entity/field_spatial_coverage'
sticky:
Expand Down
35 changes: 34 additions & 1 deletion tests/features/joinup_search/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Feature: Global search
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:
| Any location |
| European Union (1) |
| Belgium (1) |
| European Union (1) |
Then the option with text "Demography (1)" from select facet "topic" is selected
And the "topic" select facet should contain the following options:
| Any topic |
Expand Down Expand Up @@ -118,6 +118,39 @@ Feature: Global search
But I should not see the "Spherification" tile
And I should not see the "El Celler de Can Roca" tile

@javascript
Scenario: Alphabetical order for the spatial coverage in the search page.
Given the following owner:
| name | type |
| Responsible owner | Company |
And the following contact:
| name | Go-to contact |
| email | go-to@example.com |
And the following collections:
| title | description | abstract | state |
| Collection alpha | <p>collection <strong>beta</strong> description.</p> | The collection gamma abstract. | validated |
| Col for Sol | <p>collection for the solution.</p> | The col for sol abstract. | validated |
And event content:
| title | short title | body | spatial coverage | agenda | location | organisation | scope | keywords | collection | state |
| Event Omega | Event short delta | The epsilon event content. | Greece | Event agenda. | Some place | European Commission | International | Alphabet | Collection alpha | validated |
| Alternative event | Alt event | This event stays in the background. | Luxembourg | To be planned. | Event location | Event organisation | | | Collection alpha | validated |
And document content:
| title | document type | short title | body | spatial coverage | keywords | collection | state |
| 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:
| 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
# 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:
| Any location |
| Greece (1) |
| Luxembourg (2) |

Scenario: Content can be found with a full-text search.
Given the following owner:
| name | type |
Expand Down
29 changes: 15 additions & 14 deletions tests/src/Context/JoinupContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,61 +747,62 @@ protected static function getNodeFieldNameFromAlias($type, $alias) {
$aliases = [
'custom_page' => [
'attachments' => 'field_attachment',
'logo' => 'field_custom_page_logo',
'body' => 'field_paragraphs_body',
'logo' => 'field_custom_page_logo',
],
'discussion' => [
'attachments' => 'field_attachment',
'content' => 'body',
'keywords' => 'field_keywords',
'state' => 'field_state',
'publication date' => 'published_at',
'state' => 'field_state',
],
'document' => [
'document type' => 'field_type',
'document publication date' => 'field_document_publication_date',
'document type' => 'field_type',
'file' => 'field_file',
'keywords' => 'field_keywords',
'licence' => 'field_licence',
'logo' => 'field_document_logo',
'publication date' => 'published_at',
'short title' => 'field_short_title',
'spatial coverage' => 'field_document_spatial_coverage',
'state' => 'field_state',
'publication date' => 'published_at',
],
'event' => [
'keywords' => 'field_keywords',
'logo' => 'field_event_logo',
'short title' => 'field_short_title',
'start date' => 'field_event_date:value',
'end date' => 'field_event_date:end_value',
'agenda' => 'field_event_agenda',
'end date' => 'field_event_date:end_value',
'keywords' => 'field_keywords',
'location' => 'field_location',
'logo' => 'field_event_logo',
'online location' => 'field_event_online_location',
'organisation' => 'field_organisation',
'web url' => 'field_event_web_url',
'publication date' => 'published_at',
'scope' => 'field_scope',
'short title' => 'field_short_title',
'spatial coverage' => 'field_event_spatial_coverage',
'start date' => 'field_event_date:value',
'state' => 'field_state',
'publication date' => 'published_at',
'web url' => 'field_event_web_url',
],
'glossary' => [
'synonyms' => 'field_glossary_synonyms',
'definition' => 'field_glossary_definition:value',
'summary' => 'field_glossary_definition:summary',
'synonyms' => 'field_glossary_synonyms',
],
'news' => [
'headline' => 'field_news_headline',
'keywords' => 'field_keywords',
'logo' => 'field_news_logo',
'publication date' => 'published_at',
'spatial coverage' => 'field_news_spatial_coverage',
'state' => 'field_state',
'publication date' => 'published_at',
],
'shared' => [
'collection' => OgGroupAudienceHelperInterface::DEFAULT_FIELD,
'shared on' => 'field_shared_in',
'solution' => OgGroupAudienceHelperInterface::DEFAULT_FIELD,
'topic' => 'field_topic',
'shared on' => 'field_shared_in',
'visits' => 'visit_count',
],
];
Expand Down

0 comments on commit f61f31d

Please sign in to comment.