@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.
Files changed (246) hide show
  1. package/CHANGELOG.md +2 -13
  2. package/lib/HOC/recreateOnNavigation.js +29 -0
  3. package/lib/HOC/recreateOnNavigation.js.map +1 -0
  4. package/lib/components/Button.js +1 -2
  5. package/lib/components/Button.js.map +1 -1
  6. package/lib/components/Card/CardsRender.js +6 -13
  7. package/lib/components/Card/CardsRender.js.map +1 -1
  8. package/lib/components/Card/helpers/index.js +0 -7
  9. package/lib/components/Card/helpers/index.js.map +1 -1
  10. package/lib/components/Code/Code.js +3 -7
  11. package/lib/components/Code/Code.js.map +1 -1
  12. package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  13. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  14. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +2 -3
  15. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  16. package/lib/components/Layout/Layout.js +3 -2
  17. package/lib/components/Layout/Layout.js.map +1 -1
  18. package/lib/components/Layout/LayoutFactory.js +35 -0
  19. package/lib/components/Layout/LayoutFactory.js.map +1 -0
  20. package/lib/components/Layout/LayoutWithStickyTimer.js +66 -0
  21. package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  22. package/lib/components/Layout/index.js +2 -2
  23. package/lib/components/Layout/index.js.map +1 -1
  24. package/lib/components/List/ListFactory.js +11 -16
  25. package/lib/components/List/ListFactory.js.map +1 -1
  26. package/lib/components/List/helpers/index.js +0 -14
  27. package/lib/components/List/helpers/index.js.map +1 -1
  28. package/lib/components/SearchContent/SearchContent.js +6 -8
  29. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  30. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +11 -17
  31. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  32. package/lib/components/SearchFilter/SearchFilterContainer.js +85 -63
  33. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  34. package/lib/components/SearchFilter/helpers/build-filters-query.js +1 -3
  35. package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  36. package/lib/components/SearchFilter/helpers/build-new-query.js +15 -0
  37. package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -0
  38. package/lib/components/SearchFilter/helpers/build-query.js +37 -0
  39. package/lib/components/SearchFilter/helpers/build-query.js.map +1 -0
  40. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +43 -0
  41. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
  42. package/lib/components/SearchFilter/helpers/index.js +11 -18
  43. package/lib/components/SearchFilter/helpers/index.js.map +1 -1
  44. package/lib/components/SearchFilter/index.js.map +1 -1
  45. package/lib/components/SearchFilterSort/SearchFilterSort.js +11 -31
  46. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  47. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +5 -19
  48. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  49. package/lib/components/SearchFilterSort/helpers/update-sort.js +5 -9
  50. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  51. package/lib/helpers/build-inherited-filters.js +0 -2
  52. package/lib/helpers/build-inherited-filters.js.map +1 -1
  53. package/lib/helpers/build-props-query.js +2 -5
  54. package/lib/helpers/build-props-query.js.map +1 -1
  55. package/lib/helpers/build-set-filters.js +1 -5
  56. package/lib/helpers/build-set-filters.js.map +1 -1
  57. package/lib/helpers/get-query-filters.js +8 -6
  58. package/lib/helpers/get-query-filters.js.map +1 -1
  59. package/lib/helpers/get-query-props.js +2 -13
  60. package/lib/helpers/get-query-props.js.map +1 -1
  61. package/lib/helpers/get-wrapped-value-with-link.js +3 -2
  62. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  63. package/lib/helpers/index.js +0 -14
  64. package/lib/helpers/index.js.map +1 -1
  65. package/lib/helpers/parse-props-to-display.js +8 -13
  66. package/lib/helpers/parse-props-to-display.js.map +1 -1
  67. package/lib/utils/get-class-modifiers.js +1 -1
  68. package/lib/utils/get-class-modifiers.js.map +1 -1
  69. package/lib-es/HOC/recreateOnNavigation.js +20 -0
  70. package/lib-es/HOC/recreateOnNavigation.js.map +1 -0
  71. package/lib-es/components/Button.js +1 -2
  72. package/lib-es/components/Button.js.map +1 -1
  73. package/lib-es/components/Card/CardsRender.js +7 -14
  74. package/lib-es/components/Card/CardsRender.js.map +1 -1
  75. package/lib-es/components/Card/helpers/index.js +0 -1
  76. package/lib-es/components/Card/helpers/index.js.map +1 -1
  77. package/lib-es/components/Code/Code.js +4 -8
  78. package/lib-es/components/Code/Code.js.map +1 -1
  79. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  80. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  81. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
  82. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  83. package/lib-es/components/Layout/Layout.js +3 -2
  84. package/lib-es/components/Layout/Layout.js.map +1 -1
  85. package/lib-es/components/Layout/LayoutFactory.js +14 -0
  86. package/lib-es/components/Layout/LayoutFactory.js.map +1 -0
  87. package/lib-es/components/Layout/LayoutWithStickyTimer.js +42 -0
  88. package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -0
  89. package/lib-es/components/Layout/index.js +2 -2
  90. package/lib-es/components/Layout/index.js.map +1 -1
  91. package/lib-es/components/List/ListFactory.js +12 -16
  92. package/lib-es/components/List/ListFactory.js.map +1 -1
  93. package/lib-es/components/List/helpers/index.js +0 -2
  94. package/lib-es/components/List/helpers/index.js.map +1 -1
  95. package/lib-es/components/SearchContent/SearchContent.js +6 -8
  96. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  97. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +11 -18
  98. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  99. package/lib-es/components/SearchFilter/SearchFilterContainer.js +72 -47
  100. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  101. package/lib-es/components/SearchFilter/helpers/build-filters-query.js +0 -2
  102. package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -1
  103. package/lib-es/components/SearchFilter/helpers/build-new-query.js +6 -0
  104. package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -0
  105. package/lib-es/components/SearchFilter/helpers/build-query.js +23 -0
  106. package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -0
  107. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +26 -0
  108. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -0
  109. package/lib-es/components/SearchFilter/helpers/index.js +4 -5
  110. package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
  111. package/lib-es/components/SearchFilter/index.js +2 -2
  112. package/lib-es/components/SearchFilter/index.js.map +1 -1
  113. package/lib-es/components/SearchFilterSort/SearchFilterSort.js +10 -26
  114. package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  115. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +4 -21
  116. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  117. package/lib-es/components/SearchFilterSort/helpers/update-sort.js +4 -8
  118. package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  119. package/lib-es/helpers/build-inherited-filters.js +0 -2
  120. package/lib-es/helpers/build-inherited-filters.js.map +1 -1
  121. package/lib-es/helpers/build-props-query.js +2 -4
  122. package/lib-es/helpers/build-props-query.js.map +1 -1
  123. package/lib-es/helpers/build-set-filters.js +1 -5
  124. package/lib-es/helpers/build-set-filters.js.map +1 -1
  125. package/lib-es/helpers/get-query-filters.js +8 -6
  126. package/lib-es/helpers/get-query-filters.js.map +1 -1
  127. package/lib-es/helpers/get-query-props.js +2 -10
  128. package/lib-es/helpers/get-query-props.js.map +1 -1
  129. package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
  130. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  131. package/lib-es/helpers/index.js +0 -2
  132. package/lib-es/helpers/index.js.map +1 -1
  133. package/lib-es/helpers/parse-props-to-display.js +9 -12
  134. package/lib-es/helpers/parse-props-to-display.js.map +1 -1
  135. package/lib-es/utils/get-class-modifiers.js +1 -1
  136. package/lib-es/utils/get-class-modifiers.js.map +1 -1
  137. package/package.json +10 -10
  138. package/src/HOC/recreateOnNavigation.js +21 -0
  139. package/src/components/Button.js +1 -2
  140. package/src/components/Card/CardsRender.js +7 -27
  141. package/src/components/Card/helpers/index.js +0 -1
  142. package/src/components/Code/Code.js +3 -7
  143. package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
  144. package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
  145. package/src/components/Layout/Layout.js +29 -32
  146. package/src/components/Layout/LayoutFactory.js +17 -0
  147. package/src/components/Layout/LayoutWithStickyTimer.js +40 -0
  148. package/src/components/Layout/index.js +2 -2
  149. package/src/components/List/ListFactory.js +15 -25
  150. package/src/components/List/helpers/index.js +0 -2
  151. package/src/components/SearchContent/SearchContent.js +6 -8
  152. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -21
  153. package/src/components/SearchFilter/SearchFilterContainer.js +69 -57
  154. package/src/components/SearchFilter/helpers/build-filters-query.js +1 -9
  155. package/src/components/SearchFilter/helpers/build-new-query.js +6 -0
  156. package/src/components/SearchFilter/helpers/build-query.js +26 -0
  157. package/src/components/SearchFilter/helpers/get-initial-filter-values.js +30 -0
  158. package/src/components/SearchFilter/helpers/index.js +7 -9
  159. package/src/components/SearchFilter/index.js +2 -2
  160. package/src/components/SearchFilterSort/SearchFilterSort.js +8 -18
  161. package/src/components/SearchFilterSort/helpers/handle-sort-update.js +5 -14
  162. package/src/components/SearchFilterSort/helpers/update-sort.js +3 -7
  163. package/src/helpers/build-inherited-filters.js +1 -3
  164. package/src/helpers/build-props-query.js +2 -4
  165. package/src/helpers/build-set-filters.js +1 -2
  166. package/src/helpers/get-query-filters.js +4 -4
  167. package/src/helpers/get-query-props.js +4 -12
  168. package/src/helpers/get-wrapped-value-with-link.js +3 -6
  169. package/src/helpers/index.js +0 -2
  170. package/src/helpers/parse-props-to-display.js +21 -25
  171. package/src/utils/get-class-modifiers.js +1 -1
  172. package/tests/helpers/mocks.js +5 -3
  173. package/tests/unit/src/HOC/recreateOnNavigation.test.js +28 -0
  174. package/tests/unit/src/components/Code/Code.test.js +0 -5
  175. package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
  176. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
  177. package/tests/unit/src/components/Layout/Layout.test.js +1 -1
  178. package/tests/unit/src/components/Layout/LayoutFactory.test.js +53 -0
  179. package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
  180. package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +10 -10
  181. package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +7 -24
  182. package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +10 -10
  183. package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +1 -4
  184. package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +19 -26
  185. package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
  186. package/tests/unit/src/helpers/build-props-query.test.js +0 -25
  187. package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
  188. package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
  189. package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
  190. package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  191. package/lib/components/List/helpers/get-list-query.js +0 -43
  192. package/lib/components/List/helpers/get-list-query.js.map +0 -1
  193. package/lib/components/List/helpers/get-list-specific-search-filter.js +0 -21
  194. package/lib/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
  195. package/lib/components/List/helpers/strip-query-key.js +0 -14
  196. package/lib/components/List/helpers/strip-query-key.js.map +0 -1
  197. package/lib/components/SearchFilter/helpers/build-new-url.js +0 -17
  198. package/lib/components/SearchFilter/helpers/build-new-url.js.map +0 -1
  199. package/lib/components/SearchFilter/helpers/build-url-query.js +0 -48
  200. package/lib/components/SearchFilter/helpers/build-url-query.js.map +0 -1
  201. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -32
  202. package/lib/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
  203. package/lib/components/SearchFilter/helpers/get-filter-values.js +0 -31
  204. package/lib/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
  205. package/lib/components/SearchFilter/searchFilterReducer.js +0 -45
  206. package/lib/components/SearchFilter/searchFilterReducer.js.map +0 -1
  207. package/lib/helpers/build-query-key.js +0 -16
  208. package/lib/helpers/build-query-key.js.map +0 -1
  209. package/lib/helpers/process-data-summary-value.js +0 -56
  210. package/lib/helpers/process-data-summary-value.js.map +0 -1
  211. package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
  212. package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  213. package/lib-es/components/List/helpers/get-list-query.js +0 -24
  214. package/lib-es/components/List/helpers/get-list-query.js.map +0 -1
  215. package/lib-es/components/List/helpers/get-list-specific-search-filter.js +0 -12
  216. package/lib-es/components/List/helpers/get-list-specific-search-filter.js.map +0 -1
  217. package/lib-es/components/List/helpers/strip-query-key.js +0 -6
  218. package/lib-es/components/List/helpers/strip-query-key.js.map +0 -1
  219. package/lib-es/components/SearchFilter/helpers/build-new-url.js +0 -8
  220. package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +0 -1
  221. package/lib-es/components/SearchFilter/helpers/build-url-query.js +0 -30
  222. package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +0 -1
  223. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -18
  224. package/lib-es/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js.map +0 -1
  225. package/lib-es/components/SearchFilter/helpers/get-filter-values.js +0 -19
  226. package/lib-es/components/SearchFilter/helpers/get-filter-values.js.map +0 -1
  227. package/lib-es/components/SearchFilter/searchFilterReducer.js +0 -28
  228. package/lib-es/components/SearchFilter/searchFilterReducer.js.map +0 -1
  229. package/lib-es/helpers/build-query-key.js +0 -7
  230. package/lib-es/helpers/build-query-key.js.map +0 -1
  231. package/lib-es/helpers/process-data-summary-value.js +0 -36
  232. package/lib-es/helpers/process-data-summary-value.js.map +0 -1
  233. package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
  234. package/src/components/List/helpers/get-list-query.js +0 -28
  235. package/src/components/List/helpers/get-list-specific-search-filter.js +0 -10
  236. package/src/components/List/helpers/strip-query-key.js +0 -6
  237. package/src/components/SearchFilter/helpers/build-new-url.js +0 -8
  238. package/src/components/SearchFilter/helpers/build-url-query.js +0 -31
  239. package/src/components/SearchFilter/helpers/get-filter-ranges-and-checkboxes-values.js +0 -17
  240. package/src/components/SearchFilter/helpers/get-filter-values.js +0 -21
  241. package/src/components/SearchFilter/searchFilterReducer.js +0 -15
  242. package/src/helpers/build-query-key.js +0 -7
  243. package/src/helpers/process-data-summary-value.js +0 -22
  244. package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
  245. package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
  246. package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
