@eeacms/volto-n2k 1.0.33 → 1.0.34

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,11 +4,33 @@ 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
- ### [1.0.33](https://github.com/eea/volto-n2k/compare/1.0.32...1.0.33) - 3 July 2023
7
+ ### [1.0.34](https://github.com/eea/volto-n2k/compare/1.0.33...1.0.34) - 13 May 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: fix issue where schemeSpectral was never used due to the always truthy color array [ana-oprea - [`ea4cd65`](https://github.com/eea/volto-n2k/commit/ea4cd65a14719c5c60b899332d7ed289c1a50e5c)]
12
+ - fix(tests): add cypress 13 to devdependencies [ana-oprea - [`a218b28`](https://github.com/eea/volto-n2k/commit/a218b289fdbd0825540527cab4567ee3880a8e44)]
13
+
14
+ #### :house: Internal changes
15
+
16
+ - chore: husky, lint-staged use fixed versions [valentinab25 - [`647d621`](https://github.com/eea/volto-n2k/commit/647d621d52400c50f5bc629b3ddc4f2121f14ffa)]
17
+ - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`60d94b6`](https://github.com/eea/volto-n2k/commit/60d94b61ff8826abc57af9616793a1a247f585b5)]
18
+
19
+ #### :house: Documentation changes
20
+
21
+ - docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`d6d017d`](https://github.com/eea/volto-n2k/commit/d6d017de1409f7319684f1c98d2c017d35631e83)]
8
22
 
9
23
  #### :hammer_and_wrench: Others
10
24
 
11
- - hide arrows if pictures length <= 1 [Miu Razvan - [`5dfee21`](https://github.com/eea/volto-n2k/commit/5dfee212b039d92c325665eed203c99280fd8155)]
25
+ - use volto-spotlight theme in jenkins [ana-oprea - [`f7ffa9a`](https://github.com/eea/volto-n2k/commit/f7ffa9a8d4621fe4d0e46fd6450791a9f6d5c7e7)]
26
+ - fix sonarqube errors [ana-oprea - [`50a4ff2`](https://github.com/eea/volto-n2k/commit/50a4ff2a03ca964b93443ef98f79684d40e0b768)]
27
+ - try to use volto-spotlight theme in jenkins [Miu Razvan - [`ec0b952`](https://github.com/eea/volto-n2k/commit/ec0b9525b967f907922ae660bd9f520119cd80c1)]
28
+ - remove waitForResourceToLoad [ana-oprea - [`eaded9b`](https://github.com/eea/volto-n2k/commit/eaded9b9ecd1ca2eb78aa8dd65838c063d95db85)]
29
+ - update image size from 300 to 800 px [Claudia Ifrim - [`8d9270a`](https://github.com/eea/volto-n2k/commit/8d9270a09506278ceaea25e8a72abdf5b22fcc78)]
30
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4850d6a`](https://github.com/eea/volto-n2k/commit/4850d6a65349fe49dbe9244c30592ae38c9aeaba)]
31
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2c91856`](https://github.com/eea/volto-n2k/commit/2c9185688a2fe6b36e5eeb2963f6c8676e3c5628)]
32
+ ### [1.0.33](https://github.com/eea/volto-n2k/compare/1.0.32...1.0.33) - 3 July 2023
33
+
12
34
  ### [1.0.32](https://github.com/eea/volto-n2k/compare/1.0.31...1.0.32) - 26 June 2023
13
35
 
14
36
  #### :hammer_and_wrench: Others
@@ -261,7 +283,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
261
283
  - Update [razvanMiu - [`42ab50e`](https://github.com/eea/volto-n2k/commit/42ab50e6681a47251d15ac06b836c6f8c27157fa)]
262
284
  - Added bubble chart [razvanMiu - [`89fba5e`](https://github.com/eea/volto-n2k/commit/89fba5e5db41aa955ba2d0ed58c9f0042c461504)]
263
285
  - Group species by id_eunis in species list [razvanMiu - [`543c957`](https://github.com/eea/volto-n2k/commit/543c9573b53acd8eecc9afbb6ae7beeddba53966)]
264
- - Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2ca3e4c`](https://github.com/eea/volto-n2k/commit/2ca3e4c092211f92339791d71db81f5b4ca2d562)]
265
286
  - update maps - species and habitats distribution maps [Claudia Ifrim - [`ad12eb1`](https://github.com/eea/volto-n2k/commit/ad12eb141907d6f28444f1eafc3f687735d2a68d)]
266
287
  - update format for common name and author [Claudia Ifrim - [`26b7a2f`](https://github.com/eea/volto-n2k/commit/26b7a2f3d20c7701b57fb24f39fc7dfeceec3ce8)]
267
288
  - update format for species name (common / scientific) [Claudia Ifrim - [`abdedcf`](https://github.com/eea/volto-n2k/commit/abdedcfe645665031dedf050fd2c5cdde8c14a50)]
package/DEVELOP.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## Develop
4
4
 
5
+ 1. Make sure you have `docker` and `docker compose` installed and running on your machine:
6
+
7
+ ```Bash
8
+ git clone https://github.com/eea/volto-n2k.git
9
+ cd volto-n2k
10
+ git checkout -b bugfix-123456 develop
11
+ make
12
+ make start
13
+ ```
14
+
15
+ 1. Wait for `Volto started at 0.0.0.0:3000` meesage
16
+
17
+ 1. Go to http://localhost:3000
18
+
19
+ 1. Initialize git hooks
20
+
21
+ ```Bash
22
+ yarn prepare
23
+ ```
24
+
25
+ 1. Happy hacking!
26
+
27
+ ### Or add @eeacms/volto-n2k to your Volto project
28
+
5
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
30
 
7
31
  1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
@@ -28,18 +52,15 @@ Before starting make sure your development environment is properly set. See [Vol
28
52
 
29
53
  1. Install
30
54
 
31
- $ yarn develop
55
+ $ make develop
32
56
  $ yarn
33
57
 
34
58
  1. Start backend
35
59
 
36
- $ docker pull plone
37
- $ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
60
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
38
61
 
39
62
  ...wait for backend to setup and start - `Ready to handle requests`:
40
63
 
41
- $ docker logs -f plone
42
-
43
64
  ...you can also check http://localhost:8080/Plone
44
65
 
45
66
  1. Start frontend
@@ -51,3 +72,37 @@ Before starting make sure your development environment is properly set. See [Vol
51
72
  1. Happy hacking!
52
73
 
53
74
  $ cd src/addons/volto-n2k/
75
+
76
+ ## Cypress
77
+
78
+ To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
79
+
80
+ You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
81
+ project where you added `volto-n2k` to `mrs.developer.json`
82
+
83
+ Go to:
84
+
85
+ ```BASH
86
+ cd src/addons/volto-n2k/
87
+ ```
88
+
89
+ Start:
90
+
91
+ ```Bash
92
+ make
93
+ make start
94
+ ```
95
+
96
+ This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-n2k` block installed.
97
+
98
+ Open Cypress Interface:
99
+
100
+ ```Bash
101
+ make cypress-open
102
+ ```
103
+
104
+ Or run it:
105
+
106
+ ```Bash
107
+ make cypress-run
108
+ ```
package/README.md CHANGED
@@ -14,27 +14,35 @@
14
14
  [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-n2k-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
16
16
 
17
+
17
18
  [Volto](https://github.com/plone/volto) add-on
18
19
 
19
20
  ## Features
20
21
 
21
- ###
22
-
23
22
  Demo GIF
24
23
 
25
24
  ## Getting started
26
25
 
27
- 1. Create new volto project if you don't already have one:
26
+ ### Try volto-n2k with Docker
28
27
 
29
- ```
30
- $ npm install -g yo @plone/generator-volto
31
- $ yo @plone/volto my-volto-project --addon @eeacms/volto-n2k
28
+ git clone https://github.com/eea/volto-n2k.git
29
+ cd volto-n2k
30
+ make
31
+ make start
32
+
33
+ Go to http://localhost:3000
34
+
35
+ ### Add volto-n2k to your Volto project
36
+
37
+ 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
32
38
 
33
- $ cd my-volto-project
34
- $ yarn add -W @eeacms/volto-n2k
39
+ ```Bash
40
+ docker compose up backend
35
41
  ```
36
42
 
37
- 1. If you already have a volto project, just update `package.json`:
43
+ 1. Start Volto frontend
44
+
45
+ * If you already have a volto project, just update `package.json`:
38
46
 
39
47
  ```JSON
40
48
  "addons": [
@@ -42,15 +50,23 @@ Demo GIF
42
50
  ],
43
51
 
44
52
  "dependencies": {
45
- "@eeacms/volto-n2k": "^1.0.0"
53
+ "@eeacms/volto-n2k": "*"
46
54
  }
47
55
  ```
48
56
 
57
+ * If not, create one:
58
+
59
+ ```
60
+ npm install -g yo @plone/generator-volto
61
+ yo @plone/volto my-volto-project --canary --addon @eeacms/volto-n2k
62
+ cd my-volto-project
63
+ ```
64
+
49
65
  1. Install new add-ons and restart Volto:
50
66
 
51
67
  ```
52
- $ yarn
53
- $ yarn start
68
+ yarn
69
+ yarn start
54
70
  ```
55
71
 
56
72
  1. Go to http://localhost:3000
package/RELEASE.md CHANGED
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
20
20
  ```
21
21
  npm install -g release-it
22
22
  ```
23
-
23
+
24
24
  Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
-
25
+
26
26
  Release-it is a tool that automates 4 important steps in the release process:
27
27
 
28
28
  1. Version increase in `package.json` ( increased from the current version in `package.json`)
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
30
30
  3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
31
  4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
32
 
33
- To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
34
 
35
35
  ```
36
36
  export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
37
  ```
38
-
38
+
39
39
  To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
-
40
+
41
41
  ```
42
42
  echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
43
  ```
44
44
 
45
45
  #### Using release-it tool
46
-
46
+
47
47
  There are 3 yarn scripts that can be run to do the release
48
48
 
49
49
  ##### yarn release-beta
50
50
 
51
- Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
52
 
53
53
  ```
54
- ? Select increment (next version):
55
- ❯ prepatch (0.1.1-beta.0)
56
- preminor (0.2.0-beta.0)
57
- premajor (1.0.0-beta.0)
58
- Other, please specify...
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
59
  ```
60
60
 
61
61
  ##### yarn release-major-beta
62
62
 
63
63
  Same as `yarn release-beta`, but with premajor version pre-selected.
64
-
64
+
65
65
  ##### yarn release
66
66
 
67
67
  Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
68
 
69
69
  #### Important notes
70
70
 
71
- > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
72
 
73
73
  > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
74
 
package/cypress.config.js CHANGED
@@ -5,9 +5,9 @@ module.exports = defineConfig({
5
5
  defaultCommandTimeout: 8888,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
- video: true,
8
+ video: false,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 2,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -0,0 +1,32 @@
1
+ version: "3"
2
+ services:
3
+ backend:
4
+ image: eeacms/plone-backend
5
+ ports:
6
+ - "8080:8080"
7
+ environment:
8
+ SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
10
+
11
+ frontend:
12
+ build:
13
+ context: ./
14
+ dockerfile: ./Dockerfile
15
+ args:
16
+ ADDON_NAME: "${ADDON_NAME}"
17
+ ADDON_PATH: "${ADDON_PATH}"
18
+ VOLTO_VERSION: ${VOLTO_VERSION:-16}
19
+ ports:
20
+ - "3000:3000"
21
+ - "3001:3001"
22
+ depends_on:
23
+ - backend
24
+ volumes:
25
+ - ./:/app/src/addons/${ADDON_PATH}
26
+ environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
30
+ RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
31
+ RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
32
+ HOST: "0.0.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -13,6 +13,7 @@
13
13
  "react"
14
14
  ],
15
15
  "addons": [
16
+ "@eeacms/volto-spotlight",
16
17
  "@eeacms/volto-datablocks",
17
18
  "@eeacms/volto-openlayers-map",
18
19
  "@eeacms/volto-resize-helper",
@@ -23,6 +24,7 @@
23
24
  "url": "git@github.com:eea/volto-n2k.git"
24
25
  },
25
26
  "dependencies": {
27
+ "@eeacms/volto-spotlight": "*",
26
28
  "@eeacms/volto-datablocks": "*",
27
29
  "@eeacms/volto-openlayers-map": "*",
28
30
  "@eeacms/volto-resize-helper": "*",
@@ -37,11 +39,35 @@
37
39
  "swiper": "9.1.1"
38
40
  },
39
41
  "devDependencies": {
42
+ "cypress": "13.1.0",
40
43
  "@cypress/code-coverage": "^3.10.0",
41
44
  "@plone/scripts": "*",
42
45
  "babel-plugin-transform-class-properties": "^6.24.1",
46
+ "husky": "^8.0.3",
47
+ "lint-staged": "^14.0.1",
43
48
  "md5": "^2.3.0"
44
49
  },
50
+ "lint-staged": {
51
+ "src/**/*.{js,jsx,ts,tsx,json}": [
52
+ "make lint-fix",
53
+ "make prettier-fix"
54
+ ],
55
+ "src/**/*.{jsx}": [
56
+ "make i18n"
57
+ ],
58
+ "theme/**/*.{css,less}": [
59
+ "make stylelint-fix"
60
+ ],
61
+ "src/**/*.{css,less}": [
62
+ "make stylelint-fix"
63
+ ],
64
+ "theme/**/*.overrides": [
65
+ "make stylelint-fix"
66
+ ],
67
+ "src/**/*.overrides": [
68
+ "make stylelint-fix"
69
+ ]
70
+ },
45
71
  "scripts": {
46
72
  "release": "release-it",
47
73
  "release-major-beta": "release-it major --preRelease=beta",
@@ -59,6 +85,7 @@
59
85
  "lint:fix": "make lint-fix",
60
86
  "i18n": "make i18n",
61
87
  "cypress:run": "make cypress-run",
62
- "cypress:open": "make cypress-open"
88
+ "cypress:open": "make cypress-open",
89
+ "prepare": "husky install"
63
90
  }
64
91
  }
@@ -15,8 +15,8 @@ const SwiperLoader = loadable.lib(() => import('swiper'));
15
15
  const SwiperReactLoader = loadable.lib(() => import('swiper/react'));
16
16
 
17
17
  const getSource = (source) => {
18
- let parsedSource = replaceQueryParam(source, 'x', 300);
19
- parsedSource = replaceQueryParam(parsedSource, 'y', 300);
18
+ let parsedSource = replaceQueryParam(source, 'x', 800);
19
+ parsedSource = replaceQueryParam(parsedSource, 'y', 800);
20
20
 
21
21
  return parsedSource;
22
22
  };
@@ -31,7 +31,7 @@ const View = (props) => {
31
31
  <div className="site-habitats-list">
32
32
  {Object.keys(habitats)?.length ? (
33
33
  Object.keys(habitats)
34
- .sort()
34
+ .sort((a, b) => a.localeCompare(b))
35
35
  .map((habitat) => {
36
36
  const expanded = expandedHabitats.includes(habitat);
37
37
  return (
@@ -16,8 +16,8 @@ const SwiperLoader = loadable.lib(() => import('swiper'));
16
16
  const SwiperReactLoader = loadable.lib(() => import('swiper/react'));
17
17
 
18
18
  const getSource = (source) => {
19
- let parsedSource = replaceQueryParam(source, 'x', 300);
20
- parsedSource = replaceQueryParam(parsedSource, 'y', 300);
19
+ let parsedSource = replaceQueryParam(source, 'x', 800);
20
+ parsedSource = replaceQueryParam(parsedSource, 'y', 800);
21
21
 
22
22
  return parsedSource;
23
23
  };
@@ -12,7 +12,7 @@ const getSerieData = (serie) => {
12
12
 
13
13
  function StackedBars(props) {
14
14
  const { d3 } = props;
15
- const { scaleOrdinal, schemeSpectral, stack } = d3;
15
+ const { scaleOrdinal, stack } = d3;
16
16
  const {
17
17
  element,
18
18
  height,
@@ -34,12 +34,10 @@ function StackedBars(props) {
34
34
  d.forEach((v) => (v.key = d.key));
35
35
  return d;
36
36
  });
37
+
37
38
  const color = scaleOrdinal()
38
39
  .domain(series.map((d) => d.key))
39
- .range(
40
- ['#70AD47', '#ED7D31', '#FF3F3F', '#AFABAB'] ||
41
- schemeSpectral[series.length],
42
- )
40
+ .range(['#70AD47', '#ED7D31', '#FF3F3F', '#AFABAB'])
43
41
  .unknown('#ccc');
44
42
 
45
43
  return (
@@ -1 +0,0 @@
1
- module.exports = require('@plone/volto/babel');