Skip to content

Commit

Permalink
Merge branch 'develop' into Pit
Browse files Browse the repository at this point in the history
  • Loading branch information
bobylito authored May 22, 2018
2 parents 8f718e8 + ab08dd4 commit 2e8a507
Show file tree
Hide file tree
Showing 56 changed files with 387 additions and 385 deletions.
46 changes: 0 additions & 46 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve InstantSearch.js

---

<!--
Thanks for participating in this project! We will try to answer as soon as possible 🙏
-->

**Describe the bug 🐛**
A clear and concise description of what the bug is.

**To Reproduce 🔍**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

A live example helps a lot! We have a simple online template for you to use for your explanations:
https://codesandbox.io/s/github/algolia/instantsearch-templates/tree/master/src/InstantSearch.js

**Expected behavior 💭**
A clear and concise description of what you expected to happen.

**Screenshots 🖥**
If applicable, add screenshots to help explain your problem.

**Environment:**
- OS: [e.g. iOS / windows / mac / android]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for this project

---

<!--
Thanks for participating in this project! We will try to answer as soon as possible 🙏
-->

**Is your feature request related to a problem? Please describe 🙏**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like 🤔**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered ✨**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
<a name="2.7.4"></a>
## [2.7.4](https://github.com/algolia/instantsearch.js/compare/v2.7.3...v2.7.4) (2018-05-03)


### Bug Fixes

