@eeacms/volto-marine-policy 1.0.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.
Files changed (154) hide show
  1. package/.coverage.babel.config.js +9 -0
  2. package/.eslintrc.js +65 -0
  3. package/.husky/pre-commit +2 -0
  4. package/.release-it.json +17 -0
  5. package/CHANGELOG.md +5 -0
  6. package/DEVELOP.md +53 -0
  7. package/DEVELOP.md.tpl +106 -0
  8. package/Jenkinsfile.tpl +416 -0
  9. package/LICENSE.md +9 -0
  10. package/Makefile.tpl +165 -0
  11. package/README.md +172 -0
  12. package/README.md.tpl +93 -0
  13. package/RELEASE.md +74 -0
  14. package/babel.config.js +17 -0
  15. package/bootstrap +41 -0
  16. package/cypress.config.js +24 -0
  17. package/docker-compose.yml +32 -0
  18. package/jest-addon.config.js +35 -0
  19. package/jest-addon.config.js.tpl +51 -0
  20. package/jest.setup.js +65 -0
  21. package/locales/de/LC_MESSAGES/volto.po +14 -0
  22. package/locales/en/LC_MESSAGES/volto.po +14 -0
  23. package/locales/it/LC_MESSAGES/volto.po +14 -0
  24. package/locales/ro/LC_MESSAGES/volto.po +14 -0
  25. package/locales/volto.pot +16 -0
  26. package/package.json +68 -0
  27. package/package.json.tpl +70 -0
  28. package/razzle.extend.js +29 -0
  29. package/src/components/Blocks/CustomBlockTemplates/customBlockTemplates.js +25 -0
  30. package/src/components/Blocks/MsfdDataExplorerBlock/Edit.jsx +29 -0
  31. package/src/components/Blocks/MsfdDataExplorerBlock/View.jsx +105 -0
  32. package/src/components/Blocks/MsfdDataExplorerBlock/index.js +23 -0
  33. package/src/components/Blocks/MsfdDataExplorerBlock/schema.jsx +30 -0
  34. package/src/components/Result/MarineMeasureItem.jsx +83 -0
  35. package/src/components/Widgets/MeasureViewWidget.jsx +233 -0
  36. package/src/components/Widgets/String.jsx +15 -0
  37. package/src/components/Widgets/TextAlign.jsx +41 -0
  38. package/src/components/Widgets/measure.css +101 -0
  39. package/src/components/index.js +15 -0
  40. package/src/components/theme/AppExtras/PrintPage/PrintPage.jsx +61 -0
  41. package/src/components/theme/AppExtras/PrintPage/css/printpage.less +29 -0
  42. package/src/components/theme/AppExtras/PrintPage/index.js +3 -0
  43. package/src/components/theme/AppExtras/ScrollToTop/ScrollToTop.jsx +61 -0
  44. package/src/components/theme/AppExtras/ScrollToTop/css/scrolltop.less +19 -0
  45. package/src/components/theme/AppExtras/ScrollToTop/index.js +3 -0
  46. package/src/components/theme/AppExtras/index.js +18 -0
  47. package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +39 -0
  48. package/src/components/theme/DatabaseItemView/style.less +87 -0
  49. package/src/components/theme/Header/HeroSection.jsx +45 -0
  50. package/src/components/theme/Header/StickyHeader.jsx +51 -0
  51. package/src/components/theme/Header/less/globals.less +18 -0
  52. package/src/components/theme/Header/less/herosection.less +64 -0
  53. package/src/components/theme/Header/less/herosection.variables +18 -0
  54. package/src/components/theme/ItemMetadata/ItemMetadata.jsx +217 -0
  55. package/src/components/theme/ItemMetadata/ItemMetadataSnippet.jsx +69 -0
  56. package/src/components/theme/ItemMetadata/ItemTitle.jsx +29 -0
  57. package/src/components/theme/MetadataListingView/MapPreview.jsx +105 -0
  58. package/src/components/theme/MetadataListingView/MetadataHeader.jsx +66 -0
  59. package/src/components/theme/MetadataListingView/MetadataListingView.jsx +36 -0
  60. package/src/components/theme/MetadataListingView/style.less +219 -0
  61. package/src/components/theme/SimpleListingView/SimpleListingView.jsx +97 -0
  62. package/src/components/theme/SimpleListingView/style.less +33 -0
  63. package/src/components/theme/Tableau/TableauDownload.jsx +86 -0
  64. package/src/components/theme/Tableau/TableauFullscreen.jsx +78 -0
  65. package/src/components/theme/Tableau/TableauShare.jsx +128 -0
  66. package/src/components/theme/View/FullwidthView.jsx +102 -0
  67. package/src/components/theme/View/HeroSectionView.jsx +125 -0
  68. package/src/constants/ActionTypes.js +12 -0
  69. package/src/constants/measureFields.js +56 -0
  70. package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +217 -0
  71. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +358 -0
  72. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
  73. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
  74. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/Logo.jsx +32 -0
  75. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/marine_logo.svg +63 -0
  76. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +81 -0
  77. package/src/customizations/volto/components/manage/Contents/README.md +1 -0
  78. package/src/customizations/volto/components/manage/Toolbar/PersonalTools.jsx +205 -0
  79. package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +624 -0
  80. package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +49 -0
  81. package/src/customizations/volto/components/theme/Breadcrumbs/README.md +1 -0
  82. package/src/customizations/volto/components/theme/Header/Header.jsx +272 -0
  83. package/src/helpers/index.js +2 -0
  84. package/src/helpers/useCopyToClipboard.js +25 -0
  85. package/src/helpers/useOutsideClick.js +20 -0
  86. package/src/icons/arrow.svg +3 -0
  87. package/src/icons/basket.svg +3 -0
  88. package/src/icons/newspaper.svg +3 -0
  89. package/src/icons/popup.svg +3 -0
  90. package/src/icons/search.svg +3 -0
  91. package/src/icons/star-full.svg +3 -0
  92. package/src/icons/user.svg +3 -0
  93. package/src/index.js +466 -0
  94. package/src/reducers/breadcrumb/breadcrumb.js +59 -0
  95. package/src/reducers/index.js +2 -0
  96. package/src/reducers/localnavigation/localnavigation.js +69 -0
  97. package/src/search/config.js +98 -0
  98. package/src/search/facets.js +85 -0
  99. package/src/search/index.js +48 -0
  100. package/src/search/views.js +15 -0
  101. package/src/slate-styles.less +43 -0
  102. package/src/static/bise_logo.svg +1 -0
  103. package/src/static/cca_logo.svg +20 -0
  104. package/src/static/ec_logo.svg +343 -0
  105. package/src/static/ec_logo_white.svg +10 -0
  106. package/src/static/eea_logo.svg +14 -0
  107. package/src/static/footer-fishes.svg +21 -0
  108. package/src/static/forest_logo.svg +30 -0
  109. package/src/static/freshwater_logo.svg +12 -0
  110. package/src/static/marine_logo.svg +63 -0
  111. package/src/static/marine_logo_white.svg +44 -0
  112. package/src/utils.js +38 -0
  113. package/theme/assets/fonts/Poppins/Poppins-Bold.ttf +0 -0
  114. package/theme/assets/fonts/Poppins/Poppins-Bold.woff +0 -0
  115. package/theme/assets/fonts/Poppins/Poppins-Bold.woff2 +0 -0
  116. package/theme/assets/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  117. package/theme/assets/fonts/Poppins/Poppins-Light.ttf +0 -0
  118. package/theme/assets/fonts/Poppins/Poppins-Light.woff +0 -0
  119. package/theme/assets/fonts/Poppins/Poppins-Light.woff2 +0 -0
  120. package/theme/assets/fonts/Poppins/Poppins-Regular.ttf +0 -0
  121. package/theme/assets/fonts/Poppins/Poppins-Regular.woff +0 -0
  122. package/theme/assets/fonts/Poppins/Poppins-Regular.woff2 +0 -0
  123. package/theme/assets/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  124. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff +0 -0
  125. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff2 +0 -0
  126. package/theme/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  127. package/theme/assets/fonts/Roboto/Roboto-Light.woff +0 -0
  128. package/theme/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
  129. package/theme/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  130. package/theme/assets/fonts/Roboto/Roboto-Medium.woff +0 -0
  131. package/theme/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  132. package/theme/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  133. package/theme/assets/fonts/Roboto/Roboto-Regular.woff +0 -0
  134. package/theme/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  135. package/theme/assets/images/Footer/ec_logo.svg +10 -0
  136. package/theme/assets/images/Header/climate-adapt-logo-1.svg +20 -0
  137. package/theme/assets/images/Header/climate-adapt-logo.svg +22 -0
  138. package/theme/assets/images/spinner.svg +1 -0
  139. package/theme/collections/table.variables +17 -0
  140. package/theme/elements/button.overrides +22 -0
  141. package/theme/extras/banner.variables +5 -0
  142. package/theme/extras/contextNavigation.overrides +60 -0
  143. package/theme/extras/contextNavigation.variables +32 -0
  144. package/theme/extras/footer.variables +6 -0
  145. package/theme/extras/header.overrides +20 -0
  146. package/theme/extras/header.variables +7 -0
  147. package/theme/extras/hero.overrides +4 -0
  148. package/theme/extras/inpageNavigation.variables +5 -0
  149. package/theme/extras/mixins.less +8 -0
  150. package/theme/globals/site.overrides +349 -0
  151. package/theme/globals/site.variables +997 -0
  152. package/theme/theme.config +136 -0
  153. package/theme/tokens/colors.less +9 -0
  154. package/theme/tokens/tokens.less +1 -0
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 European Environment Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/Makefile.tpl ADDED
@@ -0,0 +1,165 @@
1
+ ##############################################################################
2
+ # Run:
3
+ # make
4
+ # make start
5
+ #
6
+ # Go to:
7
+ #
8
+ # http://localhost:3000
9
+ #
10
+ # Cypress:
11
+ #
12
+ # make cypress-open
13
+ #
14
+ ##############################################################################
15
+ # SETUP MAKE
16
+ #
17
+ ## Defensive settings for make: https://tech.davis-hansson.com/p/make/
18
+ SHELL:=bash
19
+ .ONESHELL:
20
+ # for Makefile debugging purposes add -x to the .SHELLFLAGS
21
+ .SHELLFLAGS:=-eu -o pipefail -O inherit_errexit -c
22
+ .SILENT:
23
+ .DELETE_ON_ERROR:
24
+ MAKEFLAGS+=--warn-undefined-variables
25
+ MAKEFLAGS+=--no-builtin-rules
26
+
27
+ # Colors
28
+ # OK=Green, warn=yellow, error=red
29
+ ifeq ($(TERM),)
30
+ # no colors if not in terminal
31
+ MARK_COLOR=
32
+ OK_COLOR=
33
+ WARN_COLOR=
34
+ ERROR_COLOR=
35
+ NO_COLOR=
36
+ else
37
+ MARK_COLOR=`tput setaf 6`
38
+ OK_COLOR=`tput setaf 2`
39
+ WARN_COLOR=`tput setaf 3`
40
+ ERROR_COLOR=`tput setaf 1`
41
+ NO_COLOR=`tput sgr0`
42
+ endif
43
+
44
+ ##############################################################################
45
+ # SETTINGS AND VARIABLE
46
+ DIR=$(shell basename $$(pwd))
47
+ NODE_MODULES?="../../../node_modules"
48
+ PLONE_VERSION?=6
49
+ VOLTO_VERSION?=17
50
+ ADDON_PATH="${DIR}"
51
+ ADDON_NAME="@eeacms/${ADDON_PATH}"
52
+ DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose
53
+ RAZZLE_INTERNAL_API_PATH?="http://localhost:8080/Plone"
54
+ RAZZLE_DEV_PROXY_API_PATH?="${RAZZLE_INTERNAL_API_PATH}"
55
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}"
56
+
57
+
58
+
59
+ # Top-level targets
60
+ .PHONY: all
61
+ all: clean install
62
+
63
+ .PHONY: clean
64
+ clean: ## Cleanup development environment
65
+ ${DOCKER_COMPOSE} down --volumes --remove-orphans
66
+
67
+ .PHONY: install
68
+ install: ## Build and install development environment
69
+ echo "Running: ${DOCKER_COMPOSE} build"
70
+ ${DOCKER_COMPOSE} pull
71
+ ${DOCKER_COMPOSE} build
72
+
73
+ .PHONY: start
74
+ start: ## Start development environment
75
+ echo "Running: ${DOCKER_COMPOSE} up"
76
+ ${DOCKER_COMPOSE} up
77
+
78
+ .PHONY: shell
79
+ shell: ## Start a shell in the frontend container
80
+ echo "Running: ${DOCKER_COMPOSE} run frontend bash"
81
+ ${DOCKER_COMPOSE} run --entrypoint=bash frontend
82
+
83
+ .PHONY: cypress-open
84
+ cypress-open: ## Open cypress integration tests
85
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
86
+
87
+ .PHONY: cypress-run
88
+ cypress-run: ## Run cypress integration tests
89
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
90
+
91
+ .PHONY: test
92
+ test: ## Run jest tests
93
+ ${DOCKER_COMPOSE} run -e CI=1 frontend test
94
+
95
+ .PHONY: test-update
96
+ test-update: ## Update jest tests snapshots
97
+ ${DOCKER_COMPOSE} run -e CI=1 frontend test -u
98
+
99
+ .PHONY: stylelint
100
+ stylelint: ## Stylelint
101
+ $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}'
102
+
103
+ .PHONY: stylelint-overrides
104
+ stylelint-overrides:
105
+ $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
106
+
107
+ .PHONY: stylelint-fix
108
+ stylelint-fix: ## Fix stylelint
109
+ $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' --fix
110
+ $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
111
+
112
+ .PHONY: prettier
113
+ prettier: ## Prettier
114
+ $(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'
115
+
116
+ .PHONY: prettier-fix
117
+ prettier-fix: ## Fix prettier
118
+ $(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'
119
+
120
+ .PHONY: lint
121
+ lint: ## ES Lint
122
+ $(NODE_MODULES)/.bin/eslint --max-warnings=0 'src/**/*.{js,jsx}'
123
+
124
+ .PHONY: lint-fix
125
+ lint-fix: ## Fix ES Lint
126
+ $(NODE_MODULES)/.bin/eslint --fix 'src/**/*.{js,jsx}'
127
+
128
+ .PHONY: i18n
129
+ i18n: ## i18n
130
+ rm -rf build/messages
131
+ NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon
132
+
133
+ .PHONY: help
134
+ help: ## Show this help.
135
+ @echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
136
+ head -n 14 Makefile
137
+
138
+ .PHONY: ci-fix
139
+ ci-fix:
140
+ echo "Running lint-fix"
141
+ make lint-fix
142
+ echo "Running prettier-fix"
143
+ make prettier-fix
144
+ echo "Running stylelint-fix"
145
+ make stylelint-fix
146
+
147
+ .PHONY: test-ci
148
+ test-ci:
149
+ cd /app
150
+ RAZZLE_JEST_CONFIG=src/addons/${ADDON_PATH}/jest-addon.config.js CI=true yarn test src/addons/${ADDON_PATH}/src --watchAll=false --reporters=default --reporters=jest-junit --collectCoverage --coverageReporters lcov cobertura text
151
+
152
+ .PHONY: start-ci
153
+ start-ci:
154
+ cp .coverage.babel.config.js /app/babel.config.js
155
+ cd ../..
156
+ yarn start
157
+
158
+ .PHONY: check-ci
159
+ check-ci:
160
+ $(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
161
+
162
+ .PHONY: cypress-ci
163
+ cypress-ci:
164
+ $(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
165
+ CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chromium
package/README.md ADDED
@@ -0,0 +1,172 @@
1
+ # volto-marine-policy
2
+
3
+ [![Releases](https://img.shields.io/github/v/release/eea/volto-marine-policy)](https://github.com/eea/volto-marine-policy/releases)
4
+
5
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-marine-policy%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-marine-policy/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-master)
10
+
11
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-marine-policy%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-marine-policy/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-marine-policy-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-marine-policy-develop)
16
+
17
+ [Volto](https://github.com/plone/volto) add-on
18
+
19
+ ## Features
20
+
21
+ Demo GIF
22
+
23
+ ## Getting started
24
+
25
+ ### Try volto-marine-policy with Docker
26
+
27
+ 1. Get the latest Docker images
28
+
29
+ ```
30
+ docker pull plone
31
+ docker pull plone/volto
32
+ ```
33
+
34
+ 1. Start Plone backend
35
+
36
+ ```
37
+ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
38
+ ```
39
+
40
+ 1. Start Volto frontend
41
+
42
+ ```
43
+ docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-marine-policy" plone/volto
44
+ ```
45
+
46
+ 1. Go to http://localhost:3000
47
+
48
+ ### Add volto-marine-policy to your Volto project
49
+
50
+ 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
51
+
52
+ 1. Start Volto frontend
53
+
54
+ - If you already have a volto project, just update `package.json`:
55
+
56
+ ```JSON
57
+ "addons": [
58
+ "@eeacms/volto-marine-policy"
59
+ ],
60
+
61
+ "dependencies": {
62
+ "@eeacms/volto-marine-policy": "^1.0.0"
63
+ }
64
+ ```
65
+
66
+ - If not, create one:
67
+
68
+ ```
69
+ npm install -g yo @plone/generator-volto
70
+ yo @plone/volto my-volto-project --addon @eeacms/volto-marine-policy
71
+ cd my-volto-project
72
+ ```
73
+
74
+ 1. Install new add-ons and restart Volto:
75
+
76
+ ```
77
+ yarn
78
+ yarn start
79
+ ```
80
+
81
+ 1. Go to http://localhost:3000
82
+
83
+ 1. Happy editing!
84
+
85
+ ## Release
86
+
87
+ ### Automatic release using Jenkins
88
+
89
+ - 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.
90
+ - It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
91
+ - 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.
92
+ - 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.
93
+ - 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.
94
+ - The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
95
+ - 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.
96
+ - Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
97
+
98
+ ### Manual release from the develop branch ( beta release )
99
+
100
+ #### Installation and configuration of release-it
101
+
102
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
103
+
104
+ ```
105
+ npm install -g release-it
106
+ ```
107
+
108
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
109
+
110
+ Release-it is a tool that automates 4 important steps in the release process:
111
+
112
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
113
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
114
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
115
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
116
+
117
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
118
+
119
+ ```
120
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
121
+ ```
122
+
123
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
124
+
125
+ ```
126
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
127
+ ```
128
+
129
+ #### Using release-it tool
130
+
131
+ There are 3 yarn scripts that can be run to do the release
132
+
133
+ ##### yarn release-beta
134
+
135
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
136
+
137
+ ```
138
+ ? Select increment (next version):
139
+ ❯ prepatch (0.1.1-beta.0)
140
+ preminor (0.2.0-beta.0)
141
+ premajor (1.0.0-beta.0)
142
+ Other, please specify...
143
+ ```
144
+
145
+ ##### yarn release-major-beta
146
+
147
+ Same as `yarn release-beta`, but with premajor version pre-selected.
148
+
149
+ ##### yarn release
150
+
151
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
152
+
153
+ #### Important notes
154
+
155
+ > 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.
156
+
157
+ > 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).
158
+
159
+ ## How to contribute
160
+
161
+ See [DEVELOP.md](https://github.com/eea/volto-marine-policy/blob/master/DEVELOP.md).
162
+
163
+ ## Copyright and license
164
+
165
+ The Initial Owner of the Original Code is European Environment Agency (EEA).
166
+ All Rights Reserved.
167
+
168
+ See [LICENSE.md](https://github.com/eea/volto-marine-policy/blob/master/LICENSE.md) for details.
169
+
170
+ ## Funding
171
+
172
+ [European Environment Agency (EU)](http://eea.europa.eu)
package/README.md.tpl ADDED
@@ -0,0 +1,93 @@
1
+ # <%= name %>
2
+
3
+ [![Releases](https://img.shields.io/github/v/release/eea/<%= name %>)](https://github.com/eea/<%= name %>/releases)
4
+
5
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2F<%= name %>%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/<%= name %>/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-master)
10
+
11
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2F<%= name %>%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/<%= name %>/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=<%= name %>-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=<%= name %>-develop)
16
+
17
+
18
+ [Volto](https://github.com/plone/volto) add-on
19
+
20
+ ## Features
21
+
22
+ Demo GIF
23
+
24
+ ## Getting started
25
+
26
+ ### Try <%= name %> with Docker
27
+
28
+ git clone https://github.com/eea/<%= name %>.git
29
+ cd <%= name %>
30
+ make
31
+ make start
32
+
33
+ Go to http://localhost:3000
34
+
35
+ ### Add <%= name %> 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
38
+
39
+ ```Bash
40
+ docker compose up backend
41
+ ```
42
+
43
+ 1. Start Volto frontend
44
+
45
+ * If you already have a volto project, just update `package.json`:
46
+
47
+ ```JSON
48
+ "addons": [
49
+ "<%= addonName %>"
50
+ ],
51
+
52
+ "dependencies": {
53
+ "<%= addonName %>": "*"
54
+ }
55
+ ```
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 <%= addonName %>
62
+ cd my-volto-project
63
+ ```
64
+
65
+ 1. Install new add-ons and restart Volto:
66
+
67
+ ```
68
+ yarn
69
+ yarn start
70
+ ```
71
+
72
+ 1. Go to http://localhost:3000
73
+
74
+ 1. Happy editing!
75
+
76
+ ## Release
77
+
78
+ See [RELEASE.md](https://github.com/eea/<%= name %>/blob/master/RELEASE.md).
79
+
80
+ ## How to contribute
81
+
82
+ See [DEVELOP.md](https://github.com/eea/<%= name %>/blob/master/DEVELOP.md).
83
+
84
+ ## Copyright and license
85
+
86
+ The Initial Owner of the Original Code is European Environment Agency (EEA).
87
+ All Rights Reserved.
88
+
89
+ See [LICENSE.md](https://github.com/eea/<%= name %>/blob/master/LICENSE.md) for details.
90
+
91
+ ## Funding
92
+
93
+ [European Environment Agency (EU)](http://eea.europa.eu)
package/RELEASE.md ADDED
@@ -0,0 +1,74 @@
1
+ ## Release
2
+
3
+ ### Automatic release using Jenkins
4
+
5
+ * 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.
6
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
7
+ * 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.
8
+ * 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.
9
+ * 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.
10
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
11
+ * 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.
12
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
13
+
14
+ ### Manual release from the develop branch ( beta release )
15
+
16
+ #### Installation and configuration of release-it
17
+
18
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
19
+
20
+ ```
21
+ npm install -g release-it
22
+ ```
23
+
24
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
+
26
+ Release-it is a tool that automates 4 important steps in the release process:
27
+
28
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
29
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
30
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
+
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
+
35
+ ```
36
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
+ ```
38
+
39
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
+
41
+ ```
42
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
+ ```
44
+
45
+ #### Using release-it tool
46
+
47
+ There are 3 yarn scripts that can be run to do the release
48
+
49
+ ##### yarn release-beta
50
+
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
+
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...
59
+ ```
60
+
61
+ ##### yarn release-major-beta
62
+
63
+ Same as `yarn release-beta`, but with premajor version pre-selected.
64
+
65
+ ##### yarn release
66
+
67
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
+
69
+ #### Important notes
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.
72
+
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
+
@@ -0,0 +1,17 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ const presets = ['razzle'];
4
+ const plugins = [
5
+ [
6
+ 'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
7
+ {
8
+ messagesDir: './build/messages/',
9
+ },
10
+ ],
11
+ ];
12
+
13
+ return {
14
+ plugins,
15
+ presets,
16
+ };
17
+ };
package/bootstrap ADDED
@@ -0,0 +1,41 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const ejs = require('ejs');
4
+
5
+ const currentDir = path.basename(process.cwd());
6
+
7
+ const bootstrap = function (ofile) {
8
+ fs.readFile(ofile, 'utf8', function (err, data) {
9
+ if (err) {
10
+ return console.log(err);
11
+ }
12
+ const result = ejs.render(data, {
13
+ addonName: `@eeacms/${currentDir}`,
14
+ name: currentDir
15
+ });
16
+ const output = ofile.replace('.tpl', '');
17
+ fs.writeFile(output, result, 'utf8', function (err) {
18
+ if (err) {
19
+ return console.log(err);
20
+ }
21
+ });
22
+ if (ofile.includes('.tpl')) {
23
+ fs.unlink(ofile, (err) => {
24
+ if (err) {
25
+ return console.error(err);
26
+ }
27
+ });
28
+ }
29
+ });
30
+ }
31
+
32
+ fs.readdir(".", { withFileTypes: true }, (err, dirents) => {
33
+ const files = dirents
34
+ .filter(dirent => dirent.isFile())
35
+ .map(dirent => dirent.name);
36
+ files.forEach(function (file) {
37
+ if (file != 'bootstrap') {
38
+ bootstrap(file);
39
+ }
40
+ });
41
+ });
@@ -0,0 +1,24 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ },
22
+ baseUrl: 'http://localhost:3000',
23
+ },
24
+ });
@@ -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"
@@ -0,0 +1,35 @@
1
+ module.exports = {
2
+ testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
3
+ collectCoverageFrom: [
4
+ 'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
5
+ '!src/**/*.d.ts',
6
+ ],
7
+ moduleNameMapper: {
8
+ '@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
9
+ '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
+ '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
+ '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
+ '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
+ '@plone/volto-slate':
15
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
16
+ '~/(.*)$': '<rootDir>/src/$1',
17
+ 'load-volto-addons':
18
+ '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
19
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
20
+ },
21
+ transform: {
22
+ '^.+\\.js(x)?$': 'babel-jest',
23
+ '^.+\\.(png)$': 'jest-file',
24
+ '^.+\\.(jpg)$': 'jest-file',
25
+ '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
26
+ },
27
+ coverageThreshold: {
28
+ global: {
29
+ branches: 5,
30
+ functions: 5,
31
+ lines: 5,
32
+ statements: 5,
33
+ },
34
+ },
35
+ };