@eeacms/volto-eea-map 2.0.3 → 2.0.6

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.
@@ -0,0 +1,2 @@
1
+ [ -n "$CI" ] && exit 0
2
+ yarn lint-staged
package/CHANGELOG.md CHANGED
@@ -4,15 +4,43 @@ 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
- ### [2.0.3](https://github.com/eea/volto-eea-map/compare/2.0.2...2.0.3) - 16 August 2023
7
+ ### [2.0.6](https://github.com/eea/volto-eea-map/compare/2.0.5...2.0.6) - 29 September 2023
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: lint-staged reorder in package.json [Alin Voinea - [`c72036c`](https://github.com/eea/volto-eea-map/commit/c72036c7d0fe1a578280bf117de0ac7d0c3af51d)]
12
+
13
+ #### :house: Documentation changes
14
+
15
+ - docs: Update README and DEVELOP [Alin Voinea - [`bf38088`](https://github.com/eea/volto-eea-map/commit/bf38088f4e5056afbb3a949a03a73354d411e9de)]
16
+ - docs: Update README and DEVELOP [Alin Voinea - [`605f3a7`](https://github.com/eea/volto-eea-map/commit/605f3a7251ea1a9b8d49529da660a13132a04ff9)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c6d141`](https://github.com/eea/volto-eea-map/commit/4c6d1413b67ffc3fe27a7d09dcc99ef98867cec9)]
21
+ - test: Fix package.json scripts to use makefile [Alin Voinea - [`1cd6751`](https://github.com/eea/volto-eea-map/commit/1cd675118165d8631c41d35c00a8c902c7edd803)]
22
+ - test: Fix eslint and yarn i18n [Alin Voinea - [`0184641`](https://github.com/eea/volto-eea-map/commit/018464116ba5b86b2c1e0a4ebc9b2fd95b772b66)]
23
+ - i18n: Add en [Alin Voinea - [`1d29304`](https://github.com/eea/volto-eea-map/commit/1d293049a21e138fa933cd5ed9a04cceac1a5cff)]
24
+ ### [2.0.5](https://github.com/eea/volto-eea-map/compare/2.0.4...2.0.5) - 23 August 2023
8
25
 
9
26
  #### :bug: Bug Fixes
10
27
 
11
- - fix: fullscreen changes parent height #256519 [andreiggr - [`f4c4183`](https://github.com/eea/volto-eea-map/commit/f4c4183a2f7523dd2fc6957e4cc967d100be2b45)]
28
+ - fix: remove height on PP [Andrei Grigore - [`9039dd5`](https://github.com/eea/volto-eea-map/commit/9039dd5b037c0f3dcdf44bc74f2b58bbb525f0e4)]
12
29
 
13
- #### :house: Internal changes
30
+ ### [2.0.4](https://github.com/eea/volto-eea-map/compare/2.0.3...2.0.4) - 23 August 2023
31
+
32
+ #### :bug: Bug Fixes
33
+
34
+ - fix: remove height on PP [Andrei Grigore - [`ee786bf`](https://github.com/eea/volto-eea-map/commit/ee786bf82281acac87050916992fe4735b2e94a7)]
35
+
36
+ #### :hammer_and_wrench: Others
14
37
 
15
- - chore: add map fullscreen widget #256519 [andreiggr - [`f9a2d63`](https://github.com/eea/volto-eea-map/commit/f9a2d63ddd7e09187874339f90fb18833d3f0230)]
38
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`ce5c385`](https://github.com/eea/volto-eea-map/commit/ce5c3857ebbeac1d3e9e53dbbcd432a796bdee9c)]
39
+ ### [2.0.3](https://github.com/eea/volto-eea-map/compare/2.0.2...2.0.3) - 16 August 2023
40
+
41
+ #### :bug: Bug Fixes
42
+
43
+ - fix: fullscreen changes parent height #256519 [andreiggr - [`f4c4183`](https://github.com/eea/volto-eea-map/commit/f4c4183a2f7523dd2fc6957e4cc967d100be2b45)]
16
44
 
17
45
  ### [2.0.2](https://github.com/eea/volto-eea-map/compare/2.0.1...2.0.2) - 14 August 2023
18
46
 
@@ -48,11 +76,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
48
76
  #### :hammer_and_wrench: Others
49
77
 
50
78
  - Release 2.0.0 [Alin Voinea - [`7be280d`](https://github.com/eea/volto-eea-map/commit/7be280d4809186e663f422687aca3c33dd732904)]
79
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`ba6ed22`](https://github.com/eea/volto-eea-map/commit/ba6ed22118406db979457384d4739cced2096137)]
51
80
  ### [1.0.2](https://github.com/eea/volto-eea-map/compare/1.0.1...1.0.2) - 21 July 2023
52
81
 
53
82
  #### :hammer_and_wrench: Others
54
83
 
55
84
  - Allow blocks in content type [Tiberiu Ichim - [`2ac09a6`](https://github.com/eea/volto-eea-map/commit/2ac09a613aba07f6cbaf42c386660f2d7d09bd13)]
85
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`403b4c0`](https://github.com/eea/volto-eea-map/commit/403b4c009e5aaded58203bc292ba3baa4631488b)]
86
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`aedb654`](https://github.com/eea/volto-eea-map/commit/aedb6544fd45b147a3385425aba46ffba108f5ca)]
56
87
  ### [1.0.1](https://github.com/eea/volto-eea-map/compare/1.0.0...1.0.1) - 22 June 2023
57
88
 
58
89
  #### :rocket: New Features
@@ -113,6 +144,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
113
144
 
114
145
  - chore: clear unused #254131 [andreiggr - [`ccec2ea`](https://github.com/eea/volto-eea-map/commit/ccec2eaab173c905cd4ea0190a9c6cfd630250f9)]
115
146
  - chore: clear block style #254131 [andreiggr - [`af500bc`](https://github.com/eea/volto-eea-map/commit/af500bc10a5f280eff0335f45bae1596d66a7e6b)]
147
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`76b29e5`](https://github.com/eea/volto-eea-map/commit/76b29e510f5156590723831a524bc39dfba6deba)]
116
148
 
117
149
  #### :hammer_and_wrench: Others
118
150
 
@@ -122,6 +154,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
122
154
  - * versions [andreiggr - [`6d9ff2b`](https://github.com/eea/volto-eea-map/commit/6d9ff2b26a236b6445678e3d84698d1c3c0826f4)]
123
155
  - add razzle-plugin-scss dep [andreiggr - [`d74cee5`](https://github.com/eea/volto-eea-map/commit/d74cee51d30c866afe55730e5b25e0bf11d2caea)]
124
156
  - volto-object-widget [andreiggr - [`18d0ed7`](https://github.com/eea/volto-eea-map/commit/18d0ed72c1ba7b0f7159a0eefc09ccea9acee5cb)]
157
+ - Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`5911d01`](https://github.com/eea/volto-eea-map/commit/5911d01f7f3bc79a2c834fab75a9a4ac05d2d042)]
125
158
  ### [0.1.32](https://github.com/eea/volto-eea-map/compare/0.1.31...0.1.32) - 20 February 2023
126
159
 
127
160
  #### :hammer_and_wrench: Others
@@ -129,6 +162,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
129
162
  - remove console.log [tedw87 - [`3aeb3e8`](https://github.com/eea/volto-eea-map/commit/3aeb3e8ec5474387f3cd22eb9b387c6681e17120)]
130
163
  - refactor code [tedw87 - [`6d7830e`](https://github.com/eea/volto-eea-map/commit/6d7830eb934f56c255eea5642bdefba30d892946)]
131
164
  - add Blossom basemap layer [tedw87 - [`5226ee2`](https://github.com/eea/volto-eea-map/commit/5226ee218df3401cf467afbc7a4d720dc30719e1)]
165
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`1dad5c6`](https://github.com/eea/volto-eea-map/commit/1dad5c6617096ff85223165a6dd2b1d5d7deea6a)]
132
166
  ### [0.1.31](https://github.com/eea/volto-eea-map/compare/0.1.30...0.1.31) - 11 November 2022
133
167
 
134
168
  #### :hammer_and_wrench: Others
package/DEVELOP.md CHANGED
@@ -1,4 +1,4 @@
1
- # volto-addon-template
1
+ # volto-eea-map
2
2
 
3
3
  ## Develop
4
4
 
@@ -16,12 +16,14 @@
16
16
 
17
17
  1. Go to http://localhost:3000
18
18
 
19
- 1. Happy hacking!
19
+ 1. Initialize git hooks
20
20
 
21
21
  ```Bash
22
- cd src/addons/volto-eea-map/
22
+ yarn prepare
23
23
  ```
24
24
 
25
+ 1. Happy hacking!
26
+
25
27
  ### Or add @eeacms/volto-eea-map to your Volto project
26
28
 
27
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
@@ -32,15 +34,15 @@ Before starting make sure your development environment is properly set. See [Vol
32
34
 
33
35
  1. Create new volto app
34
36
 
35
- yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template --skip-install
37
+ yo @plone/volto my-volto-project --addon @eeacms/volto-eea-map --skip-install
36
38
  cd my-volto-project
37
39
 
38
40
  1. Add the following to `mrs.developer.json`:
39
41
 
40
42
  {
41
- "volto-addon-template": {
42
- "url": "https://github.com/eea/volto-addon-template.git",
43
- "package": "@eeacms/volto-addon-template",
43
+ "volto-eea-map": {
44
+ "url": "https://github.com/eea/volto-eea-map.git",
45
+ "package": "@eeacms/volto-eea-map",
44
46
  "branch": "develop",
45
47
  "path": "src"
46
48
  }
@@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
48
50
 
49
51
  1. Install
50
52
 
51
- yarn develop
53
+ make develop
52
54
  yarn
53
55
 
54
56
  1. Start backend
55
57
 
56
- docker pull plone
57
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
58
59
 
59
60
  ...wait for backend to setup and start - `Ready to handle requests`:
60
61
 
61
- docker logs -f plone
62
-
63
62
  ...you can also check http://localhost:8080/Plone
64
63
 
65
64
  1. Start frontend
@@ -70,7 +69,7 @@ Before starting make sure your development environment is properly set. See [Vol
70
69
 
71
70
  1. Happy hacking!
72
71
 
73
- cd src/addons/volto-addon-template/
72
+ cd src/addons/volto-eea-map/
74
73
 
75
74
  ## Cypress
76
75
 
package/README.md CHANGED
@@ -14,12 +14,25 @@
14
14
  [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-map-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-map-develop)
16
16
 
17
-
18
17
  [Volto](https://github.com/plone/volto) add-on
19
18
 
20
- ## Features
19
+ # Configuration
20
+
21
+ This addon contains the EEA Embed Map Block & EEA Map Block. It's configured to work with the map visualization content type and give more access to ArcGIS maps. See available maps here https://discomap.eea.europa.eu/
22
+
23
+ # Enable data queries auto-import
24
+
25
+ To enable automatic import of queries from the content-type, "Parameters for data connections" should be checked as behavior on the content-type that uses the map.
26
+
27
+ controlpanel/dexterity-types/{content-type-id}
28
+
29
+ # Enable Sources
30
+
31
+ Sources (Data provenance) should be set on the visualization. To enable this, "EEA Core Metadata" should be checked as behavior on the visualization content-type.
21
32
 
22
- Demo GIF
33
+ controlpanel/dexterity-types/map_visualization
34
+
35
+ After this, sources can be added from the visualization edit interface. "Data Provenance" tab => "Add source"
23
36
 
24
37
  ## Getting started
25
38
 
package/cypress.config.js CHANGED
@@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');
2
2
 
3
3
  module.exports = defineConfig({
4
4
  viewportWidth: 1280,
5
- defaultCommandTimeout: 8888,
5
+ defaultCommandTimeout: 5000,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
8
  video: true,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 1,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -1,11 +1,12 @@
1
1
  version: "3"
2
2
  services:
3
3
  backend:
4
- image: plone/plone-backend:${PLONE_VERSION:-6}
4
+ image: eeacms/plone-backend
5
5
  ports:
6
6
  - "8080:8080"
7
7
  environment:
8
8
  SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
9
10
 
10
11
  frontend:
11
12
  build:
@@ -23,6 +24,9 @@ services:
23
24
  volumes:
24
25
  - ./:/app/src/addons/${ADDON_PATH}
25
26
  environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
26
30
  RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
27
31
  RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
28
32
  HOST: "0.0.0.0"
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
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",
@@ -36,23 +36,49 @@
36
36
  "babel-plugin-transform-class-properties": "^6.24.1",
37
37
  "cypress": "10.3.1",
38
38
  "cypress-fail-fast": "^5.0.1",
39
+ "husky": "*",
40
+ "lint-staged": "*",
39
41
  "md5": "^2.3.0"
40
42
  },
43
+ "lint-staged": {
44
+ "src/**/*.{js,jsx,ts,tsx,json}": [
45
+ "make lint-fix",
46
+ "make prettier-fix"
47
+ ],
48
+ "src/**/*.{jsx}": [
49
+ "make i18n"
50
+ ],
51
+ "theme/**/*.{css,less}": [
52
+ "make stylelint-fix"
53
+ ],
54
+ "src/**/*.{css,less}": [
55
+ "make stylelint-fix"
56
+ ],
57
+ "theme/**/*.overrides": [
58
+ "make stylelint-fix"
59
+ ],
60
+ "src/**/*.overrides": [
61
+ "make stylelint-fix"
62
+ ]
63
+ },
41
64
  "scripts": {
42
65
  "release": "release-it",
66
+ "release-major-beta": "release-it major --preRelease=beta",
67
+ "release-beta": "release-it --preRelease=beta",
43
68
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
44
69
  "test": "make test",
45
70
  "test:fix": "make test-update",
46
71
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
47
- "stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
48
- "stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
49
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
50
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
51
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
52
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
53
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
54
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
55
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
56
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
72
+ "stylelint": "make stylelint",
73
+ "stylelint:overrides": "make stylelint-overrides",
74
+ "stylelint:fix": "make stylelint-fix",
75
+ "prettier": "make prettier",
76
+ "prettier:fix": "make prettier-fix",
77
+ "lint": "make lint",
78
+ "lint:fix": "make lint-fix",
79
+ "i18n": "make i18n",
80
+ "cypress:run": "make cypress-run",
81
+ "cypress:open": "make cypress-open",
82
+ "prepare": "husky install"
57
83
  }
58
84
  }
@@ -21,6 +21,29 @@ const Edit = (props) => {
21
21
  const [mapData, setMapData] = React.useState('');
22
22
  const data = React.useMemo(() => props.data, [props.data]);
23
23
  const { height = '' } = data;
24
+
25
+ React.useEffect(() => {
26
+ if (!Object.hasOwn(data, 'show_legend')) {
27
+ onChangeBlock(block, {
28
+ ...data,
29
+ show_legend: true,
30
+ });
31
+ }
32
+ if (!Object.hasOwn(data, 'show_sources')) {
33
+ onChangeBlock(block, {
34
+ ...data,
35
+ show_sources: true,
36
+ });
37
+ }
38
+ if (!Object.hasOwn(data, 'dataprotection')) {
39
+ onChangeBlock(block, {
40
+ ...data,
41
+ dataprotection: { enabled: true },
42
+ });
43
+ }
44
+ // eslint-disable-next-line react-hooks/exhaustive-deps
45
+ }, [data.show_legend, data.show_sources, data.dataprotection]);
46
+
24
47
  React.useEffect(() => {
25
48
  if (props.data.vis_url) {
26
49
  props.getVisualization(expandToBackendURL(props.data.vis_url));
@@ -111,12 +111,10 @@ export const Schema = (props) => {
111
111
  title: 'Show sources',
112
112
  description: 'Will show sources set in this page Data provenance',
113
113
  type: 'boolean',
114
- defaultValue: true,
115
114
  },
116
115
  show_legend: {
117
116
  title: 'Show legend',
118
117
  type: 'boolean',
119
- defaultValue: true,
120
118
  },
121
119
  show_viewer: {
122
120
  title: 'Show API link',
@@ -44,7 +44,7 @@ const View = (props) => {
44
44
  ]);
45
45
 
46
46
  return (
47
- <PrivacyProtection data={data} height={height} {...props}>
47
+ <PrivacyProtection data={data} {...props}>
48
48
  {mapData && (
49
49
  <div>
50
50
  <Webmap data={mapData} height={height} />
@@ -1,6 +1,6 @@
1
- export Webmap from './Webmap';
2
- export ExtraViews from './ExtraViews';
3
- export LegendView from './LegendView';
1
+ export { default as Webmap } from './Webmap';
2
+ export { default as ExtraViews } from './ExtraViews';
3
+ export { default as LegendView } from './LegendView';
4
4
 
5
- export EmbedMapView from './Blocks/EmbedEEAMap/View';
6
- export EmbedMapEdit from './Blocks/EmbedEEAMap/Edit';
5
+ export { default as EmbedMapView } from './Blocks/EmbedEEAMap/View';
6
+ export { default as EmbedMapEdit } from './Blocks/EmbedEEAMap/Edit';