Skip to content

Commit

Permalink
Merge pull request #42 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea committed Jan 9, 2023
2 parents c2448a1 + 01c766f commit 0a35437
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 107 deletions.
19 changes: 6 additions & 13 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,12 @@ 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).

### [5.1.0](https://github.com/eea/volto-slate-zotero/compare/5.0.2...5.1.0) - 9 January 2023

#### :hammer_and_wrench: Others

- Release 5.1.0 [Alin Voinea - [`d798902`](https://github.com/eea/volto-slate-zotero/commit/d7989022a6ab704be3a74c22e3d7253cfeef2707)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`4243028`](https://github.com/eea/volto-slate-zotero/commit/4243028178c8d9ed30d2ae9bc16169486ef45b43)]
### [5.0.2](https://github.com/eea/volto-slate-zotero/compare/5.0.1...5.0.2) - 16 November 2022

#### :hammer_and_wrench: Others
Expand All @@ -16,15 +22,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`010e0cd`](https://github.com/eea/volto-slate-zotero/commit/010e0cdf67b04afbdb40e980920e39bc73aa0c6b)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`f61258b`](https://github.com/eea/volto-slate-zotero/commit/f61258b580ba98205a0c1fafcf94619a6c7bc22f)]
### [4.0.5](https://github.com/eea/volto-slate-zotero/compare/4.0.4...4.0.5) - 1 July 2022

#### :hammer_and_wrench: Others

- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`074c26f`](https://github.com/eea/volto-slate-zotero/commit/074c26f6bc78fb6023446b2b2a542230e392bd19)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`8510591`](https://github.com/eea/volto-slate-zotero/commit/85105915cb9e16305af6e778c274b5c58741a0ac)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`88874c7`](https://github.com/eea/volto-slate-zotero/commit/88874c73adc42463a3b87963f610663094a138ba)]
### [4.0.4](https://github.com/eea/volto-slate-zotero/compare/4.0.3...4.0.4) - 3 January 2022

### [4.0.3](https://github.com/eea/volto-slate-zotero/compare/4.0.2...4.0.3) - 22 December 2021
Expand All @@ -36,25 +37,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`0cec947`](https://github.com/eea/volto-slate-zotero/commit/0cec94778644b24a6cb4caf4fece54a81c23f28e)]
- Add SonarQube badges [Alin Voinea - [`bf7eba7`](https://github.com/eea/volto-slate-zotero/commit/bf7eba74e9d9f5b062135ce4609730332e380333)]
### [4.0.1](https://github.com/eea/volto-slate-zotero/compare/4.0.0...4.0.1) - 14 December 2021

#### :hammer_and_wrench: Others

- [Webscore fix] Added generic font-family [Miu Razvan - [`fb4629e`](https://github.com/eea/volto-slate-zotero/commit/fb4629e2f4d76a7960ae6b99fb0311e8be51f545)]
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`3deea22`](https://github.com/eea/volto-slate-zotero/commit/3deea22cfe05f32cbec4f957f2b499c4cfbd4f95)]
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`4a48e98`](https://github.com/eea/volto-slate-zotero/commit/4a48e98c41f2c32bddffd782b381edf1979f33db)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`a984b89`](https://github.com/eea/volto-slate-zotero/commit/a984b8963cc924fe69ae787378b49281bfe0316b)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`e99c4ca`](https://github.com/eea/volto-slate-zotero/commit/e99c4ca7a32135d690d7ffde92a651698703db0a)]
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`914c441`](https://github.com/eea/volto-slate-zotero/commit/914c4415fddfa6ce2f2e779ea60fdf19192ad1bf)]
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`ab154c1`](https://github.com/eea/volto-slate-zotero/commit/ab154c18dbc33f12742fc71aca2a48ecaed86590)]
## [4.0.0](https://github.com/eea/volto-slate-zotero/compare/3.0.0...4.0.0) - 24 September 2021

#### :hammer_and_wrench: Others

- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`7c0ce8d`](https://github.com/eea/volto-slate-zotero/commit/7c0ce8d1322bc4843e9ffae59d5f13c667249ce8)]
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`80a4b41`](https://github.com/eea/volto-slate-zotero/commit/80a4b41f696dfd231c7a44fd5ee173c73abc26b7)]
## [3.0.0](https://github.com/eea/volto-slate-zotero/compare/2.1.6...3.0.0) - 9 September 2021

#### :hammer_and_wrench: Others
Expand Down
118 changes: 59 additions & 59 deletions Jenkinsfile
Expand Up @@ -4,9 +4,9 @@ pipeline {
environment {
GIT_NAME = "volto-slate-zotero"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine"
SONARQUBE_TAGS = "volto.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu,prod-www.eea.europa.eu,water.europa.eu-marine,demo-kitkat.dev2aws.eea.europa.eu,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = "alpha"
VOLTO = ""
}

stages {
Expand Down Expand Up @@ -108,62 +108,62 @@ pipeline {
}
}

stage('Integration tests') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
}
}
steps {
parallel(

"Cypress": {
node(label: 'docker') {
script {
try {
sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci:alpha cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/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'])
}
sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
}
finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
}
sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true

}
}
}
}
}

)
}
}
// stage('Integration tests') {
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// anyOf {
// not { changelog '.*^Automated release [0-9\\.]+$' }
// branch 'master'
// }
// }
// }
// steps {
// parallel(

