Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algolia/instantsearch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.16.0
Choose a base ref
...
head repository: algolia/instantsearch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.16.1
Choose a head ref
  • 2 commits
  • 16 files changed
  • 1 contributor

Commits on Mar 3, 2021

  1. Copy the full SHA
    579eee8 View commit details
  2. chore: release v4.16.1 (#4669)

    Eunjae Lee authored Mar 3, 2021
    Copy the full SHA
    a4062a6 View commit details
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
## [4.16.1](https://github.com/algolia/instantsearch.js/compare/v4.16.0...v4.16.1) (2021-03-03)


### Bug Fixes

* **relevantSort:** rename smartSort to relevantSort ([#4668](https://github.com/algolia/instantsearch.js/issues/4668)) ([579eee8](https://github.com/algolia/instantsearch.js/commit/579eee8d38effe067407a269e493400c460eb842))



# [4.16.0](https://github.com/algolia/instantsearch.js/compare/v4.15.0...v4.16.0) (2021-03-01)


### Bug Fixes

* **smartSort:** export the widget and the connector ([#4663](https://github.com/algolia/instantsearch.js/issues/4663)) ([e7aaa8c](https://github.com/algolia/instantsearch.js/commit/e7aaa8ceb47b8cafc3a3a323ebe47f45f3841ba4))
* **relevantSort:** export the widget and the connector ([#4663](https://github.com/algolia/instantsearch.js/issues/4663)) ([e7aaa8c](https://github.com/algolia/instantsearch.js/commit/e7aaa8ceb47b8cafc3a3a323ebe47f45f3841ba4))


### Features
@@ -17,7 +26,7 @@

### Features

* **smartSort:** add widget ([#4648](https://github.com/algolia/instantsearch.js/issues/4648)) ([89c6e86](https://github.com/algolia/instantsearch.js/commit/89c6e868f490e9b6e507dd70c215e962f4c69ccb))
* **relevantSort:** add widget ([#4648](https://github.com/algolia/instantsearch.js/issues/4648)) ([89c6e86](https://github.com/algolia/instantsearch.js/commit/89c6e868f490e9b6e507dd70c215e962f4c69ccb))
* **stats:** apply nbSortedHits ([#4649](https://github.com/algolia/instantsearch.js/issues/4649)) ([34478c1](https://github.com/algolia/instantsearch.js/commit/34478c198dcafbd45fd101db0cd2fbe6328272b8))
* **ts:** convert menu ([#4652](https://github.com/algolia/instantsearch.js/issues/4652)) ([2271b43](https://github.com/algolia/instantsearch.js/commit/2271b4379918e865a1b0cea09c139e517df97bc5))

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instantsearch.js",
"version": "4.16.0",
"version": "4.16.1",
"description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
"homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
"types": "es/index.d.ts",
Original file line number Diff line number Diff line change
@@ -3,25 +3,25 @@
import { h } from 'preact';
import Template from '../Template/Template';
import {
SmartSortCSSClasses,
SmartSortTemplates,
} from '../../widgets/smart-sort/smart-sort';
RelevantSortCSSClasses,
RelevantSortTemplates,
} from '../../widgets/relevant-sort/relevant-sort';

type SmartSortProps = {
cssClasses: SmartSortCSSClasses;
templates: SmartSortTemplates;
isSmartSorted: boolean;
type RelevantSortProps = {
cssClasses: RelevantSortCSSClasses;
templates: RelevantSortTemplates;
isRelevantSorted: boolean;
isVirtualReplica: boolean;
refine(relevancyStrictness: number | undefined): void;
};

const SmartSort = ({
const RelevantSort = ({
cssClasses,
templates,
isSmartSorted,
isRelevantSorted,
isVirtualReplica,
refine,
}: SmartSortProps) =>
}: RelevantSortProps) =>
isVirtualReplica ? (
<div className={cssClasses.root}>
<Template
@@ -30,13 +30,13 @@ const SmartSort = ({
rootProps={{
className: cssClasses.text,
}}
data={{ isSmartSorted }}
data={{ isRelevantSorted }}
/>
<button
type="button"
className={cssClasses.button}
onClick={() => {
if (isSmartSorted) {
if (isRelevantSorted) {
refine(0);
} else {
refine(undefined);
@@ -47,10 +47,10 @@ const SmartSort = ({
rootTagName="span"
templateKey="button"
templates={templates}
data={{ isSmartSorted }}
data={{ isRelevantSorted }}
/>
</button>
</div>
) : null;

export default SmartSort;
export default RelevantSort;
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { h } from 'preact';
import { render, fireEvent } from '@testing-library/preact';

import SmartSort from '../SmartSort';
import RelevantSort from '../RelevantSort';

const cssClasses = {
root: 'root',
@@ -13,18 +13,18 @@ const cssClasses = {

const templates = {
text: '',
button: ({ isSmartSorted }) => {
return isSmartSorted ? 'See all results' : 'See relevant results';
button: ({ isRelevantSorted }) => {
return isRelevantSorted ? 'See all results' : 'See relevant results';
},
};

describe('SmartSort', () => {
describe('RelevantSort', () => {
it('render nothing if not virtual replica', () => {
const { container } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={false}
isRelevantSorted={false}
isVirtualReplica={false}
refine={() => {}}
/>
@@ -34,10 +34,10 @@ describe('SmartSort', () => {

it('render the default status', () => {
const { container } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={false}
isRelevantSorted={false}
isVirtualReplica={true}
refine={() => {}}
/>
@@ -66,10 +66,10 @@ describe('SmartSort', () => {
it('refine on button click', () => {
const refine = jest.fn();
const { getByText } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={false}
isRelevantSorted={false}
isVirtualReplica={true}
refine={refine}
/>
@@ -80,10 +80,10 @@ describe('SmartSort', () => {

it('render sorted status', () => {
const { container } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={true}
isRelevantSorted={true}
isVirtualReplica={true}
refine={() => {}}
/>
@@ -112,10 +112,10 @@ describe('SmartSort', () => {
it('refine with `undefined` on "See relevant results"', () => {
const refine = jest.fn();
const { getByText } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={false}
isRelevantSorted={false}
isVirtualReplica={true}
refine={refine}
/>
@@ -128,10 +128,10 @@ describe('SmartSort', () => {
it('refine with `0` on "Seeing all results"', () => {
const refine = jest.fn();
const { getByText } = render(
<SmartSort
<RelevantSort
cssClasses={cssClasses}
templates={templates}
isSmartSorted={true}
isRelevantSorted={true}
isVirtualReplica={true}
refine={refine}
/>
2 changes: 1 addition & 1 deletion src/connectors/index.ts
Original file line number Diff line number Diff line change
@@ -25,4 +25,4 @@ export { default as connectAutocomplete } from './autocomplete/connectAutocomple
export { default as connectQueryRules } from './query-rules/connectQueryRules';
export { default as connectVoiceSearch } from './voice-search/connectVoiceSearch';
export { default as EXPERIMENTAL_connectAnswers } from './answers/connectAnswers';
export { default as connectSmartSort } from './smart-sort/connectSmartSort';
export { default as connectRelevantSort } from './relevant-sort/connectRelevantSort';
Loading