Skip to content

Commit

Permalink
Merge pull request #47 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Jun 12, 2023
2 parents 93087fa + 4be57c8 commit 6040b54
Show file tree
Hide file tree
Showing 6 changed files with 402 additions and 5 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +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).

### [5.2.1](https://github.com/eea/volto-slate-zotero/compare/5.2.0...5.2.1) - 12 June 2023

#### :house: Internal changes

- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`b47ef01`](https://github.com/eea/volto-slate-zotero/commit/b47ef017c013b4dd095119f3b5ccd972af1579b2)]

#### :hammer_and_wrench: Others

- test: jest should look for addons in node_modules Refs #253277 [valentinab25 - [`d94ba38`](https://github.com/eea/volto-slate-zotero/commit/d94ba383ea21a04a3d2f88706b312614053987f9)]
- test: Add unit tests for utils - refs #253277 [ana-oprea - [`cf5ccfe`](https://github.com/eea/volto-slate-zotero/commit/cf5ccfe8ed131c95be083132f3c4e3ef036dae84)]
- test: Fix test config, coverage Refs #253277 [valentinab25 - [`de7bb7a`](https://github.com/eea/volto-slate-zotero/commit/de7bb7aac517be3611aeb38a88acf0aa8ae98a70)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5fad21c`](https://github.com/eea/volto-slate-zotero/commit/5fad21c42aa266b7148998009cebaedc0fc3b5c8)]
### [5.2.0](https://github.com/eea/volto-slate-zotero/compare/5.1.1...5.2.0) - 27 March 2023

#### :hammer_and_wrench: Others

- Release 5.2.0 [Alin Voinea - [`93e6fc5`](https://github.com/eea/volto-slate-zotero/commit/93e6fc5504717bfafffaa90440bea26dccf6472e)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e8a4434`](https://github.com/eea/volto-slate-zotero/commit/e8a4434b50cf2db393f0db2f71dc051b56dc21fe)]
### [5.1.1](https://github.com/eea/volto-slate-zotero/compare/5.1.0...5.1.1) - 21 February 2023

#### :bug: Bug Fixes
Expand All @@ -17,12 +29,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 - [`1358372`](https://github.com/eea/volto-slate-zotero/commit/1358372e3bd09e2574612a1676842d3ba6ecb8ea)]
### [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)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`912cf8a`](https://github.com/eea/volto-slate-zotero/commit/912cf8a4a2ecc4dafeb9c459cd2a0f6f6252b890)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`4243028`](https://github.com/eea/volto-slate-zotero/commit/4243028178c8d9ed30d2ae9bc16169486ef45b43)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a105c91`](https://github.com/eea/volto-slate-zotero/commit/a105c91331d7f0e929ad20cabbf2fc626ffaca15)]
- yarn 3 [Alin Voinea - [`1d3706b`](https://github.com/eea/volto-slate-zotero/commit/1d3706baffbcf84fed1f7c643cbbabe1ea261b47)]
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`4857eca`](https://github.com/eea/volto-slate-zotero/commit/4857eca8536c8ed740f5fa8c9f37c522863fb883)]
### [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 @@ -35,10 +52,15 @@ 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 @@ -50,17 +72,25 @@ 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
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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,demo-kitkat.dev2aws.eea.europa.eu,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en"
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,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en"
DEPENDENCIES = ""
VOLTO = ""
}
Expand Down Expand Up @@ -188,6 +188,7 @@ pipeline {
def nodeJS = tool 'NodeJS';
withSonarQubeEnv('Sonarqube') {
sh '''sed -i "s#/opt/frontend/my-volto-project/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 '''try=2; 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 60; try=\$(( \$try - 1 )); fi; done'''
}
Expand Down
4 changes: 2 additions & 2 deletions jest-addon.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ module.exports = {
'!src/**/*.d.ts',
],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
'@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
'@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
'@package/(.*)$': '<rootDir>/src/$1',
'@root/(.*)$': '<rootDir>/src/$1',
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
'@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
'@plone/volto-slate':
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
'~/(.*)$': '<rootDir>/src/$1',
'load-volto-addons':
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
},
transform: {
'^.+\\.js(x)?$': 'babel-jest',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-slate-zotero",
"version": "5.2.0",
"version": "5.2.1",
"description": "Zotero integration with Volto Slate Footnotes",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
66 changes: 66 additions & 0 deletions src/plugins/zotero/editor/actions.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {
getZoteroSettings,
fetchZoteroCollections,
fetchZoteroItems,
} from './actions';
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { ZOTERO_SETTINGS } from '../constants';

const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);

global.fetch = jest.fn(() =>
Promise.resolve({
ok: true,
json: () => Promise.resolve({}),
headers: {
get: jest.fn().mockReturnValue(0),
},
}),
);

jest.mock('react-toastify', () => ({
toast: {
error: jest.fn(),
},
}));

describe('Zotero and Openaire actions', () => {
afterEach(() => {
fetch.mockClear();
});

it('getZoteroSettings returns correct action', () => {
const expectedAction = {
type: ZOTERO_SETTINGS,
request: {
op: 'get',
path: `/@zotero`,
},
};
expect(getZoteroSettings()).toEqual(expectedAction);
});

it('fetchZoteroCollections dispatches correct actions on success', async () => {
const store = mockStore({});
await store.dispatch(fetchZoteroCollections('url', {}));
expect(store.getActions()).toContainEqual({
type: 'ZOTERO_COLLECTIONS_PENDING',
});
expect(store.getActions()).toContainEqual({
type: 'ZOTERO_COLLECTIONS_SUCCESS',
result: { results: {}, totalResults: 0 },
});
});

it('fetchZoteroItems dispatches correct actions on success', async () => {
const store = mockStore({});
await store.dispatch(fetchZoteroItems('url', {}));
expect(store.getActions()).toContainEqual({ type: 'ZOTERO_ITEMS_PENDING' });
expect(store.getActions()).toContainEqual({
type: 'ZOTERO_ITEMS_SUCCESS',
result: { results: {}, totalResults: 0 },
});
});
});
Loading

0 comments on commit 6040b54

Please sign in to comment.