Skip to content

Commit

Permalink
Merge pull request #28 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Feb 19, 2024
2 parents abdab9b + f10f8bf commit ecc502c
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 64 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Jest configuration variables
# - possible values: ON, OFF
JEST_USE_SETUP=OFF
65 changes: 65 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const fs = require('fs');
const path = require('path');
const projectRootPath = fs.realpathSync(__dirname + '/../../../');

let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
let configFile;
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
configFile = `${projectRootPath}/tsconfig.json`;
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
configFile = `${projectRootPath}/jsconfig.json`;

if (configFile) {
const jsConfig = require(configFile).compilerOptions;
const pathsConfig = jsConfig.paths;
if (pathsConfig['@plone/volto'])
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
}

const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
const reg = new AddonConfigurationRegistry(projectRootPath);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(reg.packages).map((o) => [
o,
reg.packages[o].modulePath,
]);

const addonExtenders = reg.getEslintExtenders().map((m) => require(m));

const defaultConfig = {
extends: `${voltoPath}/.eslintrc`,
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', '@plone/volto/src'],
['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
...addonAliases,
['@package', `${__dirname}/src`],
['@root', `${__dirname}/src`],
['~', `${__dirname}/src`],
],
extensions: ['.js', '.jsx', '.json'],
},
'babel-plugin-root-import': {
rootPathSuffix: 'src',
},
},
},
rules: {
'react/jsx-no-target-blank': [
'error',
{
allowReferrer: true,
},
],
}
};

const config = addonExtenders.reduce(
(acc, extender) => extender.modify(acc),
defaultConfig,
);

module.exports = config;
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode/
.history
.eslintrc.js
.nyc_output
project
coverage
Expand Down
48 changes: 0 additions & 48 deletions .project.eslintrc.js

This file was deleted.

43 changes: 43 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).

### [4.3.1](https://github.com/eea/volto-call-to-action-block/compare/4.3.0...4.3.1) - 19 February 2024

#### :bug: Bug Fixes

