Skip to content

Commit

Permalink
feat(connector): move clearAll as a rendering option
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Stanislawski committed Mar 24, 2017
1 parent 4bc2d21 commit ce41cde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ connectCurrentRefinedValues({
const connectCurrentRefinedValues = renderCurrentRefinedValues => ({
attributes = [],
onlyListedAttributes = false,
clearAll = 'before',
}) => {
const attributesOK = isArray(attributes) &&
reduce(
Expand All @@ -76,8 +75,7 @@ const connectCurrentRefinedValues = renderCurrentRefinedValues => ({
const showUsage = false ||
!isArray(attributes) ||
!attributesOK ||
!isBoolean(onlyListedAttributes) ||
[false, 'before', 'after'].indexOf(clearAll) === -1;
!isBoolean(onlyListedAttributes);

if (showUsage) {
throw new Error(usage);
Expand Down Expand Up @@ -105,7 +103,6 @@ const connectCurrentRefinedValues = renderCurrentRefinedValues => ({
renderCurrentRefinedValues({
attributes: attributesObj,
clearAllClick: this._clearRefinementsAndSearch,
clearAllPosition: clearAll,
clearAllURL,
clearRefinementClicks,
clearRefinementURLs,
Expand All @@ -123,7 +120,6 @@ const connectCurrentRefinedValues = renderCurrentRefinedValues => ({
renderCurrentRefinedValues({
attributes: attributesObj,
clearAllClick: this._clearRefinementsAndSearch,
clearAllPosition: clearAll,
clearAllURL,
clearRefinementClicks,
clearRefinementURLs,
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/current-refined-values/current-refined-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const bem = bemHelper('ais-current-refined-values');

const renderer = ({
autoHideContainer,
clearAllPosition,
collapsible,
containerNode,
cssClasses,
Expand All @@ -34,7 +35,6 @@ const renderer = ({
}) => ({
attributes,
clearAllClick,
clearAllPosition,
clearAllURL,
clearRefinementClicks,
clearRefinementURLs,
Expand Down Expand Up @@ -183,6 +183,7 @@ export default function currentRefinedValues({

const specializedRenderer = renderer({
containerNode,
clearAllPosition: clearAll,
collapsible,
cssClasses,
autoHideContainer,
Expand Down

0 comments on commit ce41cde

Please sign in to comment.