From aec82fbbc2b2ec0af5f305e3091ee1c6339be827 Mon Sep 17 00:00:00 2001 From: EEA Jenkins Date: Mon, 27 Mar 2023 17:06:04 +0300 Subject: [PATCH 1/4] Add Sonarqube tag using eea-website-frontend addons list --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fee0933..9e09466 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { environment { GIT_NAME = "volto-widgets-view" NAMESPACE = "@eeacms" - SONARQUBE_TAGS = "volto.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.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,forest.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.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,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 = "" } From 9be48008da2f0be69c38488130734912034dbf76 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Tue, 25 Apr 2023 16:29:15 +0300 Subject: [PATCH 2/4] feat(Url.js): add getURL helper function to extract URL from data object feat(index.js): export getURL helper function from Url.js --- src/helpers/Url.js | 20 ++++++++++++++++++++ src/helpers/index.js | 1 + 2 files changed, 21 insertions(+) create mode 100644 src/helpers/Url.js diff --git a/src/helpers/Url.js b/src/helpers/Url.js new file mode 100644 index 0000000..0e7a809 --- /dev/null +++ b/src/helpers/Url.js @@ -0,0 +1,20 @@ +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers'; + +import isString from 'lodash/isString'; +import isObject from 'lodash/isObject'; +import isArray from 'lodash/isArray'; + +/** + * Get url + * @method getURL + * @param {object} data + * @returns {string} URL string value. + */ +export const getURL = (data) => { + let url = data; + if (isObject(data) && !isArray(data) && data['@type'] === 'URL') { + url = data['value'] || data['url'] || data['href'] || ''; + } + if (isString(url) && isInternalURL(url)) return flattenToAppURL(url); + return url; +}; diff --git a/src/helpers/index.js b/src/helpers/index.js index b42adc8..f2affb9 100644 --- a/src/helpers/index.js +++ b/src/helpers/index.js @@ -1 +1,2 @@ +export * from './Url'; export * from './Widget'; From c4d986db6264e0e96f8d5d3360ce68835e79863f Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Tue, 25 Apr 2023 16:29:39 +0300 Subject: [PATCH 3/4] chore(package.json): increase version from 4.1.0 to 4.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75f3520..a8aae51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-widgets-view", - "version": "4.1.0", + "version": "4.2.0", "description": "Volto Widgets in View mode", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From c2918a6abc56557cad5531ab89c5ae6f82201092 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Tue, 25 Apr 2023 13:41:32 +0000 Subject: [PATCH 4/4] Automated release 4.2.0 --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c4b4d..d0ce9d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,22 @@ 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.2.0](https://github.com/eea/volto-widgets-view/compare/4.1.0...4.2.0) - 25 April 2023 + +#### :rocket: New Features + +- feat(Url.js): add getURL helper function to extract URL from data object [Miu Razvan - [`9be4800`](https://github.com/eea/volto-widgets-view/commit/9be48008da2f0be69c38488130734912034dbf76)] + +#### :house: Internal changes + +- chore(package.json): increase version from 4.1.0 to 4.2.0 [Miu Razvan - [`c4d986d`](https://github.com/eea/volto-widgets-view/commit/c4d986db6264e0e96f8d5d3360ce68835e79863f)] + +#### :hammer_and_wrench: Others + ### [4.1.0](https://github.com/eea/volto-widgets-view/compare/4.0.1...4.1.0) - 27 March 2023 #### :hammer_and_wrench: Others -- Release 4.1.0 [Alin Voinea - [`d58f7f8`](https://github.com/eea/volto-widgets-view/commit/d58f7f8c64a0935173c21dbf9da927b25ebf7680)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`3771315`](https://github.com/eea/volto-widgets-view/commit/377131511ec4621834562fcba79e33b5cd237eb9)] ### [4.0.1](https://github.com/eea/volto-widgets-view/compare/4.0.0...4.0.1) - 16 November 2022