Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(infiniteHits): add previous button #659

Merged
merged 21 commits into from
Apr 24, 2019

Conversation

yannickcr
Copy link
Contributor

@yannickcr yannickcr commented Apr 12, 2019

Summary

The InfiniteHits widget is used to display a list of results with a “Show more” button. The user can click on this button to display more results without leaving its current page context.

Each time the user click on the “Show more” button the user will navigate to a new page (provided that the routing option is enabled in ais-instant-search).

However, in the case the user navigates directly to a particular page (direct link, previous button, page refresh) then the widget only displays the last result page.

This change add a previous button to the Infinite Hits widget to give the possibility to the user to load the previous result pages.

For implementation details see the full RFC.

Before being mergeable, this change requires a new release of https://github.com/algolia/instantsearch.js with the previous button feature:

Result

Some "with previous button enabled" and "with a custom show previous render" stories were added for the Instant Hits widget.

https://deploy-preview-659--vue-instantsearch.netlify.com/stories/?selectedKind=ais-infinite-hits&selectedStory=with%20show%20previous%20enabled&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybooks%2Fstorybook-addon-knobs

@yannickcr yannickcr requested a review from a team April 12, 2019 15:38
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Outdated Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Outdated Show resolved Hide resolved
stories/MemoryRouter.js Show resolved Hide resolved
stories/InfiniteHits.stories.js Outdated Show resolved Hide resolved
stories/InfiniteHits.stories.js Outdated Show resolved Hide resolved
stories/InfiniteHits.stories.js Outdated Show resolved Hide resolved
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Show resolved Hide resolved
francoischalifour and others added 10 commits April 18, 2019 17:09
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/InfiniteHits.vue Outdated Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Show resolved Hide resolved
stories/MemoryRouter.js Outdated Show resolved Hide resolved
src/components/__tests__/InfiniteHits.js Show resolved Hide resolved
samouss and others added 7 commits April 23, 2019 15:13
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
Co-Authored-By: yannickcr <yannick.croissant@gmail.com>
@yannickcr yannickcr merged commit 3d2eec9 into master Apr 24, 2019
@yannickcr yannickcr deleted the feat/infinitehits-previous-button branch April 24, 2019 11:02
Haroenv pushed a commit to algolia/instantsearch that referenced this pull request Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants