Skip to content

Commit a84a76a

Browse files
committed
build
2 parents 6f96b3f + 005d64a commit a84a76a

24 files changed

+582
-537
lines changed

app/sensors/CategorySearch.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default class CategorySearch extends Component {
134134
// default query
135135
defaultSearchQuery(input) {
136136
if (input && input.value) {
137-
const query = [];
137+
let query = [];
138138
if (this.fieldType === "string") {
139139
query.push({
140140
match_phrase_prefix: {
@@ -149,6 +149,13 @@ export default class CategorySearch extends Component {
149149
}
150150
});
151151
});
152+
153+
query = {
154+
bool: {
155+
should: query,
156+
minimum_should_match: 1
157+
}
158+
}
152159
}
153160

154161
if (input.category && input.category !== null) {
@@ -299,7 +306,7 @@ export default class CategorySearch extends Component {
299306
if(this.props.onValueChange) {
300307
this.props.onValueChange(obj.value);
301308
}
302-
helper.URLParams.update(this.props.componentId, finalVal.value, this.props.URLParam);
309+
helper.URLParams.update(this.props.componentId, finalVal.value, this.props.URLParams);
303310
helper.selectedSensor.set(obj, true);
304311
this.setState({
305312
currentValue: value
@@ -366,15 +373,15 @@ CategorySearch.propTypes = {
366373
React.PropTypes.arrayOf(React.PropTypes.string)
367374
]),
368375
componentStyle: React.PropTypes.object,
369-
URLParam: React.PropTypes.bool
376+
URLParams: React.PropTypes.bool
370377
};
371378

372379
// Default props value
373380
CategorySearch.defaultProps = {
374381
placeholder: "Search",
375382
highlight: false,
376383
componentStyle: {},
377-
URLParam: false
384+
URLParams: false
378385
};
379386

380387
// context type
@@ -393,5 +400,5 @@ CategorySearch.types = {
393400
defaultSelected: TYPES.STRING,
394401
customQuery: TYPES.FUNCTION,
395402
highlight: TYPES.BOOLEAN,
396-
URLParam: TYPES.BOOLEAN
403+
URLParams: TYPES.BOOLEAN
397404
};

app/sensors/DynamicRangeSlider.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export default class DynamicRangeSlider extends Component {
301301
if(this.props.onValueChange) {
302302
this.props.onValueChange(obj.value);
303303
}
304-
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam);
304+
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams);
305305
helper.selectedSensor.set(obj, true);
306306

307307
this.setState({
@@ -394,15 +394,15 @@ DynamicRangeSlider.propTypes = {
394394
onValueChange: React.PropTypes.func,
395395
interval: React.PropTypes.number,
396396
componentStyle: React.PropTypes.object,
397-
URLParam: React.PropTypes.bool
397+
URLParams: React.PropTypes.bool
398398
};
399399

400400
DynamicRangeSlider.defaultProps = {
401401
title: null,
402402
stepValue: 1,
403403
showHistogram: true,
404404
componentStyle: {},
405-
URLParam: false
405+
URLParams: false
406406
};
407407

408408
// context type
@@ -422,5 +422,5 @@ DynamicRangeSlider.types = {
422422
showHistogram: TYPES.BOOLEAN,
423423
customQuery: TYPES.FUNCTION,
424424
initialLoader: TYPES.OBJECT,
425-
URLParam: TYPES.BOOLEAN
425+
URLParams: TYPES.BOOLEAN
426426
};

app/sensors/NestedList.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export default class NestedList extends Component {
313313
if(this.props.onValueChange) {
314314
this.props.onValueChange(obj.value);
315315
}
316-
helper.URLParams.update(this.props.componentId, value, this.props.URLParam);
316+
helper.URLParams.update(this.props.componentId, value, this.props.URLParams);
317317
helper.selectedSensor.set(obj, isExecuteQuery);
318318
}
319319

@@ -484,7 +484,7 @@ NestedList.propTypes = {
484484
react: React.PropTypes.object,
485485
onValueChange: React.PropTypes.func,
486486
componentStyle: React.PropTypes.object,
487-
URLParam: React.PropTypes.bool
487+
URLParams: React.PropTypes.bool
488488
};
489489

490490
// Default props value
@@ -496,7 +496,7 @@ NestedList.defaultProps = {
496496
title: null,
497497
placeholder: "Search",
498498
componentStyle: {},
499-
URLParam: false
499+
URLParams: false
500500
};
501501

502502
// context type
@@ -518,5 +518,5 @@ NestedList.types = {
518518
defaultSelected: TYPES.ARRAY,
519519
customQuery: TYPES.FUNCTION,
520520
initialLoader: TYPES.OBJECT,
521-
URLParam: TYPES.BOOLEAN
521+
URLParams: TYPES.BOOLEAN
522522
};

app/sensors/RatingsFilter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default class RatingsFilter extends Component {
8888
}
8989
// pass the selected sensor value with componentId as key,
9090
const isExecuteQuery = true;
91-
helper.URLParams.update(this.props.componentId, JSON.stringify(record), this.props.URLParam);
91+
helper.URLParams.update(this.props.componentId, JSON.stringify(record), this.props.URLParams);
9292
helper.selectedSensor.set(obj, isExecuteQuery);
9393
}
9494

@@ -160,14 +160,14 @@ RatingsFilter.propTypes = {
160160
customQuery: React.PropTypes.func,
161161
onValueChange: React.PropTypes.func,
162162
componentStyle: React.PropTypes.object,
163-
URLParam: React.PropTypes.bool
163+
URLParams: React.PropTypes.bool
164164
};
165165

166166
// Default props value
167167
RatingsFilter.defaultProps = {
168168
title: null,
169169
componentStyle: {},
170-
URLParam: false
170+
URLParams: false
171171
};
172172

173173
// context type
@@ -183,5 +183,5 @@ RatingsFilter.types = {
183183
data: TYPES.OBJECT,
184184
defaultSelected: TYPES.OBJECT,
185185
customQuery: TYPES.FUNCTION,
186-
URLParam: TYPES.BOOLEAN
186+
URLParams: TYPES.BOOLEAN
187187
};

app/sensors/TagCloud.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class TagCloud extends Component {
6666
key: this.props.componentId,
6767
value: this.selectedValue
6868
};
69-
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam);
69+
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams);
7070
helper.selectedSensor.set(obj, true);
7171
} else if (!this.props.multiSelect && this.defaultSelected !== defaultValue) {
7272
this.defaultSelected = defaultValue;
@@ -91,7 +91,7 @@ export default class TagCloud extends Component {
9191
key: this.props.componentId,
9292
value: this.selectedValue
9393
};
94-
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam);
94+
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams);
9595
helper.selectedSensor.set(obj, true);
9696
}
9797
}, 300);
@@ -270,7 +270,7 @@ export default class TagCloud extends Component {
270270
key: this.props.componentId,
271271
value: this.selectedValue
272272
};
273-
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParam);
273+
helper.URLParams.update(this.props.componentId, obj.value, this.props.URLParams);
274274
helper.selectedSensor.set(obj, true);
275275
}
276276

