Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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
2 changes: 2 additions & 0 deletions content/widgets/clear-refinements.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ classes:
options:
- name: excludedAttributes
description: Attributes not to clear
- name: includedAttributes
description: Attributes to show exclusively
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have this one on CurrentRefinements?

Copy link
Contributor

@francoischalifour francoischalifour Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have it for both ClearRefinements (algolia/instantsearch#3114) and CurrentRefinements (yet to be implemented).

Copy link
Contributor

@samouss samouss Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep but it's not written in the specs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Will add it!

- name: clearsQuery
default: false
description: Also clears the query
Expand Down
47 changes: 36 additions & 11 deletions content/widgets/current-refinements.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,37 @@ html: |
</span>
</li>
</ul>
<button class="ais-CurrentRefinements-reset">
Clear all
</button>
</div>
althtml1: |
<div class="ais-CurrentRefinements">
<ul class="ais-CurrentRefinements-list">
<li class="ais-CurrentRefinements-item">
<span class="ais-CurrentRefinements-label">
Category:
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">Movies & TV Shows</span>
<button class="ais-CurrentRefinements-delete">✕</button>
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">Others</span>
<button class="ais-CurrentRefinements-delete">✕</button>
</span>
</li>
<li class="ais-CurrentRefinements-item">
<span class="ais-CurrentRefinements-label">
Query:
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">
<q>Bla bla bla</q>
</span>
<button class="ais-CurrentRefinements-delete">✕</button>
</span>
</li>
</ul>
</div>
alt1: with includesQuery and a query
classes:
- name: .ais-CurrentRefinements
description: the root div of the widget
Expand All @@ -34,19 +61,17 @@ classes:
- name: .ais-CurrentRefinements-category
description: the category of each item
- name: .ais-CurrentRefinements-categoryLabel
description: the label of each catgory
description: the label of each category
- name: .ais-CurrentRefinements-delete
description: the delete button of each catgory
- name: .ais-CurrentRefinements-reset
description: the reset button for current selected values
description: the delete button of each category
- name: .ais-CurrentRefinements-query
description: the quote element if query is included
options:
- name: attributes
description: Label definitions for the different filters.
- name: excludedAttributes
description: list of attributes not to show
- name: clearsQuery
- name: includesQuery
Copy link
Contributor

@samouss samouss Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have two different option names includesQuery and clearsQuery?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rename it to includesQuery in ClearRefinements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it feels a bit redundant to have excludes, includes and includesQuery. It could be implemented as includes with a wildcard for example (probably not the best though - see below). An other solution is to have the value of the query present by default in CurrentRefinements & ClearRefinements.

includes = ['*', 'query']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a new pattern in InstantSearch I think?
I reckon it's a good compromise. Maybe calling this option attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be confusing because that’s the previous option name no?

Copy link
Contributor

@samouss samouss Oct 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still be able to excludes & includes with only attributes we can't. I agree with @Haroenv on the question about the name of the options. attributes will be a bit confusing regarding the other widgets.

default: false
description: The clear all button also clears the query
description: The list includes the query too
- name: transformItems
description: Function which receives the items, which will be called before displaying them. Should return a new array with the same shape as the original array. Useful for mapping over the items to transform, remove or reorder them
---