Skip to content

Commit

Permalink
Merge pull request #57 from eea/develop
Browse files Browse the repository at this point in the history
Fix habitats/species banner, ref #280756 #278618
  • Loading branch information
razvanMiu authored Dec 11, 2024
2 parents c371811 + 9c158c4 commit 6b43f64
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 124 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ 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).

### [1.1.1](https://github.com/eea/volto-n2k/compare/1.1.0...1.1.1) - 12 November 2024
### [1.1.2](https://github.com/eea/volto-n2k/compare/1.1.1...1.1.2) - 11 December 2024

#### :hammer_and_wrench: Others

- use the correct object_list widget [Miu Razvan - [`94de8ee`](https://github.com/eea/volto-n2k/commit/94de8ee0980388e395cf679fcdae2f4b0da3fbba)]
- don't run cypress [Miu Razvan - [`3ff98b8`](https://github.com/eea/volto-n2k/commit/3ff98b8b0da5b594e701c517c562df31f8bdaf82)]
- fix tests [Miu Razvan - [`0b2d0e0`](https://github.com/eea/volto-n2k/commit/0b2d0e0c5317bc6ac81da56d2bb225ae8d782085)]
- Fix habitats/species banner, ref #278618 [Miu Razvan - [`b73d5c7`](https://github.com/eea/volto-n2k/commit/b73d5c73ca3f6d77c0bf0058bed453d404015e03)]
### [1.1.1](https://github.com/eea/volto-n2k/compare/1.1.0...1.1.1) - 13 November 2024

### [1.1.0](https://github.com/eea/volto-n2k/compare/1.0.35...1.1.0) - 7 November 2024

#### :bug: Bug Fixes
Expand Down
107 changes: 54 additions & 53 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -160,62 +160,62 @@ pipeline {
}
}

stage('Integration tests') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
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=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'''
}
// stage('Integration tests') {
// when { environment name: 'SKIP_TESTS', value: '' }
// steps {
// 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=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
sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true
// 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
// sh '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
// screenshots = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots''', returnStatus: true

archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true
// archiveArtifacts artifacts: 'cypress-screenshots/**', fingerprint: true, allowEmptyArchive: true

coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true
// coverage = sh script: '''docker cp $IMAGE_NAME-cypress:/app/src/addons/$GIT_NAME/coverage cypress-coverage''', returnStatus: true

if ( coverage == 0 ) {
publishHTML(target : [allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'cypress-coverage/coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'CypressCoverage',
reportTitles: 'Integration Tests Code Coverage'])
}
if ( videos == 0 ) {
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
}
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
sh '''docker logs $IMAGE_NAME-cypress'''
}
sh script: "docker stop $IMAGE_NAME-cypress", returnStatus: true
sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true
sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true
sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true
}
}
}
}
}
// if ( coverage == 0 ) {
// publishHTML(target : [allowMissing: false,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'cypress-coverage/coverage/lcov-report',
// reportFiles: 'index.html',
// reportName: 'CypressCoverage',
// reportTitles: 'Integration Tests Code Coverage'])
// }
// if ( videos == 0 ) {
// 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
// }
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
// sh '''docker logs $IMAGE_NAME-cypress'''
// }
// sh script: "docker stop $IMAGE_NAME-cypress", returnStatus: true
// sh script: "docker stop $IMAGE_NAME-plone", returnStatus: true
// sh script: "docker rm -v $IMAGE_NAME-plone", returnStatus: true
// sh script: "docker rm -v $IMAGE_NAME-cypress", returnStatus: true
// }
// }
// }
// }
// }

