@eeacms/volto-clms-theme 1.1.49 → 1.1.50

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,11 @@ 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
+ ### [1.1.50](https://github.com/eea/volto-clms-theme/compare/1.1.49...1.1.50) - 26 September 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - add flattenToAppURL to card images [Ion Lizarazu - [`5982aed`](https://github.com/eea/volto-clms-theme/commit/5982aed9e4d9f481c7bc283e5f82b65f9b8fc8bb)]
7
12
  ### [1.1.49](https://github.com/eea/volto-clms-theme/compare/1.1.48...1.1.49) - 25 September 2023
8
13
 
9
14
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -16,15 +16,21 @@ import PropTypes from 'prop-types';
16
16
  import { FormattedMessage } from 'react-intl';
17
17
  import CclLoginModal from '@eeacms/volto-clms-theme/components/CclLoginModal/CclLoginModal';
18
18
  import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
19
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
19
20
 
20
21
  const CardImage = ({ card, size = 'preview', isCustomCard }) => {
21
22
  return card?.image_field ? (
22
23
  <img
23
- src={`${card.getURL}/@@images/${card?.image_field}/${size}`}
24
+ src={`${flattenToAppURL(card.getURL)}/@@images/${
25
+ card?.image_field
26
+ }/${size}`}
24
27
  alt={card?.image?.alt || 'Placeholder'}
25
28
  />
26
29
  ) : isCustomCard && card?.image?.url ? (
27
- <img src={`${card.image.url}/@@images/image`} alt={card.image.alt} />
30
+ <img
31
+ src={`${flattenToAppURL(card.image.url)}/@@images/image`}
32
+ alt={card.image.alt}
33
+ />
28
34
  ) : (
29
35
  <img src={PlaceHolder} alt={card?.image?.alt || 'Placeholder'} />
30
36
  );