@eeacms/volto-clms-theme 1.1.286 → 1.1.287

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,18 @@ 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.287](https://github.com/eea/volto-clms-theme/compare/1.1.286...1.1.287) - 18 May 2026
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: Automated code fix [eea-jenkins - [`3f56cf8`](https://github.com/eea/volto-clms-theme/commit/3f56cf831a5df1394e9c214bfff848b8feae55a1)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - Remove @plone-collective/volto-authomatic dependency [dobri1408 - [`122f114`](https://github.com/eea/volto-clms-theme/commit/122f1149d28d509610a25916fb9cd6d91d58d028)]
16
+ - Add Login component to routes and clean up code [dobri1408 - [`dd6641b`](https://github.com/eea/volto-clms-theme/commit/dd6641baa61ceb97fb0e5ebe83060af904e4c178)]
17
+ - (bug): Fix feedback survey modal crash by guarding missing config and clearing stale open timer [Unai Bolivar - [`a04d0ce`](https://github.com/eea/volto-clms-theme/commit/a04d0ce7513fc992554483593a97d1d775927ccb)]
18
+ - Delete src/components/CLMSLoginView/AuthomaticLoginPlone.jsx [dobri1408 - [`c3fcfaa`](https://github.com/eea/volto-clms-theme/commit/c3fcfaa868c900794132d014f37cefa519b65678)]
7
19
  ### [1.1.286](https://github.com/eea/volto-clms-theme/compare/1.1.285...1.1.286) - 15 May 2026
8
20
 
9
21
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.286",
3
+ "version": "1.1.287",
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",
@@ -59,7 +59,6 @@
59
59
  "@fortawesome/react-fontawesome": "0.1.14",
60
60
  "@ginkgo-bioworks/react-json-schema-form-builder": "2.10.1",
61
61
  "@kitconcept/volto-blocks-grid": "7.0.2",
62
- "@plone-collective/volto-authomatic": "2.0.1",
63
62
  "connected-react-router": "6.8.0",
64
63
  "d3-array": "^2.12.1",
65
64
  "husky": "7.0.4",
@@ -22,7 +22,7 @@ function SurveyModal(props) {
22
22
  >
23
23
  <ModalContent>
24
24
  <ModalDescription>
25
- <p>{config.text}</p>
25
+ <p>{config?.text || ''}</p>
26
26
  </ModalDescription>
27
27
  </ModalContent>
28
28
  <ModalActions>
@@ -42,7 +42,9 @@ function SurveyModal(props) {
42
42
  setOpen(false);
43
43
  markSurveyAsDone();
44
44
  //window.open(config.link, '_blank');
45
- window.location.replace(config.link);
45
+ if (config?.link) {
46
+ window.location.replace(config.link);
47
+ }
46
48
  }}
47
49
  >
48
50
  Take survey
@@ -100,20 +102,29 @@ export const FeedbackSurvey = () => {
100
102
 
101
103
  const location = useLocation();
102
104
  useEffect(() => {
105
+ let modalTimer;
103
106
  if (surveyConfig !== undefined) {
104
107
  if (surveyConfig.is_active === true) {
105
108
  incrementPageviews(20);
106
109
  let willOpen = decideToOpenModal();
107
110
  if (willOpen) {
108
- setTimeout(() => {
111
+ modalTimer = setTimeout(() => {
109
112
  setIsModalOpen(true);
110
113
  }, 5000);
111
114
  }
112
115
  }
113
116
  }
117
+
118
+ return () => {
119
+ if (modalTimer) {
120
+ clearTimeout(modalTimer);
121
+ }
122
+ };
114
123
  }, [location, surveyConfig]);
115
124
 
116
- return isModalOpen ? <SurveyModal config={surveyConfig} /> : null;
125
+ return isModalOpen && surveyConfig ? (
126
+ <SurveyModal config={surveyConfig} />
127
+ ) : null;
117
128
  };
118
129
 
119
130
  export default FeedbackSurvey;
package/src/index.js CHANGED
@@ -4,7 +4,7 @@ import customBlocks, {
4
4
  } from '@eeacms/volto-clms-theme/components/Blocks/customBlocks';
5
5
 
6
6
  // ROUTE VIEWS
7
- import { ContactForm, Search, Sitemap } from '@plone/volto/components';
7
+ import { ContactForm, Search, Sitemap, Login } from '@plone/volto/components';
8
8
 
9
9
  // VIEWS
10
10
  import CLMSDatasetDetailView from '@eeacms/volto-clms-theme/components/CLMSDatasetDetailView/CLMSDatasetDetailView';
@@ -52,7 +52,6 @@ import { CheckboxHtmlWidget } from './components/Blocks/CustomTemplates/VoltoFor
52
52
  import reducers from './reducers';
53
53
  import CookieBanner from 'volto-cookie-banner/CookieBannerContainer';
54
54
  import CLMSLoginView from './components/CLMSLoginView/CLMSLogin';
55
- import AuthomaticLoginPlone from './components/CLMSLoginView/AuthomaticLoginPlone';
56
55
 
57
56
  //SLATE CONFIGURATION
58
57
  import installLinkEditor from '@plone/volto-slate/editor/plugins/AdvancedLink';
@@ -257,14 +256,15 @@ const applyConfig = (config) => {
257
256
  config,
258
257
  );
259
258
 
260
- const loginRoutes = [
259
+ config.addonRoutes = [
260
+ ...config.addonRoutes,
261
261
  {
262
262
  path: '/login-plone',
263
- component: AuthomaticLoginPlone,
263
+ component: Login,
264
264
  },
265
265
  {
266
266
  path: '/**/login-plone',
267
- component: AuthomaticLoginPlone,
267
+ component: Login,
268
268
  },
269
269
  {
270
270
  path: '/login',
@@ -274,11 +274,6 @@ const applyConfig = (config) => {
274
274
  path: '/**/login',
275
275
  component: CLMSLoginView,
276
276
  },
277
- ];
278
-
279
- config.addonRoutes = [
280
- ...loginRoutes,
281
- ...config.addonRoutes,
282
277
  {
283
278
  path: '/profile',
284
279
  component: ProfileView,
@@ -1,110 +0,0 @@
1
- /**
2
- * Authomatic login mounted on /login-plone.
3
- * @module components/CLMSLoginView/AuthomaticLoginPlone
4
- */
5
- import React, { useEffect, useState } from 'react';
6
- import {
7
- authomaticRedirect,
8
- listAuthOptions,
9
- oidcRedirect,
10
- } from '@plone-collective/volto-authomatic/actions'; // eslint-disable-line import/no-unresolved
11
- // eslint-disable-next-line import/no-unresolved
12
- import LoginForm from '@plone-collective/volto-authomatic/components/Login/LoginForm';
13
- import { injectIntl } from 'react-intl';
14
- import { useSelector, useDispatch } from 'react-redux';
15
- import { useLocation } from 'react-router-dom';
16
- import qs from 'query-string';
17
- import { useCookies } from 'react-cookie';
18
-
19
- function getReturnUrl(location) {
20
- const returnUrl = qs.parse(location.search).return_url;
21
-
22
- if (returnUrl) {
23
- return returnUrl;
24
- }
25
-
26
- const pathname = location.pathname || '/';
27
- const loginPloneSuffix = '/login-plone';
28
- const loginSuffix = '/login';
29
-
30
- if (pathname === loginPloneSuffix || pathname === loginSuffix) {
31
- return '/';
32
- }
33
-
34
- if (pathname.endsWith(loginPloneSuffix)) {
35
- return pathname.slice(0, -loginPloneSuffix.length) || '/';
36
- }
37
-
38
- if (pathname.endsWith(loginSuffix)) {
39
- return pathname.slice(0, -loginSuffix.length) || '/';
40
- }
41
-
42
- return '/';
43
- }
44
-
45
- function AuthomaticLoginPlone() {
46
- const dispatch = useDispatch();
47
- const [startedOAuth, setStartedOAuth] = useState(false);
48
- const [startedOIDC, setStartedOIDC] = useState(false);
49
- const loading = useSelector((state) => state.authOptions.loading);
50
- const options = useSelector((state) => state.authOptions.options);
51
- const loginOAuthValues = useSelector((state) => state.authomaticRedirect);
52
- const loginOIDCValues = useSelector((state) => state.oidcRedirect);
53
- const location = useLocation();
54
- const [, setCookie] = useCookies();
55
-
56
- useEffect(() => {
57
- dispatch(listAuthOptions());
58
- }, [dispatch]);
59
-
60
- useEffect(() => {
61
- const nextUrl = loginOAuthValues.next_url;
62
- const session = loginOAuthValues.session;
63
-
64
- if (nextUrl && session && startedOAuth) {
65
- setStartedOAuth(false);
66
- setTimeout(() => {
67
- window.location.href = nextUrl;
68
- }, 500);
69
- }
70
- }, [startedOAuth, loginOAuthValues]);
71
-
72
- const onSelectProvider = (provider) => {
73
- setStartedOAuth(true);
74
- setCookie('return_url', getReturnUrl(location), { path: '/' });
75
- dispatch(authomaticRedirect(provider.id));
76
- };
77
-
78
- useEffect(() => {
79
- const nextUrl = loginOIDCValues.next_url;
80
-
81
- if (nextUrl && startedOIDC) {
82
- setStartedOIDC(false);
83
- setTimeout(() => {
84
- window.location.href = nextUrl;
85
- }, 500);
86
- }
87
- }, [startedOIDC, loginOIDCValues]);
88
-
89
- useEffect(() => {
90
- if (
91
- options !== undefined &&
92
- options.length === 1 &&
93
- options[0].id === 'oidc'
94
- ) {
95
- setStartedOIDC(true);
96
- dispatch(oidcRedirect('oidc'));
97
- }
98
- }, [options, dispatch]);
99
-
100
- return (
101
- <LoginForm
102
- loading={loading}
103
- providers={options}
104
- action="login"
105
- onSelectProvider={onSelectProvider}
106
- />
107
- );
108
- }
109
-
110
- export default injectIntl(AuthomaticLoginPlone);