diff --git a/CHANGELOG.md b/CHANGELOG.md index 545448e..0a38810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,26 @@ 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). -### [3.0.0](https://github.com/eea/volto-call-to-action-block/compare/2.0.0...3.0.0) - 24 January 2023 +### [3.0.1](https://github.com/eea/volto-call-to-action-block/compare/3.0.0...3.0.1) - 25 January 2023 #### :hammer_and_wrench: Others +- Fix flattenToAppURL [Alin Voinea - [`d80bbe7`](https://github.com/eea/volto-call-to-action-block/commit/d80bbe71711fca7ac61d468ce2516e1a2b8d09d8)] +## [3.0.0](https://github.com/eea/volto-call-to-action-block/compare/2.0.0...3.0.0) - 25 January 2023 + +#### :hammer_and_wrench: Others + +- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`e46fb39`](https://github.com/eea/volto-call-to-action-block/commit/e46fb392ba15f9280e1a2d91b38e4acaa3105486)] +- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`184e4d5`](https://github.com/eea/volto-call-to-action-block/commit/184e4d527764cbb754398b7c1975268c0eacdc86)] +- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`8ff40cc`](https://github.com/eea/volto-call-to-action-block/commit/8ff40cc8fb5087bd0f56fbc3e38a26f5d61d63fa)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`d1ba7b8`](https://github.com/eea/volto-call-to-action-block/commit/d1ba7b844f114305604e7f8c8b3158746dd59a7b)] +- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`4dea109`](https://github.com/eea/volto-call-to-action-block/commit/4dea10962560c760c2c44db27d3446a4268ded57)] +- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`fd6b7f3`](https://github.com/eea/volto-call-to-action-block/commit/fd6b7f31d28e05ed254a32bb213ad662e2635c96)] +- yarn 3 [Alin Voinea - [`8bfd09a`](https://github.com/eea/volto-call-to-action-block/commit/8bfd09a161d1d0b3174585c172a3804e56315dea)] +- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`440cd71`](https://github.com/eea/volto-call-to-action-block/commit/440cd71451fd5d5ef0316b5c74b61e66170444a7)] +- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`e05f0dd`](https://github.com/eea/volto-call-to-action-block/commit/e05f0dd0cf782872b4105f3305c7f40ccb69cbb9)] +- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`6d44be8`](https://github.com/eea/volto-call-to-action-block/commit/6d44be88d8aabd57a8b74a3e16be7032dfda5eee)] +- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`4867cf3`](https://github.com/eea/volto-call-to-action-block/commit/4867cf362a91ea38bded8598d1937d33b35a12ab)] ## [2.0.0](https://github.com/eea/volto-call-to-action-block/compare/1.0.0...2.0.0) - 16 November 2022 #### :nail_care: Enhancements @@ -18,6 +33,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`39e8df4`](https://github.com/eea/volto-call-to-action-block/commit/39e8df468509414924327917154f035235ec5798)] +- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`0e06348`](https://github.com/eea/volto-call-to-action-block/commit/0e06348412feed9eeea6ae5d06ae59b8c21e4eff)] - test(cypress): Rename [Alin Voinea - [`ef8b823`](https://github.com/eea/volto-call-to-action-block/commit/ef8b82323a0c108e58f73c180f5b4cb23ed04f0e)] ## [1.0.0](https://github.com/eea/volto-call-to-action-block/compare/0.2.4...1.0.0) - 28 October 2022 @@ -31,6 +47,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - test(cypress): Fix typo [Alin Voinea - [`f3cc342`](https://github.com/eea/volto-call-to-action-block/commit/f3cc3424ace81d26b296882b8484d6b6b12b0d28)] - Cleanup [Alin Voinea - [`2e63ef6`](https://github.com/eea/volto-call-to-action-block/commit/2e63ef665d3812d44b6a87bac6c7f657e40e2147)] - Update dependencies [Alin Voinea - [`cfb5062`](https://github.com/eea/volto-call-to-action-block/commit/cfb50627df9a9a15ebe67adc43dac97379c64efb)] +- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`09c7c14`](https://github.com/eea/volto-call-to-action-block/commit/09c7c14265b0e63f054c3373530ba1dfbd39f4f7)] ### [0.2.4](https://github.com/eea/volto-call-to-action-block/compare/0.2.3...0.2.4) - 30 June 2022 ### [0.2.3](https://github.com/eea/volto-call-to-action-block/compare/0.2.2...0.2.3) - 30 June 2022 @@ -38,6 +55,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - Add tertiary theming option [Alin Voinea - [`c133291`](https://github.com/eea/volto-call-to-action-block/commit/c133291f17c7a8800271bafe96c008dae3b4ee79)] +- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`720a9a6`](https://github.com/eea/volto-call-to-action-block/commit/720a9a62f1505906b5e6e0667272e07598a67972)] ### [0.2.2](https://github.com/eea/volto-call-to-action-block/compare/0.2.1...0.2.2) - 2 June 2022 ### [0.2.1](https://github.com/eea/volto-call-to-action-block/compare/0.2.0...0.2.1) - 2 June 2022 @@ -60,4 +78,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others +- yarn bootstrap [Alin Voinea - [`12f3e83`](https://github.com/eea/volto-call-to-action-block/commit/12f3e834d6d3e257cb9e7b6dde80dab783613a01)] - Initial commit [Alin Voinea - [`00f39c8`](https://github.com/eea/volto-call-to-action-block/commit/00f39c8a36327a821cc613a772bf228451a71e67)] diff --git a/package.json b/package.json index cb2f4cf..f75b6c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-call-to-action-block", - "version": "3.0.0", + "version": "3.0.1", "description": "@eeacms/volto-call-to-action-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/components/View.jsx b/src/components/View.jsx index e5f5fe9..98c8d55 100644 --- a/src/components/View.jsx +++ b/src/components/View.jsx @@ -35,7 +35,9 @@ const View = ({ data, isEditMode }) => { } }, [isEditMode, data.href]); - const url = flattenToAppURL(data.href?.[0]?.['@id'] || data.href); + const url = hasLink + ? flattenToAppURL(data.href?.[0]?.['@id'] || data.href) + : ''; const As = hasLink && isInternalURL(url) ? Link : 'a'; return (
diff --git a/src/components/Widget.jsx b/src/components/Widget.jsx index 16ff177..1b53c38 100644 --- a/src/components/Widget.jsx +++ b/src/components/Widget.jsx @@ -44,7 +44,9 @@ export const CallToActionWidget = (props) => { const inputId = `field-${id}`; const [value, setValue] = useState( - flattenToAppURL(props.value?.[0]?.['@id'] || props.value), + props?.value?.length + ? flattenToAppURL(props.value?.[0]?.['@id'] || props.value) + : '', ); const [isInvalid, setIsInvalid] = useState(false); /**