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

[SD-339] update filters toggle #1380

Merged
merged 1 commit into from
Nov 21, 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 @@ -14,7 +14,6 @@ Feature: Search listing - Filter

When I visit the page "/filters"
Then the search listing filters section should be open
And the filters toggle should be hidden

@mockserver
Example: Raw filter - Should reflect the value from the URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Then(
When(`I toggle the content collection filters`, () => {
cy.get(`[data-component-type="TideCustomCollection"]`)
.find(`button`)
.contains('Refine search')
.contains('Filters')
.click()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Then(
)

When(`I toggle the search listing filters section`, () => {
cy.get(`button`).contains('Refine search').as('refineBtn')
cy.get(`button`).contains('Filters').as('refineBtn')
cy.wait(300)
cy.get('@refineBtn').click()
})
Expand All @@ -374,15 +374,15 @@ Then(
(filterCount: number) => {
if (filterCount === 0) {
cy.get(`button`)
.contains('Refine search')
.contains('Filters')
.should(($div) => {
expect($div.text().trim()).equal(`Refine search`)
expect($div.text().trim()).equal(`Filters`)
})
} else {
cy.get(`button`)
.contains('Refine search')
.contains('Filters')
.should(($div) => {
expect($div.text().trim()).equal(`Refine search (${filterCount})`)
expect($div.text().trim()).equal(`Filters (${filterCount})`)
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const numAppliedFilters = computed(() => {
})

const toggleFiltersLabel = computed(() => {
let label = 'Refine search'
let label = 'Filters'

return numAppliedFilters.value
? `${label} (${numAppliedFilters.value})`
Expand Down Expand Up @@ -423,7 +423,6 @@ watch(
</template>
<RplSearchBarRefine
v-if="
!searchListingConfig?.showFiltersOnLoad &&
!searchListingConfig?.showFiltersOnly &&
userFilters &&
userFilters.length > 0
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-search/components/TideSearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const filtersExpanded = ref(false)
const submitFiltersLabel = 'Apply search filters'

const toggleFiltersLabel = computed(() => {
let label = 'Refine search'
let label = 'Filters'

return searchState.value?.filters?.length
? `${label} (${searchState.value.filters.length})`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ const numAppliedFilters = computed(() => {
})

const toggleFiltersLabel = computed(() => {
let label = 'Refine search'
let label = 'Filters'

return numAppliedFilters.value
? `${label} (${numAppliedFilters.value})`
Expand Down Expand Up @@ -619,7 +619,6 @@ const locationOrGeolocation = computed(() => {
<div class="tide-search-refine-wrapper">
<RplSearchBarRefine
v-if="
!searchListingConfig?.showFiltersOnLoad &&
!searchListingConfig?.showFiltersOnly &&
userFilters &&
userFilters.length > 0
Expand Down