@eeacms/volto-eea-website-theme 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [2.1.3](https://github.com/eea/volto-eea-website-theme/compare/2.1.2...2.1.3) - 22 July 2024
8
+
7
9
  ### [2.1.2](https://github.com/eea/volto-eea-website-theme/compare/2.1.1...2.1.2) - 14 June 2024
8
10
 
9
11
  #### :house: Internal changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -29,6 +29,7 @@ const UniversalLink = ({
29
29
  const token = useSelector((state) => state.userSession?.token);
30
30
 
31
31
  let url = href;
32
+
32
33
  if (!href && item) {
33
34
  if (!item['@id']) {
34
35
  // eslint-disable-next-line no-console
@@ -51,10 +52,10 @@ const UniversalLink = ({
51
52
 
52
53
  //case: item of type 'File'
53
54
  if (
54
- !token &&
55
+ download &&
55
56
  config.settings.downloadableObjects.includes(item['@type'])
56
57
  ) {
57
- url = `${url}/@@download/file`;
58
+ url = url.includes('/@@download/file') ? url : `${url}/@@download/file`;
58
59
  }
59
60
 
60
61
  if (
@@ -68,10 +69,10 @@ const UniversalLink = ({
68
69
 
69
70
  const isExternal = !isInternalURL(url);
70
71
 
71
- const isDownload = (!isExternal && url.includes('@@download')) || download;
72
+ const isDownload = !isExternal && url && url.includes('@@download/file');
73
+
72
74
  const isDisplayFile =
73
75
  (!isExternal && url.includes('@@display-file')) || false;
74
-
75
76
  const checkedURL = URLUtils.checkAndNormalizeUrl(url);
76
77
 
77
78
  // we can receive an item with a linkWithHash property set from ObjectBrowserWidget