@eeacms/volto-clms-theme 1.1.41 → 1.1.43

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,11 +4,29 @@ 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.41](https://github.com/eea/volto-clms-theme/compare/1.1.40...1.1.41) - 18 September 2023
7
+ ### [1.1.43](https://github.com/eea/volto-clms-theme/compare/1.1.42...1.1.43) - 19 September 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: add lazy loading option to the HomeUsersBlock schema [Ion Lizarazu - [`f5e7882`](https://github.com/eea/volto-clms-theme/commit/f5e7882ff2e986706e26c41f824892964bd79ad9)]
12
+ - feat: header and footer img width and height [Ion Lizarazu - [`0742d37`](https://github.com/eea/volto-clms-theme/commit/0742d3701ea479c6be00013c3b42e12cad50c0e0)]
13
+
14
+ #### :bug: Bug Fixes
15
+
16
+ - fix: convert to publicUrl Home image urls [Ion Lizarazu - [`28b7759`](https://github.com/eea/volto-clms-theme/commit/28b77591813cdd9ebd7f2895fe508352b4b44d4a)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - code refactor [Ion Lizarazu - [`17bba57`](https://github.com/eea/volto-clms-theme/commit/17bba5706f7007199983190a747bf567f682554b)]
21
+ ### [1.1.42](https://github.com/eea/volto-clms-theme/compare/1.1.41...1.1.42) - 18 September 2023
8
22
 
9
23
  #### :bug: Bug Fixes
10
24
 
11
- - fix:use-case listing image size and use-case view image size [Ion Lizarazu - [`d162295`](https://github.com/eea/volto-clms-theme/commit/d162295d6911767d6b6b347e52f9c5cca9266920)]
25
+ - fix: check if exists the array before the loop [Ion Lizarazu - [`22fd984`](https://github.com/eea/volto-clms-theme/commit/22fd984cd0bddd06bce2b9bec57e73459c7ab73b)]
26
+ - fix: replace name Map viewer in the cart listed items source with Data viewer [Ion Lizarazu - [`1f7eefa`](https://github.com/eea/volto-clms-theme/commit/1f7eefaea5fd9691660a918924b70d041967e71f)]
27
+ - fix: capitalize some buttons [Ion Lizarazu - [`87a150a`](https://github.com/eea/volto-clms-theme/commit/87a150a013221c284a7679c837a935a1099d7d0d)]
28
+
29
+ ### [1.1.41](https://github.com/eea/volto-clms-theme/compare/1.1.40...1.1.41) - 18 September 2023
12
30
 
13
31
  ### [1.1.40](https://github.com/eea/volto-clms-theme/compare/1.1.39...1.1.40) - 14 September 2023
14
32
 
@@ -40,7 +58,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
40
58
 
41
59
  - fix cart items concat function [Ion Lizarazu - [`4b72249`](https://github.com/eea/volto-clms-theme/commit/4b72249ef17a0cda22661809fce5be7c2d1f6649)]
42
60
  - revert Jenkinsfile [Ion Lizarazu - [`64f6cd0`](https://github.com/eea/volto-clms-theme/commit/64f6cd08100357843b507c00d3286d7debe0ef04)]
43
- - yarn.lock file [Ion Lizarazu - [`8444ad1`](https://github.com/eea/volto-clms-theme/commit/8444ad1606b3939e4609bdd186e5ace2252588a8)]
44
61
  - packages.json versions order [Ion Lizarazu - [`4fd7a86`](https://github.com/eea/volto-clms-theme/commit/4fd7a86ab43238841b421e1ed10ebd52ab420a15)]
45
62
  - downloadablefilestablewidget param modification [Ion Lizarazu - [`5dd794a`](https://github.com/eea/volto-clms-theme/commit/5dd794a33a8eddd042a753b7ab47e7d2a323b011)]
46
63
  - add technical_documents_accordion_text field to the dataset view [Ion Lizarazu - [`96ed1e5`](https://github.com/eea/volto-clms-theme/commit/96ed1e5e2c2b501bd303bc76b333a70ad1614c16)]
@@ -165,7 +182,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
165
182
 
166
183
  - remove NUTS text for area naming in the cart [ionlizarazu - [`062e0a3`](https://github.com/eea/volto-clms-theme/commit/062e0a375f5352bc13c18ff7ec33fad4bcc59f2f)]
167
184
  - dependencies [ionlizarazu - [`405ef96`](https://github.com/eea/volto-clms-theme/commit/405ef96090fe7bd4af73a49d3285a92fad712e3b)]
168
- - yarn.lock [ionlizarazu - [`7132119`](https://github.com/eea/volto-clms-theme/commit/71321195c4dd4fceed67f2f0872f3e24bba61c17)]
169
185
  - volto-blocks-grid module mapping [ionlizarazu - [`4fec3ca`](https://github.com/eea/volto-clms-theme/commit/4fec3cabc437322ad92ed90d682250bd123ccaaf)]
170
186
  - volto-blocks-grid v7.0.2 [ionlizarazu - [`2557e60`](https://github.com/eea/volto-clms-theme/commit/2557e6039d3cea33ca0bd11a0a3ef4764c611f78)]
171
187
  - remove styling from teaser block [ionlizarazu - [`879e684`](https://github.com/eea/volto-clms-theme/commit/879e684057c88f52f60f0fa54cbaa155c7d14688)]
@@ -253,7 +269,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
253
269
 
254
270
  #### :house: Internal changes
255
271
 
256
- - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`b4cbf65`](https://github.com/eea/volto-clms-theme/commit/b4cbf6557fbc67f7fc4cea5aa2cb19804f3d7e3c)]
257
272
 
258
273
  #### :hammer_and_wrench: Others
259
274
 
@@ -1452,7 +1467,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1452
1467
  #### :hammer_and_wrench: Others
1453
1468
 
1454
1469
  - related products and datasets added to news and meeting views and login-plone route created [Unai - [`5704a1a`](https://github.com/eea/volto-clms-theme/commit/5704a1a766148746162b60efaf232ea90dc20cf4)]
1455
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
1456
1470
  - sort items according to the lowercased label and put those with special meaning at the end [Mikel Larreategi - [`6410abe`](https://github.com/eea/volto-clms-theme/commit/6410abe096f60dcad54dced2026c9df9b7946d68)]
1457
1471
  - lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
1458
1472
  - footer newsletter subscription change, global search maxLength change from 8000 to 200 and /login design change [Unai - [`a09d24a`](https://github.com/eea/volto-clms-theme/commit/a09d24adbb6fa053fb2a2cc0071506b906593b42)]
@@ -1603,7 +1617,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1603
1617
  - search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
1604
1618
  - language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
1605
1619
  - toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
1606
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
1607
1620
  ### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
1608
1621
 
1609
1622
  #### :hammer_and_wrench: Others
@@ -2508,13 +2521,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2508
2521
  #### :hammer_and_wrench: Others
2509
2522
 
2510
2523
  - replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
2511
- - yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
2512
2524
  - add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
2513
2525
  - upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
2514
2526
  - HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
2515
2527
  - babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
2516
2528
  - prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
2517
- - add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
2518
2529
  - Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
2519
2530
  - cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
2520
2531
  - some fixes [ionlizarazu - [`046279b`](https://github.com/eea/volto-clms-theme/commit/046279b9d05bea8a64eca03eed493e02621534c9)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.41",
3
+ "version": "1.1.43",
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",
@@ -52,11 +52,12 @@ const CclFAQBlockView = (props) => {
52
52
  React.useEffect(() => {
53
53
  let indexes = [];
54
54
  // eslint-disable-next-line no-unused-expressions
55
- contextNavigation?.[cn_key]?.data?.items.forEach((i) => {
56
- if (i.items.length > 0) {
57
- indexes.push(i.items[0].normalized_id);
58
- }
59
- });
55
+ contextNavigation?.[cn_key]?.data?.items &&
56
+ contextNavigation?.[cn_key]?.data?.items.forEach((i) => {
57
+ if (i.items.length > 0) {
58
+ indexes.push(i.items[0].normalized_id);
59
+ }
60
+ });
60
61
  setActiveIndex(indexes);
61
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
62
63
  }, [contextNavigation?.[cn_key]?.data?.items]);
@@ -1,29 +1,17 @@
1
1
  import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
2
2
  import CclHomeImageEditor from './CclHomeImageEditor';
3
3
  import React from 'react';
4
+ import { toPublicURL } from '@plone/volto/helpers';
5
+ import { HomeBgImg } from './HomeBgImg';
4
6
 
5
7
  const CclGreenBgView = (props) => {
6
8
  const { data, isEditMode } = props;
7
9
  const { showInfo, setShowInfo } = props?.content || {};
10
+ const image_url = data?.image?.url ? toPublicURL(data.image.url) : '';
8
11
  return (
9
12
  <div className="ccl-banner-top-container">
10
13
  <div className="ccl-banner-top-main">
11
- <img
12
- src={
13
- `${data?.image?.url}/@@images/image/huge` ||
14
- 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
15
- }
16
- srcSet={`${data?.image?.url}/@@images/image/huge4000 4000w,
17
- ${data?.image?.url}/@@images/image/huge3000 3000w,
18
- ${data?.image?.url}/@@images/image/huge2400 2400w,
19
- ${data?.image?.url}/@@images/image/huge 1600w,
20
- ${data?.image?.url}/@@images/image/great 1200w,
21
- ${data?.image?.url}/@@images/image/larger 1000w,
22
- ${data?.image?.url}/@@images/image/large 800w,
23
- ${data?.image?.url}/@@images/image/teaser 600w,
24
- `}
25
- alt={data.image.alt}
26
- />
14
+ {image_url && <HomeBgImg url={image_url} alt={data?.image?.alt} />}
27
15
  {isEditMode && <CclHomeImageEditor {...props} />}
28
16
  <div className="ccl-container">
29
17
  <div className="ccl-banner-top-main-block-title">
@@ -1,28 +1,16 @@
1
1
  import React from 'react';
2
2
  import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
3
3
  import CclHomeImageEditor from './CclHomeImageEditor';
4
+ import { toPublicURL } from '@plone/volto/helpers';
5
+ import { HomeBgImg } from './HomeBgImg';
4
6
 
5
7
  const CclWhiteBgView = (props) => {
6
8
  const { data, isEditMode } = props;
9
+ const image_url = data?.image?.url ? toPublicURL(data.image.url) : '';
7
10
 
8
11
  return (
9
12
  <div className="home-map-container">
10
- <img
11
- src={
12
- `${data?.image?.url}/@@images/image/huge` ||
13
- 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
14
- }
15
- srcSet={`${data?.image?.url}/@@images/image/huge4000 4000w,
16
- ${data?.image?.url}/@@images/image/huge3000 3000w,
17
- ${data?.image?.url}/@@images/image/huge2400 2400w,
18
- ${data?.image?.url}/@@images/image/huge 1600w,
19
- ${data?.image?.url}/@@images/image/great 1200w,
20
- ${data?.image?.url}/@@images/image/larger 1000w,
21
- ${data?.image?.url}/@@images/image/large 800w,
22
- ${data?.image?.url}/@@images/image/teaser 600w,
23
- `}
24
- alt={data.image.alt}
25
- />
13
+ {image_url && <HomeBgImg url={image_url} alt={data?.image?.alt} />}
26
14
  {isEditMode && <CclHomeImageEditor {...props} />}
27
15
  <div className="ccl-container">
28
16
  <div className="home-map-banner">
@@ -0,0 +1,23 @@
1
+ export const HomeBgImg = ({ url, alt }) => {
2
+ return (
3
+ <img
4
+ src={
5
+ `${url}/@@images/image/huge` ||
6
+ 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
7
+ }
8
+ srcSet={`${url}/@@images/image/huge4000 4000w,
9
+ ${url}/@@images/image/huge3000 3000w,
10
+ ${url}/@@images/image/huge2400 2400w,
11
+ ${url}/@@images/image/huge 1600w,
12
+ ${url}/@@images/image/great 1200w,
13
+ ${url}/@@images/image/larger 1000w,
14
+ ${url}/@@images/image/large 800w,
15
+ ${url}/@@images/image/teaser 600w,
16
+ `}
17
+ alt={alt}
18
+ width={'100%'}
19
+ height={349}
20
+ fetchpriority="high"
21
+ />
22
+ );
23
+ };
@@ -47,59 +47,65 @@ const CclHomeUsersBlockView = (props) => {
47
47
  <div className="ccl-container">
48
48
  <h3>{data.title}</h3>
49
49
  <Slider className="ccl-list-carousel ccl-list-items" {...settings}>
50
- {cards.map((card, index) => (
51
- <div index={index} key={index}>
52
- <div className="ccl-list-item ">
53
- <div className="ccl-list-item-image">
54
- {card?.image?.url ? (
55
- <img
56
- src={`${card.image.url}/@@images/image`}
57
- alt={card.image.alt}
58
- />
59
- ) : card.productUrl &&
60
- card.productUrl.length > 0 &&
61
- card.productUrl[0].image_field ? (
62
- <img
63
- src={`${card.productUrl[0]['@id']}/@@images/${card.productUrl[0].image_field}/preview`}
64
- alt={card?.productUrl[0].title || 'Placeholder'}
65
- />
66
- ) : (
67
- <img
68
- src={
69
- 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
70
- }
71
- alt={'placeholder'}
72
- />
73
- )}
50
+ {cards.map((card, index) => {
51
+ const loading = card.lazyLoad ? { loading: 'lazy' } : {};
52
+ return (
53
+ <div index={index} key={index}>
54
+ <div className="ccl-list-item ">
55
+ <div className="ccl-list-item-image">
56
+ {card?.image?.url ? (
57
+ <img
58
+ src={`${card.image.url}/@@images/image/teaser`}
59
+ alt={card.image.alt}
60
+ {...loading}
61
+ />
62
+ ) : card.productUrl &&
63
+ card.productUrl.length > 0 &&
64
+ card.productUrl[0].image_field ? (
65
+ <img
66
+ src={`${card.productUrl[0]['@id']}/@@images/${card.productUrl[0].image_field}/preview`}
67
+ alt={card?.productUrl[0].title || 'Placeholder'}
68
+ {...loading}
69
+ />
70
+ ) : (
71
+ <img
72
+ src={
73
+ 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
74
+ }
75
+ alt={'placeholder'}
76
+ {...loading}
77
+ />
78
+ )}
79
+ </div>
80
+ <ConditionalLink
81
+ condition={card.productUrl && card.productUrl.length > 0}
82
+ item={
83
+ card.productUrl && card.productUrl.length > 0
84
+ ? card.productUrl[0]
85
+ : {}
86
+ }
87
+ >
88
+ <h4>
89
+ {card.title
90
+ ? card.title
91
+ : card.productUrl &&
92
+ card.productUrl.length > 0 &&
93
+ card.productUrl[0]['@id'].indexOf('http') !== 0
94
+ ? card.productUrl[0].title
95
+ : card.title}
96
+ </h4>
97
+ </ConditionalLink>
98
+ <p>
99
+ {card.description
100
+ ? card.description
101
+ : card.productUrl && card.productUrl.length > 0
102
+ ? card.productUrl[0].description
103
+ : card.description}
104
+ </p>
74
105
  </div>
75
- <ConditionalLink
76
- condition={card.productUrl && card.productUrl.length > 0}
77
- item={
78
- card.productUrl && card.productUrl.length > 0
79
- ? card.productUrl[0]
80
- : {}
81
- }
82
- >
83
- <h4>
84
- {card.title
85
- ? card.title
86
- : card.productUrl &&
87
- card.productUrl.length > 0 &&
88
- card.productUrl[0]['@id'].indexOf('http') !== 0
89
- ? card.productUrl[0].title
90
- : card.title}
91
- </h4>
92
- </ConditionalLink>
93
- <p>
94
- {card.description
95
- ? card.description
96
- : card.productUrl && card.productUrl.length > 0
97
- ? card.productUrl[0].description
98
- : card.description}
99
- </p>
100
106
  </div>
101
- </div>
102
- ))}
107
+ );
108
+ })}
103
109
  </Slider>
104
110
  {data.moreLinkUrl && data.moreLinkText && (
105
111
  <CclButton url={data.moreLinkUrl[0]['@id']}>
@@ -40,7 +40,7 @@ export const CardBlockSchema = () => ({
40
40
  {
41
41
  id: 'default',
42
42
  title: 'Default',
43
- fields: ['title', 'description', 'productUrl'],
43
+ fields: ['title', 'description', 'productUrl', 'lazyLoad'],
44
44
  },
45
45
  ],
46
46
  properties: {
@@ -61,6 +61,13 @@ export const CardBlockSchema = () => ({
61
61
  selectedItemAttrs: ['description', 'image_field'],
62
62
  allowExternals: true,
63
63
  },
64
+ lazyLoad: {
65
+ title: 'Lazy load',
66
+ description:
67
+ 'Check it ONLY if the image is not going to be shown in the first load',
68
+ type: 'boolean',
69
+ default: false,
70
+ },
64
71
  },
65
72
  required: ['product'],
66
73
  });
@@ -105,7 +105,7 @@ export const TimeseriesPicker = (props) => {
105
105
  setIsOpen(false);
106
106
  }}
107
107
  >
108
- apply
108
+ Apply
109
109
  </CclButton>
110
110
  </DatePicker>
111
111
  </Grid.Row>
@@ -165,7 +165,7 @@ export const TimeseriesPicker = (props) => {
165
165
  setIsOpen(false);
166
166
  }}
167
167
  >
168
- cancel
168
+ Cancel
169
169
  </CclButton>
170
170
  </Grid.Row>
171
171
  </Grid.Column>
@@ -116,7 +116,7 @@ export const getCartObjectFromMapviewer = (
116
116
  type_options.length > 0 ? type_options[0].full_format : null,
117
117
  resolution: dataset_data.resolution || '-',
118
118
  size: dataset_data.size || '-',
119
- source: 'Map viewer',
119
+ source: 'Data viewer',
120
120
  type: type_options.length > 0 ? type_options[0].id : null,
121
121
  type_options: type_options,
122
122
  version: dataset_data.version || '-',
@@ -257,6 +257,8 @@ class Footer extends Component {
257
257
  className="ccl-footer-logo-img"
258
258
  src={CopernicusImage}
259
259
  alt={'Copernicus'}
260
+ width={290}
261
+ height={70}
260
262
  />
261
263
  </a>
262
264
  </div>
@@ -56,6 +56,7 @@ const Logo = () => {
56
56
  alt={intl.formatMessage(messages.copernicuslogo)}
57
57
  title={intl.formatMessage(messages.copernicuslogo)}
58
58
  height={44}
59
+ width={212}
59
60
  />
60
61
  </a>
61
62
  <Link
@@ -68,6 +69,7 @@ const Logo = () => {
68
69
  alt={intl.formatMessage(messages.plonesite)}
69
70
  title={intl.formatMessage(messages.plonesite)}
70
71
  height={44}
72
+ width={215}
71
73
  />
72
74
  </Link>
73
75
  </div>