@blaze-cms/react-page-builder 0.124.1-alpha.2 → 0.124.1-alpha.3
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.
- package/CHANGELOG.md +11 -0
- package/lib/BannerContext/index.js.map +1 -1
- package/lib/HOC/withInfiniteScroll.js.map +1 -1
- package/lib/HOC/withTitle.js.map +1 -1
- package/lib/PBContext/index.js.map +1 -1
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/BackToTop/BackToTop.js.map +1 -1
- package/lib/components/Banner/AdSlotRender.js.map +1 -1
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContainer.js.map +1 -1
- package/lib/components/Card/CardFactory.js.map +1 -1
- package/lib/components/Card/CardRender.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/Card/helpers/filters-setup.js.map +1 -1
- package/lib/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselImage/CarouselImage.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/CarouselWrapper.js.map +1 -1
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Code/ScriptTag.js.map +1 -1
- package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-data-summary-query.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-prop-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
- package/lib/components/DataSummary/helpers/strip-summary-props-content.js.map +1 -1
- package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/NavButton.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageDetails.js.map +1 -1
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/Image/ImageRender.js.map +1 -1
- package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
- package/lib/components/ItemList/ItemListNew/ItemListNew.js.map +1 -1
- package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -1
- package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -1
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/helpers/check-if-row-has-columns.js.map +1 -1
- package/lib/components/LazyImage/LazyImage.js.map +1 -1
- package/lib/components/LazyImage/index.js.map +1 -1
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/List/components/Pagination/Classic.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib/components/List/helpers/build-az-aggregations.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/List/helpers/has-required-item-list-details.js.map +1 -1
- package/lib/components/Login/LoggedInMessage.js.map +1 -1
- package/lib/components/Login/Login.js.map +1 -1
- package/lib/components/Login/LoginForm.js.map +1 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/MenuContext.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/PasswordReset/PasswordReset.js.map +1 -1
- package/lib/components/PasswordReset/helpers/validatePassword.js.map +1 -1
- package/lib/components/PasswordResetRequest/PasswordResetRequest.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +9 -3
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js +1 -2
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +24 -6
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/calculate-min-max.js.map +1 -1
- package/lib/components/SearchFilter/helpers/check-if-range-updated.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-intersected-prop.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-range-value.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/SocialFollow/SFItem.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollow.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
- package/lib/components/SubMenu/SubMenu.js.map +1 -1
- package/lib/components/TextBlock/TextBlockRender.js.map +1 -1
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/VideoModal.js.map +1 -1
- package/lib/components/Video/VideoRender.js.map +1 -1
- package/lib/components/Video/providers/Default.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/components/Wrapper.js.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib/helpers/check-props-to-use.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js.map +1 -1
- package/lib/helpers/get-entity-data.js.map +1 -1
- package/lib/helpers/get-entity-render-props.js.map +1 -1
- package/lib/helpers/get-filter-props.js.map +1 -1
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/get-image-ids.js.map +1 -1
- package/lib/helpers/get-parsed-prop-values.js.map +1 -1
- package/lib/helpers/get-prop-values.js.map +1 -1
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-updated-filter-by.js.map +1 -1
- package/lib/helpers/inject-banner.js.map +1 -1
- package/lib/helpers/inject-banners-to-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/inject-multiple-banners.js.map +1 -1
- package/lib/helpers/is-filter-entitys-id.js.map +1 -1
- package/lib/helpers/parse-TextBlock.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/sort-response-data.js.map +1 -1
- package/lib/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/getComponent.js.map +1 -1
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/helpers/insert-banners.js.map +1 -1
- package/lib/hooks/helpers/update-targetings.js.map +1 -1
- package/lib/hooks/use-banner-insertion.js.map +1 -1
- package/lib/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib/hooks/use-get-entity-schema.js.map +1 -1
- package/lib/hooks/use-get-entity-schemas-as-obj.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-get-images.js.map +1 -1
- package/lib/hooks/use-get-single-entity-schema.js.map +1 -1
- package/lib/hooks/use-page-builder.js.map +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib/utils/get-image-data.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +7 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Range.js +1 -2
- package/lib-es/components/SearchFilter/components/Range.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +25 -6
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SearchFilter/SearchFilterContainer.js +7 -1
- package/src/components/SearchFilter/components/Range.js +10 -13
- package/src/components/SearchFilter/helpers/build-filters-query.js +7 -6
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];
|
|
2
2
|
|
|
3
|
-
const builFilterObject = (
|
|
3
|
+
const builFilterObject = ({
|
|
4
|
+
queryKey,
|
|
5
|
+
value,
|
|
6
|
+
filters,
|
|
7
|
+
isRange,
|
|
8
|
+
isInQuery
|
|
9
|
+
}) => {
|
|
4
10
|
if (isRange) {
|
|
5
11
|
// don't add to query if value matches range values
|
|
6
|
-
if (value.min !== value.minValue && value.max !== value.maxValue) {
|
|
12
|
+
if (isInQuery || value.min !== value.minValue && value.max !== value.maxValue) {
|
|
7
13
|
filters.push({
|
|
8
14
|
range: {
|
|
9
15
|
[queryKey]: {
|
|
10
|
-
gte: Number(value.
|
|
11
|
-
lte: Number(value.
|
|
16
|
+
gte: Number(value.minValue),
|
|
17
|
+
lte: Number(value.maxValue)
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
20
|
});
|
|
@@ -39,14 +45,27 @@ const builFilterObject = (queryKey, value, filters, isRange) => {
|
|
|
39
45
|
});
|
|
40
46
|
};
|
|
41
47
|
|
|
42
|
-
const buildFiltersQuery = (
|
|
48
|
+
const buildFiltersQuery = ({
|
|
49
|
+
query,
|
|
50
|
+
filterBy,
|
|
51
|
+
filterByProperty,
|
|
52
|
+
rangeValues,
|
|
53
|
+
queryKeys
|
|
54
|
+
}) => {
|
|
43
55
|
const mustFilters = [];
|
|
44
56
|
Object.keys(query).forEach(queryKey => {
|
|
45
57
|
if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;
|
|
46
58
|
if (!queryKey || !query[queryKey]) return;
|
|
47
59
|
const queryValue = query[queryKey];
|
|
48
60
|
const isRange = rangeValues.includes(queryKey);
|
|
49
|
-
|
|
61
|
+
const isInQuery = queryKeys.includes(queryKey);
|
|
62
|
+
builFilterObject({
|
|
63
|
+
queryKey,
|
|
64
|
+
value: queryValue,
|
|
65
|
+
filters: mustFilters,
|
|
66
|
+
isRange,
|
|
67
|
+
isInQuery
|
|
68
|
+
});
|
|
50
69
|
});
|
|
51
70
|
|
|
52
71
|
if (filterByProperty && filterByProperty.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-filters-query.js","names":["QUERY_KEYS_TO_IGNORE","builFilterObject","queryKey","value","filters","isRange","min","minValue","max","maxValue","push","range","gte","Number","lte","key","isArray","Array","singleFilterObj","match","forEach","filterValue","buildFiltersQuery","query","filterBy","filterByProperty","rangeValues","mustFilters","Object","keys","includes","queryValue","length","filterByPropOption","filterByPropKey","split","filterByOption","indexOf","filteryByValue","filterByKeyword"],"sources":["../../../../src/components/SearchFilter/helpers/build-filters-query.js"],"sourcesContent":["const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];\n\nconst builFilterObject = (queryKey, value, filters, isRange) => {\n if (isRange) {\n // don't add to query if value matches range values\n if (value.min !== value.minValue && value.max !== value.maxValue) {\n filters.push({\n range: {\n [queryKey]: {\n gte: Number(value.
|
|
1
|
+
{"version":3,"file":"build-filters-query.js","names":["QUERY_KEYS_TO_IGNORE","builFilterObject","queryKey","value","filters","isRange","isInQuery","min","minValue","max","maxValue","push","range","gte","Number","lte","key","isArray","Array","singleFilterObj","match","forEach","filterValue","buildFiltersQuery","query","filterBy","filterByProperty","rangeValues","queryKeys","mustFilters","Object","keys","includes","queryValue","length","filterByPropOption","filterByPropKey","split","filterByOption","indexOf","filteryByValue","filterByKeyword"],"sources":["../../../../src/components/SearchFilter/helpers/build-filters-query.js"],"sourcesContent":["const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];\n\nconst builFilterObject = ({ queryKey, value, filters, isRange, isInQuery }) => {\n if (isRange) {\n // don't add to query if value matches range values\n if (isInQuery || (value.min !== value.minValue && value.max !== value.maxValue)) {\n filters.push({\n range: {\n [queryKey]: {\n gte: Number(value.minValue),\n lte: Number(value.maxValue)\n }\n }\n });\n }\n return;\n }\n\n const key = isRange ? queryKey : `${queryKey}.keyword`;\n\n const isArray = Array.isArray(value);\n if (!isArray) {\n const singleFilterObj = { match: { [key]: value } };\n filters.push(singleFilterObj);\n return;\n }\n\n value.forEach(filterValue => {\n filters.push({ match: { [key]: filterValue } });\n });\n};\nconst buildFiltersQuery = ({ query, filterBy, filterByProperty, rangeValues, queryKeys }) => {\n const mustFilters = [];\n Object.keys(query).forEach(queryKey => {\n if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;\n if (!queryKey || !query[queryKey]) return;\n const queryValue = query[queryKey];\n\n const isRange = rangeValues.includes(queryKey);\n const isInQuery = queryKeys.includes(queryKey);\n builFilterObject({ queryKey, value: queryValue, filters: mustFilters, isRange, isInQuery });\n });\n\n if (filterByProperty && filterByProperty.length) {\n filterByProperty &&\n filterByProperty.forEach(filterByPropOption => {\n const [filterByPropKey] = filterByPropOption.split('/');\n filterBy.forEach(filterByOption => {\n if (filterByOption.indexOf(filterByPropKey) === -1) return;\n const [, filteryByValue] = filterByOption.split('/');\n const filterByKeyword = `${filterByPropKey}.keyword`;\n if (!filteryByValue) return;\n mustFilters.push({ match: { [filterByKeyword]: filteryByValue } });\n });\n });\n }\n\n return mustFilters;\n};\n\nexport default buildFiltersQuery;\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.124.1-alpha.
|
|
3
|
+
"version": "0.124.1-alpha.3",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"lib/*",
|
|
86
86
|
"lib-es/*"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "25aa010b1846146fab034b6ce1323144ec0bf23c"
|
|
89
89
|
}
|
|
@@ -86,7 +86,13 @@ const SearchFilterContainer = ({
|
|
|
86
86
|
const { docType } = getEntityData(entity);
|
|
87
87
|
|
|
88
88
|
const filtersQuery = shouldAddFilters
|
|
89
|
-
? buildFiltersQuery(
|
|
89
|
+
? buildFiltersQuery({
|
|
90
|
+
query: filterValues,
|
|
91
|
+
filterBy,
|
|
92
|
+
filterByProperty,
|
|
93
|
+
rangeValues,
|
|
94
|
+
queryKeys: Object.keys(query)
|
|
95
|
+
})
|
|
90
96
|
: [];
|
|
91
97
|
|
|
92
98
|
const rawQueryStringified = buildRawQueryStringified(
|
|
@@ -40,7 +40,6 @@ const Range = ({
|
|
|
40
40
|
const options = getSelectOptions(getEntitySchema, propsToDisplay);
|
|
41
41
|
// get range from aggregations so it updates
|
|
42
42
|
const { min, max } = calculateMinMax(dataAggregations[rangeOption], rangeInterval);
|
|
43
|
-
const shouldShowRange = rangeOption && min !== max;
|
|
44
43
|
const minValue = rangeValue.minValue < min ? min : rangeValue.minValue;
|
|
45
44
|
const maxValue = rangeValue.maxValue > max ? max : rangeValue.maxValue;
|
|
46
45
|
const valueToUse = { ...rangeValue, min, max, minValue, maxValue };
|
|
@@ -72,18 +71,16 @@ const Range = ({
|
|
|
72
71
|
/>
|
|
73
72
|
</>
|
|
74
73
|
)}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
74
|
+
<RangeFilter
|
|
75
|
+
key={`${rangeOption}-${minValue}-${maxValue}`}
|
|
76
|
+
name={rangeOption}
|
|
77
|
+
label={hasMultipleOptions ? '' : label}
|
|
78
|
+
value={valueToUse}
|
|
79
|
+
id={rangeOption}
|
|
80
|
+
onChange={({ value }) => {
|
|
81
|
+
handleChange(rangeOption, value);
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
87
84
|
</>
|
|
88
85
|
);
|
|
89
86
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];
|
|
2
2
|
|
|
3
|
-
const builFilterObject = (queryKey, value, filters, isRange) => {
|
|
3
|
+
const builFilterObject = ({ queryKey, value, filters, isRange, isInQuery }) => {
|
|
4
4
|
if (isRange) {
|
|
5
5
|
// don't add to query if value matches range values
|
|
6
|
-
if (value.min !== value.minValue && value.max !== value.maxValue) {
|
|
6
|
+
if (isInQuery || (value.min !== value.minValue && value.max !== value.maxValue)) {
|
|
7
7
|
filters.push({
|
|
8
8
|
range: {
|
|
9
9
|
[queryKey]: {
|
|
10
|
-
gte: Number(value.
|
|
11
|
-
lte: Number(value.
|
|
10
|
+
gte: Number(value.minValue),
|
|
11
|
+
lte: Number(value.maxValue)
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -29,7 +29,7 @@ const builFilterObject = (queryKey, value, filters, isRange) => {
|
|
|
29
29
|
filters.push({ match: { [key]: filterValue } });
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
const buildFiltersQuery = (query, filterBy, filterByProperty, rangeValues) => {
|
|
32
|
+
const buildFiltersQuery = ({ query, filterBy, filterByProperty, rangeValues, queryKeys }) => {
|
|
33
33
|
const mustFilters = [];
|
|
34
34
|
Object.keys(query).forEach(queryKey => {
|
|
35
35
|
if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;
|
|
@@ -37,7 +37,8 @@ const buildFiltersQuery = (query, filterBy, filterByProperty, rangeValues) => {
|
|
|
37
37
|
const queryValue = query[queryKey];
|
|
38
38
|
|
|
39
39
|
const isRange = rangeValues.includes(queryKey);
|
|
40
|
-
|
|
40
|
+
const isInQuery = queryKeys.includes(queryKey);
|
|
41
|
+
builFilterObject({ queryKey, value: queryValue, filters: mustFilters, isRange, isInQuery });
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
if (filterByProperty && filterByProperty.length) {
|