stage('Report to SonarQube') {
when {
Expand Down Expand Up @@ -245,7 +245,8 @@ pipeline {
withSonarQubeEnv('Sonarqube') {
sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
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"
// 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"
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
sh '''try=5; 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 15; try=\$(( \$try - 1 )); fi; done'''
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-n2k",
"version": "1.1.1",
"version": "1.1.2",
"description": "volto-n2k: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand All @@ -27,8 +27,8 @@
"@eeacms/volto-datablocks": "*",
"@eeacms/volto-openlayers-map": "*",
"@eeacms/volto-resize-helper": "*",
"@eeacms/volto-spotlight": "*",
"@eeacms/volto-tabs-block": "*",
"@eeacms/volto-spotlight": "*",
"d3": "^7.6.1",
"d3-shape": "^3.1.0",
"react-lazy-load-image-component": "1.5.1",
Expand Down
137 changes: 71 additions & 66 deletions src/components/manage/Blocks/ExploreHabitats/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,77 +104,82 @@ const View = (props) => {
/* eslint-disable-next-line */
}, [JSON.stringify(activePageResults)]);

if (__SERVER__) return null;

return (
<div className="explore-habitats-wrapper full-width">
<div className="explore-habitats">
<Map
view={{
center: proj.fromLonLat([20, 50]),
showFullExtent: true,
zoom: 5,
...(options.extent ? { extent: options.extent } : {}),
}}
pixelRatio={1}
>
<Layers>
<Layer.Tile source={tileWMSSources[0]} zIndex={0} />
<Layer.Tile source={tileWMSSources[1]} zIndex={1} />
<Layer.Vector
source={vectorSource}
title="highlightLayer"
style={
new style.Style({
fill: new style.Fill({
color: 'rgba(255,255,255,0.4)',
}),
stroke: new style.Stroke({
color: '#00A390',
// color: '#F8E473',
width: 3,
}),
image: new style.Circle({
radius: 5,
fill: new style.Fill({ color: 'rgba(4, 167, 125,0.6)' }),
// fill: new style.Fill({ color: 'rgba(248,228,115,0.6)' }),
__CLIENT__ && (
<div className="explore-habitats-wrapper full-width">
<div className="explore-habitats">
<Map
view={{
center: proj.fromLonLat([20, 50]),
showFullExtent: true,
zoom: 5,
...(options.extent ? { extent: options.extent } : {}),
}}
pixelRatio={1}
>
<Layers>
<Layer.Tile source={tileWMSSources[0]} zIndex={0} />
<Layer.Tile source={tileWMSSources[1]} zIndex={1} />
<Layer.Vector
source={vectorSource}
title="highlightLayer"
style={
new style.Style({
fill: new style.Fill({
color: 'rgba(255,255,255,0.4)',
}),
stroke: new style.Stroke({
color: 'rgba(242, 180, 87, 1)',
width: 2,
color: '#00A390',
// color: '#F8E473',
width: 3,
}),
image: new style.Circle({
radius: 5,
fill: new style.Fill({ color: 'rgba(4, 167, 125,0.6)' }),
// fill: new style.Fill({ color: 'rgba(248,228,115,0.6)' }),
stroke: new style.Stroke({
color: 'rgba(242, 180, 87, 1)',
width: 2,
}),
}),
}),
})
}
zIndex={2}
})
}
zIndex={2}
/>
</Layers>
<Controls attribution={true} zoom={false} />
<Interactions
doubleClickZoom={true}
dragAndDrop={false}
dragPan={true}
keyboardPan={true}
keyboardZoom={true}
mouseWheelZoom={true}
pointer={false}
select={false}
/>
</Layers>
<Controls attribution={true} zoom={false} />
<Interactions
doubleClickZoom={true}
dragAndDrop={false}
dragPan={true}
keyboardPan={true}
keyboardZoom={true}
mouseWheelZoom={true}
pointer={false}
select={false}
/>
</Map>
</Map>
</div>
<Container>
<Message className="map-info-notice" style={{ color: '#005248' }}>
<p>
The designations employed and the presentation of material on this
map do not imply the expression of any opinion whatsoever on the
part of the European Union concerning the legal status of any
country, territory, city or area or of its authorities, or
concerning the delimitation of its frontiers or boundaries.
</p>
<p>
<strong>Note:</strong> When you perform a search we will highlight
only the results available on the active page of the results
table.
</p>
</Message>
</Container>
</div>
<Container>
<Message className="map-info-notice" style={{ color: '#005248' }}>
<p>
The designations employed and the presentation of material on this
map do not imply the expression of any opinion whatsoever on the
part of the European Union concerning the legal status of any
country, territory, city or area or of its authorities, or
concerning the delimitation of its frontiers or boundaries.
</p>
<p>
<strong>Note:</strong> When you perform a search we will highlight
only the results available on the active page of the results table.
</p>
</Message>
</Container>
</div>
)
);
};

Expand Down
5 changes: 4 additions & 1 deletion src/components/manage/Blocks/HabitatsBanner/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import arrowLeft from '@eeacms/volto-n2k/icons/arrow-left.svg';
import arrowRight from '@eeacms/volto-n2k/icons/arrow-right.svg';

import './style.less';
import 'swiper/css';

const SwiperLoader = loadable.lib(() => import('swiper'));
const SwiperReactLoader = loadable.lib(() => import('swiper/react'));
Expand Down Expand Up @@ -114,7 +115,9 @@ const _View = (props) => {
</>
)}
{!!attribution_copyright[activeSlide] && (
<p>{attribution_copyright[activeSlide]}</p>
<p title={attribution_copyright[activeSlide]}>
{attribution_copyright[activeSlide]}
</p>
)}
</div>
{__CLIENT__ && (
Expand Down
1 change: 1 addition & 0 deletions src/components/manage/Blocks/SpeciesBanner/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import arrowLeft from '@eeacms/volto-n2k/icons/arrow-left.svg';
import arrowRight from '@eeacms/volto-n2k/icons/arrow-right.svg';

import './style.less';
import 'swiper/css';

const SwiperLoader = loadable.lib(() => import('swiper'));
const SwiperReactLoader = loadable.lib(() => import('swiper/react'));
Expand Down

0 comments on commit 6b43f64

Please sign in to comment.