Skip to content

Commit

Permalink
fix(call-to-action): linking to file downloads by using UniversalLink…
Browse files Browse the repository at this point in the history
… component #32 from eea/develop
  • Loading branch information
ichim-david committed Jun 27, 2024
2 parents d456892 + 8da3559 commit f421a83
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ 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.0.0](https://github.com/eea/volto-call-to-action-block/compare/4.3.1...5.0.0) - 22 April 2024
### [5.1.0](https://github.com/eea/volto-call-to-action-block/compare/5.0.0...5.1.0) - 27 June 2024

#### :bug: Bug Fixes

- fix(call-to-action): linking to file downloads by using UniversalLink component [David Ichim - [`a31f7f1`](https://github.com/eea/volto-call-to-action-block/commit/a31f7f127e213c61ca0fd5129070f9768833a900)]

#### :hammer_and_wrench: Others

- Test only on volto 17 [David Ichim - [`63f3c4e`](https://github.com/eea/volto-call-to-action-block/commit/63f3c4e4e238e460fa077dd49c400a1503a95b29)]
- bump package version [David Ichim - [`825eaf3`](https://github.com/eea/volto-call-to-action-block/commit/825eaf38509773adeca5dff25f44674eaad76e3f)]
## [5.0.0](https://github.com/eea/volto-call-to-action-block/compare/4.3.1...5.0.0) - 22 April 2024

#### :rocket: New Features

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline {
BACKEND_PROFILES = "eea.kitkat:testing"
BACKEND_ADDONS = ""
VOLTO = "17"
VOLTO16_BREAKING_CHANGES = "no"
VOLTO16_BREAKING_CHANGES = "yes"
IMAGE_NAME = BUILD_TAG.toLowerCase()
}

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-call-to-action-block",
"version": "5.0.0",
"version": "5.1.0",
"description": "@eeacms/volto-call-to-action-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
5 changes: 3 additions & 2 deletions src/components/View.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { Icon } from 'semantic-ui-react';
import cx from 'classnames';
import { Link } from 'react-router-dom';

import { UniversalLink } from '@plone/volto/components';
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';

const Content = ({ data }) =>
Expand Down Expand Up @@ -36,7 +37,7 @@ const View = ({ data, isEditMode }) => {
}, [isEditMode, data.href]);

const url = hasLink && isInternalURL(href) ? flattenToAppURL(href) : href;
const As = hasLink && isInternalURL(url) ? Link : 'a';
const As = hasLink && isInternalURL(url) ? UniversalLink : 'a';
return (
<div className={cx('block call-to-action align', data.styles?.align)}>
<As
Expand Down

0 comments on commit f421a83

Please sign in to comment.