@eeacms/volto-clms-theme 1.1.284 → 1.1.286

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,20 @@ 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.286](https://github.com/eea/volto-clms-theme/compare/1.1.285...1.1.286) - 15 May 2026
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Refs #294985 - Fix autoprefixer warning in technical library result styles. [GhitaB - [`858bc25`](https://github.com/eea/volto-clms-theme/commit/858bc250b7dde49aae96d130eb64b2fa0acd2fc9)]
12
+ ### [1.1.285](https://github.com/eea/volto-clms-theme/compare/1.1.284...1.1.285) - 14 May 2026
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - fix [Dobricean Ioan Dorian - [`b2e3af5`](https://github.com/eea/volto-clms-theme/commit/b2e3af5bdaaaf2c04e912ba468e3337358f2cae7)]
17
+ - fix [Dobricean Ioan Dorian - [`42a8a4a`](https://github.com/eea/volto-clms-theme/commit/42a8a4a13594eacbb29b5ad1e3ff49a2dede768a)]
18
+ - fix imports [Dobricean Ioan Dorian - [`978c116`](https://github.com/eea/volto-clms-theme/commit/978c11631312efb125e226b5a331f706a2843bd8)]
19
+ - add entra id view [Dobricean Ioan Dorian - [`5048e4c`](https://github.com/eea/volto-clms-theme/commit/5048e4cd2201f4309301e83e601f765a732b65be)]
20
+ - add entra id view [Dobricean Ioan Dorian - [`d70373e`](https://github.com/eea/volto-clms-theme/commit/d70373e752143495a7503c6a6460d3a51dc58e33)]
7
21
  ### [1.1.284](https://github.com/eea/volto-clms-theme/compare/1.1.283...1.1.284) - 13 May 2026
8
22
 
9
23
  ### [1.1.283](https://github.com/eea/volto-clms-theme/compare/1.1.282...1.1.283) - 4 May 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.284",
3
+ "version": "1.1.286",
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,6 +59,7 @@
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",
62
63
  "connected-react-router": "6.8.0",
63
64
  "d3-array": "^2.12.1",
64
65
  "husky": "7.0.4",
@@ -0,0 +1,110 @@
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);
@@ -111,7 +111,7 @@ body.clmsSearchTechnicalLibrary-view {
111
111
  .technical-library-title {
112
112
  display: inline-flex !important;
113
113
  width: 100%;
114
- align-items: start;
114
+ align-items: flex-start;
115
115
  }
116
116
 
117
117
  .label {
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, Login } from '@plone/volto/components';
7
+ import { ContactForm, Search, Sitemap } from '@plone/volto/components';
8
8
 
9
9
  // VIEWS
10
10
  import CLMSDatasetDetailView from '@eeacms/volto-clms-theme/components/CLMSDatasetDetailView/CLMSDatasetDetailView';
@@ -52,6 +52,7 @@ 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';
55
56
 
56
57
  //SLATE CONFIGURATION
57
58
  import installLinkEditor from '@plone/volto-slate/editor/plugins/AdvancedLink';
@@ -256,15 +257,14 @@ const applyConfig = (config) => {
256
257
  config,
257
258
  );
258
259
 
259
- config.addonRoutes = [
260
- ...config.addonRoutes,
260
+ const loginRoutes = [
261
261
  {
262
262
  path: '/login-plone',
263
- component: Login,
263
+ component: AuthomaticLoginPlone,
264
264
  },
265
265
  {
266
266
  path: '/**/login-plone',
267
- component: Login,
267
+ component: AuthomaticLoginPlone,
268
268
  },
269
269
  {
270
270
  path: '/login',
@@ -274,6 +274,11 @@ const applyConfig = (config) => {
274
274
  path: '/**/login',
275
275
  component: CLMSLoginView,
276
276
  },
277
+ ];
278
+
279
+ config.addonRoutes = [
280
+ ...loginRoutes,
281
+ ...config.addonRoutes,
277
282
  {
278
283
  path: '/profile',
279
284
  component: ProfileView,