Skip to content

Commit

Permalink
merge origin/develop + fix filterType not updating
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Jul 24, 2024
2 parents 88b412e + bc3165f commit 702b16d
Show file tree
Hide file tree
Showing 52 changed files with 725 additions and 927 deletions.
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,79 @@ 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.2](https://github.com/eea/volto-searchlib/compare/2.0.1...2.0.2) - 12 June 2024

### [2.0.1](https://github.com/eea/volto-searchlib/compare/2.0.0...2.0.1) - 12 June 2024

#### :house: Internal changes

- chore: fix package.json [alin - [`6269896`](https://github.com/eea/volto-searchlib/commit/6269896ee1e15ea5e00787034c752fe05b62e75d)]

## [2.0.0](https://github.com/eea/volto-searchlib/compare/1.0.0...2.0.0) - 7 June 2024

#### :nail_care: Enhancements

- change(lib): run cypress only on volto-17 branch [David Ichim - [`e0a2155`](https://github.com/eea/volto-searchlib/commit/e0a2155de117297a16c2ce55455c80189a7cdc69)]

#### :hammer_and_wrench: Others

- bump package version since we no longer check for volto 16 [David Ichim - [`1a3248c`](https://github.com/eea/volto-searchlib/commit/1a3248ca387bf2e60a7802c78512fa1679e1c3f0)]
- Don't crash when there is no configuration for hiding the remove button for active filters [Zoltan Szabo - [`a94ffeb`](https://github.com/eea/volto-searchlib/commit/a94ffebc7b72aa2853e0e399a2389803c6343ab6)]
- Revert "wip lazy loading luxon on models.js" [David Ichim - [`a69e0eb`](https://github.com/eea/volto-searchlib/commit/a69e0ebb2739ac84e168df3f87633ff881b8c99d)]
- wip lazy loading luxon on models.js [David Ichim - [`e8201a9`](https://github.com/eea/volto-searchlib/commit/e8201a94040ef6c5461ad0cf5cadfc3cfb6ddc1e)]
- Update package.json to add cypress 13.1.0 for Volto 16 [ichim-david - [`355e51a`](https://github.com/eea/volto-searchlib/commit/355e51a295ed04321015d469ee75db6fb2941678)]
- Update elastic/search-ui to 1.19.0 package.json [ichim-david - [`f6a965c`](https://github.com/eea/volto-searchlib/commit/f6a965c6ce0ab874aae5db99ad3d17b41437541d)]
- use exact pin for elastic/search-ui version 1.21.4 [David Ichim - [`e38fd95`](https://github.com/eea/volto-searchlib/commit/e38fd951f815229ff58c62a0dd6a615260af5ad5)]
- removed @elastic/react-search-ui-views dependency and storybook testing [David Ichim - [`44c9fc9`](https://github.com/eea/volto-searchlib/commit/44c9fc9263bd1907f038f1767cc226d642fdf6cf)]
- use same version of jotai as Volto core which is 2.0.3 [David Ichim - [`5b57d20`](https://github.com/eea/volto-searchlib/commit/5b57d2042405975a86ae8fdce140393413f19077)]
## [1.0.0](https://github.com/eea/volto-searchlib/compare/0.9.3...1.0.0) - 22 April 2024

#### :rocket: New Features

- feat: Release 1.0.0 - Volto 17 support [alin - [`111056b`](https://github.com/eea/volto-searchlib/commit/111056be8fe773fc1694eae8a201322a0abd2da8)]
- feat: Volto 17 support - refs #264527 [EEA Jenkins - [`f2bb50c`](https://github.com/eea/volto-searchlib/commit/f2bb50c6c7af410ddb18bbf33eae751ff9db2ade)]

### [0.9.3](https://github.com/eea/volto-searchlib/compare/0.9.2...0.9.3) - 17 April 2024

#### :rocket: New Features

- feat: when facet isMulti=false use clearFilters() to clear the filters [laszlocseh - [`b3a797a`](https://github.com/eea/volto-searchlib/commit/b3a797a2790c0e496e1e560bb1ed41dce23af1aa)]

### [0.9.2](https://github.com/eea/volto-searchlib/compare/0.9.1...0.9.2) - 25 March 2024

#### :bug: Bug Fixes

- fix: filters selection on mobile [kreafox - [`04ee9fe`](https://github.com/eea/volto-searchlib/commit/04ee9fe7b8b1c34dcefae2821ddd3762f58fd437)]
- fix: remove unused import [kreafox - [`0a60a99`](https://github.com/eea/volto-searchlib/commit/0a60a9900b7df578697de3dd4439d252d5a5bb22)]

#### :nail_care: Enhancements

- change: use loader in modal facet [kreafox - [`80650d5`](https://github.com/eea/volto-searchlib/commit/80650d56a92fd54a0458e02eb12089a1e94a790e)]
- change: disable search phrases [kreafox - [`d9a0fbf`](https://github.com/eea/volto-searchlib/commit/d9a0fbf839d4fb7366169e7e1124e25843c65a06)]

### [0.9.1](https://github.com/eea/volto-searchlib/compare/0.9.0...0.9.1) - 20 March 2024

### [0.9.0](https://github.com/eea/volto-searchlib/compare/0.8.0...0.9.0) - 18 March 2024

#### :hammer_and_wrench: Others

- Bump version in package.json [Laszlo Cseh - [`db384c6`](https://github.com/eea/volto-searchlib/commit/db384c6523673cb7e45ffb2d43f29dd170cba759)]
### [0.8.0](https://github.com/eea/volto-searchlib/compare/0.7.3...0.8.0) - 13 March 2024

#### :boom: Breaking Change

- breaking(webpack): removed path import as webpack 5 no longer patches node modules to use in the browser [David Ichim - [`cef8cfb`](https://github.com/eea/volto-searchlib/commit/cef8cfb93e9f9fa746d40143f0c95a5d20e98b34)]

#### :house: Internal changes

- chore: package.json [Alin Voinea - [`3a3604c`](https://github.com/eea/volto-searchlib/commit/3a3604cc7e0981dc79d62c5a5213466aef34369c)]

#### :hammer_and_wrench: Others

- Update package.json [ichim-david - [`efd1a90`](https://github.com/eea/volto-searchlib/commit/efd1a90a20dc9280e8968453864f387afe2ece27)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`af47007`](https://github.com/eea/volto-searchlib/commit/af47007cf003f0ed8b89c2a8d76c92b3a6fbdfb9)]
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`983cc26`](https://github.com/eea/volto-searchlib/commit/983cc26472054a09d4f19a7f6a836cee194e6b0a)]
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`5462660`](https://github.com/eea/volto-searchlib/commit/5462660c1677f5d5404158d2cdb0515493466726)]
### [0.7.3](https://github.com/eea/volto-searchlib/compare/0.7.2...0.7.3) - 30 January 2024

#### :nail_care: Enhancements
Expand Down
181 changes: 136 additions & 45 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ pipeline {
environment {
GIT_NAME = "volto-searchlib"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine,www.eea.europa.eu-en,climate-adapt.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,clms.land.copernicus.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine,www.eea.europa.eu-en,climate-adapt.eea.europa.eu,water.europa.eu-freshwater,insitu.copernicus.eu"
DEPENDENCIES = ""
BACKEND_PROFILES = "eea.kitkat:testing"
BACKEND_ADDONS = ""
VOLTO = "16"
VOLTO = "17"
VOLTO16_BREAKING_CHANGES = "yes"
IMAGE_NAME = BUILD_TAG.toLowerCase()
}

Expand Down Expand Up @@ -44,6 +45,7 @@ pipeline {
}
steps {
script {
checkout scm
withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
check_result = sh script: '''docker run --pull always -i --rm --name="$IMAGE_NAME-gitflow-check" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /check_if_testing_needed.sh''', returnStatus: true

Expand All @@ -61,33 +63,34 @@ pipeline {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
environment name: 'SKIP_TESTS', value: ''
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
environment name: 'SKIP_TESTS', value: ''
}
}
}
stages {
stage('Build test image') {
steps {
checkout scm
sh '''docker build --pull --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend'''
parallel {

stage('Volto 17') {
agent { node { label 'docker-1.13'} }
stages {
stage('Build test image') {
steps {
sh '''docker build --pull --build-arg="VOLTO_VERSION=$VOLTO" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend'''
}
}
}

stage('Fix code') {
when {

stage('Fix code') {
when {
environment name: 'CHANGE_ID', value: ''
not { branch 'master' }
}
steps {
script {
}
steps {
script {
fix_result = sh(script: '''docker run --name="$IMAGE_NAME-fix" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend ci-fix''', returnStatus: true)
sh '''docker cp $IMAGE_NAME-fix:/app/src/addons/$GIT_NAME/src .'''
sh '''docker rm -v $IMAGE_NAME-fix'''
Expand All @@ -105,31 +108,31 @@ pipeline {
sh '''exit 1'''
}
}
}
}
}

stage('ES lint') {
steps {
sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
stage('ES lint') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
sh '''docker run --rm --name="$IMAGE_NAME-eslint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend lint'''
}
}
}

stage('Style lint') {
steps {
sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
stage('Style lint') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
sh '''docker run --rm --name="$IMAGE_NAME-stylelint" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend stylelint'''
}
}
}

stage('Prettier') {
steps {
sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
stage('Prettier') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
sh '''docker run --rm --name="$IMAGE_NAME-prettier" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend prettier'''
}
}
}

stage('Coverage Tests') {
parallel {

stage('Unit tests') {
stage('Unit tests') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
script {
try {
Expand All @@ -155,9 +158,10 @@ pipeline {
}
}
}
}
}

stage('Integration tests') {
stage('Integration tests') {
when { environment name: 'SKIP_TESTS', value: '' }
steps {
script {
try {
Expand Down Expand Up @@ -211,26 +215,19 @@ pipeline {
}
}
}
}
}
}
}
post {
always {
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
}
}
}

stage('Report to SonarQube') {
when {
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
environment name: 'SKIP_TESTS', value: ''
}
allOf {
environment name: 'CHANGE_ID', value: ''
environment name: 'SKIP_TESTS', value: ''
anyOf {
allOf {
branch 'develop'
Expand All @@ -255,14 +252,107 @@ pipeline {
}
}


}
}

stage('Volto 16') {
agent { node { label 'integration'} }
when {
environment name: 'SKIP_TESTS', value: ''
not { environment name: 'VOLTO16_BREAKING_CHANGES', value: 'yes' }
}
stages {
stage('Build test image') {
steps {
sh '''docker build --pull --build-arg="VOLTO_VERSION=16" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend16'''
}
}

stage('Unit tests Volto 16') {
steps {
script {
try {
sh '''docker run --name="$IMAGE_NAME-volto16" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend16 test-ci'''
sh '''rm -rf xunit-reports16'''
sh '''mkdir -p xunit-reports16'''
sh '''docker cp $IMAGE_NAME-volto16:/app/junit.xml xunit-reports16/'''
} finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'xunit-reports16/junit.xml', allowEmptyResults: true
}
sh script: '''docker rm -v $IMAGE_NAME-volto16''', returnStatus: true
}
}
}
}

stage('Integration tests Volto 16') {
steps {
script {
try {
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone16" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone16:plone --name="$IMAGE_NAME-cypress16" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend16 start-ci'''
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress16 make check-ci''', returnStatus: true
if ( frontend != 0 ) {
sh '''docker logs $IMAGE_NAME-cypress16; exit 1'''
}
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress16 make cypress-ci'''
} finally {
try {
if ( frontend == 0 ) {
sh '''rm -rf cypress-videos16 cypress-results16 cypress-coverage16 cypress-screenshots16'''
sh '''mkdir -p cypress-videos16 cypress-results16 cypress-coverage16 cypress-screenshots16'''
videos = sh script: '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos16/''', returnStatus: true
sh '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/reports cypress-results16/'''
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress16:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots16''', returnStatus: true

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

if ( videos == 0 ) {
sh '''for file in $(find cypress-results16 -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-videos16/videos/$testname.mp4; fi; done'''
archiveArtifacts artifacts: 'cypress-videos16/**/*.mp4', fingerprint: true, allowEmptyArchive: true
}
}
} finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results16/**/*.xml', allowEmptyResults: true
}
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
sh '''docker logs $IMAGE_NAME-cypress16'''
}
sh script: "docker stop $IMAGE_NAME-cypress16", returnStatus: true
sh script: "docker stop $IMAGE_NAME-plone16", returnStatus: true
sh script: "docker rm -v $IMAGE_NAME-plone16", returnStatus: true
sh script: "docker rm -v $IMAGE_NAME-cypress16", returnStatus: true
}
}
}
}
}

}
}
}
post {
always {
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
sh script: "docker rmi $IMAGE_NAME-frontend16", returnStatus: true
}
}
}


stage('SonarQube compare to master') {
when {
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
environment name: 'SKIP_TESTS', value: ''
}
allOf {
environment name: 'SKIP_TESTS', value: ''
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
Expand Down Expand Up @@ -323,3 +413,4 @@ pipeline {
}
}
}

10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ endif
DIR=$(shell basename $$(pwd))
NODE_MODULES?="../../../node_modules"
PLONE_VERSION?=6
VOLTO_VERSION?=16
VOLTO_VERSION?=17
ADDON_PATH="${DIR}"
ADDON_NAME="@eeacms/${ADDON_PATH}"
DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose
Expand Down Expand Up @@ -98,15 +98,15 @@ test-update: ## Update jest tests snapshots

.PHONY: stylelint
stylelint: ## Stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
$(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}'

.PHONY: stylelint-overrides
stylelint-overrides:
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'

.PHONY: stylelint-fix
stylelint-fix: ## Fix stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix

.PHONY: prettier
Expand All @@ -119,11 +119,11 @@ prettier-fix: ## Fix prettier

.PHONY: lint
lint: ## ES Lint
$(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'
$(NODE_MODULES)/.bin/eslint --max-warnings=0 'src/**/*.{js,jsx}'

.PHONY: lint-fix
lint-fix: ## Fix ES Lint
$(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'
$(NODE_MODULES)/.bin/eslint --fix 'src/**/*.{js,jsx}'

.PHONY: i18n
i18n: ## i18n
Expand Down
Loading

0 comments on commit 702b16d

Please sign in to comment.