- fix: remove norefferer for seo purposes #27 from eea/263008-noreferrer [ichim-david - [`6ff0547`](https://github.com/eea/volto-call-to-action-block/commit/6ff05478152b381701264323730efc6602056491)]
- fix: remove norefferer for seo purposes [hazigabriel - [`1f3bd81`](https://github.com/eea/volto-call-to-action-block/commit/1f3bd810e1bd5ea00fdc29ccbcd4e1a943226741)]

#### :house: Internal changes

- chore: package.json [Alin Voinea - [`9c57459`](https://github.com/eea/volto-call-to-action-block/commit/9c574593e82b1dc063dc21028b164905458cbd96)]
- style: Automated code fix [eea-jenkins - [`1e73384`](https://github.com/eea/volto-call-to-action-block/commit/1e73384498c3e7e8dce4d657a6d103e7b0498784)]

#### :hammer_and_wrench: Others

- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`c6c7eb8`](https://github.com/eea/volto-call-to-action-block/commit/c6c7eb868fca220f35f1a7d9932c18be5353d671)]
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`47dc9e2`](https://github.com/eea/volto-call-to-action-block/commit/47dc9e2d224e1dc3ea873df912108d24b51bccbf)]
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`da3e7c3`](https://github.com/eea/volto-call-to-action-block/commit/da3e7c3cfd3d35e8316f3f9e9707983698b7ecec)]
### [4.3.0](https://github.com/eea/volto-call-to-action-block/compare/4.2.2...4.3.0) - 16 January 2024

#### :bug: Bug Fixes
Expand All @@ -13,15 +30,22 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Release 4.3.0 [Alin Voinea - [`b491422`](https://github.com/eea/volto-call-to-action-block/commit/b4914228e57f318fbca137f411dd49f3712df9c8)]
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`c6057b3`](https://github.com/eea/volto-call-to-action-block/commit/c6057b319380f1ebcb5cc7fbeb529e444fff4705)]
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`e44ba72`](https://github.com/eea/volto-call-to-action-block/commit/e44ba72a949a5eeb034acf50af9f6fc3c69b355b)]
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`85a327e`](https://github.com/eea/volto-call-to-action-block/commit/85a327e45eca2ad418cc362842925eda53bb57eb)]
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`afd3faf`](https://github.com/eea/volto-call-to-action-block/commit/afd3faf1a9e85a7f88dcb14b53c0c8c4bdb87745)]
- test: [JENKINS] Improve cypress time [valentinab25 - [`09e77ac`](https://github.com/eea/volto-call-to-action-block/commit/09e77acaa10dda801c8dbb5d49b087f6aabf0ba3)]
### [4.2.2](https://github.com/eea/volto-call-to-action-block/compare/4.2.1...4.2.2) - 2 November 2023

#### :house: Internal changes

- chore: [JENKINS] Refactor automated testing [valentinab25 - [`478cf6c`](https://github.com/eea/volto-call-to-action-block/commit/478cf6c50122dada7bb1f7859bd8e9795828db49)]
- chore: husky, lint-staged use fixed versions [valentinab25 - [`67f68bc`](https://github.com/eea/volto-call-to-action-block/commit/67f68bcc6fde8888cb44b0c483b4c1933d207e54)]
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`e958386`](https://github.com/eea/volto-call-to-action-block/commit/e95838603735d0ebfa7829359d1503a4e06a39ac)]

#### :hammer_and_wrench: Others

- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`6a58b9c`](https://github.com/eea/volto-call-to-action-block/commit/6a58b9cde2882d1f0996a5329823bb3a6e03011b)]
- Update README.md [ana-oprea - [`f9b73a5`](https://github.com/eea/volto-call-to-action-block/commit/f9b73a50664cf4a4f1292eb2d5a93dd156e70639)]
### [4.2.1](https://github.com/eea/volto-call-to-action-block/compare/4.2.0...4.2.1) - 29 September 2023

Expand Down Expand Up @@ -53,6 +77,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`8522a41`](https://github.com/eea/volto-call-to-action-block/commit/8522a4181a5a622c2e30482dee26cd740d6c3d09)]
- i18n: Add en [Alin Voinea - [`be35c5d`](https://github.com/eea/volto-call-to-action-block/commit/be35c5dc9ba4f29d5abd6c8eb261371e8daf23bf)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`567a4ac`](https://github.com/eea/volto-call-to-action-block/commit/567a4ac159360e799ddc5fdcdbef5ec1e453dbe9)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`647da7b`](https://github.com/eea/volto-call-to-action-block/commit/647da7bcd410cf2731835f4246888ec97a793bb5)]
### [4.1.4](https://github.com/eea/volto-call-to-action-block/compare/4.1.3...4.1.4) - 16 June 2023

### [4.1.3](https://github.com/eea/volto-call-to-action-block/compare/4.1.2...4.1.3) - 14 June 2023
Expand All @@ -61,11 +86,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`2e2d8ad`](https://github.com/eea/volto-call-to-action-block/commit/2e2d8ad039cd60ac5391b63d5359b5bf7cb4d4a5)]

#### :hammer_and_wrench: Others

- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`e9c4a3f`](https://github.com/eea/volto-call-to-action-block/commit/e9c4a3f6fd4ecad1e1ff2ef28876dcb500ecd4b3)]
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`8a67d7f`](https://github.com/eea/volto-call-to-action-block/commit/8a67d7f21794a33976bbf46b84309cca0c9e58fd)]
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`3ae3cb5`](https://github.com/eea/volto-call-to-action-block/commit/3ae3cb51c08b53530cca88921fd8bbc097fa6b70)]
### [4.1.1](https://github.com/eea/volto-call-to-action-block/compare/4.1.0...4.1.1) - 4 April 2023

#### :nail_care: Enhancements
Expand All @@ -77,6 +104,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`8911bba`](https://github.com/eea/volto-call-to-action-block/commit/8911bbadbe3036432c8d083cc836d3ab7f36c01c)]
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`d58685c`](https://github.com/eea/volto-call-to-action-block/commit/d58685ca755e59cd77090ddeb446855d56a73876)]
## [4.0.0](https://github.com/eea/volto-call-to-action-block/compare/3.0.1...4.0.0) - 7 February 2023

#### :nail_care: Enhancements
Expand All @@ -96,7 +125,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`e46fb39`](https://github.com/eea/volto-call-to-action-block/commit/e46fb392ba15f9280e1a2d91b38e4acaa3105486)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`184e4d5`](https://github.com/eea/volto-call-to-action-block/commit/184e4d527764cbb754398b7c1975268c0eacdc86)]
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`8ff40cc`](https://github.com/eea/volto-call-to-action-block/commit/8ff40cc8fb5087bd0f56fbc3e38a26f5d61d63fa)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`d1ba7b8`](https://github.com/eea/volto-call-to-action-block/commit/d1ba7b844f114305604e7f8c8b3158746dd59a7b)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`4dea109`](https://github.com/eea/volto-call-to-action-block/commit/4dea10962560c760c2c44db27d3446a4268ded57)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`fd6b7f3`](https://github.com/eea/volto-call-to-action-block/commit/fd6b7f31d28e05ed254a32bb213ad662e2635c96)]
- yarn 3 [Alin Voinea - [`8bfd09a`](https://github.com/eea/volto-call-to-action-block/commit/8bfd09a161d1d0b3174585c172a3804e56315dea)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`440cd71`](https://github.com/eea/volto-call-to-action-block/commit/440cd71451fd5d5ef0316b5c74b61e66170444a7)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`e05f0dd`](https://github.com/eea/volto-call-to-action-block/commit/e05f0dd0cf782872b4105f3305c7f40ccb69cbb9)]
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`6d44be8`](https://github.com/eea/volto-call-to-action-block/commit/6d44be88d8aabd57a8b74a3e16be7032dfda5eee)]
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`4867cf3`](https://github.com/eea/volto-call-to-action-block/commit/4867cf362a91ea38bded8598d1937d33b35a12ab)]
## [2.0.0](https://github.com/eea/volto-call-to-action-block/compare/1.0.0...2.0.0) - 16 November 2022

#### :nail_care: Enhancements
Expand All @@ -106,6 +145,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`39e8df4`](https://github.com/eea/volto-call-to-action-block/commit/39e8df468509414924327917154f035235ec5798)]
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`0e06348`](https://github.com/eea/volto-call-to-action-block/commit/0e06348412feed9eeea6ae5d06ae59b8c21e4eff)]
- test(cypress): Rename [Alin Voinea - [`ef8b823`](https://github.com/eea/volto-call-to-action-block/commit/ef8b82323a0c108e58f73c180f5b4cb23ed04f0e)]
## [1.0.0](https://github.com/eea/volto-call-to-action-block/compare/0.2.4...1.0.0) - 28 October 2022

Expand All @@ -119,13 +159,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- test(cypress): Fix typo [Alin Voinea - [`f3cc342`](https://github.com/eea/volto-call-to-action-block/commit/f3cc3424ace81d26b296882b8484d6b6b12b0d28)]
- Cleanup [Alin Voinea - [`2e63ef6`](https://github.com/eea/volto-call-to-action-block/commit/2e63ef665d3812d44b6a87bac6c7f657e40e2147)]
- Update dependencies [Alin Voinea - [`cfb5062`](https://github.com/eea/volto-call-to-action-block/commit/cfb50627df9a9a15ebe67adc43dac97379c64efb)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`09c7c14`](https://github.com/eea/volto-call-to-action-block/commit/09c7c14265b0e63f054c3373530ba1dfbd39f4f7)]
### [0.2.4](https://github.com/eea/volto-call-to-action-block/compare/0.2.3...0.2.4) - 30 June 2022

### [0.2.3](https://github.com/eea/volto-call-to-action-block/compare/0.2.2...0.2.3) - 30 June 2022

#### :hammer_and_wrench: Others

- Add tertiary theming option [Alin Voinea - [`c133291`](https://github.com/eea/volto-call-to-action-block/commit/c133291f17c7a8800271bafe96c008dae3b4ee79)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`720a9a6`](https://github.com/eea/volto-call-to-action-block/commit/720a9a62f1505906b5e6e0667272e07598a67972)]
### [0.2.2](https://github.com/eea/volto-call-to-action-block/compare/0.2.1...0.2.2) - 2 June 2022

### [0.2.1](https://github.com/eea/volto-call-to-action-block/compare/0.2.0...0.2.1) - 2 June 2022
Expand All @@ -148,4 +190,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn bootstrap [Alin Voinea - [`12f3e83`](https://github.com/eea/volto-call-to-action-block/commit/12f3e834d6d3e257cb9e7b6dde80dab783613a01)]
- Initial commit [Alin Voinea - [`00f39c8`](https://github.com/eea/volto-call-to-action-block/commit/00f39c8a36327a821cc613a772bf228451a71e67)]
11 changes: 9 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipeline {
environment {
GIT_NAME = "volto-call-to-action-block"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,forest.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,biodiversity.europa.eu,climate-adapt.eea.europa.eu,climate-energy.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-ims,www.eea.europa.eu-en,industry.eea.europa.eu,water.europa.eu-freshwater,land.copernicus.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,forest.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,biodiversity.europa.eu,climate-adapt.eea.europa.eu,climate-energy.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-ims,www.eea.europa.eu-en,industry.eea.europa.eu,water.europa.eu-freshwater,land.copernicus.eu,insitu-frontend.eionet.europa.eu"
DEPENDENCIES = ""
BACKEND_PROFILES = "eea.kitkat:testing"
BACKEND_ADDONS = ""
Expand Down Expand Up @@ -162,10 +162,16 @@ pipeline {
script {
try {
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
sh '''docker run -d --shm-size=3g --link $IMAGE_NAME-plone:plone --name="$IMAGE_NAME-cypress" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend start-ci'''
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone:plone --name="$IMAGE_NAME-cypress" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend start-ci'''
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make check-ci''', returnStatus: true
if ( frontend != 0 ) {
sh '''docker logs $IMAGE_NAME-cypress; exit 1'''
}

sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress make cypress-ci'''
} finally {
try {
if ( frontend == 0 ) {
sh '''rm -rf cypress-videos cypress-results cypress-coverage cypress-screenshots'''
sh '''mkdir -p cypress-videos cypress-results cypress-coverage cypress-screenshots'''
videos = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos/''', returnStatus: true
Expand All @@ -189,6 +195,7 @@ pipeline {
sh '''for file in $(find cypress-results -name *.xml); do if [ $(grep -E 'failures="[1-9].*"' $file | wc -l) -eq 0 ]; then testname=$(grep -E 'file=.*failures="0"' $file | sed 's#.* file=".*\\/\\(.*\\.[jsxt]\\+\\)" time.*#\\1#' ); rm -f cypress-videos/videos/$testname.mp4; fi; done'''
archiveArtifacts artifacts: 'cypress-videos/**/*.mp4', fingerprint: true, allowEmptyArchive: true
}
}
} finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ cypress-open: ## Open cypress integration tests

.PHONY: cypress-run
cypress-run: ## Run cypress integration tests
CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chromium
CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run

.PHONY: test
test: ## Run jest tests
Expand Down Expand Up @@ -155,8 +155,11 @@ start-ci:
cd ../..
yarn start

.PHONY: check-ci
check-ci:
$(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000

.PHONY: cypress-ci
cypress-ci:
$(NODE_MODULES)/.bin/wait-on -t 240000 http://localhost:3000
NODE_ENV=development make cypress-run

CYPRESS_API_PATH="${RAZZLE_DEV_PROXY_API_PATH}" NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run --browser chromium
Loading

0 comments on commit ecc502c

Please sign in to comment.