@bento-core/facet-filter 1.0.1-CDS.0 → 1.0.1-CDS.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,7 @@ const FacetView = _ref => {
61
61
  type,
62
62
  facetValues
63
63
  } = facet;
64
- const selectedItems = facetValues && facetValues.filter(item => item.isChecked);
64
+ const selectedItems = facetValues && facetValues.filter(item => item && item.isChecked);
65
65
  const displayFacet = _objectSpread({}, facet);
66
66
  displayFacet.facetValues = selectedItems;
67
67
  const isActiveFacet = [...selectedItems].length > 0;
@@ -10,7 +10,8 @@ const sortType = {
10
10
  NUMERIC: 'NUMERIC',
11
11
  ALPHA_NUMERIC: 'ALPHA_NUMERIC',
12
12
  CUSTOM_NUMBER: 'CUSTOM_NUMBER',
13
- RANGE: 'RANGE'
13
+ RANGE: 'RANGE',
14
+ NONE: 'NONE'
14
15
  };
15
16
 
16
17
  /**
@@ -51,7 +52,7 @@ const sortBySection = _ref => {
51
52
  count = 'subjects'
52
53
  } = _ref;
53
54
  const sortfacetValues = [...facetValues];
54
- if (!sortfacetValues) {
55
+ if (!sortfacetValues || sort_type === sortType.NONE) {
55
56
  return facetValues;
56
57
  }
57
58
  if (sortBy === sortType.NUMERIC) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/facet-filter",
3
- "version": "1.0.1-CDS.0",
3
+ "version": "1.0.1-CDS.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -25,5 +25,5 @@
25
25
  },
26
26
  "author": "CTOS Bento Team",
27
27
  "license": "ISC",
28
- "gitHead": "4a7e8f3a0eaf09a10dbb1a0ef54218cd84a377f1"
28
+ "gitHead": "7b3aaef031248be613da70582863625cf729fcce"
29
29
  }
@@ -52,7 +52,7 @@ const FacetView = ({
52
52
  * display checked items on facet collapse
53
53
  */
54
54
  const { type, facetValues } = facet;
55
- const selectedItems = facetValues && facetValues.filter((item) => item.isChecked);
55
+ const selectedItems = facetValues && facetValues.filter((item) => item && item.isChecked);
56
56
  const displayFacet = { ...facet };
57
57
  displayFacet.facetValues = selectedItems;
58
58
  const isActiveFacet = [...selectedItems].length > 0;
package/src/utils/Sort.js CHANGED
@@ -5,6 +5,7 @@ export const sortType = {
5
5
  ALPHA_NUMERIC: 'ALPHA_NUMERIC',
6
6
  CUSTOM_NUMBER: 'CUSTOM_NUMBER',
7
7
  RANGE: 'RANGE',
8
+ NONE: 'NONE',
8
9
  };
9
10
 
10
11
  /**
@@ -45,7 +46,7 @@ export const sortBySection = ({
45
46
  count = 'subjects',
46
47
  }) => {
47
48
  const sortfacetValues = [...facetValues];
48
- if (!sortfacetValues) {
49
+ if (!sortfacetValues || sort_type === sortType.NONE) {
49
50
  return facetValues;
50
51
  }
51
52
  if (sortBy === sortType.NUMERIC) {