@eeacms/volto-eea-map 0.1.29 → 0.1.31
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/.coverage.babel.config.js +1 -1
- package/.project.eslintrc.js +7 -6
- package/CHANGELOG.md +14 -2
- package/jest-addon.config.js +2 -4
- package/package.json +5 -5
- package/src/components/Blocks/EmbedEEAMap/Edit.jsx +17 -2
- package/src/components/Blocks/EmbedEEAMap/View.jsx +15 -2
- package/src/components/ExtraViews.jsx +1 -1
- package/src/components/widgets/LayerSelectWidget.jsx +1 -1
- package/src/components/widgets/LegendWidget.jsx +15 -16
|
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
|
|
|
2
2
|
|
|
3
3
|
function applyDefault(api) {
|
|
4
4
|
const voltoBabel = defaultBabel(api);
|
|
5
|
-
voltoBabel.plugins.push('
|
|
5
|
+
voltoBabel.plugins.push('istanbul');
|
|
6
6
|
return voltoBabel;
|
|
7
7
|
}
|
|
8
8
|
|
package/.project.eslintrc.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
const projectRootPath = fs.
|
|
4
|
+
const projectRootPath = fs.existsSync('./project')
|
|
5
|
+
? fs.realpathSync('./project')
|
|
6
|
+
: fs.realpathSync('./../../../');
|
|
5
7
|
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
6
|
-
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json'))
|
|
8
|
+
const jsConfig = require(path.join(projectRootPath, 'jsconfig.json'))
|
|
9
|
+
.compilerOptions;
|
|
7
10
|
|
|
8
11
|
const pathsConfig = jsConfig.paths;
|
|
9
12
|
|
|
10
13
|
let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
|
|
11
14
|
|
|
12
|
-
Object.keys(pathsConfig).forEach(pkg => {
|
|
15
|
+
Object.keys(pathsConfig).forEach((pkg) => {
|
|
13
16
|
if (pkg === '@plone/volto') {
|
|
14
17
|
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
|
|
15
18
|
}
|
|
@@ -18,12 +21,11 @@ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
|
18
21
|
const reg = new AddonConfigurationRegistry(projectRootPath);
|
|
19
22
|
|
|
20
23
|
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
21
|
-
const addonAliases = Object.keys(reg.packages).map(o => [
|
|
24
|
+
const addonAliases = Object.keys(reg.packages).map((o) => [
|
|
22
25
|
o,
|
|
23
26
|
reg.packages[o].modulePath,
|
|
24
27
|
]);
|
|
25
28
|
|
|
26
|
-
|
|
27
29
|
module.exports = {
|
|
28
30
|
extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
|
|
29
31
|
settings: {
|
|
@@ -43,4 +45,3 @@ module.exports = {
|
|
|
43
45
|
},
|
|
44
46
|
},
|
|
45
47
|
};
|
|
46
|
-
|
package/CHANGELOG.md
CHANGED
|
@@ -4,11 +4,23 @@ 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
|
-
### [0.1.
|
|
7
|
+
### [0.1.31](https://github.com/eea/volto-eea-map/compare/0.1.30...0.1.31) - 11 November 2022
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- fix project rootpath [andreiggr - [`ad4801d`](https://github.com/eea/volto-eea-map/commit/ad4801d8b17a68bf227f2a75f2d3fdd9a3491c13)]
|
|
12
|
+
- blocks styles for embed map block [andreiggr - [`a6263d5`](https://github.com/eea/volto-eea-map/commit/a6263d54374719914e6f52ee8e3ae7e3cc9450f5)]
|
|
13
|
+
- show first three visible layers in legend [andreiggr - [`1d434e3`](https://github.com/eea/volto-eea-map/commit/1d434e39ca0a5393baebe194948fd1a2a072d73d)]
|
|
14
|
+
### [0.1.30](https://github.com/eea/volto-eea-map/compare/0.1.29...0.1.30) - 4 November 2022
|
|
8
15
|
|
|
9
16
|
#### :hammer_and_wrench: Others
|
|
10
17
|
|
|
11
|
-
-
|
|
18
|
+
- jest transforms [Andrei Grigore - [`432aeee`](https://github.com/eea/volto-eea-map/commit/432aeeec40be5ecbb04c119df347be5d03950426)]
|
|
19
|
+
- cy10/razzle4 updates [Andrei Grigore - [`419fe6b`](https://github.com/eea/volto-eea-map/commit/419fe6b8a7cfbc7561ba2585a2cc4f5a7583fac5)]
|
|
20
|
+
- config new slate route [andreiggr - [`5343926`](https://github.com/eea/volto-eea-map/commit/5343926755aa0ace5ee4741e00df3aa4679e8bd7)]
|
|
21
|
+
- use alpha in cy [andreiggr - [`775a92c`](https://github.com/eea/volto-eea-map/commit/775a92c959013a08c9a5c9c121df798a289088a9)]
|
|
22
|
+
### [0.1.29](https://github.com/eea/volto-eea-map/compare/0.1.28...0.1.29) - 19 October 2022
|
|
23
|
+
|
|
12
24
|
### [0.1.28](https://github.com/eea/volto-eea-map/compare/0.1.27...0.1.28) - 7 October 2022
|
|
13
25
|
|
|
14
26
|
#### :hammer_and_wrench: Others
|
package/jest-addon.config.js
CHANGED
|
@@ -11,16 +11,14 @@ module.exports = {
|
|
|
11
11
|
'@package/(.*)$': '<rootDir>/src/$1',
|
|
12
12
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
13
13
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
|
|
14
|
-
'volto-slate
|
|
14
|
+
'@plone/volto-slate':
|
|
15
|
+
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
|
|
15
16
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
16
17
|
'load-volto-addons':
|
|
17
18
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
|
18
19
|
},
|
|
19
20
|
transform: {
|
|
20
21
|
'^.+\\.js(x)?$': 'babel-jest',
|
|
21
|
-
'^.+\\.css$': 'jest-css-modules',
|
|
22
|
-
'^.+\\.less$': 'jest-css-modules',
|
|
23
|
-
'^.+\\.scss$': 'jest-css-modules',
|
|
24
22
|
'^.+\\.(png)$': 'jest-file',
|
|
25
23
|
'^.+\\.(jpg)$': 'jest-file',
|
|
26
24
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
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",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"addons": [
|
|
20
20
|
"@eeacms/volto-embed",
|
|
21
|
-
"volto-
|
|
21
|
+
"@eeacms/volto-block-style"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eeacms/volto-
|
|
24
|
+
"@eeacms/volto-block-style": "4.1.0",
|
|
25
|
+
"@eeacms/volto-embed": "5.0.0",
|
|
25
26
|
"@plone/scripts": "*",
|
|
26
27
|
"esri-loader": "3.6.0",
|
|
27
28
|
"lodash": "4.17.21",
|
|
28
|
-
"react-querybuilder": "4.2.3"
|
|
29
|
-
"volto-slate": "*"
|
|
29
|
+
"react-querybuilder": "4.2.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@cypress/code-coverage": "^3.9.5",
|
|
@@ -4,6 +4,8 @@ import { SidebarPortal } from '@plone/volto/components';
|
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import { compose } from 'redux';
|
|
6
6
|
|
|
7
|
+
import { BlockStyleWrapperEdit } from '@eeacms/volto-block-style/BlockStyleWrapper';
|
|
8
|
+
import cx from 'classnames';
|
|
7
9
|
import { getContent } from '@plone/volto/actions';
|
|
8
10
|
|
|
9
11
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
@@ -58,7 +60,20 @@ const Edit = (props) => {
|
|
|
58
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
61
|
}, [props.block, props.data_query, data.data_query_params]);
|
|
60
62
|
return (
|
|
61
|
-
<
|
|
63
|
+
<BlockStyleWrapperEdit
|
|
64
|
+
{...props}
|
|
65
|
+
role="presentation"
|
|
66
|
+
data={{
|
|
67
|
+
...(props.data || {}),
|
|
68
|
+
styles: {
|
|
69
|
+
...(props.data?.styles || {}),
|
|
70
|
+
customClass: cx(
|
|
71
|
+
props.data?.styles?.customClass || '',
|
|
72
|
+
'custom-map-class',
|
|
73
|
+
),
|
|
74
|
+
},
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
62
77
|
<View data={data} id={id} isEdit={true} />
|
|
63
78
|
<SidebarPortal selected={selected}>
|
|
64
79
|
<BlockDataForm
|
|
@@ -74,7 +89,7 @@ const Edit = (props) => {
|
|
|
74
89
|
formData={data}
|
|
75
90
|
/>
|
|
76
91
|
</SidebarPortal>
|
|
77
|
-
</
|
|
92
|
+
</BlockStyleWrapperEdit>
|
|
78
93
|
);
|
|
79
94
|
};
|
|
80
95
|
|
|
@@ -9,6 +9,9 @@ import { getContent } from '@plone/volto/actions';
|
|
|
9
9
|
import Webmap from '../../Webmap';
|
|
10
10
|
import ExtraViews from '../../ExtraViews';
|
|
11
11
|
|
|
12
|
+
import { StyleWrapperView } from '@eeacms/volto-block-style/StyleWrapper';
|
|
13
|
+
import cx from 'classnames';
|
|
14
|
+
|
|
12
15
|
const View = (props) => {
|
|
13
16
|
const { data, id, isEdit, map_visualization = '', data_provenance = {} } =
|
|
14
17
|
props || {};
|
|
@@ -74,7 +77,17 @@ const View = (props) => {
|
|
|
74
77
|
}, [map_visualization, props.data, props.data_query, isEdit, enable_queries]);
|
|
75
78
|
|
|
76
79
|
return (
|
|
77
|
-
<
|
|
80
|
+
<StyleWrapperView
|
|
81
|
+
{...props}
|
|
82
|
+
data={data}
|
|
83
|
+
styleData={{
|
|
84
|
+
...data.styles,
|
|
85
|
+
customClass: cx(
|
|
86
|
+
data.styles?.customClass || '',
|
|
87
|
+
'columns-tabs-container',
|
|
88
|
+
),
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
78
91
|
<PrivacyProtection data={data} height={height} {...props}>
|
|
79
92
|
{mapData && (
|
|
80
93
|
<div>
|
|
@@ -92,7 +105,7 @@ const View = (props) => {
|
|
|
92
105
|
<p>No map view to show. Set visualization in block configuration.</p>
|
|
93
106
|
)}
|
|
94
107
|
</PrivacyProtection>
|
|
95
|
-
</
|
|
108
|
+
</StyleWrapperView>
|
|
96
109
|
);
|
|
97
110
|
};
|
|
98
111
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { UniversalLink, Icon } from '@plone/volto/components';
|
|
3
3
|
|
|
4
4
|
import LegendWidget from './widgets/LegendWidget';
|
|
5
|
-
import { serializeNodes } from 'volto-slate/editor/render';
|
|
5
|
+
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
6
6
|
|
|
7
7
|
import rightKeySVG from '@plone/volto/icons/right-key.svg';
|
|
8
8
|
import downKeySVG from '@plone/volto/icons/down-key.svg';
|
|
@@ -4,7 +4,7 @@ import { Input, Select, Button, Grid, Checkbox } from 'semantic-ui-react';
|
|
|
4
4
|
import { QueryBuilder } from 'react-querybuilder';
|
|
5
5
|
import 'react-querybuilder/dist/query-builder.css';
|
|
6
6
|
|
|
7
|
-
import RichTextWidget from 'volto-slate/widgets/RichTextWidget';
|
|
7
|
+
import RichTextWidget from '@plone/volto-slate/widgets/RichTextWidget';
|
|
8
8
|
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
10
|
import { compose } from 'redux';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Button, Grid } from 'semantic-ui-react';
|
|
3
3
|
import { fetchArcGISData, setLegendColumns } from '../../utils';
|
|
4
4
|
import { Icon } from '@plone/volto/components';
|
|
5
|
-
import { serializeNodes } from 'volto-slate/editor/render';
|
|
5
|
+
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
6
6
|
|
|
7
7
|
import rightKeySVG from '@plone/volto/icons/right-key.svg';
|
|
8
8
|
import downKeySVG from '@plone/volto/icons/down-key.svg';
|
|
@@ -99,20 +99,19 @@ const LegendWidget = (props) => {
|
|
|
99
99
|
const [expand, setExpand] = React.useState(true);
|
|
100
100
|
|
|
101
101
|
const { layers = {} } = data;
|
|
102
|
-
const map_layers =
|
|
103
|
-
layers &&
|
|
104
|
-
layers.map_layers &&
|
|
105
|
-
layers.map_layers.length > 0 &&
|
|
106
|
-
layers.map_layers.length > 3
|
|
107
|
-
? layers?.map_layers.slice(0, 3)
|
|
108
|
-
: layers?.map_layers;
|
|
109
102
|
|
|
110
|
-
const visible_layers =
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
const visible_layers =
|
|
104
|
+
layers && layers.map_layers && layers.map_layers.length
|
|
105
|
+
? layers.map_layers.filter((l) => !l?.map_layer?.hide)
|
|
106
|
+
: '';
|
|
107
|
+
|
|
108
|
+
const map_layers =
|
|
109
|
+
visible_layers && visible_layers.length > 0 && visible_layers.length > 3
|
|
110
|
+
? visible_layers.slice(0, 3)
|
|
111
|
+
: visible_layers;
|
|
113
112
|
|
|
114
113
|
const legendColumns =
|
|
115
|
-
|
|
114
|
+
map_layers && setLegendColumns(map_layers.length, device);
|
|
116
115
|
return (
|
|
117
116
|
<>
|
|
118
117
|
<div className="legend-container">
|
|
@@ -127,16 +126,16 @@ const LegendWidget = (props) => {
|
|
|
127
126
|
</h3>
|
|
128
127
|
</button>
|
|
129
128
|
<Grid columns={legendColumns}>
|
|
130
|
-
{(!
|
|
129
|
+
{(!map_layers || map_layers.length === 0) && (
|
|
131
130
|
<p>
|
|
132
131
|
No layer found for legend. Please add a map layer from editor.
|
|
133
132
|
</p>
|
|
134
133
|
)}
|
|
135
134
|
{expand && (
|
|
136
135
|
<Grid.Row divided>
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
{map_layers &&
|
|
137
|
+
map_layers.length > 0 &&
|
|
138
|
+
map_layers.map((l, i) => (
|
|
140
139
|
<LayerLegend
|
|
141
140
|
key={i}
|
|
142
141
|
data={l.map_layer}
|