@blaze-cms/react-page-builder 0.130.0-admin-updates.9 → 0.130.0-alpha.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 (118) hide show
  1. package/CHANGELOG.md +4 -71
  2. package/lib/components/Card/CardsRender.js +6 -13
  3. package/lib/components/Card/CardsRender.js.map +1 -1
  4. package/lib/components/Card/helpers/index.js +0 -7
  5. package/lib/components/Card/helpers/index.js.map +1 -1
  6. package/lib/components/Code/Code.js +3 -7
  7. package/lib/components/Code/Code.js.map +1 -1
  8. package/lib/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  9. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  10. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js +2 -3
  11. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  12. package/lib/components/Layout/Layout.js +10 -4
  13. package/lib/components/Layout/Layout.js.map +1 -1
  14. package/lib/components/SearchContent/SearchContent.js +6 -8
  15. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  16. package/lib/components/SearchContent/SearchContentItems.js +1 -1
  17. package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
  18. package/lib/components/SearchFilter/SearchFilterContainer.js +1 -2
  19. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  20. package/lib/components/SearchFilter/helpers/build-new-query.js +2 -3
  21. package/lib/components/SearchFilter/helpers/build-new-query.js.map +1 -1
  22. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js +2 -5
  23. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  24. package/lib/components/SearchFilterSort/helpers/update-sort.js +1 -2
  25. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  26. package/lib/helpers/build-inherited-filters.js +0 -2
  27. package/lib/helpers/build-inherited-filters.js.map +1 -1
  28. package/lib/helpers/build-props-query.js +2 -5
  29. package/lib/helpers/build-props-query.js.map +1 -1
  30. package/lib/helpers/build-set-filters.js +1 -5
  31. package/lib/helpers/build-set-filters.js.map +1 -1
  32. package/lib/helpers/get-query-props.js +2 -13
  33. package/lib/helpers/get-query-props.js.map +1 -1
  34. package/lib/helpers/get-wrapped-value-with-link.js +3 -2
  35. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  36. package/lib/helpers/index.js +0 -7
  37. package/lib/helpers/index.js.map +1 -1
  38. package/lib/helpers/parse-props-to-display.js +8 -13
  39. package/lib/helpers/parse-props-to-display.js.map +1 -1
  40. package/lib-es/components/Card/CardsRender.js +7 -14
  41. package/lib-es/components/Card/CardsRender.js.map +1 -1
  42. package/lib-es/components/Card/helpers/index.js +0 -1
  43. package/lib-es/components/Card/helpers/index.js.map +1 -1
  44. package/lib-es/components/Code/Code.js +4 -8
  45. package/lib-es/components/Code/Code.js.map +1 -1
  46. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +1 -3
  47. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  48. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -4
  49. package/lib-es/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  50. package/lib-es/components/Layout/Layout.js +11 -5
  51. package/lib-es/components/Layout/Layout.js.map +1 -1
  52. package/lib-es/components/SearchContent/SearchContent.js +6 -8
  53. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  54. package/lib-es/components/SearchContent/SearchContentItems.js +1 -1
  55. package/lib-es/components/SearchContent/SearchContentItems.js.map +1 -1
  56. package/lib-es/components/SearchFilter/SearchFilterContainer.js +1 -2
  57. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  58. package/lib-es/components/SearchFilter/helpers/build-new-query.js +2 -3
  59. package/lib-es/components/SearchFilter/helpers/build-new-query.js.map +1 -1
  60. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js +2 -7
  61. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  62. package/lib-es/components/SearchFilterSort/helpers/update-sort.js +2 -2
  63. package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  64. package/lib-es/helpers/build-inherited-filters.js +0 -2
  65. package/lib-es/helpers/build-inherited-filters.js.map +1 -1
  66. package/lib-es/helpers/build-props-query.js +2 -4
  67. package/lib-es/helpers/build-props-query.js.map +1 -1
  68. package/lib-es/helpers/build-set-filters.js +1 -5
  69. package/lib-es/helpers/build-set-filters.js.map +1 -1
  70. package/lib-es/helpers/get-query-props.js +2 -10
  71. package/lib-es/helpers/get-query-props.js.map +1 -1
  72. package/lib-es/helpers/get-wrapped-value-with-link.js +2 -2
  73. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  74. package/lib-es/helpers/index.js +0 -1
  75. package/lib-es/helpers/index.js.map +1 -1
  76. package/lib-es/helpers/parse-props-to-display.js +9 -12
  77. package/lib-es/helpers/parse-props-to-display.js.map +1 -1
  78. package/package.json +10 -10
  79. package/src/components/Card/CardsRender.js +7 -27
  80. package/src/components/Card/helpers/index.js +0 -1
  81. package/src/components/Code/Code.js +3 -7
  82. package/src/components/DataSummary/helpers/build-loop-props-content.js +1 -4
  83. package/src/components/DataSummary/helpers/build-props-to-display-with-content.js +3 -6
  84. package/src/components/Layout/Layout.js +9 -2
  85. package/src/components/SearchContent/SearchContent.js +6 -8
  86. package/src/components/SearchFilter/SearchFilterContainer.js +1 -2
  87. package/src/components/SearchFilter/helpers/build-new-query.js +2 -3
  88. package/src/components/SearchFilterSort/helpers/handle-sort-update.js +3 -7
  89. package/src/components/SearchFilterSort/helpers/update-sort.js +2 -2
  90. package/src/helpers/build-inherited-filters.js +1 -3
  91. package/src/helpers/build-props-query.js +2 -4
  92. package/src/helpers/build-set-filters.js +1 -2
  93. package/src/helpers/get-query-props.js +4 -12
  94. package/src/helpers/get-wrapped-value-with-link.js +3 -6
  95. package/src/helpers/index.js +0 -1
  96. package/src/helpers/parse-props-to-display.js +21 -25
  97. package/tests/unit/src/components/Code/Code.test.js +0 -5
  98. package/tests/unit/src/components/Code/__snapshots__/Code.test.js.snap +0 -8
  99. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +0 -9
  100. package/tests/unit/src/components/SearchFilter/helpers/build-new-query.test.js +1 -15
  101. package/tests/unit/src/components/SearchFilterSort/helpers/handle-sort-update.test.js +3 -9
  102. package/tests/unit/src/components/SearchFilterSort/helpers/update-sort.test.js +1 -10
  103. package/tests/unit/src/helpers/build-props-query.test.js +0 -25
  104. package/tests/unit/src/helpers/get-wrapped-value-with-link.test.js +2 -2
  105. package/tests/unit/src/helpers/parse-props-to-display.test.js +0 -4
  106. package/lib/components/Card/helpers/get-updated-items-to-display.js +0 -55
  107. package/lib/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  108. package/lib/helpers/process-data-summary-value.js +0 -56
  109. package/lib/helpers/process-data-summary-value.js.map +0 -1
  110. package/lib-es/components/Card/helpers/get-updated-items-to-display.js +0 -32
  111. package/lib-es/components/Card/helpers/get-updated-items-to-display.js.map +0 -1
  112. package/lib-es/helpers/process-data-summary-value.js +0 -36
  113. package/lib-es/helpers/process-data-summary-value.js.map +0 -1
  114. package/src/components/Card/helpers/get-updated-items-to-display.js +0 -32
  115. package/src/helpers/process-data-summary-value.js +0 -22
  116. package/tests/unit/src/components/Card/helpers/get-updated-items-to-display.test.js +0 -72
  117. package/tests/unit/src/helpers/__snapshots__/get-wrapped-value-with-link.test.js.snap +0 -18
  118. package/tests/unit/src/helpers/prcoess-data-summary-value.test.js +0 -52