// "Cypress": {
// node(label: 'docker') {
// script {
// try {
// sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
// sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci:alpha cypress'''
// } finally {
// try {
// sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
// sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/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'])
// }
// sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
// archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
// stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
// }
// finally {
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
// }
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true

// }
// }
// }
// }
// }

// )
// }
// }

stage('Report to SonarQube') {
when {
Expand All @@ -183,7 +183,7 @@ pipeline {
script{
checkout scm
unstash "xunit-reports"
unstash "cypress-coverage"
// unstash "cypress-coverage"
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS';
withSonarQubeEnv('Sonarqube') {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-slate-zotero",
"version": "5.0.2",
"version": "5.1.0",
"description": "Zotero integration with Volto Slate Footnotes",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down Expand Up @@ -28,8 +28,8 @@
"@eeacms/volto-slate-footnote": "*"
},
"devDependencies": {
"@plone/scripts": "*",
"@cypress/code-coverage": "^3.10.0",
"@plone/scripts": "*",
"babel-plugin-transform-class-properties": "^6.24.1",
"md5": "^2.3.0"
},
Expand Down
13 changes: 10 additions & 3 deletions src/plugins/zotero/editor/MasterDetailWidget.jsx
Expand Up @@ -82,8 +82,8 @@ const makeList = (props, resultsType, handleClick, activeIndex) => (
</Card.Meta>
<Card.Meta>
<span>
Author: {item.data.creators[0]?.firstName}{' '}
{item.data.creators[0]?.lastName}{' '}
Author: {item?.data?.creators?.[0]?.firstName}{' '}
{item?.data?.creators?.[0]?.lastName}{' '}
</span>
</Card.Meta>
<Card.Description>
Expand Down Expand Up @@ -167,7 +167,14 @@ const panes = (
{
menuItem: (
<Menu.Item key="zotero-tab">
Zotero<Label>{props.zoteroSearchItemsTotalResultsNumber}</Label>
Zotero
<Label>
{props.zoteroSearchLoading ? (
<Loader active inline size="mini" />
) : (
<>{props.zoteroSearchItemsTotalResultsNumber}</>
)}
</Label>
</Menu.Item>
),
render: () => (
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/zotero/editor/ZoteroDataWrapper.jsx
Expand Up @@ -37,6 +37,7 @@ const ZoteroDataWrapper = (props) => {
const [composedItems, setComposedItems] = useState([]);
const [allSearchResults, setAllSearchResults] = useState([]);
const [zoteroSearchResults, setZoteroSearchResults] = useState([]);
const [zoteroSearchLoading, setZoteroSearchLoading] = useState(false);
const [openAireSearchResults, setOpenAireSearchResults] = useState([]);
const [loading, setLoading] = useState(false);
const [citationLoading, setCitationLoading] = useState(false);
Expand Down Expand Up @@ -82,6 +83,9 @@ const ZoteroDataWrapper = (props) => {
const zotero_search_items = useSelector(
(state) => state?.zotero_search_items?.api,
);
const zotero_search_request = useSelector(
(state) => state?.zotero_search_items?.get,
);
const zotero_collections = useSelector(
(state) => state?.zotero_collections?.api,
);
Expand Down Expand Up @@ -447,6 +451,10 @@ const ZoteroDataWrapper = (props) => {
}
}, [zotero_search_items]); // eslint-disable-line

useEffect(() => {
setZoteroSearchLoading(!!zotero_search_request?.loading);
}, [zotero_search_request]);

useEffect(() => {
if (openaire_items_pub.api) {
const formattedResults = openaire_items_pub.api.map((item) =>
Expand Down Expand Up @@ -610,6 +618,7 @@ const ZoteroDataWrapper = (props) => {
showSearchResults={showSearchResults}
allSearchResults={allSearchResults}
zoteroSearchResults={zoteroSearchResults}
zoteroSearchLoading={zoteroSearchLoading}
openAireSearchResults={openAireSearchResults}
pushSearchItem={pushSearchItem}
showCollections={showCollections}
Expand Down

0 comments on commit 0a35437

Please sign in to comment.