Skip to content

Commit

Permalink
Merge pull request #58 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Sep 29, 2023
2 parents df671cf + 7b99ad3 commit d8930ad
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ -n "$CI" ] && exit 0
yarn lint-staged
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [2.0.6](https://github.com/eea/volto-eea-map/compare/2.0.5...2.0.6) - 29 September 2023

#### :house: Internal changes

- style: lint-staged reorder in package.json [Alin Voinea - [`c72036c`](https://github.com/eea/volto-eea-map/commit/c72036c7d0fe1a578280bf117de0ac7d0c3af51d)]

#### :house: Documentation changes

- docs: Update README and DEVELOP [Alin Voinea - [`bf38088`](https://github.com/eea/volto-eea-map/commit/bf38088f4e5056afbb3a949a03a73354d411e9de)]
- docs: Update README and DEVELOP [Alin Voinea - [`605f3a7`](https://github.com/eea/volto-eea-map/commit/605f3a7251ea1a9b8d49529da660a13132a04ff9)]

#### :hammer_and_wrench: Others

- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`4c6d141`](https://github.com/eea/volto-eea-map/commit/4c6d1413b67ffc3fe27a7d09dcc99ef98867cec9)]
- test: Fix package.json scripts to use makefile [Alin Voinea - [`1cd6751`](https://github.com/eea/volto-eea-map/commit/1cd675118165d8631c41d35c00a8c902c7edd803)]
- test: Fix eslint and yarn i18n [Alin Voinea - [`0184641`](https://github.com/eea/volto-eea-map/commit/018464116ba5b86b2c1e0a4ebc9b2fd95b772b66)]
- i18n: Add en [Alin Voinea - [`1d29304`](https://github.com/eea/volto-eea-map/commit/1d293049a21e138fa933cd5ed9a04cceac1a5cff)]
### [2.0.5](https://github.com/eea/volto-eea-map/compare/2.0.4...2.0.5) - 23 August 2023

#### :bug: Bug Fixes
Expand Down
25 changes: 12 additions & 13 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# volto-addon-template
# volto-eea-map

## Develop

Expand All @@ -16,12 +16,14 @@

1. Go to http://localhost:3000

1. Happy hacking!
1. Initialize git hooks

```Bash
cd src/addons/volto-eea-map/
yarn prepare
```

1. Happy hacking!

### Or add @eeacms/volto-eea-map to your Volto project

Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
Expand All @@ -32,34 +34,31 @@ Before starting make sure your development environment is properly set. See [Vol

1. Create new volto app

yo @plone/volto my-volto-project --addon @eeacms/volto-addon-template --skip-install
yo @plone/volto my-volto-project --addon @eeacms/volto-eea-map --skip-install
cd my-volto-project

1. Add the following to `mrs.developer.json`:

{
"volto-addon-template": {
"url": "https://github.com/eea/volto-addon-template.git",
"package": "@eeacms/volto-addon-template",
"volto-eea-map": {
"url": "https://github.com/eea/volto-eea-map.git",
"package": "@eeacms/volto-eea-map",
"branch": "develop",
"path": "src"
}
}

1. Install

yarn develop
make develop
yarn

1. Start backend

docker pull plone
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend

...wait for backend to setup and start - `Ready to handle requests`:

docker logs -f plone

...you can also check http://localhost:8080/Plone

1. Start frontend
Expand All @@ -70,7 +69,7 @@ Before starting make sure your development environment is properly set. See [Vol

1. Happy hacking!

cd src/addons/volto-addon-template/
cd src/addons/volto-eea-map/

## Cypress

Expand Down
66 changes: 45 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ pipeline {

stage('Tests') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
}
}
}
Expand Down Expand Up @@ -110,11 +116,17 @@ pipeline {

stage('Integration tests') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
}
}
}
Expand Down Expand Up @@ -167,13 +179,19 @@ pipeline {

stage('Report to SonarQube') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
branch 'master'
allOf {
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
allOf {
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
branch 'master'
}
}
}
Expand All @@ -199,10 +217,16 @@ pipeline {

stage('SonarQube compare to master') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
}
}
steps {
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,25 @@
[![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)
[![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)


[Volto](https://github.com/plone/volto) add-on

## Features
# Configuration

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/

# Enable data queries auto-import

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.

controlpanel/dexterity-types/{content-type-id}

# Enable Sources

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.

Demo GIF
controlpanel/dexterity-types/map_visualization

After this, sources can be added from the visualization edit interface. "Data Provenance" tab => "Add source"

## Getting started

Expand Down
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const { defineConfig } = require('cypress');

module.exports = defineConfig({
viewportWidth: 1280,
defaultCommandTimeout: 8888,
defaultCommandTimeout: 5000,
chromeWebSecurity: false,
reporter: 'junit',
video: true,
retries: {
runMode: 8,
runMode: 1,
openMode: 0,
},
reporterOptions: {
Expand Down
14 changes: 14 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language: \n"
"Language-Team: \n"
"Content-Type: \n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"


48 changes: 37 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-eea-map",
"version": "2.0.5",
"version": "2.0.6",
"description": "@eeacms/volto-eea-map: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down Expand Up @@ -36,23 +36,49 @@
"babel-plugin-transform-class-properties": "^6.24.1",
"cypress": "10.3.1",
"cypress-fail-fast": "^5.0.1",
"husky": "*",
"lint-staged": "*",
"md5": "^2.3.0"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json}": [
"make lint-fix",
"make prettier-fix"
],
"src/**/*.{jsx}": [
"make i18n"
],
"theme/**/*.{css,less}": [
"make stylelint-fix"
],
"src/**/*.{css,less}": [
"make stylelint-fix"
],
"theme/**/*.overrides": [
"make stylelint-fix"
],
"src/**/*.overrides": [
"make stylelint-fix"
]
},
"scripts": {
"release": "release-it",
"release-major-beta": "release-it major --preRelease=beta",
"release-beta": "release-it --preRelease=beta",
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
"test": "make test",
"test:fix": "make test-update",
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
"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",
"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",
"stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
"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",
"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",
"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",
"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",
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
"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",
"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"
"stylelint": "make stylelint",
"stylelint:overrides": "make stylelint-overrides",
"stylelint:fix": "make stylelint-fix",
"prettier": "make prettier",
"prettier:fix": "make prettier-fix",
"lint": "make lint",
"lint:fix": "make lint-fix",
"i18n": "make i18n",
"cypress:run": "make cypress-run",
"cypress:open": "make cypress-open",
"prepare": "husky install"
}
}
10 changes: 5 additions & 5 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export Webmap from './Webmap';
export ExtraViews from './ExtraViews';
export LegendView from './LegendView';
export { default as Webmap } from './Webmap';
export { default as ExtraViews } from './ExtraViews';
export { default as LegendView } from './LegendView';

export EmbedMapView from './Blocks/EmbedEEAMap/View';
export EmbedMapEdit from './Blocks/EmbedEEAMap/Edit';
export { default as EmbedMapView } from './Blocks/EmbedEEAMap/View';
export { default as EmbedMapEdit } from './Blocks/EmbedEEAMap/Edit';

0 comments on commit d8930ad

Please sign in to comment.