@eeacms/volto-clms-theme 1.1.224 → 1.1.226

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,7 +4,15 @@ 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.224](https://github.com/eea/volto-clms-theme/compare/1.1.223...1.1.224) - 23 March 2025
7
+ ### [1.1.226](https://github.com/eea/volto-clms-theme/compare/1.1.225...1.1.226) - 31 March 2025
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: the button should show the correct message whether the user is logged in or not -refs #283619 [ana-oprea - [`49f3d06`](https://github.com/eea/volto-clms-theme/commit/49f3d0676c27262a8d0fc2cfa94b4a58132c9be7)]
12
+
13
+ ### [1.1.225](https://github.com/eea/volto-clms-theme/compare/1.1.224...1.1.225) - 25 March 2025
14
+
15
+ ### [1.1.224](https://github.com/eea/volto-clms-theme/compare/1.1.223...1.1.224) - 24 March 2025
8
16
 
9
17
  #### :rocket: New Features
10
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.224",
3
+ "version": "1.1.226",
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",
@@ -1,18 +1,25 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { connect } from 'react-redux';
3
3
  import { withRouter } from 'react-router';
4
- import { NavLink, Route } from 'react-router-dom';
4
+ import { NavLink, Route, useLocation } from 'react-router-dom';
5
5
  import { compose } from 'redux';
6
6
 
7
7
  import { RenderBlocks } from '@plone/volto/components';
8
8
  import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
9
- import { useLocation } from 'react-router-dom';
10
9
  import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
11
10
  import { slugify } from '../../utils';
12
11
  import './fontawesome';
13
12
 
14
13
  import cx from 'classnames';
15
14
 
15
+ const scrollToContentSection = () => {
16
+ window.scrollTo({
17
+ top: 0,
18
+ left: 0,
19
+ behavior: 'smooth',
20
+ });
21
+ };
22
+
16
23
  const handleClick = (e, tab, activeTab, setActiveTab, location, tabHash) => {
17
24
  if (activeTab !== tab) {
18
25
  location.hash = `#${tabHash}`;
@@ -38,6 +45,17 @@ const TabsComponent = (props) => {
38
45
  document.querySelector('#loader').style.display = 'block';
39
46
  }
40
47
  const location = useLocation();
48
+
49
+ useEffect(() => {
50
+ const urlParams = new URLSearchParams(location.search);
51
+ const hasHash = location.hash.length > 1;
52
+ const hasQueryTab = urlParams.has('tab');
53
+
54
+ if (hasHash || hasQueryTab) {
55
+ scrollToContentSection();
56
+ }
57
+ }, [activeTab, location.hash.length, location.search]);
58
+
41
59
  return (
42
60
  <div className="tabs" role="tablist">
43
61
  <nav>
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  import InfoDownloadDataSet from './InfoDownloadDataSet';
14
14
 
15
- const DownloadDataSetContent = (data, token, fontAwesomeSolid) => {
15
+ const DownloadDataSetContent = (data, token) => {
16
16
  const user = useSelector((state) => state?.users?.user);
17
17
  const locale = useSelector((state) => state?.intl?.locale);
18
18
  let download_other_ways_access_dataset = sanitizedHTML(
@@ -31,7 +31,8 @@ const DownloadDataSetContent = (data, token, fontAwesomeSolid) => {
31
31
  <div
32
32
  className={
33
33
  data.download_limit_temporal_extent &&
34
- user?.['@id'] &&
34
+ data?.downloadable_full_dataset &&
35
+ download_by_area_extra_text !== '' &&
35
36
  (data.mapviewer_istimeseries ||
36
37
  data.download_show_auxiliary_calendar)
37
38
  ? ''
@@ -57,28 +58,38 @@ const DownloadDataSetContent = (data, token, fontAwesomeSolid) => {
57
58
  </>
58
59
  )}
59
60
 
60
- {user?.['@id'] ? (
61
- data.mapviewer_istimeseries ||
62
- data.download_show_auxiliary_calendar ? (
63
- <>
64
- <CclButton
65
- url={'/' + locale + '/map-viewer?dataset=' + data?.UID}
66
- >
61
+ {data.mapviewer_istimeseries ||
62
+ data.download_show_auxiliary_calendar ? (
63
+ <>
64
+ {user?.['@id'] ? (
65
+ <CclButton url={`/${locale}/map-viewer?dataset=${data?.UID}`}>
67
66
  Go to download by area and time
68
67
  </CclButton>
69
- {data.download_limit_temporal_extent && (
70
- <InfoDownloadDataSet
71
- temporalLimitExtent={data.download_limit_temporal_extent}
72
- />
73
- )}
74
- </>
75
- ) : (
76
- <CclButton
77
- url={'/' + locale + '/map-viewer?dataset=' + data?.UID}
78
- >
79
- Go to download by area
80
- </CclButton>
81
- )
68
+ ) : (
69
+ <CclLoginModal
70
+ triggerComponent={() => (
71
+ <CclButton
72
+ isButton={true}
73
+ className={'ccl-button ccl-button--default'}
74
+ >
75
+ <FormattedMessage
76
+ id="downloadByAreaAndTime"
77
+ defaultMessage="Go to download by area and time"
78
+ />
79
+ </CclButton>
80
+ )}
81
+ />
82
+ )}
83
+ {data.download_limit_temporal_extent && (
84
+ <InfoDownloadDataSet
85
+ temporalLimitExtent={data.download_limit_temporal_extent}
86
+ />
87
+ )}
88
+ </>
89
+ ) : user?.['@id'] ? (
90
+ <CclButton url={`/${locale}/map-viewer?dataset=${data?.UID}`}>
91
+ Go to download by area
92
+ </CclButton>
82
93
  ) : (
83
94
  <CclLoginModal
84
95
  triggerComponent={() => (