@@ -1 +1 @@
1
- {"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","processDataSummaryValue","parsePropsToDisplay","props","propsToDisplay","filter","Boolean","map","options","currentIndex","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","Wrapper","parsedPropValues","sanitizedPropValues","length","stringEndBlank","processedValue","Array","isArray","value","createElement"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\nimport processDataSummaryValue from './process-data-summary-value';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map((options, currentIndex) => {\n const { bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink } = options;\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n const processedValue = Array.isArray(sanitizedPropValues)\n ? sanitizedPropValues.map(value => processDataSummaryValue(value, options))\n : processDataSummaryValue(sanitizedPropValues, options);\n\n return (\n <Wrapper>\n {prefix} {processedValue} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n });\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,QAAQ,EAAEC,0BAA0B,QAAQ,cAAc;AACnE,OAAOC,uBAAuB,MAAM,8BAA8B;;AAElE;AACA,MAAMC,mBAAmB,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,cAAc,GAAG,EAAE,KAAK;EAC/D,IAAI,CAACR,QAAQ,CAACQ,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,OAAOT,EAAE,CAACQ,KAAK,EAAEC,cAAc,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EAElF,OAAOF,cAAc,CAACG,GAAG,CAAC,CAACC,OAAO,EAAEC,YAAY,KAAK;IACnD,MAAM;MAAEC,IAAI;MAAEC,mBAAmB;MAAEC,MAAM;MAAEC,MAAM;MAAEC,WAAW;MAAEC;IAAW,CAAC,GAAGP,OAAO;IACtF,MAAMQ,OAAO,GAAGN,IAAI,GAAGX,QAAQ,GAAGL,QAAQ;IAE1C,MAAMuB,gBAAgB,GAAGpB,mBAAmB,CAAC;MAC3Cc,mBAAmB;MACnBR,KAAK;MACLY,UAAU;MACVD;IACF,CAAC,CAAC;IAEF,MAAMI,mBAAmB,GAAGpB,sBAAsB,CAACmB,gBAAgB,CAAC;IACpE,IAAI,CAACC,mBAAmB,IAAI,CAACA,mBAAmB,CAACC,MAAM,EAAE,OAAO,IAAI;IACpE,MAAMC,cAAc,GAClBX,YAAY,GAAG,CAAC,KAAKL,cAAc,CAACe,MAAM,GAAG,EAAE,GAAGnB,0BAA0B;IAE9E,MAAMqB,cAAc,GAAGC,KAAK,CAACC,OAAO,CAACL,mBAAmB,CAAC,GACrDA,mBAAmB,CAACX,GAAG,CAACiB,KAAK,IAAIvB,uBAAuB,CAACuB,KAAK,EAAEhB,OAAO,CAAC,CAAC,GACzEP,uBAAuB,CAACiB,mBAAmB,EAAEV,OAAO,CAAC;IAEzD,oBACEf,KAAA,CAAAgC,aAAA,CAACT,OAAO,QACLJ,MAAM,EAAC,GAAC,EAACS,cAAc,EAAC,GAAC,EAACR,MAAM,EAChCO,cACM,CAAC;EAEd,CAAC,CAAC;AACJ,CAAC;AAED,eAAelB,mBAAmB"}
1
+ {"version":3,"file":"parse-props-to-display.js","names":["React","Fragment","at","isObject","getParsedPropValues","getSanitizedPropValues","BOLD_TAG","BLANK_SPACE_UNICODE_STRING","parsePropsToDisplay","props","propsToDisplay","filter","Boolean","map","bold","propertiesToDisplay","prefix","suffix","shouldStrip","enableLink","currentIndex","Wrapper","parsedPropValues","sanitizedPropValues","length","stringEndBlank","createElement"],"sources":["../../src/helpers/parse-props-to-display.js"],"sourcesContent":["import React, { Fragment } from 'react';\nimport at from 'lodash.at';\nimport isObject from './is-object';\nimport getParsedPropValues from './get-parsed-prop-values';\nimport getSanitizedPropValues from './get-sanitized-prop-values';\nimport { BOLD_TAG, BLANK_SPACE_UNICODE_STRING } from '../constants';\n\n// TODO this helper should be removed if database is wiped clean and all elements change to new props struc\nconst parsePropsToDisplay = (props = {}, propsToDisplay = []) => {\n if (!isObject(propsToDisplay[0])) return at(props, propsToDisplay).filter(Boolean);\n\n return propsToDisplay.map(\n ({ bold, propertiesToDisplay, prefix, suffix, shouldStrip, enableLink }, currentIndex) => {\n const Wrapper = bold ? BOLD_TAG : Fragment;\n\n const parsedPropValues = getParsedPropValues({\n propertiesToDisplay,\n props,\n enableLink,\n shouldStrip\n });\n\n const sanitizedPropValues = getSanitizedPropValues(parsedPropValues);\n if (!sanitizedPropValues || !sanitizedPropValues.length) return null;\n const stringEndBlank =\n currentIndex + 1 === propsToDisplay.length ? '' : BLANK_SPACE_UNICODE_STRING;\n\n return (\n <Wrapper>\n {prefix} {sanitizedPropValues} {suffix}\n {stringEndBlank}\n </Wrapper>\n );\n }\n );\n};\n\nexport default parsePropsToDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,QAAQ,EAAEC,0BAA0B,QAAQ,cAAc;;AAEnE;AACA,MAAMC,mBAAmB,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,cAAc,GAAG,EAAE,KAAK;EAC/D,IAAI,CAACP,QAAQ,CAACO,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,OAAOR,EAAE,CAACO,KAAK,EAAEC,cAAc,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC;EAElF,OAAOF,cAAc,CAACG,GAAG,CACvB,CAAC;IAAEC,IAAI;IAAEC,mBAAmB;IAAEC,MAAM;IAAEC,MAAM;IAAEC,WAAW;IAAEC;EAAW,CAAC,EAAEC,YAAY,KAAK;IACxF,MAAMC,OAAO,GAAGP,IAAI,GAAGR,QAAQ,GAAGL,QAAQ;IAE1C,MAAMqB,gBAAgB,GAAGlB,mBAAmB,CAAC;MAC3CW,mBAAmB;MACnBN,KAAK;MACLU,UAAU;MACVD;IACF,CAAC,CAAC;IAEF,MAAMK,mBAAmB,GAAGlB,sBAAsB,CAACiB,gBAAgB,CAAC;IACpE,IAAI,CAACC,mBAAmB,IAAI,CAACA,mBAAmB,CAACC,MAAM,EAAE,OAAO,IAAI;IACpE,MAAMC,cAAc,GAClBL,YAAY,GAAG,CAAC,KAAKV,cAAc,CAACc,MAAM,GAAG,EAAE,GAAGjB,0BAA0B;IAE9E,oBACEP,KAAA,CAAA0B,aAAA,CAACL,OAAO,QACLL,MAAM,EAAC,GAAC,EAACO,mBAAmB,EAAC,GAAC,EAACN,MAAM,EACrCQ,cACM,CAAC;EAEd,CACF,CAAC;AACH,CAAC;AAED,eAAejB,mBAAmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/react-page-builder",
3
- "version": "0.130.0-admin-updates.9",
3
+ "version": "0.130.0-alpha.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.130.0-admin-updates.0",
31
- "@blaze-cms/core-errors": "0.130.0-admin-updates.0",
32
- "@blaze-cms/core-errors-ui": "0.130.0-admin-updates.0",
30
+ "@blaze-cms/core-auth-ui": "0.130.0-alpha.0",
31
+ "@blaze-cms/core-errors": "^0.127.0",
32
+ "@blaze-cms/core-errors-ui": "^0.128.1",
33
33
  "@blaze-cms/image-cdn-react": "0.3.0-alpha.5",
34
- "@blaze-cms/nextjs-components": "0.130.0-admin-updates.0",
35
- "@blaze-cms/plugin-search-ui": "0.130.0-admin-updates.9",
36
- "@blaze-cms/setup-ui": "0.130.0-admin-updates.0",
37
- "@blaze-cms/utils": "0.130.0-admin-updates.0",
38
- "@blaze-cms/utils-handlebars": "0.130.0-admin-updates.0",
34
+ "@blaze-cms/nextjs-components": "^0.128.1",
35
+ "@blaze-cms/plugin-search-ui": "0.130.0-alpha.0",
36
+ "@blaze-cms/setup-ui": "^0.128.1",
37
+ "@blaze-cms/utils": "0.130.0-alpha.0",
38
+ "@blaze-cms/utils-handlebars": "^0.128.1",
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": "462e28db91657c82f0e901a77dd82d9901d2a160"
92
+ "gitHead": "62334acab51d27cf32429e515a33604ae259a6c8"
93
93
  }
@@ -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: updatedItemsToDisplay,
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 = updatedItemsToDisplay.map(({ imageId }) => imageId).filter(Boolean);
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 (hasNoFiltersOrItemsToDisplay) return null;
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, updatedItemsToDisplay);
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, updatedItemsToDisplay);
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, disableWrapper, ...otherProps }) => {
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), processedValue, linkToPublishedContent, modifier];
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, processDataSummaryValue } from '../../../helpers';
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 processedValue = processDataSummaryValue(objPropValue, options);
30
+ const link = getLink(enableLink, key, props, objPropValue);
31
31
 
