-
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 #1200 from dpc-sdp/feature/multiple-result-compone…
…nt-support feat(@dpc-sdp/ripple-tide-search): allow multiple result items types
- Loading branch information
Showing
8 changed files
with
918 additions
and
46 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
examples/nuxt-app/test/features/search-listing/result-items.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,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
151
examples/nuxt-app/test/fixtures/search-listing/result-items/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,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" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.