@eeacms/volto-clms-theme 1.1.294 → 1.1.295

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,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.295](https://github.com/eea/volto-clms-theme/compare/1.1.294...1.1.295) - 8 June 2026
8
+
9
+ #### :house: Internal changes
10
+
11
+ - style: Automated code fix [eea-jenkins - [`cb21bf3`](https://github.com/eea/volto-clms-theme/commit/cb21bf3e1891a59fce5e8cbd2bd2185ba67cae03)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - fix routing [Dobricean Ioan Dorian - [`a640f1f`](https://github.com/eea/volto-clms-theme/commit/a640f1f55e682d2f6b5a007df8e12aa4283d27b1)]
7
16
  ### [1.1.294](https://github.com/eea/volto-clms-theme/compare/1.1.293...1.1.294) - 5 June 2026
8
17
 
9
18
  #### :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.294",
3
+ "version": "1.1.295",
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",
package/src/index.js CHANGED
@@ -53,6 +53,7 @@ import reducers from './reducers';
53
53
  import CookieBanner from 'volto-cookie-banner/CookieBannerContainer';
54
54
  import CLMSLoginView from './components/CLMSLoginView/CLMSLogin';
55
55
  import AuthomaticLoginPlone from './components/CLMSLoginView/AuthomaticLoginPlone';
56
+ import { withCLMSLoginRoutes } from './loginRoutes';
56
57
  //SLATE CONFIGURATION
57
58
  import installLinkEditor from '@plone/volto-slate/editor/plugins/AdvancedLink';
58
59
 
@@ -271,23 +272,11 @@ const applyConfig = (config) => {
271
272
  );
272
273
 
273
274
  config.addonRoutes = [
274
- ...config.addonRoutes,
275
- {
276
- path: '/login-plone',
277
- component: AuthomaticLoginPlone,
278
- },
279
- {
280
- path: '/**/login-plone',
281
- component: AuthomaticLoginPlone,
282
- },
283
- {
284
- path: '/login',
285
- component: CLMSLoginView,
286
- },
287
- {
288
- path: '/**/login',
289
- component: CLMSLoginView,
290
- },
275
+ ...withCLMSLoginRoutes(
276
+ config.addonRoutes,
277
+ CLMSLoginView,
278
+ AuthomaticLoginPlone,
279
+ ),
291
280
  {
292
281
  path: '/profile',
293
282
  component: ProfileView,
@@ -0,0 +1,35 @@
1
+ const clmsLoginPaths = [
2
+ '/login',
3
+ '/**/login',
4
+ '/login-plone',
5
+ '/**/login-plone',
6
+ ];
7
+
8
+ const routeHasCLMSLoginPath = (route) => {
9
+ const paths = Array.isArray(route.path) ? route.path : [route.path];
10
+ return paths.some((path) => clmsLoginPaths.includes(path));
11
+ };
12
+
13
+ export const buildLoginRoutes = (Login, LoginPlone) => [
14
+ {
15
+ path: '/login',
16
+ component: Login,
17
+ },
18
+ {
19
+ path: '/**/login',
20
+ component: Login,
21
+ },
22
+ {
23
+ path: '/login-plone',
24
+ component: LoginPlone,
25
+ },
26
+ {
27
+ path: '/**/login-plone',
28
+ component: LoginPlone,
29
+ },
30
+ ];
31
+
32
+ export const withCLMSLoginRoutes = (addonRoutes, Login, LoginPlone) => [
33
+ ...buildLoginRoutes(Login, LoginPlone),
34
+ ...(addonRoutes || []).filter((route) => !routeHasCLMSLoginPath(route)),
35
+ ];