Skip to content

Commit db1b819

Browse files
authored
Merge pull request #367 from eea/develop
Release
2 parents 38343b8 + eb9babc commit db1b819

19 files changed

+240
-289
lines changed

CHANGELOG.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,32 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
### [0.2.89](https://github.com/eea/volto-cca-policy/compare/0.2.88...0.2.89) - 7 January 2025
7+
### [0.2.90](https://github.com/eea/volto-cca-policy/compare/0.2.89...0.2.90) - 8 January 2025
8+
9+
#### :rocket: New Features
10+
11+
- feat(view): move health specific metadata to a separate box [kreafox - [`2df42f7`](https://github.com/eea/volto-cca-policy/commit/2df42f755e13db8337e5e06b32b29aefeb964460)]
12+
13+
#### :bug: Bug Fixes
14+
15+
- fix: remove observatory-specific links from listings [kreafox - [`bc8c9a0`](https://github.com/eea/volto-cca-policy/commit/bc8c9a0dc843b04dac90ab91af89c1676b3b3d2e)]
16+
- fix: cleanup import [kreafox - [`d7ee4bf`](https://github.com/eea/volto-cca-policy/commit/d7ee4bf9e7a5fe7bb3f199f630dc817d0bb73d63)]
17+
18+
#### :nail_care: Enhancements
19+
20+
- change(view): show lead image caption in the title block [kreafox - [`3d529a0`](https://github.com/eea/volto-cca-policy/commit/3d529a05cfc31d3e8e9d10acd3de557d0af254ae)]
21+
- change: simplify URL construction by removing observatory-specific logic in language switcher [kreafox - [`63f087f`](https://github.com/eea/volto-cca-policy/commit/63f087fbb8b3c83c1bbb8cf546362dd4d402f762)]
22+
- change(view): show health specific info on database item view [kreafox - [`443eca2`](https://github.com/eea/volto-cca-policy/commit/443eca2acabeada5bb076ce29c15b89ed3442a06)]
23+
24+
#### :house: Internal changes
25+
26+
- style: move styling to theme folder [kreafox - [`8f44461`](https://github.com/eea/volto-cca-policy/commit/8f444616f5cf6dc0ab9b4f95f9e97ae8436be9fc)]
27+
28+
#### :hammer_and_wrench: Others
29+
30+
- Refs #282067 - search engine remove ++aq link update [Tripon Eugen - [`c9a45bb`](https://github.com/eea/volto-cca-policy/commit/c9a45bb3aadd293746193fd361684e39432d596c)]
31+
- core: code cleanup [kreafox - [`c6bb867`](https://github.com/eea/volto-cca-policy/commit/c6bb8676b954236279587286052e3b4a7175c31b)]
32+
### [0.2.89](https://github.com/eea/volto-cca-policy/compare/0.2.88...0.2.89) - 8 January 2025
833

934
#### :hammer_and_wrench: Others
1035

@@ -1740,10 +1765,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
17401765
- Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
17411766
- Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
17421767
- Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
1768+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
1769+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
17431770
### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
17441771

17451772
#### :house: Internal changes
17461773

1774+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
17471775
- chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
17481776

17491777
#### :hammer_and_wrench: Others
@@ -1760,6 +1788,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
17601788
- Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
17611789
- Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
17621790
- Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
1791+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
1792+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
1793+
- test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
17631794
- Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
17641795
- Refs #256681 - Fix error in CCA Event view menu. ([React Intl] An id must be provided to format a message.) [GhitaB - [`517eeb8`](https://github.com/eea/volto-cca-policy/commit/517eeb817264a47bbfd6b9b7d22aaf22d44ed224)]
17651796
- Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
@@ -1976,6 +2007,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
19762007

19772008
#### :house: Internal changes
19782009

2010+
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
19792011

19802012
#### :hammer_and_wrench: Others
19812013

@@ -2456,6 +2488,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
24562488
#### :hammer_and_wrench: Others
24572489

24582490
- Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
2491+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
24592492
### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
24602493

24612494
#### :hammer_and_wrench: Others

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eeacms/volto-cca-policy",
3-
"version": "0.2.89",
3+
"version": "0.2.90",
44
"description": "@eeacms/volto-cca-policy: Volto add-on",
55
"main": "src/index.js",
66
"author": "European Environment Agency: IDM2 A-Team",

src/components/Result/ClusterHorizontalCardItem.jsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
1313
import ResultContext from '@eeacms/search/components/Result/ResultContext';
1414
import ContentClusters from '@eeacms/search/components/Result/ContentClusters';
1515

16-
const healthURL = (href, is_observatory) => {
17-
if (is_observatory) {
18-
return href.replace(/\/metadata\//, '/observatory/++aq++metadata/');
19-
}
20-
return href;
21-
};
22-
2316
const healthBreadcrumb = (href, is_observatory) => {
2417
// It's only cosmetic. We don't want to show ++aq...
2518
if (is_observatory) {
@@ -52,7 +45,7 @@ const ExtraContent = (props) => {
5245
<div>
5346
<div className="result-info result-source">
5447
<span className="result-info-title">Source: </span>
55-
<ExternalLink href={healthURL(result.href, is_observatory)}>
48+
<ExternalLink href={result.href}>
5649
<strong title={result.source} className="source">
5750
{title}
5851
{/* {firstWords(
@@ -99,10 +92,7 @@ const ClusterHorizontalCardItem = (props) => {
9992
'@id': result.href,
10093
title: (
10194
<>
102-
<ExternalLink
103-
href={healthURL(result.href, is_observatory)}
104-
title={result.title}
105-
>
95+
<ExternalLink href={result.href} title={result.title}>
10696
{result.title}
10797
{result.isNew && <Label className="new-item">New</Label>}
10898
{result.isExpired && (

src/components/Result/HealthHorizontalCardItem.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
1414
import ResultContext from '@eeacms/search/components/Result/ResultContext';
1515
import ContentClusters from '@eeacms/search/components/Result/ContentClusters';
1616

17-
const healthURL = (href) => {
18-
return href.replace(/\/metadata\//, '/observatory/++aq++metadata/');
19-
};
20-
2117
const healthBreadcrumb = (href) => {
2218
// It's only cosmetic. We don't want to show ++aq...
2319
return href.replace(/\/metadata\//, '/observatory/');
@@ -40,7 +36,7 @@ const ExtraContent = (props) => {
4036
<div>
4137
<div className="result-info result-source">
4238
<span className="result-info-title">Source: </span>
43-
<ExternalLink href={healthURL(result.href)}>
39+
<ExternalLink href={result.href}>
4440
<strong title={result.source} className="source">
4541
{firstWords(
4642
getTermDisplayValue({
@@ -75,7 +71,7 @@ const HealthHorizontalCardItem = (props) => {
7571
'@id': result.href,
7672
title: (
7773
<>
78-
<ExternalLink href={healthURL(result.href)} title={result.title}>
74+
<ExternalLink href={result.href} title={result.title}>
7975
{result.title}
8076
{result.isNew && <Label className="new-item">New</Label>}
8177
{result.isExpired && (

src/components/manage/Blocks/Listing/IndicatorCardsListingView.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { compose } from 'redux';
55
import cx from 'classnames';
66
import { ConditionalLink } from '@plone/volto/components';
77
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers';
8-
import { makeObservatoryMetadataURL } from '@eeacms/volto-cca-policy/helpers';
98
import './styles.less';
109

1110
const fixedTitles = {
@@ -28,9 +27,7 @@ const IndicatorCardsListingView = ({ items, isEditMode, token }) => {
2827
<div className="wrapper">
2928
<div className="slot-top">
3029
<ConditionalLink
31-
to={flattenToAppURL(
32-
getBaseUrl(makeObservatoryMetadataURL(item['@id'])),
33-
)}
30+
to={flattenToAppURL(getBaseUrl(item['@id']))}
3431
condition={!isEditMode}
3532
>
3633
<div className="listing-body">

src/components/manage/Blocks/Listing/OrganisationCardsListingView.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import {
4-
makeContributionsSearchQuery,
5-
makeObservatoryMetadataURL,
6-
} from '@eeacms/volto-cca-policy/helpers';
3+
import { makeContributionsSearchQuery } from '@eeacms/volto-cca-policy/helpers';
74
import { UniversalLink } from '@plone/volto/components';
85

96
import './styles.less';
@@ -25,10 +22,7 @@ const OrganisationCardsListingView = ({ items }) => {
2522
<div className="ui fluid card u-card" key={item['@id']}>
2623
<div className="content">
2724
<div className="header">
28-
<UniversalLink
29-
className="image"
30-
href={makeObservatoryMetadataURL(item['@id'])}
31-
>
25+
<UniversalLink className="image" href={item['@id']}>
3226
<div className="img-container">
3327
<img
3428
src={item['@id'] + '/@@images/logo/preview'}
@@ -39,7 +33,7 @@ const OrganisationCardsListingView = ({ items }) => {
3933
</UniversalLink>
4034
<UniversalLink
4135
className="header-link org-name"
42-
href={makeObservatoryMetadataURL(item['@id'])}
36+
href={item['@id']}
4337
>
4438
{item.title}
4539
</UniversalLink>

src/components/theme/Header/LanguageSwitch.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,14 @@ import { useSelector } from 'react-redux';
55
import { Dropdown, Image } from 'semantic-ui-react';
66
import { flattenToAppURL } from '@plone/volto/helpers';
77
import config from '@plone/volto/registry';
8-
import { useLocation } from 'react-router-dom';
98
import { Header } from '@eeacms/volto-eea-design-system/ui';
10-
import {
11-
isObservatoryMetadataURL,
12-
makeObservatoryMetadataURL,
13-
} from '@eeacms/volto-cca-policy/helpers';
149
import cx from 'classnames';
1510

1611
import { selectedLanguageAtom } from '../../../state';
1712
import globeIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/global-line.svg';
1813

1914
export default function LanguageSwitch({ history }) {
2015
const { eea } = config.settings;
21-
const location = useLocation();
22-
const isObservatoryItem = isObservatoryMetadataURL(location.pathname);
2316
const translations = useSelector(
2417
(state) => state.content.data?.['@components']?.translations?.items,
2518
);
@@ -39,14 +32,13 @@ export default function LanguageSwitch({ history }) {
3932
const url = translation
4033
? flattenToAppURL(translation['@id'])
4134
: `/${item.code}`;
42-
const to = isObservatoryItem ? makeObservatoryMetadataURL(url) : url;
4335

4436
setLanguage(item.code);
4537
setSelectedLanguage(item.code);
4638
searchParams.set('set_language', item.code);
4739

4840
history.push({
49-
pathname: to,
41+
pathname: url,
5042
search: searchParams.toString(),
5143
});
5244
};

src/components/theme/Views/CaseStudyView.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import {
2424
ListItem,
2525
} from 'semantic-ui-react';
2626

27-
import './CaseStudyView.less';
28-
2927
const messages = defineMessages({
3028
References: { id: 'References', defaultMessage: 'References' },
3129
Challenges: { id: 'Challenges', defaultMessage: 'Challenges' },

src/components/theme/Views/CaseStudyView.less

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/components/theme/Views/DatabaseItemView.jsx

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import React from 'react';
22
import { FormattedMessage } from 'react-intl';
3-
import { useLocation } from 'react-router-dom';
43
import { PrivacyProtection } from '@eeacms/volto-embed';
54
import { Container, Divider, Grid } from 'semantic-ui-react';
65
import {
76
ShareInfoButton,
87
PortalMessage,
98
} from '@eeacms/volto-cca-policy/components';
10-
import {
11-
isObservatoryMetadataURL,
12-
fixEmbedURL,
13-
} from '@eeacms/volto-cca-policy/helpers';
9+
import { fixEmbedURL } from '@eeacms/volto-cca-policy/helpers';
1410
import {
1511
TOOL,
1612
GUIDANCE,
@@ -143,8 +139,6 @@ const MaybeIframeVisualization = ({ content }) => {
143139
const DatabaseItemView = (props) => {
144140
const { content } = props;
145141
const type = content['@type'];
146-
const location = useLocation();
147-
const isObservatoryItem = isObservatoryMetadataURL(location.pathname);
148142
const {
149143
title,
150144
acronym,
@@ -269,19 +263,15 @@ const DatabaseItemView = (props) => {
269263
</>
270264
)}
271265

272-
{isObservatoryItem && (
266+
{organisational_key_activities && (
273267
<>
274-
{organisational_key_activities && (
275-
<>
276-
<h3>
277-
<FormattedMessage
278-
id="Key activities within climate change and health"
279-
defaultMessage="Key activities within climate change and health"
280-
/>
281-
</h3>
282-
<HTMLField value={organisational_key_activities} />
283-
</>
284-
)}
268+
<h3>
269+
<FormattedMessage
270+
id="Key activities within climate change and health"
271+
defaultMessage="Key activities within climate change and health"
272+
/>
273+
</h3>
274+
<HTMLField value={organisational_key_activities} />
285275
</>
286276
)}
287277

@@ -292,31 +282,27 @@ const DatabaseItemView = (props) => {
292282

293283
<ReferenceInfo content={content} />
294284

295-
{isObservatoryItem && (
285+
{organisational_websites && (
296286
<>
297-
{organisational_websites && (
298-
<>
299-
<h5>
300-
<FormattedMessage
301-
id="Links to further information"
302-
defaultMessage="Links to further information"
303-
/>
304-
</h5>
305-
<HTMLField value={organisational_websites} />
306-
</>
307-
)}
287+
<h5>
288+
<FormattedMessage
289+
id="Links to further information"
290+
defaultMessage="Links to further information"
291+
/>
292+
</h5>
293+
<HTMLField value={organisational_websites} />
294+
</>
295+
)}
308296

309-
{organisational_contact_information && (
310-
<>
311-
<h5>
312-
<FormattedMessage
313-
id="Contact information for the Observatory"
314-
defaultMessage="Contact information for the Observatory"
315-
/>
316-
</h5>
317-
<HTMLField value={organisational_contact_information} />
318-
</>
319-
)}
297+
{organisational_contact_information && (
298+
<>
299+
<h5>
300+
<FormattedMessage
301+
id="Contact information for the Observatory"
302+
defaultMessage="Contact information for the Observatory"
303+
/>
304+
</h5>
305+
<HTMLField value={organisational_contact_information} />
320306
</>
321307
)}
322308

src/components/theme/Views/EventView.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ function EventView(props) {
1919
hasBlockTypes,
2020
} = filterBlocks(content, ['tabs_block', 'metadataSection']);
2121

22+
const titleBlock = Object.values(content.blocks).find(
23+
(block) => block['@type'] === 'title',
24+
);
25+
if (titleBlock && !titleBlock.copyright && content.image_caption) {
26+
titleBlock.copyright = content.image_caption;
27+
}
28+
2229
return (
2330
<div className="cca-event-view">
2431
<PortalMessage content={content} />

src/components/theme/Views/NewsItemView.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ const DescriptionText = ({ content }) => {
1717
function NewsItemView(props) {
1818
const { content } = props;
1919

20-
// if (content.image_caption) {
21-
// Object.values(content.blocks).forEach((block) => {
22-
// if (block['@type'] === 'title' && !block.copyright?.trim()) {
23-
// block.copyright = content.image_caption;
24-
// }
25-
// });
26-
// }
20+
const titleBlock = Object.values(content.blocks).find(
21+
(block) => block['@type'] === 'title',
22+
);
23+
if (titleBlock && !titleBlock.copyright && content.image_caption) {
24+
titleBlock.copyright = content.image_caption;
25+
}
2726

2827
// These blocks are used in the Edit View for dexterity layout.
2928
// We don't want to display them in the View mode.

0 commit comments

Comments
 (0)