@eeacms/volto-cca-policy 0.2.93 → 0.2.94

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,13 @@ 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
+ ### [0.2.94](https://github.com/eea/volto-cca-policy/compare/0.2.93...0.2.94) - 14 January 2025
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(listing): improve event listing view - refs #282708 [kreafox - [`b13a9f3`](https://github.com/eea/volto-cca-policy/commit/b13a9f3c9f8ba44ac7daf655d7f87744c52ebff6)]
12
+ - fix(listing): fix wrong URL in event listing view + code cleanup - refs #282708 [kreafox - [`f916165`](https://github.com/eea/volto-cca-policy/commit/f916165ae5d3110893216ef9d6e7882f3f07673d)]
13
+
7
14
  ### [0.2.93](https://github.com/eea/volto-cca-policy/compare/0.2.92...0.2.93) - 9 January 2025
8
15
 
9
16
  #### :hammer_and_wrench: Others
@@ -1786,13 +1793,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1786
1793
  - Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
1787
1794
  - Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
1788
1795
  - Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
1789
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
1790
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
1791
1796
  ### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
1792
1797
 
1793
1798
  #### :house: Internal changes
1794
1799
 
1795
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
1796
1800
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
1797
1801
 
1798
1802
  #### :hammer_and_wrench: Others
@@ -1809,9 +1813,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1809
1813
  - Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
1810
1814
  - Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
1811
1815
  - Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
1812
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
1813
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
1814
- - test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
1815
1816
  - Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
1816
1817
  - 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)]
1817
1818
  - Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
@@ -2028,7 +2029,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2028
2029
 
2029
2030
  #### :house: Internal changes
2030
2031
 
2031
- - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
2032
2032
 
2033
2033
  #### :hammer_and_wrench: Others
2034
2034
 
@@ -2509,7 +2509,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2509
2509
  #### :hammer_and_wrench: Others
2510
2510
 
2511
2511
  - Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
2512
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
2513
2512
  ### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
2514
2513
 
2515
2514
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.93",
3
+ "version": "0.2.94",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { connect } from 'react-redux';
4
3
  import { compose } from 'redux';
5
- import cx from 'classnames';
6
- import './styles.less';
7
- import { ConditionalLink } from '@plone/volto/components';
8
- import { Icon } from 'semantic-ui-react';
9
- import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
10
- import { Card, Grid } from 'semantic-ui-react';
11
- import { Label } from 'semantic-ui-react';
4
+ import { connect } from 'react-redux';
5
+ import { Card, Grid, Icon, Label } from 'semantic-ui-react';
12
6
  import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
7
+ import { ConditionalLink, UniversalLink } from '@plone/volto/components';
8
+ import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
9
+ import './styles.less';
13
10
 
14
11
  const Separator = () => {
15
12
  return <div className="sep">&nbsp;&nbsp;⎯&nbsp;&nbsp;</div>;
@@ -37,6 +34,7 @@ const messages = defineMessages({
37
34
  sa: { id: 'Sa', defaultMessage: 'Sa' },
38
35
  su: { id: 'Su', defaultMessage: 'Su' },
39
36
  });
37
+
40
38
  const StartDate = (start) => {
41
39
  const start_date = new Date(start);
42
40
 
@@ -87,27 +85,15 @@ const StartDate = (start) => {
87
85
  };
88
86
 
89
87
  const EventCardsListingView = ({ items, isEditMode, token }) => {
90
- const go_to_contact = (contact_info) => {
91
- if (contact_info.includes('@')) {
92
- return `mailto:${contact_info}`;
93
- }
94
- return contact_info;
95
- };
88
+ const goToContact = (contactInfo) =>
89
+ contactInfo.includes('@') ? `mailto:${contactInfo}` : contactInfo;
96
90
 
97
- const event_url = (item) => {
98
- if (!!item.event_url) {
99
- return item.event_url;
100
- }
101
- return item.id;
102
- };
91
+ const getEventUrl = (item) => item.event_url || item['@id'];
103
92
 
104
93
  return (
105
- <div className={cx('ui fluid eventCards')}>
94
+ <div className="ui fluid eventCards">
106
95
  {items.map((item, index) => (
107
- <div
108
- className={cx('u-item listing-item simple-listing-item')}
109
- key={item['@id']}
110
- >
96
+ <div className="u-item listing-item simple-listing-item" key={item.UID}>
111
97
  <div className="wrapper">
112
98
  <Card fluid>
113
99
  <Card.Content>
@@ -117,13 +103,13 @@ const EventCardsListingView = ({ items, isEditMode, token }) => {
117
103
  </Grid.Column>
118
104
  <Grid.Column width={10}>
119
105
  <div className="event-details">
120
- <h3 className={'listing-header'}>
121
- <a href={event_url(item)}>
122
- {item.title ? item.title : item.id}
123
- </a>
106
+ <h3 className="listing-header">
107
+ <UniversalLink href={getEventUrl(item)}>
108
+ {item.title}
109
+ </UniversalLink>
124
110
  </h3>
125
- <div className="listing-body-dates">
126
- {!!item.start && (
111
+ {!!item.start && (
112
+ <div className="listing-body-dates">
127
113
  <span className="event-date">
128
114
  <Icon className="ri-calendar-line" />
129
115
  <When
@@ -133,18 +119,18 @@ const EventCardsListingView = ({ items, isEditMode, token }) => {
133
119
  open_end={item.open_end}
134
120
  />
135
121
  </span>
136
- )}
137
- </div>
138
- <div className="listing-body-dates">
139
- {!!item['location'] && (
122
+ </div>
123
+ )}
124
+ {!!item.location && (
125
+ <div className="listing-body-dates">
140
126
  <span className="event-date">
141
127
  <Icon className="map marker alternate" />
142
- {item['location']}
128
+ {item.location}
143
129
  </span>
144
- )}
145
- </div>
130
+ </div>
131
+ )}
146
132
  {item.description && (
147
- <p className={'listing-description'}>
133
+ <p className="listing-description">
148
134
  {item.description}
149
135
  </p>
150
136
  )}
@@ -178,7 +164,7 @@ const EventCardsListingView = ({ items, isEditMode, token }) => {
178
164
  <a
179
165
  className="contact_email"
180
166
  title=""
181
- href={go_to_contact(item.contact_email)}
167
+ href={goToContact(item.contact_email)}
182
168
  target="_blank"
183
169
  rel="noreferrer"
184
170
  >