@blaze-cms/plugin-google-maps-fe 0.124.0-alpha.1 → 0.124.0-alpha.4

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 (50) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
  3. package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  4. package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
  5. package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  6. package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  7. package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  8. package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
  9. package/lib/GoogleMaps/helpers/build-shapes-configs.js +11 -3
  10. package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  11. package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  12. package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  13. package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
  14. package/lib/GoogleMaps/helpers/index.js.map +1 -1
  15. package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
  16. package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
  17. package/lib/GoogleMaps/hooks/index.js.map +1 -1
  18. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  19. package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
  20. package/lib/GoogleMaps/index.js.map +1 -1
  21. package/lib/GoogleMaps/queries.js +4 -4
  22. package/lib/GoogleMaps/queries.js.map +1 -1
  23. package/lib/constants.js.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
  26. package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  27. package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
  28. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  29. package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  30. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  31. package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
  32. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +8 -4
  33. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  34. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  35. package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  36. package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
  37. package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
  38. package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
  39. package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
  40. package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
  41. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  42. package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
  43. package/lib-es/GoogleMaps/index.js.map +1 -1
  44. package/lib-es/GoogleMaps/queries.js +5 -0
  45. package/lib-es/GoogleMaps/queries.js.map +1 -1
  46. package/lib-es/constants.js.map +1 -1
  47. package/lib-es/index.js.map +1 -1
  48. package/package.json +4 -4
  49. package/src/GoogleMaps/helpers/build-shapes-configs.js +8 -4
  50. package/src/GoogleMaps/queries.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-google-maps-fe",
3
- "version": "0.124.0-alpha.1",
3
+ "version": "0.124.0-alpha.4",
4
4
  "description": "Blaze Google maps plugin fe",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/nextjs-components": "^0.124.0-alpha.1",
31
- "@blaze-cms/react-page-builder": "^0.124.0-alpha.1",
30
+ "@blaze-cms/nextjs-components": "^0.124.0-alpha.2",
31
+ "@blaze-cms/react-page-builder": "^0.124.0-alpha.4",
32
32
  "@blaze-cms/setup-ui": "^0.92.0",
33
33
  "core-js": "^3.2.1",
34
34
  "lodash.isnumber": "^3.0.3",
@@ -44,5 +44,5 @@
44
44
  "lib/*",
45
45
  "lib-es/*"
46
46
  ],
47
- "gitHead": "797f21d4f5d2291343e2bdb017039cfd3b6290e0"
47
+ "gitHead": "b64d7bf5579ccdf2cdbd4930ed07f27f8c8658a1"
48
48
  }
@@ -39,7 +39,7 @@ const buildFilters = filters => {
39
39
  const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {
40
40
  const { displayItems = [], filterBy } = shape;
41
41
  const { latProp, lonProp, entity } = entityGroup;
42
- const { actions } = entityData;
42
+ const { actions, relations } = entityData;
43
43
  const action = actions ? actions.getAllPublished || actions.getAll : '';
44
44
 
45
45
  const dataSummaryProps = dataSummaries
@@ -59,7 +59,10 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
59
59
  let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';
60
60
  propsQuery = getUpdatedPropsQuery(propsQuery, entityData);
61
61
  if (latProp && lonProp) {
62
- propsQuery = `${propsQuery} ${formatProp(latProp)} ${formatProp(lonProp)}`;
62
+ propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(
63
+ lonProp,
64
+ relations
65
+ )}`;
63
66
  }
64
67
  if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;
65
68
 
@@ -73,11 +76,12 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
73
76
  };
74
77
  };
75
78
 
76
- const formatProp = prop => {
79
+ const formatProp = (prop, relations = []) => {
77
80
  if (!prop.includes('.')) return prop;
78
81
 
79
82
  const [mainProp, nestedProp] = prop.split('.');
80
- return `${mainProp}{${nestedProp}}`;
83
+ const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';
84
+ return `${mainProp}{${idProp}${nestedProp}}`;
81
85
  };
82
86
 
83
87
  const buildShapesConfig = (schemas, entityGroups, parent) => {
@@ -3,10 +3,12 @@ import { gql } from '@apollo/client';
3
3
  const GET_ENTITY_SCHEMAS = gql`
4
4
  query getEntitySchemas($identifier: String) {
5
5
  getEntitySchemas(identifier: $identifier) {
6
+ id
6
7
  identifier
7
8
  actions
8
9
  dynamicProperties
9
10
  properties
11
+ relations
10
12
  }
11
13
  }
12
14
  `;
@@ -24,12 +26,14 @@ const generateWhereQuery = queryString => gql`
24
26
  `;
25
27
  const generateQueryString = (action, query, props) => `
26
28
  ${query}: ${action}(where: $where){
29
+ id
27
30
  ${props}
28
31
  }
29
32
  `;
30
33
 
31
34
  const generateIdsQuery = (query, props, action, ids) => `
32
35
  ${query}: ${action}(where: { id: { _in: ${JSON.stringify(ids)} } }){
36
+ id
33
37
  ${props}
34
38
  }
35
39
  `;
@@ -38,6 +42,7 @@ const generateFiltersQuery = (query, props, rawQUery, filterQueryKey) => `
38
42
  ${query}: searchPublishedContent(rawQueryStringified: ${JSON.stringify(rawQUery)}){
39
43
  results {
40
44
  ...on ${filterQueryKey} {
45
+ id
41
46
  ${props}
42
47
  }
43
48
  }