Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@dpc-sdp/ripple-tide-search): allow multiple result items types #1200

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Feature: Result items

Background:
Given the site endpoint returns fixture "/site/reference" with status 200
And I am using a "macbook-16" device

@mockserver
Example: Result item type can be set per result
Given the page endpoint for path "/search-results" returns fixture "/search-listing/result-items/page" with status 200
And the search network request is stubbed with fixture "/search-listing/result-items/response" and status 200

When I visit the page "/search-results"
Then the search listing page should have 4 results
Then the search listing results should have following items:
| title | component |
| International conference | tide-event-search-result |
| Accessibility guidelines | tide-search-result-card |
| Small business grant | tide-grant-search-result |
| GovHack 2022 is coming | tide-search-result |
151 changes: 151 additions & 0 deletions examples/nuxt-app/test/fixtures/search-listing/result-items/page.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"title": "Search results",
"changed": "2024-06-03T01:12:18+00:00",
"created": "2024-06-02T23:33:24+00:00",
"type": "tide_search_listing",
"nid": "fbcaaa5d-1635-40ac-8e44-2ed826177e77",
"_sectionId": "4",
"sidebar": {},
"status": "published",
"topicTags": [],
"siteSection": null,
"meta": {
"langcode": "en",
"description": "",
"additional": [
{
"tag": "meta",
"attributes": {
"name": "title",
"content": "Search results | Victorian Government"
}
},
{
"tag": "link",
"attributes": {
"rel": "canonical",
"href": "https://develop.content.vic.gov.au/test-sl"
}
},
{
"tag": "meta",
"attributes": {
"property": "og:locale",
"content": "en-AU"
}
}
],
"keywords": "",
"image": null
},
"showContentRating": true,
"summary": null,
"beforeResults": "",
"afterResults": "",
"introText": null,
"config": {
"searchListingConfig": {
"hideSearchForm": false,
"resultsPerPage": 20,
"labels": {
"submit": "Submit search",
"placeholder": "Start typing search term..."
},
"customSort": [
{
"title.keyword": "asc"
}
],
"formTheme": "default"
},
"queryConfig": {
"multi_match": {
"query": "{{query}}",
"fields": [
"title^3",
"field_landing_page_summary^2",
"body",
"field_paragraph_body",
"summary_processed"
]
}
},
"globalFilters": [
{
"terms": {
"type": [
"news",
"grant",
"event",
"landing_page"
]
}
},
{
"terms": {
"field_node_site": [
8888
]
}
}
],
"userFilters": [
{
"id": "type",
"component": "TideSearchFilterDropdown",
"filter": {
"type": "terms",
"value": "type"
},
"props": {
"id": "type",
"label": "Type",
"placeholder": "Select a type",
"type": "RplFormDropdown",
"multiple": true,
"options": [
{
"id": "news",
"label": "News",
"value": "news"
},
{
"id": "grant",
"label": "Grant",
"value": "grant"
},
{
"id": "event",
"label": "Event",
"value": "event"
},
{
"id": "landing_page",
"label": "Landing Page",
"value": "landing_page"
}
]
}
}
],
"resultsConfig": {
"layout": {
"component": "TideSearchResultsList"
},
"item": {
"news": {
"component": "TideSearchResult"
},
"event": {
"component": "TideEventSearchResult"
},
"grant": {
"component": "TideGrantSearchResult"
},
"*": {
"component": "TideSearchResultCard"
}
}
}
}
}
Loading
Loading