@@ -348,7 +348,7 @@ TagCloud.propTypes = {
348348
react: React.PropTypes.object,
349349
onValueChange: React.PropTypes.func,
350350
componentStyle: React.PropTypes.object,
351-
URLParam: React.PropTypes.bool
351+
URLParams: React.PropTypes.bool
352352
};
353353

354354
TagCloud.defaultProps = {
@@ -357,7 +357,7 @@ TagCloud.defaultProps = {
357357
size: 100,
358358
title: null,
359359
componentStyle: {},
360-
URLParam: false
360+
URLParams: false
361361
};
362362

363363
TagCloud.contextTypes = {
@@ -376,5 +376,5 @@ TagCloud.types = {
376376
initialLoader: TYPES.STRING,
377377
defaultSelected: TYPES.STRING,
378378
react: TYPES.OBJECT,
379-
URLParam: TYPES.BOOLEAN
379+
URLParams: TYPES.BOOLEAN
380380
};

app/sensors/ToggleList.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default class ToggleList extends Component {
5050
key: props.componentId,
5151
value: records
5252
};
53-
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam);
53+
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams);
5454
helper.selectedSensor.set(obj, true);
5555
}
5656
} else {
@@ -73,7 +73,7 @@ export default class ToggleList extends Component {
7373
key: props.componentId,
7474
value: records
7575
};
76-
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam);
76+
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams);
7777
helper.selectedSensor.set(obj, true);
7878
}
7979
} else {
@@ -154,7 +154,7 @@ export default class ToggleList extends Component {
154154
}
155155
// pass the selected sensor value with componentId as key,
156156
const isExecuteQuery = true;
157-
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParam);
157+
helper.URLParams.update(this.props.componentId, this.setURLParam(obj.value), this.props.URLParams);
158158
helper.selectedSensor.set(obj, isExecuteQuery);
159159
}
160160

@@ -228,14 +228,14 @@ ToggleList.propTypes = {
228228
customQuery: React.PropTypes.func,
229229
onValueChange: React.PropTypes.func,
230230
componentStyle: React.PropTypes.object,
231-
URLParam: React.PropTypes.bool
231+
URLParams: React.PropTypes.bool
232232
};
233233

234234
// Default props value
235235
ToggleList.defaultProps = {
236236
multiSelect: true,
237237
componentStyle: {},
238-
URLParam: false
238+
URLParams: false
239239
};
240240

241241
// context type
@@ -252,5 +252,5 @@ ToggleList.types = {
252252
defaultSelected: TYPES.ARRAY,
253253
multiSelect: TYPES.BOOLEAN,
254254
customQuery: TYPES.FUNCTION,
255-
URLParam: TYPES.BOOLEAN
255+
URLParams: TYPES.BOOLEAN
256256
};

app/stories/CategorySearch.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class CategorySearchDefault extends Component {
6464
<div className="row">
6565
<div className="col s6 col-xs-6">
6666
<CategorySearch
67-
appbaseField="name"
67+
appbaseField={["name", "color"]}
6868
categoryField="brand.raw"
6969
componentId="CarSensor"
7070
title="CategorySearch"

dist/airbnb_recipe.bundle.js

Lines changed: 54 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ecommerce_recipe.bundle.js

Lines changed: 53 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/meetup_recipe.bundle.js

Lines changed: 53 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)