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

[R20-1981] fix search listing dropdowns #1153

Merged
merged 1 commit into from
May 8, 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
Expand Up @@ -11,7 +11,6 @@ Feature: Search listing - Aggregations
Example: Aggregations and Taxonomies
Given the page endpoint for path "/aggregations" 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
Expand All @@ -26,6 +25,7 @@ Feature: Search listing - Aggregations
| Government |
| Individual |
| Not-for-profit groups |
And I click the option labelled "Business" in the selected dropdown
# Close the dropdown
When I click the search listing dropdown field labelled "Elastic aggregation test"

Expand All @@ -34,3 +34,11 @@ Feature: Search listing - Aggregations
Then the selected dropdown field should have the items:
| Arts |
| Business |
And I click the option labelled "Arts" in the selected dropdown
And I click the search listing dropdown field labelled "Taxonomy test"

When I submit the search filters
Then the URL should reflect that the current active filters are as follows:
| id | value |
| audience | Business |
| topic | Arts |
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ onAggregationUpdateHook.value = (aggs: any) => {
if (uiFilter.id === key) {
const getDynamicOptions = () => {
const mappedOptions = aggs[key].map((item: any) => ({
id: item,
label: item,
value: item
id: item.key,
label: item.key,
value: item.key
}))

if (uiFilters.value[idx].props?.hasOwnProperty('options')) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-search/composables/useTideSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default ({
field: currentFilter.aggregations.field,
order: { _key: 'asc' },
size: currentFilter.aggregations.size || 30,
min_doc_count: 0
min_doc_count: searchListingConfig?.dynamicAggregations ? 0 : 1
}
}
}
Expand Down
Loading