* **searchFunction:** Fix unresolved returned Promise ([#2913](https://github.com/algolia/instantsearch.js/issues/2913)) ([5286c7c](https://github.com/algolia/instantsearch.js/commit/5286c7c))



<a name="2.7.3"></a>
## [2.7.3](https://github.com/algolia/instantsearch.js/compare/v2.7.2...v2.7.3) (2018-04-26)


### Bug Fixes

* **index.es6:** avoid use of Object.assign for IE ([#2908](https://github.com/algolia/instantsearch.js/issues/2908)) ([228b02e](https://github.com/algolia/instantsearch.js/commit/228b02e))



<a name="2.7.2"></a>
## [2.7.2](https://github.com/algolia/instantsearch.js/compare/v2.7.1...v2.7.2) (2018-04-18)

### Bug Fixes

* **routing:** should apply stateMapping when doing initial write ([#2892](https://github.com/algolia/instantsearch.js/issues/2892)) ([7f62e6dc](https://github.com/algolia/instantsearch.js/commit/7f62e6dc))
* **ie:** do not rely on Object.assign ([#2885](https://github.com/algolia/instantsearch.js/issues/2885)) ([88497e56](https://github.com/algolia/instantsearch.js/commit/88497e56))



<a name="2.7.1"></a>
## [2.7.1](https://github.com/algolia/instantsearch.js/compare/v2.7.0...v2.7.1) (2018-04-11)

Expand Down
4 changes: 3 additions & 1 deletion dev/app/builtin/stories/geo-search.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import instantsearch from '../../../../index';
import { wrapWithHits } from '../../utils/wrap-with-hits';
import createInfoBox from '../../utils/create-info-box';

const API_KEY = 'AIzaSyBawL8VbstJDdU5397SUX7pEt9DslAwWgQ';

const wrapWithHitsAndConfiguration = (story, searchParameters) =>
wrapWithHits(story, {
indexName: 'airbnb',
Expand All @@ -18,7 +20,7 @@ const wrapWithHitsAndConfiguration = (story, searchParameters) =>

const injectGoogleMaps = fn => {
injectScript(
'https://maps.googleapis.com/maps/api/js?v=3.31&key=AIzaSyCl2TTJXpwxGuuc2zQZkAlIkWhpYbyjjP8',
`https://maps.googleapis.com/maps/api/js?v=3.31&key=${API_KEY}`,
fn
);
};
Expand Down
8 changes: 8 additions & 0 deletions docgen/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ toggleDocumentationSidebar();
window.addEventListener('resize', () => {
toggleDocumentationSidebar();
});

const openIssueLink = document.querySelector('#link-open-issue');
if (openIssueLink) {
openIssueLink.href = openIssueLink.href.replace(
/__LOCATION__/g,
window.location.href
);
}
2 changes: 1 addition & 1 deletion docgen/layouts/archetypes/content-with-menu.pug
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body.documentation
block content
hr
p
strong Can't find what you are looking for? #[a(href="https://github.com/algolia/instantsearch.js/issues/new?title=I could not find what I was looking for&body=Hi! I have a documentation issue on InstantSearch.js, I could not find what I was looking for which is: -- PLEASE FILL IN HERE --") Open an issue], we'll get back to you.
strong Can't find what you are looking for? #[a(href=`https://github.com/algolia/instantsearch.js/issues/new?title=Question on the page "${title}"&body=Hi! I have a documentation issue on InstantSearch.js. I could not find what I was looking for on the page "[${title}](__LOCATION__)".%0A%0A<!-- Describe what you're looking for here. -->&labels=Doc: question`, id="link-open-issue") Open an issue], we'll get back to you.

include ../common/footer.pug
script(src=webpack.assets['js/main.js'])
Expand Down
6 changes: 3 additions & 3 deletions docgen/layouts/instantsearch.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ block content
p InstantSearch is an EventEmitter and as such it emits events on specific parts of the lifecycle.
h3 render
p
| The `render` event is triggered when the rendering of all the widgets is done. This
| Triggered when the rendering of all the widgets is done. This
| happens after a search result comes back from Algolia - which means that it is
| triggered for the first once everything after all the widgets went through all
| triggered for the first time once everything after all the widgets went through all
| there lifecycle steps once (getConfiguration, init, render).
h3 error
p
| The `error` event is triggered when an error is reported when calling the API.
| Triggered when an error is reported when calling the API.
2 changes: 1 addition & 1 deletion docgen/src/data/communityHeader.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"logo": "https://community.algolia.com/img/illus-autocomplete.svg",
"backgroundColor": "#00587f"
}, {
"name": "InstantSearch React",
"name": "React InstantSearch",
"url": "https://community.algolia.com/instantsearch.js/react",
"logo": "https://community.algolia.com/img/logo-react-instantsearch.svg",
"backgroundColor": "linear-gradient(45deg, #3369e7, #00aeff), linear-gradient(#fafafa, #fafafa)"
Expand Down
2 changes: 1 addition & 1 deletion docgen/src/examples/tourism/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<!-- /Results -->
<script src="https://cdn.jsdelivr.net/react/15.5.4/react.min.js" async></script>
<script src="https://cdn.jsdelivr.net/react/15.5.4/react-dom.min.js" async></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCL0SatoeN9oZ5Z2ToYR8hoENTmZg6iUnY" async></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBawL8VbstJDdU5397SUX7pEt9DslAwWgQ" async></script>
<script src="https://cdn.jsdelivr.net/instantsearch-googlemaps/1/instantsearch-googlemaps.min.js" async></script>

<script src="search.js"></script>
4 changes: 4 additions & 0 deletions docgen/src/stylesheets/vendors/bootstrap/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ samp {
}

// Inline code
code:empty {
display: none;
}

code {
padding: 2px 4px;
font-size: 90%;
Expand Down
6 changes: 3 additions & 3 deletions docgen/src/widgets-common-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ search.addWidget(instantsearch.searchbox({
`cssClasses` is a parameter that let you specify one or more classes to add to
some specific element of the rendered widget. When available, this parameter is
an object of either string or array of strings. The different keys available
is define in the widget reference.
is defined in the widget reference.

```javascript
const search = instantsearch(/* parameters here */);
Expand Down Expand Up @@ -79,8 +79,8 @@ search.addWidget(instantsearch.refinementList({
## transformData

`transformData` is used to provide function that will transform the data
passed to the templates. This is particularly handy when using using mustache
because it only accepts conditionnals over `boolean` value.
passed to the templates. This is particularly handy when using mustache
because it only accepts conditionals over `Boolean` values.

Those function map the different template keys available, when it makes sense.
For example, if a widget accepts an `item` template, you can provide an `item`
Expand Down
9 changes: 5 additions & 4 deletions index.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import version from './lib/version.js';

// import instantsearch from 'instantsearch.js';
// -> provides instantsearch object without connectors and widgets
const instantSearchFactory = Object.assign(toFactory(InstantSearch), {
version,
createQueryString: algoliasearchHelper.url.getQueryStringFromState,
});
const instantSearchFactory = toFactory(InstantSearch);

instantSearchFactory.version = version;
instantSearchFactory.createQueryString =
algoliasearchHelper.url.getQueryStringFromState;

Object.defineProperty(instantSearchFactory, 'widgets', {
get() {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "instantsearch.js",
"version": "2.7.1",
"version": "2.7.4",
"description": "instantsearch.js is a library of widgets to build high performance instant search experiences using Algolia",
"homepage": "https://community.algolia.com/instantsearch.js/",
"keywords": [
Expand Down Expand Up @@ -130,8 +130,8 @@
"webpack-dev-server": "2.11.2"
},
"dependencies": {
"algoliasearch": "3.25.1",
"algoliasearch-helper": "2.24.0",
"algoliasearch": "3.27.0",
"algoliasearch-helper": "2.26.0",
"classnames": "2.2.5",
"events": "1.1.0",
"hogan.js": "3.0.2",
Expand Down
10 changes: 5 additions & 5 deletions src/connectors/breadcrumb/__tests__/connectBreadcrumb-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('connectBreadcrumb', () => {
// Verify that the widget has not been rendered yet at this point
expect(rendering.mock.calls).toHaveLength(0);

const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', config);
const helper = jsHelper({}, '', config);
helper.search = jest.fn();

widget.init({
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('connectBreadcrumb', () => {
const widget = makeWidget({ attributes: ['category', 'sub_category'] });

const config = widget.getConfiguration({});
const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', config);
const helper = jsHelper({}, '', config);
helper.search = jest.fn();

helper.toggleRefinement('category', 'Decoration');
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('connectBreadcrumb', () => {
const widget = makeWidget({ attributes: ['category', 'sub_category'] });

const config = widget.getConfiguration({});
const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', config);
const helper = jsHelper({}, '', config);
helper.search = jest.fn();

widget.init({
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('connectBreadcrumb', () => {
});

const config = widget.getConfiguration({});
const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', config);
const helper = jsHelper({}, '', config);
helper.search = jest.fn();

widget.init({
Expand Down Expand Up @@ -427,7 +427,7 @@ describe('connectBreadcrumb', () => {
const widget = makeWidget({ attributes: ['category', 'sub_category'] });

const config = widget.getConfiguration({});
const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', config);
const helper = jsHelper({}, '', config);
helper.search = jest.fn();

widget.init({
Expand Down
12 changes: 6 additions & 6 deletions src/connectors/clear-all/__tests__/connectClearAll-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import connectClearAll from '../connectClearAll.js';

describe('connectClearAll', () => {
it('Renders during init and render', () => {
const helper = jsHelper({ addAlgoliaAgent: () => {} });
const helper = jsHelper({});
helper.search = sinon.stub();
// test that the dummyRendering is called with the isFirstRendering
// flag set accordingly
Expand Down Expand Up @@ -58,7 +58,7 @@ describe('connectClearAll', () => {
// test the function received by the rendering function
// to clear the refinements

const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', {
const helper = jsHelper({}, '', {
facets: ['myFacet'],
});
helper.search = sinon.stub();
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('connectClearAll', () => {
// test the function received by the rendering function
// to clear the refinements

const helper = jsHelper({ addAlgoliaAgent: () => {} }, '', {
const helper = jsHelper({}, '', {
facets: ['myFacet'],
});
helper.search = sinon.stub();
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('connectClearAll', () => {
it('some refinements from results <=> hasRefinements = true', () => {
// test if the values sent to the rendering function
// are consistent with the search state
const helper = jsHelper({ addAlgoliaAgent: () => {} }, undefined, {
const helper = jsHelper({}, undefined, {
facets: ['aFacet'],
});
helper.toggleRefinement('aFacet', 'some value');
Expand Down Expand Up @@ -184,7 +184,7 @@ describe('connectClearAll', () => {
it('(clearsQuery: true) query not empty <=> hasRefinements = true', () => {
// test if the values sent to the rendering function
// are consistent with the search state
const helper = jsHelper({ addAlgoliaAgent: () => {} }, undefined, {
const helper = jsHelper({}, undefined, {
facets: ['aFacet'],
});
helper.setQuery('no empty');
Expand Down Expand Up @@ -219,7 +219,7 @@ describe('connectClearAll', () => {
// test if the values sent to the rendering function
// are consistent with the search state

const helper = jsHelper({ addAlgoliaAgent: () => {} });
const helper = jsHelper({});
helper.setQuery('not empty');
helper.search = sinon.stub();

Expand Down
4 changes: 3 additions & 1 deletion src/connectors/configure/__tests__/connectConfigure-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import algoliasearchHelper, { SearchParameters } from 'algoliasearch-helper';

import connectConfigure from '../connectConfigure.js';

const fakeClient = { addAlgoliaAgent: () => {}, search: jest.fn() };
const fakeClient = {
search: jest.fn(() => Promise.resolve({ results: [{}] })),
};

describe('connectConfigure', () => {
let helper;
Expand Down
Loading

0 comments on commit 2e8a507

Please sign in to comment.