32
- const link = getLink(enableLink, key, props, processedValue);
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) {
@@ -14,6 +14,7 @@ const Layout = ({
14
14
  modifier,
15
15
  backgroundImage,
16
16
  tagType,
17
+ dataNoSnippet,
17
18
  ...otherProps
18
19
  }) => {
19
20
  const {
@@ -28,12 +29,16 @@ const Layout = ({
28
29
 
29
30
  if (type === COLUMN && !hasChildren(children)) return null;
30
31
 
32
+ const otherWrapperProps = {};
33
+ if (dataNoSnippet) otherWrapperProps['data-nosnippet'] = true;
34
+
31
35
  return (
32
36
  <Wrapper
33
37
  tagType={tagType}
34
38
  className={type}
35
39
  modifiers={`${classModifiers}${additionalRowModifier}`}
36
- style={style}>
40
+ style={style}
41
+ {...otherWrapperProps}>
37
42
  {title && <h2 className="heading heading--section">{title}</h2>}
38
43
  {renderChildren(children, otherProps)}
39
44
  </Wrapper>
@@ -48,6 +53,7 @@ Layout.propTypes = {
48
53
  modifier: PropTypes.string,
49
54
  backgroundImage: PropTypes.string,
50
55
  tagType: PropTypes.string,
56
+ dataNoSnippet: PropTypes.bool,
51
57
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
52
58
  };
53
59
 
@@ -57,7 +63,8 @@ Layout.defaultProps = {
57
63
  },
58
64
  backgroundImage: '',
59
65
  modifier: '',
60
- tagType: ''
66
+ tagType: '',
67
+ dataNoSnippet: false
61
68
  };
62
69
 
63
70
  export default Layout;
@@ -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(collapsedSearch);
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 (!collapsedSearch) return;
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;
@@ -128,8 +128,7 @@ const SearchFilterContainer = ({
128
128
  setKey(`filter-${name}:${Date.now()}`); // remove after range component update
129
129
  });
130
130
  }
131
- const hashBit = asPath.split('#')[1];
132
- const newUrl = buildNewQuery(url, currentUrl, newQuery, sortValues, hashBit);
131
+ const newUrl = buildNewQuery(url, currentUrl, newQuery, sortValues);
133
132
  scrollToFirstList();
134
133
  setUrlPath(newUrl);
135
134
  return router.push('/Resolver', newUrl, { shallow: !hasUrl, scroll: false });
@@ -1,7 +1,6 @@
1
- const buildNewQuery = (url, currentUrl, queryParams, sortValues, hashBit) => {
1
+ const buildNewQuery = (url, currentUrl, queryParams, sortValues) => {
2
2
  const newUrl = url ? `${url}?${queryParams}` : `${currentUrl}?${queryParams}`;
3
- const withSortValues = sortValues ? `${newUrl}&${sortValues}` : newUrl;
4
- return hashBit ? `${withSortValues}#${hashBit}` : withSortValues;
3
+ return sortValues ? `${newUrl}&${sortValues}` : newUrl;
5
4
  };
6
5
 
7
6
  export default buildNewQuery;
@@ -5,10 +5,6 @@ import updateSort from './update-sort';
5
5
  const handleSortUpdate = (router, value, query, url, selectLabel) => {
6
6
  const queryWithoutSort = {};
7
7
  const routerOptions = { shallow: true, scroll: false };
8
-
9
- const { asPath } = router;
10
- const hashBit = asPath.split('#')[1];
11
- const parsedHash = hashBit ? `#${hashBit}` : '';
12
8
  Object.keys(query).forEach(key => {
13
9
  if (key.indexOf(PAGINATION_QUERY) !== -1) return;
14
10
  if (key !== SORTBY && key !== SORT) queryWithoutSort[key] = query[key];
@@ -17,10 +13,10 @@ const handleSortUpdate = (router, value, query, url, selectLabel) => {
17
13
  const stringifiedQuery = stringify(queryWithoutSort);
18
14
 
19
15
  return stringifiedQuery
20
- ? router.push(`/Resolver`, `${url}?${stringifiedQuery}${parsedHash}`, routerOptions)
21
- : router.push(`/Resolver`, `${url}${parsedHash}`, routerOptions);
16
+ ? router.push(`/Resolver`, `${url}?${stringifiedQuery}`, routerOptions)
17
+ : router.push(`/Resolver`, url, routerOptions);
22
18
  }
23
- const updatedSortUrl = updateSort(value, queryWithoutSort, url, parsedHash);
19
+ const updatedSortUrl = updateSort(value, queryWithoutSort, url);
24
20
  return router.push('/Resolver', updatedSortUrl, routerOptions);
25
21
  };
26
22
 
@@ -1,10 +1,10 @@
1
1
  import { stringify } from 'query-string';
2
2
 
3
- const updateSort = (value, query, url, hashBit = '') => {
3
+ const updateSort = (value, query, url) => {
4
4
  const [newSortBy, newSort] = value.split(':');
5
5
  const updatedQuery = { ...query, sortby: newSortBy, sort: newSort };
6
6
  const parsedQuery = stringify(updatedQuery);
7
- return `${url}?${parsedQuery}${hashBit}`;
7
+ return `${url}?${parsedQuery}`;
8
8
  };
9
9
 
10
10
  export default updateSort;
@@ -1,7 +1,6 @@
1
1
  import flatten from 'lodash.flatten';
2
2
  import isFilterEntitysId from './is-filter-entitys-id';
3
3
  import getFilterProps from './get-filter-props';
4
- import { ID } from '../constants';
5
4
 
6
5
  const getRelationData = (entityData, relationName, currentRelationNames) => {
7
6
  if (!entityData) return null;
@@ -50,9 +49,8 @@ const buildInheritedFilters = (
50
49
  shouldIgnoreFilter
51
50
  } = getFilterProps(filter, currentSchema, filterEntitySchema);
52
51
 
53
- if (filterName === ID) return;
54
-
55
52
  const relationData = getRelationData(entityData, relationName, relationForeignKeys);
53
+
56
54
  if (
57
55
  (currentEntityId === entityName && isFilterEntitysId(filterName, currentEntityId)) ||
58
56
  shouldIgnoreFilter
@@ -44,21 +44,19 @@ const buildPropsQuery = (entitySchema, extraProps = [], cardOptions = null, link
44
44
  const buildComplexProps = (
45
45
  shouldAddCategoryProps,
46
46
  props,
47
- { relations = [], dynamicProperties = {}, properties = {} },
47
+ { relations = [], dynamicProperties = {} },
48
48
  linkProps
49
49
  ) =>
50
50
  Object.keys(props).map(base => {
51
51
  const nestedProps = props[base];
52
52
  const hasLink = !!linkProps.find(linkProp => linkProp.includes(base));
53
- const matchingProperty = !!properties[base];
54
53
  const matchingRelation = relations.find(({ localField }) => localField === base);
55
54
  const matchingDynamicProp = Object.keys(dynamicProperties).find(
56
55
  dynamicKey => dynamicKey === base
57
56
  );
58
57
 
59
58
  if (matchingRelation && !nestedProps.includes('id')) nestedProps.push('id');
60
- if (hasLink && (!!matchingProperty || !!matchingRelation || !!matchingDynamicProp))
61
- nestedProps.push('url');
59
+ if (hasLink && (!!matchingRelation || !!matchingDynamicProp)) nestedProps.push('url');
62
60
  const jointNestedProps = nestedProps.join(',');
63
61
  if (base === 'category' && shouldAddCategoryProps)
64
62
  return `${base}{${jointNestedProps}, ${categoryProps}}`;
@@ -31,9 +31,8 @@ const buildSetFilters = ({
31
31
  }
32
32
 
33
33
  const shouldApplyFilterValues = filterBy.length && filterByProperty.length;
34
- if (!shouldApplyFilterValues) return { checkboxFilters, listFilterValues: {} };
34
+ const listFilterValues = shouldApplyFilterValues ? getFilterValues(filterBy) : {};
35
35
 
36
- const listFilterValues = getFilterValues(filterBy);
37
36
  return { checkboxFilters, listFilterValues };
38
37
  };
39
38
 
@@ -2,11 +2,10 @@ import isFilterEntitysId from './is-filter-entitys-id';
2
2
  import getFilterProps from './get-filter-props';
3
3
  import { ID } from '../constants';
4
4
 
5
- const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema = {}) => {
5
+ const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema) => {
6
6
  if (!currentSchema || !inheritedFilters.length) return ID;
7
7
 
8
- const { identifier: currentEntityId, properties } = currentSchema;
9
- const { identifier: filterEntityId } = filterEntitySchema;
8
+ const { identifier: currentEntityId } = currentSchema;
10
9
 
11
10
  return inheritedFilters.reduce((acc, filter) => {
12
11
  const {
@@ -18,19 +17,12 @@ const getQueryProps = (inheritedFilters, currentSchema, filterEntitySchema = {})
18
17
  relationForeignKeys,
19
18
  shouldIgnoreFilter
20
19
  } = getFilterProps(filter, currentSchema, filterEntitySchema);
20
+
21
21
  if (shouldIgnoreFilter) return acc;
22
22
  if (relationForeignKeys && relationForeignKeys.length) {
23
23
  return `${acc} ${relationForeignKeys.join(' ')}`;
24
24
  }
25
- if (filterName === ID) {
26
- const queryValue = Object.keys(properties).find(
27
- propKey =>
28
- properties[propKey] &&
29
- properties[propKey].relation &&
30
- properties[propKey].relation.entityIdentifier === filterEntityId
31
- );
32
- if (queryValue) return `${acc} ${queryValue} `;
33
- }
25
+
34
26
  const queryProp = relationEntityName ? `${relationName} { ${relationProp} }` : filterName;
35
27
  const queryPropFinalValue =
36
28
  isEntityItself && isFilterEntitysId(filterName, currentEntityId) ? ID : queryProp;
@@ -6,16 +6,13 @@ const getWrappedValueWithLink = (value, link, keyPrefix = '') => {
6
6
  const arrayResults = value.map((arrValue, index) => {
7
7
  const { keyField, url } = arrValue;
8
8
  const keyValue = arrValue[keyField];
9
-
10
9
  const isLastItem = index === value.length - 1;
11
- const keyFieldValue = isLastItem ? keyValue : <>{keyValue}, </>;
10
+ const keyFieldValue = isLastItem ? keyValue : keyValue.concat(',');
12
11
 
13
12
  return url ? (
14
- <BlazeLink key={[keyPrefix, index].join('-')} href={url}>
15
- {<>{keyFieldValue} </>}
16
- </BlazeLink>
13
+ <BlazeLink key={[keyPrefix, index].join('-')} href={url}>{`${keyFieldValue} `}</BlazeLink>
17
14
  ) : (
18
- <>{keyFieldValue} </>
15
+ `${keyFieldValue} `
19
16
  );
20
17
  });
21
18
 
@@ -51,4 +51,3 @@ export { default as getParsedPropValues } from './get-parsed-prop-values';
51
51
  export { default as getSanitizedPropValues } from './get-sanitized-prop-values';
52
52
  export { default as appendImages } from './append-images';
53
53
  export { default as parseTextBlock } from './parse-TextBlock';
54
- export { default as processDataSummaryValue } from './process-data-summary-value';
@@ -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;
@@ -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]);