@eeacms/volto-n2k 0.1.1 → 0.1.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.
- package/CHANGELOG.md +24 -1
- package/Jenkinsfile +58 -25
- package/README.md +86 -0
- package/cypress/support/index.js +1 -1
- package/cypress.json +6 -1
- package/package.json +11 -9
- package/src/components/manage/Blocks/BubbleChart/BubbleChart.jsx +6 -6
- package/src/components/manage/Blocks/ExplodedPiesChart/Pie.jsx +4 -2
- package/src/components/manage/Blocks/ExplodedPiesChart/View.jsx +5 -4
- package/src/components/manage/Blocks/ExplodedPiesChart/style.less +1 -1
- package/src/components/manage/Blocks/HabitatsBanner/style.less +2 -2
- package/src/components/manage/Blocks/ImageText/Edit.jsx +1 -1
- package/src/components/manage/Blocks/ImageText/View.jsx +1 -1
- package/src/components/manage/Blocks/SiteBanner/style.less +4 -4
- package/src/components/manage/Blocks/SiteProtectedHabitats/style.less +1 -1
- package/src/components/manage/Blocks/SpeciesBanner/style.less +2 -2
- package/src/components/manage/Blocks/StackedBarChart/Chart.jsx +4 -9
- package/src/components/manage/Blocks/StackedBarChart/StackedBars.jsx +4 -2
- package/src/index.js +12 -6
- package/src/less/styles.less +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,32 @@ 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.4](https://github.com/eea/volto-n2k/compare/0.1.3...0.1.4)
|
|
8
|
+
|
|
9
|
+
- Prettier [`43c0a09`](https://github.com/eea/volto-n2k/commit/43c0a090f481f81e7cadcfcda59b5dcc02dd8f1a)
|
|
10
|
+
- Prettier [`553c35b`](https://github.com/eea/volto-n2k/commit/553c35b2c9b34adb8fb630f2ec41f2ffd2cf22b0)
|
|
11
|
+
- Prettier fix [`47619cb`](https://github.com/eea/volto-n2k/commit/47619cb286ff939df397c483c18cc532c58b7547)
|
|
12
|
+
- Lazy load d3 [`874e88c`](https://github.com/eea/volto-n2k/commit/874e88c48f3af2f1c01f5818971248c2f19b6789)
|
|
13
|
+
|
|
14
|
+
#### [0.1.3](https://github.com/eea/volto-n2k/compare/0.1.2...0.1.3)
|
|
15
|
+
|
|
16
|
+
> 23 June 2022
|
|
17
|
+
|
|
18
|
+
- Make this compatible with latest changes [`#4`](https://github.com/eea/volto-n2k/pull/4)
|
|
19
|
+
|
|
20
|
+
#### [0.1.2](https://github.com/eea/volto-n2k/compare/0.1.1...0.1.2)
|
|
21
|
+
|
|
22
|
+
> 14 December 2021
|
|
23
|
+
|
|
24
|
+
- Update [`#3`](https://github.com/eea/volto-n2k/pull/3)
|
|
25
|
+
- [Webscore fix] Added generic font-family [`48f7eb5`](https://github.com/eea/volto-n2k/commit/48f7eb59c956a1705579ec1796160d31fad77f96)
|
|
26
|
+
- Refs #142010 - Optimize Volto-addons gitflow pipelines [`7eea1ed`](https://github.com/eea/volto-n2k/commit/7eea1ed2f0360830658266cc44ce9a5de6381776)
|
|
27
|
+
|
|
7
28
|
#### [0.1.1](https://github.com/eea/volto-n2k/compare/0.1.0...0.1.1)
|
|
8
29
|
|
|
30
|
+
> 5 October 2021
|
|
31
|
+
|
|
32
|
+
- Cypress coverage [`#2`](https://github.com/eea/volto-n2k/pull/2)
|
|
9
33
|
- Update [`0ef14ec`](https://github.com/eea/volto-n2k/commit/0ef14ec745d6642f3c45f7f5b4138e210329e60c)
|
|
10
34
|
- Bumped versions; [`94e98ab`](https://github.com/eea/volto-n2k/commit/94e98ab1c21b7b25b5383d62398ed01a02c5cbc9)
|
|
11
35
|
- Update [`854a980`](https://github.com/eea/volto-n2k/commit/854a98070c034c402c85bf35eaa4e881fd8d6e9b)
|
|
@@ -68,7 +92,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
68
92
|
- update height for iframe (embeded maps) [`5563e6f`](https://github.com/eea/volto-n2k/commit/5563e6fd5df4c201909dd7af90cf6d06eab0a97b)
|
|
69
93
|
- add common name in species list - sdf [`a2bbb1b`](https://github.com/eea/volto-n2k/commit/a2bbb1b6586c1efb5f7f73e0269f6f96e1250806)
|
|
70
94
|
- Add jest configuration [`0ae3e0c`](https://github.com/eea/volto-n2k/commit/0ae3e0cd4926cf2e8cad672a24109dd5428473aa)
|
|
71
|
-
- Cypress coverage [`467099d`](https://github.com/eea/volto-n2k/commit/467099d11c4bf9e6882049e0ac356314debc0cd1)
|
|
72
95
|
|
|
73
96
|
#### 0.1.0
|
|
74
97
|
|
package/Jenkinsfile
CHANGED
|
@@ -6,11 +6,36 @@ pipeline {
|
|
|
6
6
|
NAMESPACE = "@eeacms"
|
|
7
7
|
SONARQUBE_TAGS = "volto.eea.europa.eu,biodiversity.europa.eu"
|
|
8
8
|
DEPENDENCIES = "volto-slate @eeacms/volto-datablocks"
|
|
9
|
+
VOLTO = "alpha"
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
stages {
|
|
12
13
|
|
|
14
|
+
stage('Release') {
|
|
15
|
+
when {
|
|
16
|
+
allOf {
|
|
17
|
+
environment name: 'CHANGE_ID', value: ''
|
|
18
|
+
branch 'master'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
steps {
|
|
22
|
+
node(label: 'docker') {
|
|
23
|
+
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
24
|
+
sh '''docker pull eeacms/gitflow'''
|
|
25
|
+
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
stage('Code') {
|
|
32
|
+
when {
|
|
33
|
+
allOf {
|
|
34
|
+
environment name: 'CHANGE_ID', value: ''
|
|
35
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
36
|
+
not { branch 'master' }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
14
39
|
steps {
|
|
15
40
|
parallel(
|
|
16
41
|
|
|
@@ -36,6 +61,15 @@ pipeline {
|
|
|
36
61
|
}
|
|
37
62
|
|
|
38
63
|
stage('Tests') {
|
|
64
|
+
when {
|
|
65
|
+
allOf {
|
|
66
|
+
environment name: 'CHANGE_ID', value: ''
|
|
67
|
+
anyOf {
|
|
68
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
69
|
+
branch 'master'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
39
73
|
steps {
|
|
40
74
|
parallel(
|
|
41
75
|
|
|
@@ -75,6 +109,15 @@ pipeline {
|
|
|
75
109
|
}
|
|
76
110
|
|
|
77
111
|
stage('Integration tests') {
|
|
112
|
+
when {
|
|
113
|
+
allOf {
|
|
114
|
+
environment name: 'CHANGE_ID', value: ''
|
|
115
|
+
anyOf {
|
|
116
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
117
|
+
branch 'master'
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
78
121
|
steps {
|
|
79
122
|
parallel(
|
|
80
123
|
|
|
@@ -82,8 +125,8 @@ pipeline {
|
|
|
82
125
|
node(label: 'docker') {
|
|
83
126
|
script {
|
|
84
127
|
try {
|
|
85
|
-
sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="
|
|
86
|
-
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
|
|
128
|
+
sh '''docker pull eeacms/plone-backend; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
|
|
129
|
+
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
|
|
87
130
|
} finally {
|
|
88
131
|
try {
|
|
89
132
|
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
|
|
@@ -100,7 +143,8 @@ pipeline {
|
|
|
100
143
|
reportName: 'CypressCoverage',
|
|
101
144
|
reportTitles: 'Integration Tests Code Coverage'])
|
|
102
145
|
}
|
|
103
|
-
|
|
146
|
+
sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
|
|
147
|
+
archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
104
148
|
stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
|
|
105
149
|
}
|
|
106
150
|
finally {
|
|
@@ -122,10 +166,16 @@ pipeline {
|
|
|
122
166
|
}
|
|
123
167
|
|
|
124
168
|
stage('Report to SonarQube') {
|
|
125
|
-
// Exclude Pull-Requests
|
|
126
169
|
when {
|
|
127
170
|
allOf {
|
|
128
171
|
environment name: 'CHANGE_ID', value: ''
|
|
172
|
+
anyOf {
|
|
173
|
+
branch 'master'
|
|
174
|
+
allOf {
|
|
175
|
+
branch 'develop'
|
|
176
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
129
179
|
}
|
|
130
180
|
}
|
|
131
181
|
steps {
|
|
@@ -135,10 +185,10 @@ pipeline {
|
|
|
135
185
|
unstash "xunit-reports"
|
|
136
186
|
unstash "cypress-coverage"
|
|
137
187
|
def scannerHome = tool 'SonarQubeScanner';
|
|
138
|
-
def nodeJS = tool '
|
|
188
|
+
def nodeJS = tool 'NodeJS';
|
|
139
189
|
withSonarQubeEnv('Sonarqube') {
|
|
140
190
|
sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
141
|
-
sh "export PATH=$
|
|
191
|
+
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
|
|
142
192
|
sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
|
|
143
193
|
}
|
|
144
194
|
}
|
|
@@ -156,8 +206,8 @@ pipeline {
|
|
|
156
206
|
steps {
|
|
157
207
|
node(label: 'docker') {
|
|
158
208
|
script {
|
|
159
|
-
if ( env.CHANGE_BRANCH != "develop"
|
|
160
|
-
error "Pipeline aborted due to PR not made from develop
|
|
209
|
+
if ( env.CHANGE_BRANCH != "develop" ) {
|
|
210
|
+
error "Pipeline aborted due to PR not made from develop branch"
|
|
161
211
|
}
|
|
162
212
|
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
|
|
163
213
|
sh '''docker pull eeacms/gitflow'''
|
|
@@ -168,23 +218,6 @@ pipeline {
|
|
|
168
218
|
}
|
|
169
219
|
}
|
|
170
220
|
|
|
171
|
-
stage('Release') {
|
|
172
|
-
when {
|
|
173
|
-
allOf {
|
|
174
|
-
environment name: 'CHANGE_ID', value: ''
|
|
175
|
-
branch 'master'
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
steps {
|
|
179
|
-
node(label: 'docker') {
|
|
180
|
-
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
|
|
181
|
-
sh '''docker pull eeacms/gitflow'''
|
|
182
|
-
sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
221
|
}
|
|
189
222
|
|
|
190
223
|
post {
|
package/README.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
# volto-n2k
|
|
2
|
+
|
|
2
3
|
[](https://github.com/eea/volto-n2k/releases)
|
|
4
|
+
|
|
3
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-n2k/job/master/display/redirect)
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-master)
|
|
10
|
+
|
|
4
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-n2k/job/develop/display/redirect)
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-n2k-develop)
|
|
5
16
|
|
|
6
17
|
[Volto](https://github.com/plone/volto) add-on
|
|
7
18
|
|
|
@@ -46,6 +57,81 @@ Demo GIF
|
|
|
46
57
|
|
|
47
58
|
1. Happy editing!
|
|
48
59
|
|
|
60
|
+
## Release
|
|
61
|
+
|
|
62
|
+
### Automatic release using Jenkins
|
|
63
|
+
|
|
64
|
+
* The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
|
|
65
|
+
* It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
|
|
66
|
+
* The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
|
|
67
|
+
* Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
|
|
68
|
+
* As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
|
|
69
|
+
* The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
|
|
70
|
+
* You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
|
|
71
|
+
* Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
|
|
72
|
+
|
|
73
|
+
### Manual release from the develop branch ( beta release )
|
|
74
|
+
|
|
75
|
+
#### Installation and configuration of release-it
|
|
76
|
+
|
|
77
|
+
You need to first install the [release-it](https://github.com/release-it/release-it) client.
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
npm install -g release-it
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
|
|
84
|
+
|
|
85
|
+
Release-it is a tool that automates 4 important steps in the release process:
|
|
86
|
+
|
|
87
|
+
1. Version increase in `package.json` ( increased from the current version in `package.json`)
|
|
88
|
+
2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
|
|
89
|
+
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
|
|
90
|
+
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
|
|
91
|
+
|
|
92
|
+
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### Using release-it tool
|
|
105
|
+
|
|
106
|
+
There are 3 yarn scripts that can be run to do the release
|
|
107
|
+
|
|
108
|
+
##### yarn release-beta
|
|
109
|
+
|
|
110
|
+
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
? Select increment (next version):
|
|
114
|
+
❯ prepatch (0.1.1-beta.0)
|
|
115
|
+
preminor (0.2.0-beta.0)
|
|
116
|
+
premajor (1.0.0-beta.0)
|
|
117
|
+
Other, please specify...
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
##### yarn release-major-beta
|
|
121
|
+
|
|
122
|
+
Same as `yarn release-beta`, but with premajor version pre-selected.
|
|
123
|
+
|
|
124
|
+
##### yarn release
|
|
125
|
+
|
|
126
|
+
Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
|
|
127
|
+
|
|
128
|
+
#### Important notes
|
|
129
|
+
|
|
130
|
+
> 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.
|
|
131
|
+
|
|
132
|
+
> 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).
|
|
133
|
+
|
|
134
|
+
|
|
49
135
|
## How to contribute
|
|
50
136
|
|
|
51
137
|
See [DEVELOP.md](https://github.com/eea/volto-n2k/blob/master/DEVELOP.md).
|
package/cypress/support/index.js
CHANGED
package/cypress.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"baseUrl": "http://localhost:3000",
|
|
3
3
|
"viewportWidth": 1280,
|
|
4
|
-
"defaultCommandTimeout":
|
|
4
|
+
"defaultCommandTimeout": 8888,
|
|
5
5
|
"reporter": "junit",
|
|
6
6
|
"video": true,
|
|
7
7
|
"reporterOptions": {
|
|
8
8
|
"mochaFile": "cypress/reports/cypress-[hash].xml",
|
|
9
9
|
"jenkinsMode": true,
|
|
10
10
|
"toConsole": true
|
|
11
|
+
},
|
|
12
|
+
"chromeWebSecurity": false,
|
|
13
|
+
"retries": {
|
|
14
|
+
"runMode": 8,
|
|
15
|
+
"openMode": 0
|
|
11
16
|
}
|
|
12
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-n2k",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "volto-n2k: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"url": "git@github.com:eea/volto-n2k.git"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@eeacms/volto-datablocks": "
|
|
28
|
-
"@eeacms/volto-resize-helper": "
|
|
29
|
-
"@eeacms/volto-openlayers-map": "
|
|
30
|
-
"@eeacms/volto-tabs-block": "
|
|
31
|
-
"
|
|
32
|
-
"d3
|
|
27
|
+
"@eeacms/volto-datablocks": "*",
|
|
28
|
+
"@eeacms/volto-resize-helper": "*",
|
|
29
|
+
"@eeacms/volto-openlayers-map": "*",
|
|
30
|
+
"@eeacms/volto-tabs-block": "*",
|
|
31
|
+
"volto-slate": "*",
|
|
32
|
+
"d3": "^7.6.1",
|
|
33
|
+
"d3-shape": "^3.1.0",
|
|
33
34
|
"react-lazy-load-image-component": "1.5.1",
|
|
34
35
|
"react-stickynode": "^4.0.0",
|
|
35
36
|
"react-use-localstorage": "^3.5.3",
|
|
36
37
|
"resize-observer-polyfill": "1.5.1",
|
|
37
|
-
"slick-carousel": "1.8.1"
|
|
38
|
-
"volto-slate": "^4.0.3"
|
|
38
|
+
"slick-carousel": "1.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@cypress/code-coverage": "^3.9.5",
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"release": "release-it",
|
|
46
|
+
"release-major-beta": "release-it major --preRelease=beta",
|
|
47
|
+
"release-beta": "release-it --preRelease=beta",
|
|
46
48
|
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
|
|
47
49
|
"stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
|
|
48
50
|
"stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _uniqueId from 'lodash/uniqueId';
|
|
3
|
-
import {
|
|
4
|
-
import * as d3 from 'd3';
|
|
3
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
5
4
|
import { adjustBrightness, getContrastColor } from '@eeacms/volto-n2k/helpers';
|
|
6
5
|
import { FormattedValue } from '@eeacms/volto-datablocks/Utils';
|
|
7
6
|
import ChartContext from './ChartContext';
|
|
8
7
|
|
|
9
8
|
function BubbleChart(props) {
|
|
10
|
-
const { chartData, interpolation } = props;
|
|
9
|
+
const { d3, chartData, interpolation } = props;
|
|
11
10
|
const { element, height, width, popup, setPopup } = React.useContext(
|
|
12
11
|
ChartContext,
|
|
13
12
|
);
|
|
14
|
-
const root = pack().size([width, height]).padding(10)(
|
|
15
|
-
|
|
13
|
+
const root = d3.pack().size([width, height]).padding(10)(
|
|
14
|
+
d3
|
|
15
|
+
.hierarchy({ children: chartData })
|
|
16
16
|
.sum((d) => d.value)
|
|
17
17
|
.sort((a, b) => b.value - a.value),
|
|
18
18
|
);
|
|
@@ -98,4 +98,4 @@ function BubbleChart(props) {
|
|
|
98
98
|
</React.Fragment>
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
export default BubbleChart;
|
|
101
|
+
export default injectLazyLibs(['d3'])(BubbleChart);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import * as d3 from 'd3';
|
|
3
2
|
import { Popup } from 'semantic-ui-react';
|
|
3
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
4
4
|
import { adjustBrightness } from '@eeacms/volto-n2k/helpers';
|
|
5
5
|
|
|
6
6
|
const Arc = ({ data, index, createArc, format, size }) => {
|
|
@@ -73,6 +73,8 @@ const Arc = ({ data, index, createArc, format, size }) => {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const Pie = (props) => {
|
|
76
|
+
const { d3 } = props;
|
|
77
|
+
|
|
76
78
|
const createPie = d3
|
|
77
79
|
.pie()
|
|
78
80
|
.value((d) => d.value)
|
|
@@ -122,4 +124,4 @@ const Pie = (props) => {
|
|
|
122
124
|
);
|
|
123
125
|
};
|
|
124
126
|
|
|
125
|
-
export default Pie;
|
|
127
|
+
export default injectLazyLibs(['d3'])(Pie);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Grid } from 'semantic-ui-react';
|
|
3
|
-
import
|
|
4
|
-
import './style.less';
|
|
3
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
5
4
|
|
|
6
5
|
import Pie from './Pie';
|
|
7
6
|
|
|
7
|
+
import './style.less';
|
|
8
|
+
|
|
8
9
|
const View = (props) => {
|
|
9
|
-
const { placeholder = 'No results' } = props;
|
|
10
|
+
const { d3, placeholder = 'No results' } = props;
|
|
10
11
|
const { x = null, y = null, x_colors = [], precision = 2 } = props.data;
|
|
11
12
|
const data = props.provider_data || {};
|
|
12
13
|
const x_values = data?.[x] || [];
|
|
@@ -77,4 +78,4 @@ const View = (props) => {
|
|
|
77
78
|
);
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
export default View;
|
|
81
|
+
export default injectLazyLibs(['d3'])(View);
|
|
@@ -6,7 +6,7 @@ div#view .habitat-banner-details .ui.container > * {
|
|
|
6
6
|
padding: 1.5em 0;
|
|
7
7
|
background-color: #04a77d;
|
|
8
8
|
color: #fff;
|
|
9
|
-
font-family: 'RajdhaniB';
|
|
9
|
+
font-family: 'RajdhaniB', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
10
10
|
|
|
11
11
|
.habitat-details {
|
|
12
12
|
display: flex;
|
|
@@ -33,7 +33,7 @@ div#view .habitat-banner-details .ui.container > * {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.info {
|
|
36
|
-
font-family: 'RajdhaniR';
|
|
36
|
+
font-family: 'RajdhaniR', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
37
37
|
font-size: 18px;
|
|
38
38
|
font-weight: 600;
|
|
39
39
|
line-height: 18px;
|
|
@@ -3,7 +3,7 @@ import config from '@plone/volto/registry';
|
|
|
3
3
|
import { SidebarPortal } from '@plone/volto/components';
|
|
4
4
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
5
5
|
import SlateEditor from 'volto-slate/editor/SlateEditor';
|
|
6
|
-
import { Editor } from '
|
|
6
|
+
import { Editor } from 'slate';
|
|
7
7
|
import getSchema from './schema';
|
|
8
8
|
import cx from 'classnames';
|
|
9
9
|
import './styles.less';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UniversalLink } from '@plone/volto/components';
|
|
3
3
|
import { serializeNodes } from 'volto-slate/editor/render';
|
|
4
|
-
import { Editor } from '
|
|
4
|
+
import { Editor } from 'slate';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import './styles.less';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
padding: 1.5em 0;
|
|
3
3
|
background-color: #04a77d;
|
|
4
4
|
color: #fff;
|
|
5
|
-
font-family: 'RajdhaniB';
|
|
5
|
+
font-family: 'RajdhaniB', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
6
6
|
|
|
7
7
|
.ui.container > * {
|
|
8
8
|
margin-bottom: 0 !important;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
margin-bottom: 0.5rem;
|
|
29
|
-
font-family: 'RajdhaniR';
|
|
29
|
+
font-family: 'RajdhaniR', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
30
30
|
font-size: 18px;
|
|
31
31
|
font-weight: 600;
|
|
32
32
|
line-height: 18px;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
max-width: 0;
|
|
56
56
|
margin-left: -1rem;
|
|
57
57
|
color: #eb9700;
|
|
58
|
-
font-family: 'RajdhaniR';
|
|
58
|
+
font-family: 'RajdhaniR', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
59
59
|
font-size: 14px;
|
|
60
60
|
line-height: 14px;
|
|
61
61
|
transition: max-width 0.3s;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.site-designation {
|
|
76
|
-
font-family: 'RajdhaniR';
|
|
76
|
+
font-family: 'RajdhaniR', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
77
77
|
font-size: 18px;
|
|
78
78
|
font-weight: 400;
|
|
79
79
|
line-height: 18px;
|
|
@@ -14,7 +14,7 @@ div#view .ui.container.habitats-wrapper > * {
|
|
|
14
14
|
background-position: center;
|
|
15
15
|
background-repeat: no-repeat;
|
|
16
16
|
background-size: cover;
|
|
17
|
-
font-family: 'RajdhaniB';
|
|
17
|
+
font-family: 'RajdhaniB', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
18
18
|
|
|
19
19
|
.habitats-container {
|
|
20
20
|
position: absolute;
|
|
@@ -7,7 +7,7 @@ div#view .species-banner-details .ui.container > * {
|
|
|
7
7
|
padding: 1.5em 0;
|
|
8
8
|
background-color: #04a77d;
|
|
9
9
|
color: #fff;
|
|
10
|
-
font-family: 'RajdhaniB';
|
|
10
|
+
font-family: 'RajdhaniB', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
11
11
|
|
|
12
12
|
.species-details {
|
|
13
13
|
display: flex;
|
|
@@ -32,7 +32,7 @@ div#view .species-banner-details .ui.container > * {
|
|
|
32
32
|
|
|
33
33
|
.info {
|
|
34
34
|
margin-bottom: 1rem;
|
|
35
|
-
font-family: 'RajdhaniR';
|
|
35
|
+
font-family: 'RajdhaniR', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
36
36
|
font-size: 18px;
|
|
37
37
|
font-weight: 600;
|
|
38
38
|
line-height: 18px;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
axisBottom,
|
|
4
|
-
axisLeft,
|
|
5
|
-
format,
|
|
6
|
-
select,
|
|
7
|
-
scaleBand,
|
|
8
|
-
scaleLinear,
|
|
9
|
-
} from 'd3';
|
|
10
2
|
import cx from 'classnames';
|
|
3
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
11
4
|
import ChartContext from './ChartContext';
|
|
12
5
|
|
|
13
6
|
/**
|
|
@@ -19,6 +12,8 @@ import ChartContext from './ChartContext';
|
|
|
19
12
|
*/
|
|
20
13
|
|
|
21
14
|
function Chart(props) {
|
|
15
|
+
const { d3 } = props;
|
|
16
|
+
const { axisBottom, axisLeft, format, select, scaleBand, scaleLinear } = d3;
|
|
22
17
|
const [scales, setScales] = useState();
|
|
23
18
|
const [popup, setPopup] = useState();
|
|
24
19
|
const chartWrapper = useRef();
|
|
@@ -124,4 +119,4 @@ function Chart(props) {
|
|
|
124
119
|
);
|
|
125
120
|
}
|
|
126
121
|
|
|
127
|
-
export default Chart;
|
|
122
|
+
export default injectLazyLibs(['d3'])(Chart);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { scaleOrdinal, schemeSpectral, stack } from 'd3';
|
|
3
2
|
import cx from 'classnames';
|
|
3
|
+
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
4
4
|
import { adjustBrightness } from '@eeacms/volto-n2k/helpers';
|
|
5
5
|
import ChartContext from './ChartContext';
|
|
6
6
|
|
|
@@ -11,6 +11,8 @@ const getSerieData = (serie) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
function StackedBars(props) {
|
|
14
|
+
const { d3 } = props;
|
|
15
|
+
const { scaleOrdinal, schemeSpectral, stack } = d3;
|
|
14
16
|
const {
|
|
15
17
|
element,
|
|
16
18
|
height,
|
|
@@ -113,4 +115,4 @@ function StackedBars(props) {
|
|
|
113
115
|
</React.Fragment>
|
|
114
116
|
);
|
|
115
117
|
}
|
|
116
|
-
export default StackedBars;
|
|
118
|
+
export default injectLazyLibs(['d3'])(StackedBars);
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-extend-native */
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import loadable from '@loadable/component';
|
|
3
4
|
|
|
4
5
|
import localStorage from './store';
|
|
5
6
|
|
|
@@ -7,12 +8,12 @@ import installAppExtras from './components/theme/AppExtras';
|
|
|
7
8
|
|
|
8
9
|
import { LinkElement } from './components/manage/Blocks/SlateLink/render';
|
|
9
10
|
import installBodyClass from './components/manage/Blocks/BodyClass';
|
|
10
|
-
|
|
11
|
+
import installBubbleChart from './components/manage/Blocks/BubbleChart';
|
|
11
12
|
import installCarouselHorizontal from './components/manage/Blocks/CarouselHorizontal';
|
|
12
13
|
import installCddaShape from './components/manage/Blocks/CddaShape';
|
|
13
14
|
import installConnectedList from './components/manage/Blocks/List';
|
|
14
15
|
import installContactBlock from './components/manage/Blocks/ContactBlock';
|
|
15
|
-
|
|
16
|
+
import installExplodedPiesChart from './components/manage/Blocks/ExplodedPiesChart';
|
|
16
17
|
import installExploreHabitats from './components/manage/Blocks/ExploreHabitats';
|
|
17
18
|
import installExploreSites from './components/manage/Blocks/ExploreSites';
|
|
18
19
|
import installExploreSpecies from './components/manage/Blocks/ExploreSpecies';
|
|
@@ -35,7 +36,7 @@ import installSpeciesBanner from './components/manage/Blocks/SpeciesBanner';
|
|
|
35
36
|
import installSpeciesClassification from './components/manage/Blocks/SpeciesClassification';
|
|
36
37
|
import installSpeciesDistribution from './components/manage/Blocks/SpeciesDistribution';
|
|
37
38
|
import installSpeciesProtectedSites from './components/manage/Blocks/SpeciesProtectedSites';
|
|
38
|
-
|
|
39
|
+
import installStackedBarChart from './components/manage/Blocks/StackedBarChart';
|
|
39
40
|
import installTilesImages from './components/manage/Blocks/TilesImages';
|
|
40
41
|
|
|
41
42
|
import { LINK } from 'volto-slate/constants';
|
|
@@ -123,16 +124,21 @@ const applyConfig = (config) => {
|
|
|
123
124
|
|
|
124
125
|
config.settings.slate.elements[LINK] = LinkElement;
|
|
125
126
|
|
|
127
|
+
config.settings.loadables = {
|
|
128
|
+
...config.settings.loadables,
|
|
129
|
+
d3: loadable.lib(() => import('d3')),
|
|
130
|
+
};
|
|
131
|
+
|
|
126
132
|
return [
|
|
127
133
|
installAppExtras,
|
|
128
134
|
|
|
129
135
|
installBodyClass,
|
|
130
|
-
|
|
136
|
+
installBubbleChart,
|
|
131
137
|
installCarouselHorizontal,
|
|
132
138
|
installCddaShape,
|
|
133
139
|
installConnectedList,
|
|
134
140
|
installContactBlock,
|
|
135
|
-
|
|
141
|
+
installExplodedPiesChart,
|
|
136
142
|
installExploreHabitats,
|
|
137
143
|
installExploreSites,
|
|
138
144
|
installExploreSpecies,
|
|
@@ -155,7 +161,7 @@ const applyConfig = (config) => {
|
|
|
155
161
|
installSpeciesClassification,
|
|
156
162
|
installSpeciesDistribution,
|
|
157
163
|
installSpeciesProtectedSites,
|
|
158
|
-
|
|
164
|
+
installStackedBarChart,
|
|
159
165
|
installTilesImages,
|
|
160
166
|
].reduce((acc, apply) => apply(acc), config);
|
|
161
167
|
};
|
package/src/less/styles.less
CHANGED