@@ -4,39 +4,35 @@ import isObject from './is-object';
4
4
  import getParsedPropValues from './get-parsed-prop-values';
5
5
  import getSanitizedPropValues from './get-sanitized-prop-values';
6
6
  import { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';
7
- import processDataSummaryValue from './process-data-summary-value';
8
7
 
9
8
  // TODO this helper should be removed if database is wiped clean and all elements change to new props struc
10
9
  const parsePropsToDisplay = (props = {}, propsToDisplay = []) => {
11
10
  if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);
12
11
 
13
- return propsToDisplay.map((options, currentIndex) => {
14
- const { bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink } = options;
15
- const Wrapper = bold ? BOLD_TAG : Fragment;
12
+ return propsToDisplay.map(
13
+ ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {
14
+ const Wrapper = bold ? BOLD_TAG : Fragment;
16
15
 
17
- const parsedPropValues = getParsedPropValues({
18
- propertiesToDisplay,
19
- props,
20
- enableLink,
21
- shouldStrip
22
- });
16
+ const parsedPropValues = getParsedPropValues({
17
+ propertiesToDisplay,
18
+ props,
19
+ enableLink,
20
+ shouldStrip
21
+ });
23
22
 
24
- const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);
25
- if (!sanitizedPropValues || !sanitizedPropValues.length) return null;
26
- const stringEndBlank =
27
- currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;
23
+ const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);
24
+ if (!sanitizedPropValues || !sanitizedPropValues.length) return null;
25
+ const stringEndBlank =
26
+ currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;
28
27
 
29
- const processedValue = Array.isArray(sanitizedPropValues)
30
- ? sanitizedPropValues.map(value => processDataSummaryValue(value, options))
31
- : processDataSummaryValue(sanitizedPropValues, options);
32
-
33
- return (
34
- <Wrapper>
35
- {prefix} {processedValue} {suffix}
36
- {stringEndBlank}
37
- </Wrapper>
38
- );
39
- });
28
+ return (
29
+ <Wrapper>
30
+ {prefix} {sanitizedPropValues} {suffix}
31
+ {stringEndBlank}
32
+ </Wrapper>
33
+ );
34
+ }
35
+ );
40
36
  };
