@eeacms/volto-eea-map 4.0.0 → 4.1.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 CHANGED
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- ### [4.0.0](https://github.com/eea/volto-eea-map/compare/3.3.1...4.0.0) - 22 April 2024
7
+ ### [4.1.0](https://github.com/eea/volto-eea-map/compare/4.0.0...4.1.0) - 7 June 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Update package.json [ichim-david - [`52e141a`](https://github.com/eea/volto-eea-map/commit/52e141a3fab57904c4acb5e7e412c079f78fb0e0)]
12
+ - bump cypress version to 13.1.0 which is what is used by volto 17 [David Ichim - [`01abef9`](https://github.com/eea/volto-eea-map/commit/01abef9089385ee0b672e09aa37c1bf89d9f21b6)]
13
+ ## [4.0.0](https://github.com/eea/volto-eea-map/compare/3.3.1...4.0.0) - 22 April 2024
8
14
 
9
15
  #### :rocket: New Features
10
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "@eeacms/volto-eea-map: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -34,7 +34,7 @@
34
34
  "@cypress/code-coverage": "^3.10.0",
35
35
  "@plone/scripts": "*",
36
36
  "babel-plugin-transform-class-properties": "^6.24.1",
37
- "cypress": "10.3.1",
37
+ "cypress": "13.1.0",
38
38
  "cypress-fail-fast": "^5.0.1",
39
39
  "dotenv": "^16.3.2",
40
40
  "husky": "^8.0.3",
@@ -2,7 +2,6 @@
2
2
  import React from 'react';
3
3
  import { withDeviceSize } from '../hocs';
4
4
  import { loadModules } from 'esri-loader';
5
- import { formatQuery } from 'react-querybuilder';
6
5
 
7
6
  const MODULES = [
8
7
  'esri/Map',
@@ -45,12 +44,19 @@ const Webmap = (props) => {
45
44
 
46
45
  const mapRef = React.useRef();
47
46
  const [modules, setModules] = React.useState({});
47
+ const [reactQueryBuilder, setReactQueryBuilder] = React.useState(null);
48
48
 
49
49
  const modules_loaded = React.useRef(false);
50
50
 
51
51
  React.useEffect(() => {
52
52
  if (!modules_loaded.current) {
53
53
  modules_loaded.current = true;
54
+ import(
55
+ /* webpackChunkName: "react-querybuilder" */ 'react-querybuilder'
56
+ ).then((module) => {
57
+ setReactQueryBuilder(module);
58
+ });
59
+
54
60
  loadModules(MODULES, {
55
61
  css: true,
56
62
  }).then((modules) => {
@@ -168,7 +174,7 @@ const Webmap = (props) => {
168
174
  : layer?.maxScale,
169
175
  opacity: opacity ? parseFloat(opacity) : 1,
170
176
  definitionExpression: query
171
- ? formatQuery(query, 'sql')
177
+ ? reactQueryBuilder.formatQuery(query, 'sql')
172
178
  : '',
173
179
  },
174
180
  ],
@@ -179,7 +185,7 @@ const Webmap = (props) => {
179
185
  layerId: layer.id,
180
186
  url,
181
187
  definitionExpression: query
182
- ? formatQuery(query, 'sql')
188
+ ? reactQueryBuilder.formatQuery(query, 'sql')
183
189
  : '',
184
190
  minScale: minScaleOverride
185
191
  ? minScaleOverride
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Icon } from '@plone/volto/components';
3
3
  import { Input, Select, Button, Grid, Checkbox } from 'semantic-ui-react';
4
- import { QueryBuilder } from 'react-querybuilder';
5
- import 'react-querybuilder/dist/query-builder.css';
6
4
 
7
5
  import { flattenToAppURL } from '@plone/volto/helpers';
8
6
  import RichTextWidget from '@plone/volto-slate/widgets/RichTextWidget';
@@ -19,6 +17,12 @@ import resetSVG from '@plone/volto/icons/reset.svg';
19
17
 
20
18
  import { fetchArcGISData } from '../../utils';
21
19
 
20
+ import loadable from '@loadable/component';
21
+
22
+ const QueryBuilder = loadable(() => import('react-querybuilder'), {
23
+ resolveComponent: (components) => components.QueryBuilder,
24
+ });
25
+
22
26
  const LayerSelectWidget = (props) => {
23
27
  const { onChange, id, data_query } = props;
24
28
 
@@ -83,6 +87,9 @@ const LayerSelectWidget = (props) => {
83
87
  };
84
88
 
85
89
  React.useEffect(() => {
90
+ import(
91
+ /* webpackChunkName: "react-querybuilder-css" */ 'react-querybuilder/dist/query-builder.css'
92
+ );
86
93
  props.getContent('', null, id);
87
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
95
  }, []);