@blaze-cms/react-page-builder 0.131.0-core-styles.0 → 0.131.0
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 +2 -13
- package/lib/HOC/recreateOnNavigation.js +29 -0
- package/lib/HOC/recreateOnNavigation.js.map +1 -0
- package/lib/components/Button.js +1 -2
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/CardsRender.js +6 -13
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Card/helpers/index.js +0 -7
- package/lib/components/Card/helpers/index.js.map +1 -1
- package/lib/components/Code/Code.js +3 -7
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- 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 +2 -3
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/Layout/Layout.js +3 -2
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/LayoutFactory.js +35 -0
- package/lib/components/Layout/LayoutFactory.js.map +1 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
- package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/List/ListFactory.js +11 -16
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/helpers/index.js +0 -14
- package/lib/components/List/helpers/index.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +6 -8
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +11 -17
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +85 -63
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -3
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-new-query.js +15 -0
- package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/build-query.js +37 -0
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +43 -0
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib/components/SearchFilter/helpers/index.js +11 -18
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/SearchFilter/index.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js +11 -31
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +5 -19
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js +5 -9
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js +0 -2
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-props-query.js +2 -5
- package/lib/helpers/build-props-query.js.map +1 -1
- package/lib/helpers/build-set-filters.js +1 -5
- package/lib/helpers/build-set-filters.js.map +1 -1
- package/lib/helpers/get-query-filters.js +8 -6
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js +2 -13
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-wrapped-value-with-link.js +3 -2
- package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib/helpers/index.js +0 -14
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js +8 -13
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/utils/get-class-modifiers.js +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib-es/HOC/recreateOnNavigation.js +20 -0
- package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
- package/lib-es/components/Button.js +1 -2
- package/lib-es/components/Button.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +7 -14
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/Card/helpers/index.js +0 -1
- package/lib-es/components/Card/helpers/index.js.map +1 -1
- package/lib-es/components/Code/Code.js +4 -8
- package/lib-es/components/Code/Code.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
- package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
- package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib-es/components/Layout/Layout.js +3 -2
- package/lib-es/components/Layout/Layout.js.map +1 -1
- package/lib-es/components/Layout/LayoutFactory.js +14 -0
- package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
- package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
- package/lib-es/components/Layout/index.js +2 -2
- package/lib-es/components/Layout/index.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +12 -16
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/helpers/index.js +0 -2
- package/lib-es/components/List/helpers/index.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js +6 -8
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +11 -18
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +72 -47
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +0 -2
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js +23 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +26 -0
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/index.js +4 -5
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/index.js +2 -2
- package/lib-es/components/SearchFilter/index.js.map +1 -1
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js +10 -26
- package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +4 -21
- package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js +4 -8
- package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib-es/helpers/build-inherited-filters.js +0 -2
- package/lib-es/helpers/build-inherited-filters.js.map +1 -1
- package/lib-es/helpers/build-props-query.js +2 -4
- package/lib-es/helpers/build-props-query.js.map +1 -1
- package/lib-es/helpers/build-set-filters.js +1 -5
- package/lib-es/helpers/build-set-filters.js.map +1 -1
- package/lib-es/helpers/get-query-filters.js +8 -6
- package/lib-es/helpers/get-query-filters.js.map +1 -1
- package/lib-es/helpers/get-query-props.js +2 -10
- package/lib-es/helpers/get-query-props.js.map +1 -1
- package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
- package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib-es/helpers/index.js +0 -2
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/parse-props-to-display.js +9 -12
- package/lib-es/helpers/parse-props-to-display.js.map +1 -1
- package/lib-es/utils/get-class-modifiers.js +1 -1
- package/lib-es/utils/get-class-modifiers.js.map +1 -1
- package/package.json +10 -10
- package/src/HOC/recreateOnNavigation.js +21 -0
- package/src/components/Button.js +1 -2
- package/src/components/Card/CardsRender.js +7 -27
- package/src/components/Card/helpers/index.js +0 -1
- package/src/components/Code/Code.js +3 -7
- package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
- package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
- package/src/components/Layout/Layout.js +29 -32
- package/src/components/Layout/LayoutFactory.js +17 -0
- package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
- package/src/components/Layout/index.js +2 -2
- package/src/components/List/ListFactory.js +15 -25
- package/src/components/List/helpers/index.js +0 -2
- package/src/components/SearchContent/SearchContent.js +6 -8
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -21
- package/src/components/SearchFilter/SearchFilterContainer.js +69 -57
- package/src/components/SearchFilter/helpers/build-filters-query.js +1 -9
- package/src/components/SearchFilter/helpers/build-new-query.js +6 -0
- package/src/components/SearchFilter/helpers/build-query.js +26 -0
- package/src/components/SearchFilter/helpers/get-initial-filter-values.js +30 -0
- package/src/components/SearchFilter/helpers/index.js +7 -9
- package/src/components/SearchFilter/index.js +2 -2
- package/src/components/SearchFilterSort/SearchFilterSort.js +8 -18
- package/src/components/SearchFilterSort/helpers/handle-sort-update.js +5 -14
- package/src/components/SearchFilterSort/helpers/update-sort.js +3 -7
- package/src/helpers/build-inherited-filters.js +1 -3
- package/src/helpers/build-props-query.js +2 -4
- package/src/helpers/build-set-filters.js +1 -2
- package/src/helpers/get-query-filters.js +4 -4
- package/src/helpers/get-query-props.js +4 -12
- package/src/helpers/get-wrapped-value-with-link.js +3 -6
- package/src/helpers/index.js +0 -2
- package/src/helpers/parse-props-to-display.js +21 -25
- package/src/utils/get-class-modifiers.js +1 -1
- package/tests/helpers/mocks.js +5 -3
- package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
- package/tests/unit/src/components/Code/Code.test.js +0 -5
- package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
- package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
- package/tests/unit/src/components/Layout/Layout.test.js +1 -1
- package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
- package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
- package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
- package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +7 -24
- package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
- package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +1 -4
- package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +19 -26
- package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
- package/tests/unit/src/helpers/build-props-query.test.js +0 -25
- package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
- package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
- package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
- package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib/components/List/helpers/get-list-query.js +0 -43
- package/lib/components/List/helpers/get-list-query.js.map +0 -1
- package/lib/components/List/helpers/get-list-specific-search-filter.js +0 -21
- package/lib/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib/components/List/helpers/strip-query-key.js +0 -14
- package/lib/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-new-url.js +0 -17
- package/lib/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib/components/SearchFilter/helpers/build-url-query.js +0 -48
- package/lib/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -32
- package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib/components/SearchFilter/helpers/get-filter-values.js +0 -31
- package/lib/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib/components/SearchFilter/searchFilterReducer.js +0 -45
- package/lib/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib/helpers/build-query-key.js +0 -16
- package/lib/helpers/build-query-key.js.map +0 -1
- package/lib/helpers/process-data-summary-value.js +0 -56
- package/lib/helpers/process-data-summary-value.js.map +0 -1
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-query.js +0 -24
- package/lib-es/components/List/helpers/get-list-query.js.map +0 -1
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js +0 -12
- package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
- package/lib-es/components/List/helpers/strip-query-key.js +0 -6
- package/lib-es/components/List/helpers/strip-query-key.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/build-url-query.js +0 -30
- package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -18
- package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js +0 -19
- package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
- package/lib-es/components/SearchFilter/searchFilterReducer.js +0 -28
- package/lib-es/components/SearchFilter/searchFilterReducer.js.map +0 -1
- package/lib-es/helpers/build-query-key.js +0 -7
- package/lib-es/helpers/build-query-key.js.map +0 -1
- package/lib-es/helpers/process-data-summary-value.js +0 -36
- package/lib-es/helpers/process-data-summary-value.js.map +0 -1
- package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
- package/src/components/List/helpers/get-list-query.js +0 -28
- package/src/components/List/helpers/get-list-specific-search-filter.js +0 -10
- package/src/components/List/helpers/strip-query-key.js +0 -6
- package/src/components/SearchFilter/helpers/build-new-url.js +0 -8
- package/src/components/SearchFilter/helpers/build-url-query.js +0 -31
- package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -17
- package/src/components/SearchFilter/helpers/get-filter-values.js +0 -21
- package/src/components/SearchFilter/searchFilterReducer.js +0 -15
- package/src/helpers/build-query-key.js +0 -7
- package/src/helpers/process-data-summary-value.js +0 -22
- package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
- package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
- package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/react-page-builder",
|
|
3
|
-
"version": "0.131.0
|
|
3
|
+
"version": "0.131.0",
|
|
4
4
|
"description": "Blaze react page builder",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/core-auth-ui": "0.131.0
|
|
31
|
-
"@blaze-cms/core-errors": "^0.
|
|
32
|
-
"@blaze-cms/core-errors-ui": "0.131.0
|
|
30
|
+
"@blaze-cms/core-auth-ui": "^0.131.0",
|
|
31
|
+
"@blaze-cms/core-errors": "^0.131.0",
|
|
32
|
+
"@blaze-cms/core-errors-ui": "^0.131.0",
|
|
33
33
|
"@blaze-cms/image-cdn-react": "0.3.0-alpha.5",
|
|
34
|
-
"@blaze-cms/nextjs-components": "0.131.0
|
|
35
|
-
"@blaze-cms/plugin-search-ui": "0.131.0
|
|
36
|
-
"@blaze-cms/setup-ui": "0.131.0
|
|
37
|
-
"@blaze-cms/utils": "0.131.0
|
|
38
|
-
"@blaze-cms/utils-handlebars": "0.131.0
|
|
34
|
+
"@blaze-cms/nextjs-components": "^0.131.0",
|
|
35
|
+
"@blaze-cms/plugin-search-ui": "^0.131.0",
|
|
36
|
+
"@blaze-cms/setup-ui": "^0.131.0",
|
|
37
|
+
"@blaze-cms/utils": "^0.131.0",
|
|
38
|
+
"@blaze-cms/utils-handlebars": "^0.131.0",
|
|
39
39
|
"@blaze-react/breadcrumb": "0.8.0-alpha.60",
|
|
40
40
|
"@blaze-react/button": "0.5.19",
|
|
41
41
|
"@blaze-react/checkboxes": "0.5.31",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"lib/*",
|
|
90
90
|
"lib-es/*"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "8448393caa59dd524bd263a07d7bb263550cda13"
|
|
93
93
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
|
|
4
|
+
const recreateOnNavigation = Component => {
|
|
5
|
+
const InnerComponent = props => {
|
|
6
|
+
const { name } = props;
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const key = `${router.asPath}:${name}`;
|
|
9
|
+
return <Component {...props} key={key} />;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
InnerComponent.WrappedComponent = Component;
|
|
13
|
+
|
|
14
|
+
InnerComponent.displayName = `recreateOnNavigation(${Component.displayName ||
|
|
15
|
+
Component.name ||
|
|
16
|
+
'Component'})`;
|
|
17
|
+
|
|
18
|
+
return InnerComponent;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default recreateOnNavigation;
|
package/src/components/Button.js
CHANGED
|
@@ -59,8 +59,7 @@ const Button = props => {
|
|
|
59
59
|
|
|
60
60
|
const logout = () => {
|
|
61
61
|
handleLogout(client);
|
|
62
|
-
|
|
63
|
-
return url ? router.reload(urlToUse) : router.reload();
|
|
62
|
+
url ? router.reload(urlToUse) : router.reload();
|
|
64
63
|
};
|
|
65
64
|
|
|
66
65
|
const handleClick = () => {
|
|
@@ -22,8 +22,7 @@ import {
|
|
|
22
22
|
filterQuerySetup,
|
|
23
23
|
shouldSkipSingleQuery,
|
|
24
24
|
shouldReturn,
|
|
25
|
-
getUpdatedSortProperties
|
|
26
|
-
getUpdatedItemsToDisplay
|
|
25
|
+
getUpdatedSortProperties
|
|
27
26
|
} from './helpers';
|
|
28
27
|
|
|
29
28
|
const CardsContainer = dynamic(() => import('./CardsContainer'));
|
|
@@ -96,7 +95,6 @@ const CardsRender = ({
|
|
|
96
95
|
isPreview,
|
|
97
96
|
itemEntityUpdated: unpublishedParentEntityName
|
|
98
97
|
});
|
|
99
|
-
|
|
100
98
|
const {
|
|
101
99
|
data: { entityData: parentEntityData = {} } = {},
|
|
102
100
|
error: _err,
|
|
@@ -124,13 +122,6 @@ const CardsRender = ({
|
|
|
124
122
|
variableProps
|
|
125
123
|
);
|
|
126
124
|
|
|
127
|
-
const updatedItemsToDisplay = getUpdatedItemsToDisplay({
|
|
128
|
-
itemsToDisplay,
|
|
129
|
-
inheritedFilters,
|
|
130
|
-
parentSchema,
|
|
131
|
-
parentEntityData
|
|
132
|
-
});
|
|
133
|
-
|
|
134
125
|
const { limit, variables } = filterQuerySetup({
|
|
135
126
|
getEntitySchemas: Object.values(requiredSchema),
|
|
136
127
|
entity: primaryEntityToUse,
|
|
@@ -139,33 +130,22 @@ const CardsRender = ({
|
|
|
139
130
|
docType: docTypes,
|
|
140
131
|
filterOperator,
|
|
141
132
|
filterEntityRelations,
|
|
142
|
-
itemsToDisplay
|
|
133
|
+
itemsToDisplay,
|
|
143
134
|
entitySameAsCurrentItemEntity,
|
|
144
135
|
useRandomSort
|
|
145
136
|
});
|
|
146
|
-
|
|
147
|
-
const hasNoFiltersOrItemsToDisplay = !updatedItemsToDisplay.length && !updatedFilterBy;
|
|
148
|
-
|
|
149
137
|
const { data: cardData, error: cardsError, loading: cardsLoading } = useQuery(action, {
|
|
150
138
|
variables,
|
|
151
139
|
fetchPolicy: useRandomSort ? 'cache-and-network' : 'cache-first',
|
|
152
|
-
skip: shouldReturn(
|
|
153
|
-
hasNoFiltersOrItemsToDisplay,
|
|
154
|
-
_loading,
|
|
155
|
-
_load,
|
|
156
|
-
schemaLoading,
|
|
157
|
-
_error,
|
|
158
|
-
_err,
|
|
159
|
-
schemaError
|
|
160
|
-
)
|
|
140
|
+
skip: shouldReturn(!updatedFilterBy, _loading, _load, schemaLoading, _error, _err, schemaError)
|
|
161
141
|
});
|
|
162
142
|
|
|
163
|
-
const imageIds =
|
|
143
|
+
const imageIds = itemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);
|
|
164
144
|
const { data: imagesData, loading: imagesLoading } = useGetImages(imageIds, true);
|
|
165
145
|
const isLoading = shouldReturn(_loading, _load, schemaLoading, cardsLoading, imagesLoading);
|
|
166
146
|
const hasError = shouldReturn(_error, _err, schemaError);
|
|
167
147
|
|
|
168
|
-
if (
|
|
148
|
+
if (!updatedFilterBy) return null;
|
|
169
149
|
if (isLoading) return null;
|
|
170
150
|
if (hasError) return null;
|
|
171
151
|
if (cardsError) return cardsError.message;
|
|
@@ -180,7 +160,7 @@ const CardsRender = ({
|
|
|
180
160
|
|
|
181
161
|
const orderedData = useRandomSort
|
|
182
162
|
? cardDataResults
|
|
183
|
-
: sortResponseData(cardDataResults,
|
|
163
|
+
: sortResponseData(cardDataResults, itemsToDisplay);
|
|
184
164
|
const { regularChildren, gtmChildren } = splitChildren(
|
|
185
165
|
children,
|
|
186
166
|
cardDataResults,
|
|
@@ -189,7 +169,7 @@ const CardsRender = ({
|
|
|
189
169
|
name: variableProps.name
|
|
190
170
|
}
|
|
191
171
|
);
|
|
192
|
-
const updatedCards = appendImages(imagesData, orderedData,
|
|
172
|
+
const updatedCards = appendImages(imagesData, orderedData, itemsToDisplay);
|
|
193
173
|
|
|
194
174
|
return (
|
|
195
175
|
<>
|
|
@@ -6,4 +6,3 @@ export { default as filterQuerySetup } from './filter-query-setup';
|
|
|
6
6
|
export { default as shouldReturn } from './should-return';
|
|
7
7
|
export { default as shouldSkipSingleQuery } from './should-skip-single-query';
|
|
8
8
|
export { default as getUpdatedSortProperties } from './get-updated-sort-properties';
|
|
9
|
-
export { default as getUpdatedItemsToDisplay } from './get-updated-items-to-display';
|
|
@@ -7,30 +7,26 @@ import { getClassModifiers } from '../../utils';
|
|
|
7
7
|
import { CODE } from '../../constants';
|
|
8
8
|
import { wrapScriptTags } from './helpers';
|
|
9
9
|
|
|
10
|
-
const Code = memo(({ code: embedCode, parserOptions,
|
|
10
|
+
const Code = memo(({ code: embedCode, parserOptions, ...otherProps }) => {
|
|
11
11
|
if (!embedCode) return null;
|
|
12
12
|
|
|
13
13
|
const parsedCode = parseHTML(embedCode, parserOptions);
|
|
14
14
|
const wrappedCode = wrapScriptTags(parsedCode);
|
|
15
15
|
const modifiers = getClassModifiers(CODE, { ...otherProps });
|
|
16
16
|
|
|
17
|
-
if (disableWrapper) return wrappedCode;
|
|
18
|
-
|
|
19
17
|
return <Wrapper modifiers={modifiers}>{wrappedCode}</Wrapper>;
|
|
20
18
|
});
|
|
21
19
|
|
|
22
20
|
Code.propTypes = {
|
|
23
21
|
code: PropTypes.string,
|
|
24
22
|
modifier: PropTypes.string,
|
|
25
|
-
parserOptions: PropTypes.object
|
|
26
|
-
disableWrapper: PropTypes.bool
|
|
23
|
+
parserOptions: PropTypes.object
|
|
27
24
|
};
|
|
28
25
|
|
|
29
26
|
Code.defaultProps = {
|
|
30
27
|
code: '',
|
|
31
28
|
modifier: '',
|
|
32
|
-
parserOptions: {}
|
|
33
|
-
disableWrapper: false
|
|
29
|
+
parserOptions: {}
|
|
34
30
|
};
|
|
35
31
|
|
|
36
32
|
export default withTitle(Code);
|
|
@@ -3,7 +3,6 @@ import flatten from 'lodash.flatten';
|
|
|
3
3
|
import getLinkToPublishedContent from './get-link-to-published-content';
|
|
4
4
|
import getLoopPropsLimit from './get-loop-props-limit';
|
|
5
5
|
import getPropValue from './get-prop-value';
|
|
6
|
-
import { processDataSummaryValue } from '../../../helpers';
|
|
7
6
|
|
|
8
7
|
const getLoopValue = value => {
|
|
9
8
|
const { keyField } = value;
|
|
@@ -47,10 +46,8 @@ const buildLoopPropsContent = (loopProps = [], propsToDisplay = [], limit = 0, d
|
|
|
47
46
|
const loopValue = loopValues[key];
|
|
48
47
|
const propValue = loopValue ? getLoopValue(loopValue[i]) : regularValues[key];
|
|
49
48
|
if (!propValue) return null;
|
|
50
|
-
|
|
51
|
-
const processedValue = processDataSummaryValue(propValue, options);
|
|
52
49
|
const linkToPublishedContent = getLinkToPublishedContent(key, data);
|
|
53
|
-
return [upperFirst(label),
|
|
50
|
+
return [upperFirst(label), propValue, linkToPublishedContent, modifier];
|
|
54
51
|
});
|
|
55
52
|
})
|
|
56
53
|
).filter(Boolean);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import upperFirst from 'lodash.upperfirst';
|
|
2
2
|
import flatten from 'lodash.flatten';
|
|
3
|
-
import { isObject
|
|
3
|
+
import { isObject } from '../../../helpers';
|
|
4
4
|
import getLinkToPublishedContent from './get-link-to-published-content';
|
|
5
5
|
import getPropValue from './get-prop-value';
|
|
6
6
|
import getLinkBasedOnValue from './get-link-based-on-value';
|
|
@@ -27,18 +27,15 @@ const buildPropsToDisplayWithContent = (props, propsToDisplay = []) => {
|
|
|
27
27
|
const objPropValue = getPropValue(key, props, options);
|
|
28
28
|
if (!objPropValue) return null;
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const link = getLink(enableLink, key, props, objPropValue);
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return [upperFirst(label), processedValue, link, modifier];
|
|
32
|
+
return [upperFirst(label), objPropValue, link, modifier];
|
|
35
33
|
});
|
|
36
34
|
})
|
|
37
35
|
).filter(Boolean);
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
export default buildPropsToDisplayWithContent;
|
|
41
|
-
|
|
42
39
|
function getLink(enableLink, key, props, objPropValue) {
|
|
43
40
|
let link = '';
|
|
44
41
|
if (enableLink) {
|
|
@@ -7,43 +7,40 @@ import { getStylesToUpdate, checkIfRowHasColumns } from './helpers';
|
|
|
7
7
|
import { renderChildren, hasChildren } from '../../helpers';
|
|
8
8
|
import { COLUMN } from '../../constants';
|
|
9
9
|
|
|
10
|
-
const Layout = (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
...otherProps
|
|
19
|
-
}) => {
|
|
20
|
-
const {
|
|
21
|
-
data: { getFile: { url = null } = {} }
|
|
22
|
-
} = useGetImages(backgroundImage);
|
|
10
|
+
const Layout = React.forwardRef(
|
|
11
|
+
(
|
|
12
|
+
{ type, children, settings, modifier, backgroundImage, tagType, dataNoSnippet, ...otherProps },
|
|
13
|
+
ref
|
|
14
|
+
) => {
|
|
15
|
+
const {
|
|
16
|
+
data: { getFile: { url = null } = {} }
|
|
17
|
+
} = useGetImages(backgroundImage);
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const style = getStylesToUpdate({ backgroundImage: url });
|
|
20
|
+
const { title } = settings;
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const classModifiers = getClassModifiers(type, { modifier, ...otherProps });
|
|
23
|
+
const additionalRowModifier = checkIfRowHasColumns(type, children) ? ' display-row' : '';
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
if (type === COLUMN && !hasChildren(children)) return null;
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
const otherWrapperProps = {};
|
|
28
|
+
if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
return (
|
|
31
|
+
<Wrapper
|
|
32
|
+
ref={ref}
|
|
33
|
+
tagType={tagType}
|
|
34
|
+
className={type}
|
|
35
|
+
modifiers={`${classModifiers}${additionalRowModifier}`}
|
|
36
|
+
style={style}
|
|
37
|
+
{...otherWrapperProps}>
|
|
38
|
+
{title && <h2 className="heading heading--section">{title}</h2>}
|
|
39
|
+
{renderChildren(children, otherProps)}
|
|
40
|
+
</Wrapper>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
47
44
|
|
|
48
45
|
Layout.propTypes = {
|
|
49
46
|
type: PropTypes.string.isRequired,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import dynamic from 'next/dynamic';
|
|
3
|
+
import Layout from './Layout';
|
|
4
|
+
|
|
5
|
+
const LayoutWithStickyTimer = dynamic(() =>
|
|
6
|
+
import(/* webpackChunkName: "blazePbLayoutWithStickyTimer" */ './LayoutWithStickyTimer')
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
const LayoutFactory = props => {
|
|
10
|
+
const { sticky, stickyTimer } = props;
|
|
11
|
+
|
|
12
|
+
if (sticky && stickyTimer) return <LayoutWithStickyTimer {...props} />;
|
|
13
|
+
|
|
14
|
+
return <Layout {...props} />;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default LayoutFactory;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useInView } from '@blaze-react/utils/lib/customHooks';
|
|
4
|
+
import recreateOnNavigation from '../../HOC/recreateOnNavigation';
|
|
5
|
+
import Layout from './Layout';
|
|
6
|
+
|
|
7
|
+
const LayoutWithStickyTimer = ({ sticky, stickyTimer, ...otherProps }) => {
|
|
8
|
+
const [isIntersecting, outerRef] = useInView({});
|
|
9
|
+
const [isSticky, setIsSticky] = useState(sticky);
|
|
10
|
+
|
|
11
|
+
useEffect(
|
|
12
|
+
() => {
|
|
13
|
+
if (isIntersecting && sticky && !!stickyTimer) {
|
|
14
|
+
setIsSticky(true);
|
|
15
|
+
const timer = setTimeout(() => {
|
|
16
|
+
setIsSticky(false);
|
|
17
|
+
}, stickyTimer);
|
|
18
|
+
|
|
19
|
+
return () => {
|
|
20
|
+
clearTimeout(timer);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
[isIntersecting, stickyTimer, sticky]
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return <Layout {...otherProps} sticky={isSticky} ref={sticky ? outerRef : null} />;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
LayoutWithStickyTimer.propTypes = {
|
|
31
|
+
sticky: PropTypes.bool,
|
|
32
|
+
stickyTimer: PropTypes.number
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
LayoutWithStickyTimer.defaultProps = {
|
|
36
|
+
sticky: false,
|
|
37
|
+
stickyTimer: 0
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default recreateOnNavigation(LayoutWithStickyTimer);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import LayoutFactory from './LayoutFactory';
|
|
2
2
|
|
|
3
|
-
export default
|
|
3
|
+
export default LayoutFactory;
|
|
@@ -7,13 +7,7 @@ import { MainContext } from '@blaze-cms/nextjs-components';
|
|
|
7
7
|
import { generateSingleItemQuery, getItemList } from '../../application/query';
|
|
8
8
|
import ListBuilder from './ListBuilder';
|
|
9
9
|
import { AZ_LIST_TYPE } from './constants';
|
|
10
|
-
import {
|
|
11
|
-
getAzQueryFilter,
|
|
12
|
-
getSortProps,
|
|
13
|
-
hasRequiredItemListDetails,
|
|
14
|
-
getListSpecificSearchFilter,
|
|
15
|
-
getListQuery
|
|
16
|
-
} from './helpers';
|
|
10
|
+
import { getAzQueryFilter, getSortProps, hasRequiredItemListDetails } from './helpers';
|
|
17
11
|
import {
|
|
18
12
|
getGenericProps,
|
|
19
13
|
getRequiredSchemas,
|
|
@@ -43,7 +37,7 @@ const ListFactory = props => {
|
|
|
43
37
|
type,
|
|
44
38
|
sortby: defaultSortBy,
|
|
45
39
|
sort: defaultSort,
|
|
46
|
-
|
|
40
|
+
searchFilter,
|
|
47
41
|
operator: filterOperator,
|
|
48
42
|
sortProperties,
|
|
49
43
|
itemListName
|
|
@@ -52,13 +46,11 @@ const ListFactory = props => {
|
|
|
52
46
|
const router = useRouter();
|
|
53
47
|
const { asPath } = router;
|
|
54
48
|
const parsedQuery = asPath.replace(/%5D/g, ']').replace(/%5B/g, '[');
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const updatedQuery = getListQuery(query, hasListSpecificFilters, name);
|
|
61
|
-
const { sort: querySort, sortby: querySortBy } = updatedQuery;
|
|
49
|
+
const {
|
|
50
|
+
query,
|
|
51
|
+
url,
|
|
52
|
+
query: { sort: querySort, sortby: querySortBy, itemListId: queryItemListId } = {}
|
|
53
|
+
} = parseUrl(parsedQuery);
|
|
62
54
|
const { sortbyFilters, updatedSortProperties } = getSortProps({
|
|
63
55
|
querySort,
|
|
64
56
|
sortProperties,
|
|
@@ -70,8 +62,8 @@ const ListFactory = props => {
|
|
|
70
62
|
const itemListId = getItemListId(itemListName, queryItemListId);
|
|
71
63
|
const { itemEntity: parentEntity, itemId: parentId } = parent;
|
|
72
64
|
const updatedParentEntity = getUnpublishedEntityName(parentEntity);
|
|
73
|
-
const paginationIndex = getPaginationIndex(
|
|
74
|
-
const azFilter = getAzQueryFilter(
|
|
65
|
+
const paginationIndex = getPaginationIndex(query, name);
|
|
66
|
+
const azFilter = getAzQueryFilter(query, name);
|
|
75
67
|
|
|
76
68
|
const entitiesToUse = entities && entities.length ? entities : [legacyEntity];
|
|
77
69
|
const [filterEntity] = entitiesToUse;
|
|
@@ -131,12 +123,10 @@ const ListFactory = props => {
|
|
|
131
123
|
const [textFilter] = getSearchFilterType(searchFilter, TEXT_SEARCH);
|
|
132
124
|
const shouldApplyTextFilter = textFilter && textFilter.propsToDisplay.length;
|
|
133
125
|
const operator = shouldApplyTextFilter ? getElasticsearchOperator(textFilter) : AND_OPERATOR;
|
|
134
|
-
const valuesText = shouldApplyTextFilter
|
|
135
|
-
|
|
136
|
-
: [];
|
|
137
|
-
const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, updatedQuery, name);
|
|
126
|
+
const valuesText = shouldApplyTextFilter ? buildSearchValuesText(textFilter, query) : [];
|
|
127
|
+
const { valuesAnd, valuesOr } = getQueryFilters(searchFilter, query);
|
|
138
128
|
const isTextSearchFilterApplied = !!(
|
|
139
|
-
|
|
129
|
+
query.search_term &&
|
|
140
130
|
searchFilter &&
|
|
141
131
|
getSearchFilterType(searchFilter, TEXT_SEARCH).length
|
|
142
132
|
);
|
|
@@ -149,7 +139,7 @@ const ListFactory = props => {
|
|
|
149
139
|
const listProps = {
|
|
150
140
|
...props,
|
|
151
141
|
...genericProps,
|
|
152
|
-
query
|
|
142
|
+
query,
|
|
153
143
|
url,
|
|
154
144
|
isCard,
|
|
155
145
|
isAZ,
|
|
@@ -189,7 +179,7 @@ ListFactory.propTypes = {
|
|
|
189
179
|
name: PropTypes.string,
|
|
190
180
|
sortby: PropTypes.array,
|
|
191
181
|
sort: PropTypes.string,
|
|
192
|
-
|
|
182
|
+
searchFilter: PropTypes.object,
|
|
193
183
|
sortProperties: PropTypes.array,
|
|
194
184
|
itemListName: PropTypes.string
|
|
195
185
|
};
|
|
@@ -205,7 +195,7 @@ ListFactory.defaultProps = {
|
|
|
205
195
|
sortProperties: [],
|
|
206
196
|
sort: '',
|
|
207
197
|
operator: AND,
|
|
208
|
-
|
|
198
|
+
searchFilter: {},
|
|
209
199
|
itemListName: ''
|
|
210
200
|
};
|
|
211
201
|
|
|
@@ -7,5 +7,3 @@ export { default as getItemsPerPageToUse } from './get-items-per-page-to-use';
|
|
|
7
7
|
export { default as getSortProps } from './get-sort-props';
|
|
8
8
|
export { default as hasRequiredItemListDetails } from './has-required-item-list-details';
|
|
9
9
|
export { default as getListComponent } from './get-list-component';
|
|
10
|
-
export { default as getListQuery } from './get-list-query';
|
|
11
|
-
export { default as getListSpecificSearchFilter } from './get-list-specific-search-filter';
|
|
@@ -10,12 +10,12 @@ const SearchContent = ({
|
|
|
10
10
|
searchInputAlignment,
|
|
11
11
|
searchInputWrapperMobile,
|
|
12
12
|
searchInputWrapperDesktop,
|
|
13
|
+
collapsible,
|
|
13
14
|
isMobile,
|
|
14
15
|
placeholder,
|
|
15
|
-
modifier
|
|
16
|
-
collapsedSearch
|
|
16
|
+
modifier
|
|
17
17
|
}) => {
|
|
18
|
-
const [collapsed, setCollapsed] = useState(
|
|
18
|
+
const [collapsed, setCollapsed] = useState(collapsible);
|
|
19
19
|
const router = useRouter();
|
|
20
20
|
|
|
21
21
|
const { results, searchTerm, setSearchTerm, debouncedSearchTerm } = useDebounceSearch({
|
|
@@ -50,7 +50,7 @@ const SearchContent = ({
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const handleOnBlur = () => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!collapsible) return;
|
|
54
54
|
if (!debouncedSearchTerm || debouncedSearchTerm === '') setCollapsed(true);
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -120,8 +120,7 @@ SearchContent.propTypes = {
|
|
|
120
120
|
isMobile: PropTypes.bool,
|
|
121
121
|
collapsible: PropTypes.bool,
|
|
122
122
|
entities: PropTypes.array.isRequired,
|
|
123
|
-
modifier: PropTypes.string
|
|
124
|
-
collapsedSearch: PropTypes.bool
|
|
123
|
+
modifier: PropTypes.string
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
SearchContent.defaultProps = {
|
|
@@ -131,8 +130,7 @@ SearchContent.defaultProps = {
|
|
|
131
130
|
placeholder: '',
|
|
132
131
|
isMobile: false,
|
|
133
132
|
collapsible: false,
|
|
134
|
-
modifier: ''
|
|
135
|
-
collapsedSearch: false
|
|
133
|
+
modifier: ''
|
|
136
134
|
};
|
|
137
135
|
|
|
138
136
|
export default SearchContent;
|
|
@@ -5,8 +5,8 @@ import debounce from 'lodash.debounce';
|
|
|
5
5
|
import FiltersList from './FiltersList';
|
|
6
6
|
import {
|
|
7
7
|
isDeviceDesktop,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
buildQuery,
|
|
9
|
+
getInitialFilterValues,
|
|
10
10
|
getResponsiveFilterClassnames
|
|
11
11
|
} from '../helpers';
|
|
12
12
|
import CloseMobileForm from './CloseMobileForm';
|
|
@@ -16,7 +16,6 @@ import { SEARCH, REFINE, MORE_FILTERS_CLASSES } from '../constants';
|
|
|
16
16
|
|
|
17
17
|
const SearchFilter = ({
|
|
18
18
|
searchFilterRef,
|
|
19
|
-
listComponentName,
|
|
20
19
|
data,
|
|
21
20
|
filters,
|
|
22
21
|
hasUrl,
|
|
@@ -29,14 +28,13 @@ const SearchFilter = ({
|
|
|
29
28
|
groupAfterDesktop,
|
|
30
29
|
groupAfterMobile,
|
|
31
30
|
filterValues,
|
|
32
|
-
setAppliedFilters
|
|
33
|
-
query
|
|
31
|
+
setAppliedFilters
|
|
34
32
|
}) => {
|
|
35
33
|
const [moreFiltersMobileCollapsed, setMoreFiltersMobileCollapsed] = useState(true);
|
|
36
34
|
const [moreFiltersDesktopCollapsed, setMoreFiltersDesktopCollapsed] = useState(true);
|
|
37
35
|
|
|
38
|
-
const doSubmit = newValues => {
|
|
39
|
-
const newQuery =
|
|
36
|
+
const doSubmit = (newValues = filterValues) => {
|
|
37
|
+
const newQuery = buildQuery(newValues, filters);
|
|
40
38
|
handleSearch(newQuery);
|
|
41
39
|
setMoreFiltersDesktopCollapsed(true);
|
|
42
40
|
setMoreFiltersMobileCollapsed(true);
|
|
@@ -71,7 +69,7 @@ const SearchFilter = ({
|
|
|
71
69
|
const formId = `filter-${name}-form`;
|
|
72
70
|
|
|
73
71
|
const handleReset = () => {
|
|
74
|
-
const newValues =
|
|
72
|
+
const newValues = getInitialFilterValues(null, filters, {});
|
|
75
73
|
setAppliedFilters({ newValues, type: 'reset' });
|
|
76
74
|
doSubmit(newValues);
|
|
77
75
|
};
|
|
@@ -81,7 +79,7 @@ const SearchFilter = ({
|
|
|
81
79
|
};
|
|
82
80
|
|
|
83
81
|
const shouldGroup = !!(groupAfterDesktop || groupAfterMobile);
|
|
84
|
-
|
|
82
|
+
const shouldSearch = !hasUrl;
|
|
85
83
|
return (
|
|
86
84
|
<>
|
|
87
85
|
<form
|
|
@@ -91,7 +89,7 @@ const SearchFilter = ({
|
|
|
91
89
|
id={formId}
|
|
92
90
|
onSubmit={e => {
|
|
93
91
|
e.preventDefault();
|
|
94
|
-
doSubmit(
|
|
92
|
+
doSubmit();
|
|
95
93
|
}}>
|
|
96
94
|
{displaySearchFilter && (
|
|
97
95
|
<CloseMobileForm handleClose={() => setDisplaySearchFilter(false)} />
|
|
@@ -103,7 +101,7 @@ const SearchFilter = ({
|
|
|
103
101
|
<div className="filter__wrapper filter__wrapper--search-refine">
|
|
104
102
|
{!shouldGroup && (
|
|
105
103
|
<FiltersList
|
|
106
|
-
shouldSearch={
|
|
104
|
+
shouldSearch={shouldSearch}
|
|
107
105
|
data={data}
|
|
108
106
|
filters={filters}
|
|
109
107
|
hasUrl={hasUrl}
|
|
@@ -116,7 +114,7 @@ const SearchFilter = ({
|
|
|
116
114
|
{shouldGroup && (
|
|
117
115
|
<>
|
|
118
116
|
<FiltersList
|
|
119
|
-
shouldSearch={
|
|
117
|
+
shouldSearch={shouldSearch}
|
|
120
118
|
data={data}
|
|
121
119
|
filters={filters.slice(0, groupAfterMobile)}
|
|
122
120
|
hasUrl={hasUrl}
|
|
@@ -138,7 +136,7 @@ const SearchFilter = ({
|
|
|
138
136
|
<div className={moreFiltersMobileWrapperClass}>
|
|
139
137
|
<div className={MORE_FILTERS_CLASSES.MOBILE_CONTENT}>
|
|
140
138
|
<FiltersList
|
|
141
|
-
shouldSearch={
|
|
139
|
+
shouldSearch={shouldSearch && isDeviceDesktop()}
|
|
142
140
|
data={data}
|
|
143
141
|
filters={filters.slice(
|
|
144
142
|
groupAfterMobile,
|
|
@@ -235,14 +233,7 @@ SearchFilter.propTypes = {
|
|
|
235
233
|
groupAfterDesktop: PropTypes.number.isRequired,
|
|
236
234
|
groupAfterMobile: PropTypes.number.isRequired,
|
|
237
235
|
filterValues: PropTypes.object.isRequired,
|
|
238
|
-
setAppliedFilters: PropTypes.func.isRequired
|
|
239
|
-
listComponentName: PropTypes.string,
|
|
240
|
-
query: PropTypes.object
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
SearchFilter.defaultProps = {
|
|
244
|
-
listComponentName: '',
|
|
245
|
-
query: {}
|
|
236
|
+
setAppliedFilters: PropTypes.func.isRequired
|
|
246
237
|
};
|
|
247
238
|
|
|
248
239
|
export default SearchFilter;
|