41
37
 
42
38
  export default parsePropsToDisplay;
@@ -25,7 +25,7 @@ const iconProps = [BUTTON_TYPE, ...commonProps];
25
25
  const commonAttributes = { props: commonProps, prefix: null };
26
26
 
27
27
  const supportedTypes = {
28
- row: { props: [WIDTH, ...responsiveProps, ...commonProps] },
28
+ row: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },
29
29
  column: { props: [WIDTH, STICKY, ...responsiveProps, ...commonProps] },
30
30
  button: {
31
31
  props: buttonProps,
@@ -1139,9 +1139,11 @@ const MOCKED_PROPS_FILTERS_LIST = {
1139
1139
  };
1140
1140
 
1141
1141
  const MOCKED_PROPS_SEARCH_FILTER = {
1142
- listComponentName: '',
1143
- filterData: {},
1144
- asPath: 'somePath',
1142
+ router: {
1143
+ asPath: 'somePath',
1144
+ query: {},
1145
+ push: () => {}
1146
+ },
1145
1147
  parent: {
1146
1148
  itemEntity: 'published_page'
1147
1149
  },
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import React from 'react';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import { render } from '@testing-library/react';
7
+ import recreateOnNavigation from '../../../../src/HOC/recreateOnNavigation';
8
+
9
+ jest.mock('next/router', () => {
10
+ const mockRouter = {
11
+ asPath: '/abc',
12
+ push: null
13
+ };
14
+ return {
15
+ router: mockRouter,
16
+ useRouter: () => mockRouter
17
+ };
18
+ });
19
+
20
+ describe('recreateOnNavigation HOC', () => {
21
+ const mockComponent = jest.fn(() => <div>Mock Component</div>);
22
+ it('should render component and change key on route change', async () => {
23
+ const WrapperComponent = recreateOnNavigation(mockComponent);
24
+ const name = 'test';
25
+ render(<WrapperComponent name={name} />);
26
+ expect(mockComponent).toHaveBeenCalledWith(expect.objectContaining({ name }), {});
27
+ });
28
+ });
@@ -23,11 +23,6 @@ describe('Code component', () => {
23
23
  expect(asFragment()).toMatchSnapshot();
24
24
  });
25
25
 
26
- it('should not render wrapper', () => {
27
- const { asFragment } = render(Code, { ...props, disableWrapper: true });
28
- expect(asFragment()).toMatchSnapshot();
29
- });
30
-
31
26
  it('should return null if there is not embed code', () => {
32
27
  const { container } = render(Code, {});
33
28
  expect(container.innerHTML).toBe('');
@@ -27,11 +27,3 @@ exports[`Code component should not render script tags 1`] = `
27
27
  </div>
28
28
  </DocumentFragment>
29
29
  `;
30
-
31
- exports[`Code component should not render wrapper 1`] = `
32
- <DocumentFragment>
33
- <p>
34
- Lorem ipsum
35
- </p>
36
- </DocumentFragment>
37
- `;
@@ -1,11 +1,6 @@
1
1
  import '@testing-library/jest-dom/extend-expect';
2
2
  import buildLoopPropsContent from '../../../../../../src/components/DataSummary/helpers/build-loop-props-content';
3
3
  import { mockedLoopProps, mockedPropsToDisplay, mockedData, mockedResults } from './mocks';
4
- import processDataSummaryValue from '../../../../../../src/helpers/process-data-summary-value';
5
-
6
- jest.mock('../../../../../../src/helpers/process-data-summary-value', () =>
7
- jest.fn(value => value)
8
- );
9
4
 
10
5
  describe('buildLoopPropsContent helper function', () => {
11
6
  const noParamsPassed = buildLoopPropsContent();
@@ -46,10 +41,6 @@ describe('buildLoopPropsContent helper function', () => {
46
41
  expect(noDataPassed).toEqual([]);
47
42
  });
48
43
 
49
- it('should call processDataSummaryValue', () => {
50
- expect(processDataSummaryValue).toHaveBeenCalledWith('pre data name', mockedPropsToDisplay[0]);
51
- });
52
-
53
44
  it('should return regular dataSummary content if no loopable values are found', () => {
54
45
  expect(withNoLoopValues).toEqual(mockedResults[0]);
55
46
  expect(withNoLoopableValues).toEqual(mockedResults[1]);
@@ -4,7 +4,7 @@
4
4
  import React from 'react';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
7
- import Layout from '../../../../../src/components/Layout';
7
+ import Layout from '../../../../../src/components/Layout/Layout';
8
8
  import { COLUMN, ROW } from '../../../../../src/constants';
9
9
  import useGetImages from '../../../../../src/hooks/use-get-images';
10
10
 
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import React from 'react';
5
+ import '@testing-library/jest-dom/extend-expect';
6
+ import { render } from '@testing-library/react';
7
+ import Layout from '../../../../../src/components/Layout';
8
+
9
+ jest.mock('../../../../../src/components/Layout/Layout', () =>
10
+ jest.fn(({ children }) => <div data-testid="Layout">{children}</div>)
11
+ );
12
+
13
+ jest.mock('next/dynamic', () => {
14
+ const LayoutWithStickyTimer = ({ children }) => (
15
+ <div data-testid="LayoutWithStickyTimer">{children}</div>
16
+ );
17
+ return jest.fn(() => LayoutWithStickyTimer);
18
+ });
19
+
20
+ const defaultComponentTestId = 'Layout';
21
+ const testId = 'child-test-id';
22
+
23
+ describe('LayoutFactoriy component', () => {
24
+ const props = { someProps: true, children: <div data-testid={testId} /> };
25
+
26
+ it('should be defined', () => {
27
+ expect(Layout).toBeDefined();
28
+ });
29
+
30
+ it('should render Layout component', () => {
31
+ const { getByTestId } = render(<Layout {...props} />);
32
+ expect(getByTestId(defaultComponentTestId)).toBeDefined();
33
+ expect(getByTestId(testId)).toBeDefined();
34
+ });
35
+
36
+ it('should render LayoutWithStickyTimer component', () => {
37
+ const { getByTestId } = render(<Layout {...props} sticky stickyTimer={10} />);
38
+ expect(getByTestId('LayoutWithStickyTimer')).toBeDefined();
39
+ expect(getByTestId(testId)).toBeDefined();
40
+ });
41
+
42
+ it('should render if stickyTimer is not set', () => {
43
+ const { getByTestId } = render(<Layout {...props} sticky />);
44
+ expect(getByTestId(defaultComponentTestId)).toBeDefined();
45
+ expect(getByTestId(testId)).toBeDefined();
46
+ });
47
+
48
+ it('should render if sticky is not set', () => {
49
+ const { getByTestId } = render(<Layout {...props} stickyTimer={20} />);
50
+ expect(getByTestId(defaultComponentTestId)).toBeDefined();
51
+ expect(getByTestId(testId)).toBeDefined();
52
+ });
53
+ });
@@ -1,5 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`SearchFilter container should match snapshot 1`] = `<DocumentFragment />`;
3
+ exports[`SearchFilter container should match snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <div>
6
+ Mocked component
7
+ </div>
8
+ </DocumentFragment>
9
+ `;
4
10
 
5
11
  exports[`SearchFilter container should return null if no filters are passed 1`] = `<DocumentFragment />`;
@@ -1,20 +1,20 @@
1
- import buildNewUrl from '../../../../../../src/components/SearchFilter/helpers/build-new-url';
2
- // url, currentUrl, queryParams, hashBit
1
+ import buildNewQuery from '../../../../../../src/components/SearchFilter/helpers/build-new-query';
2
+
3
3
  const mockedProps = [
4
4
  ['', 'current-as-path', 'some=query&params=value'],
5
5
  ['urlFromProps', '', 'other=query&with=value'],
6
- ['urlFromProps', 'not=used', 'another=query&withthis=value'],
7
- ['urlFromProps', 'not=used', 'another=query&withthis=value', 'this-is-content']
6
+ ['urlFromProps', 'not=used', 'another=query&withthis=value', 'sort=asc&sortby=name']
8
7
  ];
9
8
 
10
- describe('buildNewUrl helper function', () => {
11
- const simpleExample = buildNewUrl(...mockedProps[0]);
12
- const withPropsUrl = buildNewUrl(...mockedProps[1]);
13
- const withHash = buildNewUrl(...mockedProps[3]);
9
+ describe('buildNewQuery helper function', () => {
10
+ const simpleExample = buildNewQuery(...mockedProps[0]);
11
+ const withPropsUrl = buildNewQuery(...mockedProps[1]);
12
+ const withSort = buildNewQuery(...mockedProps[2]);
14
13
 
15
14
  it('should always return a string', () => {
16
15
  expect(typeof simpleExample).toBe('string');
17
16
  expect(typeof withPropsUrl).toBe('string');
17
+ expect(typeof withSort).toBe('string');
18
18
  });
19
19
 
20
20
  it('should return new url using asPath and queryParams passed', () => {
@@ -25,7 +25,7 @@ describe('buildNewUrl helper function', () => {
25
25
  expect(withPropsUrl).toEqual('urlFromProps?other=query&with=value');
26
26
  });
27
27
 
28
- it('should return new url with hash if passed', () => {
29
- expect(withHash).toEqual('urlFromProps?another=query&withthis=value#this-is-content');
28
+ it('should return new url with sort if passed', () => {
29
+ expect(withSort).toEqual('urlFromProps?another=query&withthis=value&sort=asc&sortby=name');
30
30
  });
31
31
  });
@@ -1,4 +1,4 @@
1
- import buildUrlQuery from '../../../../../../src/components/SearchFilter/helpers/build-url-query';
1
+ import buildQuery from '../../../../../../src/components/SearchFilter/helpers/build-query';
2
2
  import { SEARCH_TERM } from '../../../../../../src/components/SearchFilter/constants';
3
3
 
4
4
  const mockedProps = [
@@ -10,15 +10,10 @@ const mockedProps = [
10
10
  ]
11
11
  ];
12
12
 
13
- describe('buildUrlQuery helper function', () => {
14
- const simpleExample = buildUrlQuery(...mockedProps[0]);
15
- const withTextSearch = buildUrlQuery(...mockedProps[1]);
16
- const withSearchAndRange = buildUrlQuery(...mockedProps[2]);
17
- const withListName = buildUrlQuery(...mockedProps[2], 'listName');
18
- const withListNameAndOtherQueryBits = buildUrlQuery(...mockedProps[2], 'listName', {
19
- sort: 'asc',
20
- anotherQuery: '123'
21
- });
13
+ describe('buildQuery helper function', () => {
14
+ const simpleExample = buildQuery(...mockedProps[0]);
15
+ const withTextSearch = buildQuery(...mockedProps[1]);
16
+ const withSearchAndRange = buildQuery(...mockedProps[2]);
22
17
 
23
18
  it('should always return a string', () => {
24
19
  expect(typeof simpleExample).toBe('string');
@@ -29,22 +24,10 @@ describe('buildUrlQuery helper function', () => {
29
24
  });
30
25
 
31
26
  it('should return new query string with search term if available', () => {
32
- expect(withTextSearch).toEqual('search_term=new search value');
27
+ expect(withTextSearch).toEqual('search_term=new%20search%20value');
33
28
  });
34
29
 
35
30
  it('should return new query string with search text and all other available query values', () => {
36
- expect(withSearchAndRange).toEqual('search_term=new search value&rangeFilter=2-10');
37
- });
38
-
39
- it('should return new query string listName if passed', () => {
40
- expect(withListName).toEqual(
41
- 'pb[listName][search_term]=new search value&pb[listName][rangeFilter]=2-10'
42
- );
43
- });
44
-
45
- it('should return new query string with unaltered bits from other query', () => {
46
- expect(withListNameAndOtherQueryBits).toEqual(
47
- 'pb[listName][search_term]=new search value&pb[listName][rangeFilter]=2-10&sort=asc&anotherQuery=123'
48
- );
31
+ expect(withSearchAndRange).toEqual('search_term=new%20search%20value&rangeFilter=2-10');
49
32
  });
50
33
  });
@@ -1,4 +1,4 @@
1
- import getFilterValues from '../../../../../../src/components/SearchFilter/helpers/get-filter-values';
1
+ import getInitialFilterValues from '../../../../../../src/components/SearchFilter/helpers/get-initial-filter-values';
2
2
  import { SEARCH_TERM } from '../../../../../../src/components/SearchFilter/constants';
3
3
 
4
4
  const filters = [
@@ -16,24 +16,25 @@ const mockedProps = [
16
16
  [{ rangeFilter: { min: 5, max: 10 }, checkboxFilter: {}, emptySelect: {} }, filters, query]
17
17
  ];
18
18
 
19
- describe('getFilterValues helper function', () => {
20
- const withNoValue = getFilterValues(...mockedProps[0]);
21
- const withValues = getFilterValues(...mockedProps[1]);
19
+ describe('getInitialFilterValues helper function', () => {
20
+ const withNoValue = getInitialFilterValues(...mockedProps[0]);
21
+ const withValues = getInitialFilterValues(...mockedProps[1]);
22
22
 
23
23
  it('should return init filter values based on query and filterData', () => {
24
- expect(withNoValue).toEqual({ search_term: '', dataNotSet: false });
24
+ expect(withNoValue).toEqual({ dataNotSet: false, search_term: '' });
25
25
  expect(withValues).toEqual({
26
+ dataNotSet: false,
26
27
  search_term: query[SEARCH_TERM],
27
28
  rangeFilter: { max: 10, maxValue: 8, min: 5, minValue: 7, step: 1 },
28
29
  checkboxFilter: ['check1', 'check2'],
29
- emptySelect: null,
30
- dataNotSet: false
30
+ emptySelect: null
31
31
  });
32
32
  });
33
33
 
34
34
  it('should return init filter values without filterData', () => {
35
- const withNoData = getFilterValues(null, filters, query);
35
+ const withNoData = getInitialFilterValues(null, filters, query);
36
36
  expect(withNoData).toEqual({
37
+ dataNotSet: true,
37
38
  search_term: query[SEARCH_TERM],
38
39
  rangeFilter: {
39
40
  max: 8,
@@ -43,8 +44,7 @@ describe('getFilterValues helper function', () => {
43
44
  step: 1
44
45
  },
45
46
  checkboxFilter: query.checkboxFilter,
46
- emptySelect: null,
47
- dataNotSet: true
47
+ emptySelect: null
48
48
  });
49
49
  });
50
50
  });
@@ -5,11 +5,8 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import SearchFilterSort from '../../../../../src/components/SearchFilterSort/SearchFilterSort';
7
7
 
8
- jest.mock('next/router', () => ({
9
- useRouter: jest.fn(() => ({ asPath: 'test-url' }))
10
- }));
11
-
12
8
  const props = {
9
+ router: { asPath: 'some-path' },
13
10
  filters: [{ label: 'label1', propsToDisplay: ['name'], sort: 'ascending' }],
14
11
  label: 'someLabel',
15
12
  id: '123456'
@@ -1,50 +1,43 @@
1
1
  import handleSortUpdate from '../../../../../../src/components/SearchFilterSort/helpers/handle-sort-update';
2
2
 
3
3
  const routerPushResultMock = () => ({ then: jest.fn() });
4
- // router, value, query, url, selectLabel, listComponentName
5
4
  const mockedProps = [
6
- {
7
- router: { asPath: 'asPath', push: jest.fn(routerPushResultMock) },
8
- value: 'defaultOption',
9
- query: {},
10
- url: 'url',
11
- selectLabel: 'defaultOption'
12
- },
13
- {
14
- router: { asPath: 'asPath', push: jest.fn(routerPushResultMock) },
15
- value: 'defaultOption',
16
- query: { sort: 'asc', sortby: 'name', type: 'big' },
17
- url: 'baseurl',
18
- selectLabel: 'defaultOption'
19
- },
20
- {
21
- router: { asPath: 'asPath', push: jest.fn(routerPushResultMock) },
22
- value: 'name:desc',
23
- query: { someOther: 'ott' },
24
- url: 'url',
25
- selectLabel: 'defaultOption'
26
- }
5
+ [{ push: jest.fn(routerPushResultMock) }, 'defaultOption', {}, 'url', 'defaultOption'],
6
+ [
7
+ { push: jest.fn(routerPushResultMock) },
8
+ 'defaultOption',
9
+ { sort: 'asc', sortby: 'name', type: 'big' },
10
+ 'baseurl',
11
+ 'defaultOption'
12
+ ],
13
+ [
14
+ { push: jest.fn(routerPushResultMock) },
15
+ 'name:desc',
16
+ { someOther: 'ott' },
17
+ 'url',
18
+ 'defaultOption'
19
+ ]
27
20
  ];
28
21
 
29
22
  describe('handleSortUpdate helper function', () => {
30
- mockedProps.forEach(props => handleSortUpdate({ ...props }));
23
+ mockedProps.forEach(props => handleSortUpdate(...props));
31
24
 
32
25
  it('should navigate to url with no sort if default value is selected', () => {
33
- expect(mockedProps[0].router.push).toHaveBeenLastCalledWith('/Resolver', 'url', {
26
+ expect(mockedProps[0][0].push).toHaveBeenLastCalledWith('/Resolver', 'url', {
34
27
  shallow: true,
35
28
  scroll: false
36
29
  });
37
30
  });
38
31
 
39
32
  it('should navigate to url with no sort with previous querys if default value is selected', () => {
40
- expect(mockedProps[1].router.push).toHaveBeenLastCalledWith('/Resolver', 'baseurl?type=big', {
33
+ expect(mockedProps[1][0].push).toHaveBeenLastCalledWith('/Resolver', 'baseurl?type=big', {
41
34
  shallow: true,
42
35
  scroll: false
43
36
  });
44
37
  });
45
38
 
46
39
  it('should navigate to url with new sort if selected', () => {
47
- expect(mockedProps[2].router.push).toHaveBeenLastCalledWith(
40
+ expect(mockedProps[2][0].push).toHaveBeenLastCalledWith(
48
41
  '/Resolver',
49
42
  'url?someOther=ott&sort=desc&sortby=name',
50
43
  { shallow: true, scroll: false }
@@ -1,15 +1,10 @@
1
1
  import updateSort from '../../../../../../src/components/SearchFilterSort/helpers/update-sort';
2
2
 
3
- const mockedProps = [
4
- ['name:asc', {}, 'aurl'],
5
- ['name:asc', { other: '12', query2: 'an' }, 'aurl'],
6
- ['name:desc', { query1: 'aquery' }, 'theUrl', '#hashBit']
7
- ];
3
+ const mockedProps = [['name:asc', {}, 'aurl'], ['name:asc', { other: '12', query2: 'an' }, 'aurl']];
8
4
 
9
5
  describe('updateSort helper function', () => {
10
6
  const basicSort = updateSort(...mockedProps[0]);
11
7
  const sortWithOtherQuerys = updateSort(...mockedProps[1]);
12
- const sortWithhash = updateSort(...mockedProps[2]);
13
8
 
14
9
  it('should return a parsed url based on the parameters passed', () => {
15
10
  expect(basicSort).toEqual('aurl?sort=asc&sortby=name');
@@ -18,8 +13,4 @@ describe('updateSort helper function', () => {
18
13
  it('should return a parsed url with extra query params if passed', () => {
19
14
  expect(sortWithOtherQuerys).toEqual('aurl?other=12&query2=an&sort=asc&sortby=name');
20
15
  });
21
-
22
- it('should return a parsed url with extra query params and hash if passed', () => {
23
- expect(sortWithhash).toEqual('theUrl?query1=aquery&sort=desc&sortby=name#hashBit');
24
- });
25
16
  });
@@ -182,31 +182,6 @@ describe('get card render props', () => {
182
182
  'id,name,url,sponsored,featured,category{name,listingPageId,listingPageEntity, id publishedListingPage{id, url}},address{country,id}'
183
183
  );
184
184
  });
185
-
186
- it('should url props where enableLink is set', () => {
187
- const _data = {
188
- getEntitySchema: {
189
- interfaces: [CONTENT_INTERFACE],
190
- properties: {
191
- id: 'id',
192
- nestedProperty: {
193
- type: 'object'
194
- }
195
- },
196
- relations: [{ localField: 'address' }],
197
- dynamicProperties: {
198
- nestedDynamicProperty: {
199
- type: 'object'
200
- }
201
- }
202
- }
203
- };
204
- const linkProps = ['nestedProperty.title', 'nestedDynamicProperty.title', 'address.title'];
205
- const query = buildPropsQuery(_data, linkProps, {}, linkProps);
206
- expect(query).toEqual(
207
- 'id,name,url,sponsored,featured,nestedProperty{title,url},nestedDynamicProperty{title,url},address{title,id,url}'
208
- );
209
- });
210
185
  });
211
186
 
212
187
  function testUrlProperty({ extraProperties = {}, dynamicProperties = {}, cardProps }) {
@@ -33,7 +33,7 @@ describe('get wrapped value with link func', () => {
33
33
  expect(resultWithArray).toHaveLength(2);
34
34
  expect(resultWithArray[0].props.href).toEqual(link);
35
35
  expect(resultWithArray[0].key).toEqual(`${keyPrefix}-0`);
36
- expect(resultWithArray[0].props.children).toMatchSnapshot();
37
- expect(resultWithArray[1]).toMatchSnapshot();
36
+ expect(resultWithArray[0].props.children).toEqual(`${arrayOfValues[0][keyField]}, `);
37
+ expect(resultWithArray[1]).toEqual(`${arrayOfValues[1][keyField]} `);
38
38
  });
39
39
  });
@@ -1,8 +1,5 @@
1
1
  import '@testing-library/jest-dom/extend-expect';
2
2
  import parsePropsToDisplay from '../../../../src/helpers/parse-props-to-display';
3
- import processDataSummaryValue from '../../../../src/helpers/process-data-summary-value';
4
-
5
- jest.mock('../../../../src/helpers/process-data-summary-value', () => jest.fn(value => value));
6
3
 
7
4
  const mockedPropsToDisplayStringArr = ['name', 'other', 'cat.name', 'tag.name'];
8
5
  const mockedPropsToDisplayObjectArr = [
@@ -37,7 +34,6 @@ describe('parsePropsToDisplay func', () => {
37
34
  it('should return an array of react elements if an array of objects is passed', () => {
38
35
  const nonElement = !!withObjArr.find(({ type }) => typeof type !== 'symbol');
39
36
  expect(nonElement).toEqual(false);
40
- expect(processDataSummaryValue).toHaveBeenCalled();
41
37
  });
42
38
 
43
39
  it('should display bold tag wrapper when props to display has bold property', () => {
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- require("core-js/modules/es.array.find.js");
12
- require("core-js/modules/es.object.to-string.js");
13
- require("core-js/modules/es.array.index-of.js");
14
- require("core-js/modules/es.object.keys.js");
15
- require("core-js/modules/es.array.is-array.js");
16
- require("core-js/modules/es.array.for-each.js");
17
- require("core-js/modules/web.dom-collections.for-each.js");
18
- var getUpdatedItemsToDisplay = function getUpdatedItemsToDisplay(_ref) {
19
- var parentSchema = _ref.parentSchema,
20
- parentEntityData = _ref.parentEntityData,
21
- _ref$itemsToDisplay = _ref.itemsToDisplay,
22
- itemsToDisplay = _ref$itemsToDisplay === void 0 ? [] : _ref$itemsToDisplay,
23
- _ref$inheritedFilters = _ref.inheritedFilters,
24
- inheritedFilters = _ref$inheritedFilters === void 0 ? [] : _ref$inheritedFilters;
25
- var idProp = inheritedFilters.find(function (filter) {
26
- return filter.indexOf('id/') === 0;
27
- });
28
- if (!idProp || !parentSchema || !parentEntityData) return itemsToDisplay;
29
- var properties = parentSchema.properties;
30
- var _idProp$split = idProp.split('/'),
31
- _idProp$split2 = (0, _slicedToArray2["default"])(_idProp$split, 2),
32
- entityKey = _idProp$split2[1];
33
- if (!properties || !entityKey) return itemsToDisplay;
34
- var queryValue = Object.keys(properties).find(function (propKey) {
35
- return properties[propKey] && properties[propKey].relation && properties[propKey].relation.entityIdentifier === entityKey;
36
- });
37
- var parentValues = parentEntityData[queryValue];
38
- if (!parentValues) return itemsToDisplay;
39
- var updatedItemsToDisplay = (0, _toConsumableArray2["default"])(itemsToDisplay);
40
- if (Array.isArray(parentValues)) {
41
- parentValues.forEach(function (value) {
42
- updatedItemsToDisplay.push({
43
- displayItems: [value]
44
- });
45
- });
46
- } else {
47
- updatedItemsToDisplay.push({
48
- displayItems: [parentValues]
49
- });
50
- }
51
- return updatedItemsToDisplay;
52
- };
53
- var _default = getUpdatedItemsToDisplay;
54
- exports["default"] = _default;
55
- //# sourceMappingURL=get-updated-items-to-display.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-updated-items-to-display.js","names":["getUpdatedItemsToDisplay","_ref","parentSchema","parentEntityData","_ref$itemsToDisplay","itemsToDisplay","_ref$inheritedFilters","inheritedFilters","idProp","find","filter","indexOf","properties","_idProp$split","split","_idProp$split2","_slicedToArray2","entityKey","queryValue","Object","keys","propKey","relation","entityIdentifier","parentValues","updatedItemsToDisplay","_toConsumableArray2","Array","isArray","forEach","value","push","displayItems","_default","exports"],"sources":["../../../../src/components/Card/helpers/get-updated-items-to-display.js"],"sourcesContent":["const getUpdatedItemsToDisplay = ({\n parentSchema,\n parentEntityData,\n itemsToDisplay = [],\n inheritedFilters = []\n}) => {\n const idProp = inheritedFilters.find(filter => filter.indexOf('id/') === 0);\n\n if (!idProp || !parentSchema || !parentEntityData) return itemsToDisplay;\n const { properties } = parentSchema;\n const [, entityKey] = idProp.split('/');\n if (!properties || !entityKey) return itemsToDisplay;\n const queryValue = Object.keys(properties).find(\n propKey =>\n properties[propKey] &&\n properties[propKey].relation &&\n properties[propKey].relation.entityIdentifier === entityKey\n );\n const parentValues = parentEntityData[queryValue];\n if (!parentValues) return itemsToDisplay;\n const updatedItemsToDisplay = [...itemsToDisplay];\n if (Array.isArray(parentValues)) {\n parentValues.forEach(value => {\n updatedItemsToDisplay.push({ displayItems: [value] });\n });\n } else {\n updatedItemsToDisplay.push({ displayItems: [parentValues] });\n }\n return updatedItemsToDisplay;\n};\n\nexport default getUpdatedItemsToDisplay;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;EAAA,IAJJC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAAAC,mBAAA,GAAAH,IAAA,CAChBI,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAG,EAAE,GAAAA,mBAAA;IAAAE,qBAAA,GAAAL,IAAA,CACnBM,gBAAgB;IAAhBA,gBAAgB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAErB,IAAME,MAAM,GAAGD,gBAAgB,CAACE,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIA,MAAM,CAACC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;EAAA,EAAC;EAE3E,IAAI,CAACH,MAAM,IAAI,CAACN,YAAY,IAAI,CAACC,gBAAgB,EAAE,OAAOE,cAAc;EACxE,IAAQO,UAAU,GAAKV,YAAY,CAA3BU,UAAU;EAClB,IAAAC,aAAA,GAAsBL,MAAM,CAACM,KAAK,CAAC,GAAG,CAAC;IAAAC,cAAA,OAAAC,eAAA,aAAAH,aAAA;IAA9BI,SAAS,GAAAF,cAAA;EAClB,IAAI,CAACH,UAAU,IAAI,CAACK,SAAS,EAAE,OAAOZ,cAAc;EACpD,IAAMa,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACR,UAAU,CAAC,CAACH,IAAI,CAC7C,UAAAY,OAAO;IAAA,OACLT,UAAU,CAACS,OAAO,CAAC,IACnBT,UAAU,CAACS,OAAO,CAAC,CAACC,QAAQ,IAC5BV,UAAU,CAACS,OAAO,CAAC,CAACC,QAAQ,CAACC,gBAAgB,KAAKN,SAAS;EAAA,CAC/D,CAAC;EACD,IAAMO,YAAY,GAAGrB,gBAAgB,CAACe,UAAU,CAAC;EACjD,IAAI,CAACM,YAAY,EAAE,OAAOnB,cAAc;EACxC,IAAMoB,qBAAqB,OAAAC,mBAAA,aAAOrB,cAAc,CAAC;EACjD,IAAIsB,KAAK,CAACC,OAAO,CAACJ,YAAY,CAAC,EAAE;IAC/BA,YAAY,CAACK,OAAO,CAAC,UAAAC,KAAK,EAAI;MAC5BL,qBAAqB,CAACM,IAAI,CAAC;QAAEC,YAAY,EAAE,CAACF,KAAK;MAAE,CAAC,CAAC;IACvD,CAAC,CAAC;EACJ,CAAC,MAAM;IACLL,qBAAqB,CAACM,IAAI,CAAC;MAAEC,YAAY,EAAE,CAACR,YAAY;IAAE,CAAC,CAAC;EAC9D;EACA,OAAOC,qBAAqB;AAC9B,CAAC;AAAC,IAAAQ,QAAA,GAEajC,wBAAwB;AAAAkC,OAAA,cAAAD,QAAA"}