-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #708 from dpc-sdp/feature/search-listing-table-layout
Feature/search listing table layout
- Loading branch information
Showing
32 changed files
with
2,073 additions
and
45 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
examples/nuxt-app/test/features/search-listing/aggregations.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Feature: Search listing - Aggregations | ||
|
||
As a user I can see lists of values filter values, sourced from either drupal Taxonomies or Elastic Aggregations | ||
|
||
Background: | ||
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 | ||
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture | ||
And I am using a "macbook-16" device | ||
|
||
@mockserver | ||
Example: Aggregations and Taxonomies | ||
Given the endpoint "/api/tide/page" with query "?path=/aggregations&site=8888" returns fixture "/search-listing/aggregations/page" with status 200 | ||
And the search network request is stubbed with fixture "/search-listing/aggregations/response" and status 200 | ||
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT" | ||
|
||
When I visit the page "/aggregations" | ||
Then the search listing page should have 2 results | ||
And the search network request should be called with the "/search-listing/aggregations/request" fixture | ||
|
||
When I click the search listing dropdown field labelled "Elastic aggregation test" | ||
# First item is hardcoded, the rest come from ES aggregation | ||
Then the selected dropdown field should have the items: | ||
| Hard coded | | ||
| Business | | ||
| Government | | ||
| Individual | | ||
| Not-for-profit groups | | ||
# Close the dropdown | ||
When I click the search listing dropdown field labelled "Elastic aggregation test" | ||
|
||
When I click the search listing dropdown field labelled "Taxonomy test" | ||
# These come from Tide page API response (taxonomies) | ||
Then the selected dropdown field should have the items: | ||
| Arts | | ||
| Business | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
examples/nuxt-app/test/features/search-listing/table.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Search listing table layout | ||
|
||
I can see a collection of results displayed in a tabular form | ||
|
||
Background: | ||
Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 | ||
And I am using a "macbook-16" device | ||
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture | ||
|
||
@mockserver | ||
Example: Grants | ||
Given the endpoint "/api/tide/page" with query "?path=/search-listing-table&site=8888" returns fixture "/search-listing/table/page" with status 200 | ||
And the search network request is stubbed with fixture "/search-listing/table/response" and status 200 | ||
When I visit the page "/search-listing-table" | ||
And the search network request should be called with the "/search-listing/table/request" fixture | ||
And the search listing layout should be "table" | ||
|
98 changes: 98 additions & 0 deletions
98
examples/nuxt-app/test/fixtures/search-listing/aggregations/page.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"title": "Grants and programs", | ||
"changed": "2022-11-02T12:47:29+11:00", | ||
"created": "2022-11-02T12:47:29+11:00", | ||
"type": "tide_search_listing", | ||
"nid": "11dede11-10c0-111e1-1100-000000000330", | ||
"showTopicTags": true, | ||
"summary": "", | ||
"searchListingConfig": { | ||
"searchPlaceholder": "Search all grants and programs", | ||
"resultsPerPage": 10 | ||
}, | ||
"queryConfig": { | ||
"multi_match": { | ||
"query": "{{query}}", | ||
"fields": [ | ||
"title^3", | ||
"field_landing_page_summary^2", | ||
"body", | ||
"field_paragraph_body", | ||
"summary_processed" | ||
] | ||
} | ||
}, | ||
"results": { | ||
"layout": { | ||
"component": "TideSearchResultsList" | ||
}, | ||
"item": { | ||
"grant": { | ||
"component": "TideGrantSearchResult" | ||
} | ||
} | ||
}, | ||
"globalFilters": [ | ||
{ "terms": { "type": ["grant"] } }, | ||
{ "terms": { "field_node_site": [8888] } } | ||
], | ||
"userFilters": [ | ||
{ | ||
"id": "audience", | ||
"component": "TideSearchFilterDropdown", | ||
"filter": { | ||
"type": "terms", | ||
"value": "field_audience_name.keyword" | ||
}, | ||
"aggregations": { | ||
"field": "field_audience_name.keyword", | ||
"source": "elastic" | ||
}, | ||
"props": { | ||
"id": "audience", | ||
"label": "Elastic aggregation test", | ||
"placeholder": "Individuals and organisation types", | ||
"type": "RplFormDropdown", | ||
"multiple": true, | ||
"options": [ | ||
{ | ||
"id": "1", | ||
"label": "Hard coded", | ||
"value": "Hard coded" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "topic", | ||
"component": "TideSearchFilterDropdown", | ||
"filter": { | ||
"type": "terms", | ||
"value": "field_topic_name" | ||
}, | ||
"aggregations": { | ||
"field": "topic", | ||
"source": "taxonomy" | ||
}, | ||
"props": { | ||
"id": "topic", | ||
"label": "Taxonomy test", | ||
"placeholder": "Grant topic", | ||
"type": "RplFormDropdown", | ||
"multiple": true, | ||
"options": [ | ||
{ | ||
"id": "1", | ||
"label": "Arts", | ||
"value": "Arts" | ||
}, | ||
{ | ||
"id": "2", | ||
"label": "Business", | ||
"value": "Business" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
examples/nuxt-app/test/fixtures/search-listing/aggregations/request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"query": { | ||
"bool": { | ||
"must": [{ "match_all": {} }], | ||
"filter": [ | ||
{ "terms": { "type": ["grant"] } }, | ||
{ "terms": { "field_node_site": [8888] } } | ||
] | ||
} | ||
}, | ||
"size": 10, | ||
"from": 0, | ||
"sort": [{ "_score": "desc" }, { "_doc": "desc" }], | ||
"aggs": { | ||
"audience": { | ||
"terms": { | ||
"field": "field_audience_name.keyword", | ||
"order": { "_key": "asc" }, | ||
"size": 30 | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.