Skip to content

Commit

Permalink
Merge pull request #367 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kreafox authored Jan 8, 2025
2 parents 38343b8 + eb9babc commit db1b819
Show file tree
Hide file tree
Showing 19 changed files with 240 additions and 289 deletions.
35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,32 @@ 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).

### [0.2.89](https://github.com/eea/volto-cca-policy/compare/0.2.88...0.2.89) - 7 January 2025
### [0.2.90](https://github.com/eea/volto-cca-policy/compare/0.2.89...0.2.90) - 8 January 2025

#### :rocket: New Features

- feat(view): move health specific metadata to a separate box [kreafox - [`2df42f7`](https://github.com/eea/volto-cca-policy/commit/2df42f755e13db8337e5e06b32b29aefeb964460)]

#### :bug: Bug Fixes

- fix: remove observatory-specific links from listings [kreafox - [`bc8c9a0`](https://github.com/eea/volto-cca-policy/commit/bc8c9a0dc843b04dac90ab91af89c1676b3b3d2e)]
- fix: cleanup import [kreafox - [`d7ee4bf`](https://github.com/eea/volto-cca-policy/commit/d7ee4bf9e7a5fe7bb3f199f630dc817d0bb73d63)]

#### :nail_care: Enhancements

- change(view): show lead image caption in the title block [kreafox - [`3d529a0`](https://github.com/eea/volto-cca-policy/commit/3d529a05cfc31d3e8e9d10acd3de557d0af254ae)]
- change: simplify URL construction by removing observatory-specific logic in language switcher [kreafox - [`63f087f`](https://github.com/eea/volto-cca-policy/commit/63f087fbb8b3c83c1bbb8cf546362dd4d402f762)]
- change(view): show health specific info on database item view [kreafox - [`443eca2`](https://github.com/eea/volto-cca-policy/commit/443eca2acabeada5bb076ce29c15b89ed3442a06)]

#### :house: Internal changes

- style: move styling to theme folder [kreafox - [`8f44461`](https://github.com/eea/volto-cca-policy/commit/8f444616f5cf6dc0ab9b4f95f9e97ae8436be9fc)]

#### :hammer_and_wrench: Others

- Refs #282067 - search engine remove ++aq link update [Tripon Eugen - [`c9a45bb`](https://github.com/eea/volto-cca-policy/commit/c9a45bb3aadd293746193fd361684e39432d596c)]
- core: code cleanup [kreafox - [`c6bb867`](https://github.com/eea/volto-cca-policy/commit/c6bb8676b954236279587286052e3b4a7175c31b)]
### [0.2.89](https://github.com/eea/volto-cca-policy/compare/0.2.88...0.2.89) - 8 January 2025

#### :hammer_and_wrench: Others

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

#### :house: Internal changes

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

#### :hammer_and_wrench: Others
Expand All @@ -1760,6 +1788,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
- Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
- Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
- test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
- Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
- 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)]
- Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
Expand Down Expand Up @@ -1976,6 +2007,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

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

#### :hammer_and_wrench: Others

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

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

#### :hammer_and_wrench: Others
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-cca-policy",
"version": "0.2.89",
"version": "0.2.90",
"description": "@eeacms/volto-cca-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
14 changes: 2 additions & 12 deletions src/components/Result/ClusterHorizontalCardItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
import ResultContext from '@eeacms/search/components/Result/ResultContext';
import ContentClusters from '@eeacms/search/components/Result/ContentClusters';

const healthURL = (href, is_observatory) => {
if (is_observatory) {
return href.replace(/\/metadata\//, '/observatory/++aq++metadata/');
}
return href;
};

const healthBreadcrumb = (href, is_observatory) => {
// It's only cosmetic. We don't want to show ++aq...
if (is_observatory) {
Expand Down Expand Up @@ -52,7 +45,7 @@ const ExtraContent = (props) => {
<div>
<div className="result-info result-source">
<span className="result-info-title">Source: </span>
<ExternalLink href={healthURL(result.href, is_observatory)}>
<ExternalLink href={result.href}>
<strong title={result.source} className="source">
{title}
{/* {firstWords(
Expand Down Expand Up @@ -99,10 +92,7 @@ const ClusterHorizontalCardItem = (props) => {
'@id': result.href,
title: (
<>
<ExternalLink
href={healthURL(result.href, is_observatory)}
title={result.title}
>
<ExternalLink href={result.href} title={result.title}>
{result.title}
{result.isNew && <Label className="new-item">New</Label>}
{result.isExpired && (
Expand Down
8 changes: 2 additions & 6 deletions src/components/Result/HealthHorizontalCardItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
import ResultContext from '@eeacms/search/components/Result/ResultContext';
import ContentClusters from '@eeacms/search/components/Result/ContentClusters';

const healthURL = (href) => {
return href.replace(/\/metadata\//, '/observatory/++aq++metadata/');
};

const healthBreadcrumb = (href) => {
// It's only cosmetic. We don't want to show ++aq...
return href.replace(/\/metadata\//, '/observatory/');
Expand All @@ -40,7 +36,7 @@ const ExtraContent = (props) => {
<div>
<div className="result-info result-source">
<span className="result-info-title">Source: </span>
<ExternalLink href={healthURL(result.href)}>
<ExternalLink href={result.href}>
<strong title={result.source} className="source">
{firstWords(
getTermDisplayValue({
Expand Down Expand Up @@ -75,7 +71,7 @@ const HealthHorizontalCardItem = (props) => {
'@id': result.href,
title: (
<>
<ExternalLink href={healthURL(result.href)} title={result.title}>
<ExternalLink href={result.href} title={result.title}>
{result.title}
{result.isNew && <Label className="new-item">New</Label>}
{result.isExpired && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { compose } from 'redux';
import cx from 'classnames';
import { ConditionalLink } from '@plone/volto/components';
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers';
import { makeObservatoryMetadataURL } from '@eeacms/volto-cca-policy/helpers';
import './styles.less';

const fixedTitles = {
Expand All @@ -28,9 +27,7 @@ const IndicatorCardsListingView = ({ items, isEditMode, token }) => {
<div className="wrapper">
<div className="slot-top">
<ConditionalLink
to={flattenToAppURL(
getBaseUrl(makeObservatoryMetadataURL(item['@id'])),
)}
to={flattenToAppURL(getBaseUrl(item['@id']))}
condition={!isEditMode}
>
<div className="listing-body">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
makeContributionsSearchQuery,
makeObservatoryMetadataURL,
} from '@eeacms/volto-cca-policy/helpers';
import { makeContributionsSearchQuery } from '@eeacms/volto-cca-policy/helpers';
import { UniversalLink } from '@plone/volto/components';

import './styles.less';
Expand All @@ -25,10 +22,7 @@ const OrganisationCardsListingView = ({ items }) => {
<div className="ui fluid card u-card" key={item['@id']}>
<div className="content">
<div className="header">
<UniversalLink
className="image"
href={makeObservatoryMetadataURL(item['@id'])}
>
<UniversalLink className="image" href={item['@id']}>
<div className="img-container">
<img
src={item['@id'] + '/@@images/logo/preview'}
Expand All @@ -39,7 +33,7 @@ const OrganisationCardsListingView = ({ items }) => {
</UniversalLink>
<UniversalLink
className="header-link org-name"
href={makeObservatoryMetadataURL(item['@id'])}
href={item['@id']}
>
{item.title}
</UniversalLink>
Expand Down
10 changes: 1 addition & 9 deletions src/components/theme/Header/LanguageSwitch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@ import { useSelector } from 'react-redux';
import { Dropdown, Image } from 'semantic-ui-react';
import { flattenToAppURL } from '@plone/volto/helpers';
import config from '@plone/volto/registry';
import { useLocation } from 'react-router-dom';
import { Header } from '@eeacms/volto-eea-design-system/ui';
import {
isObservatoryMetadataURL,
makeObservatoryMetadataURL,
} from '@eeacms/volto-cca-policy/helpers';
import cx from 'classnames';

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

export default function LanguageSwitch({ history }) {
const { eea } = config.settings;
const location = useLocation();
const isObservatoryItem = isObservatoryMetadataURL(location.pathname);
const translations = useSelector(
(state) => state.content.data?.['@components']?.translations?.items,
);
Expand All @@ -39,14 +32,13 @@ export default function LanguageSwitch({ history }) {
const url = translation
? flattenToAppURL(translation['@id'])
: `/${item.code}`;
const to = isObservatoryItem ? makeObservatoryMetadataURL(url) : url;

setLanguage(item.code);
setSelectedLanguage(item.code);
searchParams.set('set_language', item.code);

history.push({
pathname: to,
pathname: url,
search: searchParams.toString(),
});
};
Expand Down
2 changes: 0 additions & 2 deletions src/components/theme/Views/CaseStudyView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {
ListItem,
} from 'semantic-ui-react';

import './CaseStudyView.less';

const messages = defineMessages({
References: { id: 'References', defaultMessage: 'References' },
Challenges: { id: 'Challenges', defaultMessage: 'Challenges' },
Expand Down
8 changes: 0 additions & 8 deletions src/components/theme/Views/CaseStudyView.less

This file was deleted.

70 changes: 28 additions & 42 deletions src/components/theme/Views/DatabaseItemView.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { useLocation } from 'react-router-dom';
import { PrivacyProtection } from '@eeacms/volto-embed';
import { Container, Divider, Grid } from 'semantic-ui-react';
import {
ShareInfoButton,
PortalMessage,
} from '@eeacms/volto-cca-policy/components';
import {
isObservatoryMetadataURL,
fixEmbedURL,
} from '@eeacms/volto-cca-policy/helpers';
import { fixEmbedURL } from '@eeacms/volto-cca-policy/helpers';
import {
TOOL,
GUIDANCE,
Expand Down Expand Up @@ -143,8 +139,6 @@ const MaybeIframeVisualization = ({ content }) => {
const DatabaseItemView = (props) => {
const { content } = props;
const type = content['@type'];
const location = useLocation();
const isObservatoryItem = isObservatoryMetadataURL(location.pathname);
const {
title,
acronym,
Expand Down Expand Up @@ -269,19 +263,15 @@ const DatabaseItemView = (props) => {
</>
)}

{isObservatoryItem && (
{organisational_key_activities && (
<>
{organisational_key_activities && (
<>
<h3>
<FormattedMessage
id="Key activities within climate change and health"
defaultMessage="Key activities within climate change and health"
/>
</h3>
<HTMLField value={organisational_key_activities} />
</>
)}
<h3>
<FormattedMessage
id="Key activities within climate change and health"
defaultMessage="Key activities within climate change and health"
/>
</h3>
<HTMLField value={organisational_key_activities} />
</>
)}

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

<ReferenceInfo content={content} />

{isObservatoryItem && (
{organisational_websites && (
<>
{organisational_websites && (
<>
<h5>
<FormattedMessage
id="Links to further information"
defaultMessage="Links to further information"
/>
</h5>
<HTMLField value={organisational_websites} />
</>
)}
<h5>
<FormattedMessage
id="Links to further information"
defaultMessage="Links to further information"
/>
</h5>
<HTMLField value={organisational_websites} />
</>
)}

{organisational_contact_information && (
<>
<h5>
<FormattedMessage
id="Contact information for the Observatory"
defaultMessage="Contact information for the Observatory"
/>
</h5>
<HTMLField value={organisational_contact_information} />
</>
)}
{organisational_contact_information && (
<>
<h5>
<FormattedMessage
id="Contact information for the Observatory"
defaultMessage="Contact information for the Observatory"
/>
</h5>
<HTMLField value={organisational_contact_information} />
</>
)}

Expand Down
7 changes: 7 additions & 0 deletions src/components/theme/Views/EventView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ function EventView(props) {
hasBlockTypes,
} = filterBlocks(content, ['tabs_block', 'metadataSection']);

const titleBlock = Object.values(content.blocks).find(
(block) => block['@type'] === 'title',
);
if (titleBlock && !titleBlock.copyright && content.image_caption) {
titleBlock.copyright = content.image_caption;
}

return (
<div className="cca-event-view">
<PortalMessage content={content} />
Expand Down
13 changes: 6 additions & 7 deletions src/components/theme/Views/NewsItemView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ const DescriptionText = ({ content }) => {
function NewsItemView(props) {
const { content } = props;

// if (content.image_caption) {
// Object.values(content.blocks).forEach((block) => {
// if (block['@type'] === 'title' && !block.copyright?.trim()) {
// block.copyright = content.image_caption;
// }
// });
// }
const titleBlock = Object.values(content.blocks).find(
(block) => block['@type'] === 'title',
);
if (titleBlock && !titleBlock.copyright && content.image_caption) {
titleBlock.copyright = content.image_caption;
}

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

0 comments on commit db1b819

Please sign in to comment.