@eeacms/volto-eea-website-policy 1.3.3 → 1.4.0
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,31 @@ 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.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat(contact-form): Redirect to /en/about/contact-us - refs #160689 [Alin Voinea - [`14ae1f0`](https://github.com/eea/volto-eea-website-policy/commit/14ae1f01c34f9b146207daee538f5988e1df821e)]
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fixes
|
|
14
|
+
|
|
15
|
+
- fix(logout): Fix login / logout redirect loop on demo-www [Alin Voinea - [`ab3d0fe`](https://github.com/eea/volto-eea-website-policy/commit/ab3d0fe4a79ed29b63bb0673f748481439d61b3d)]
|
|
16
|
+
|
|
17
|
+
#### :nail_care: Enhancements
|
|
18
|
+
|
|
19
|
+
- refactor(contact-form): Moved to volto-eea-website-theme - refs #160689 [Alin Voinea - [`e7c2e18`](https://github.com/eea/volto-eea-website-policy/commit/e7c2e1851d2db95055ad11bfdd9c7ccf123195f6)]
|
|
20
|
+
|
|
21
|
+
#### :hammer_and_wrench: Others
|
|
22
|
+
|
|
23
|
+
- Release 1.4.0 [Alin Voinea - [`8add7f3`](https://github.com/eea/volto-eea-website-policy/commit/8add7f353887ade8399ab3ad56c96b9dcaba461b)]
|
|
24
|
+
### [1.3.4](https://github.com/eea/volto-eea-website-policy/compare/1.3.3...1.3.4) - 17 February 2023
|
|
25
|
+
|
|
26
|
+
#### :bug: Bug Fixes
|
|
27
|
+
|
|
28
|
+
- fix(LinkView): Consider /en/ only links as internal - refs #158717 [Alin Voinea - [`a39598a`](https://github.com/eea/volto-eea-website-policy/commit/a39598ade9430bc9c3f20d63e33cb19774cd365a)]
|
|
29
|
+
- fix(LinkView): Try to use window.location.replace to redirect Links - refs #158717 [Alin Voinea - [`7210193`](https://github.com/eea/volto-eea-website-policy/commit/7210193090295fcd116aa831296b70238508f037)]
|
|
30
|
+
- fix(LinkView): Copy unchanged from volto 16.11.0 [Alin Voinea - [`3cf2634`](https://github.com/eea/volto-eea-website-policy/commit/3cf263464f1729b503561088582ca6657212fbd1)]
|
|
31
|
+
|
|
7
32
|
### [1.3.3](https://github.com/eea/volto-eea-website-policy/compare/1.3.2...1.3.3) - 17 February 2023
|
|
8
33
|
|
|
9
34
|
#### :bug: Bug Fixes
|
|
@@ -58,7 +83,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
58
83
|
#### :hammer_and_wrench: Others
|
|
59
84
|
|
|
60
85
|
- Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)]
|
|
61
|
-
- yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)]
|
|
62
86
|
### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022
|
|
63
87
|
|
|
64
88
|
#### :nail_care: Enhancements
|
|
@@ -104,7 +128,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
104
128
|
|
|
105
129
|
#### :hammer_and_wrench: Others
|
|
106
130
|
|
|
107
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
|
|
108
131
|
### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022
|
|
109
132
|
|
|
110
133
|
#### :hammer_and_wrench: Others
|
|
@@ -180,7 +203,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
180
203
|
- format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
|
|
181
204
|
- Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
|
|
182
205
|
- Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
|
|
183
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
|
|
184
206
|
### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022
|
|
185
207
|
|
|
186
208
|
#### :hammer_and_wrench: Others
|
|
@@ -193,5 +215,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
193
215
|
|
|
194
216
|
#### :hammer_and_wrench: Others
|
|
195
217
|
|
|
196
|
-
- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
|
|
197
218
|
- Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
|
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link View.
|
|
3
|
+
* @module components/theme/View/LinkView
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { Component } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
|
|
9
|
+
import { Container } from 'semantic-ui-react';
|
|
10
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
11
|
+
import { FormattedMessage } from 'react-intl';
|
|
12
|
+
import config from '@plone/volto/registry';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* View container class.
|
|
16
|
+
* @class View
|
|
17
|
+
* @extends Component
|
|
18
|
+
*/
|
|
19
|
+
class LinkView extends Component {
|
|
20
|
+
/**
|
|
21
|
+
* Property types.
|
|
22
|
+
* @property {Object} propTypes Property types.
|
|
23
|
+
* @static
|
|
24
|
+
*/
|
|
25
|
+
static propTypes = {
|
|
26
|
+
content: PropTypes.shape({
|
|
27
|
+
title: PropTypes.string,
|
|
28
|
+
description: PropTypes.string,
|
|
29
|
+
remoteUrl: PropTypes.string,
|
|
30
|
+
}),
|
|
31
|
+
token: PropTypes.string,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Default properties.
|
|
36
|
+
* @property {Object} defaultProps Default properties.
|
|
37
|
+
* @static
|
|
38
|
+
*/
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
content: null,
|
|
41
|
+
token: null,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
componentDidMount() {
|
|
45
|
+
if (!this.props.token) {
|
|
46
|
+
const { remoteUrl } = this.props.content;
|
|
47
|
+
if (isInternalURL(remoteUrl) && remoteUrl.includes('/en/')) {
|
|
48
|
+
this.props.history.replace(flattenToAppURL(remoteUrl));
|
|
49
|
+
} else if (!__SERVER__) {
|
|
50
|
+
window.location.replace(flattenToAppURL(remoteUrl));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Render method.
|
|
57
|
+
* @method render
|
|
58
|
+
* @returns {string} Markup for the component.
|
|
59
|
+
*/
|
|
60
|
+
render() {
|
|
61
|
+
const { remoteUrl } = this.props.content;
|
|
62
|
+
const { openExternalLinkInNewTab } = config.settings;
|
|
63
|
+
return (
|
|
64
|
+
<Container id="page-document">
|
|
65
|
+
<h1 className="documentFirstHeading">{this.props.content.title}</h1>
|
|
66
|
+
{this.props.content.description && (
|
|
67
|
+
<p className="documentDescription">
|
|
68
|
+
{this.props.content.description}
|
|
69
|
+
</p>
|
|
70
|
+
)}
|
|
71
|
+
{remoteUrl && (
|
|
72
|
+
<p>
|
|
73
|
+
<FormattedMessage
|
|
74
|
+
id="The link address is:"
|
|
75
|
+
defaultMessage="The link address is:"
|
|
76
|
+
/>{' '}
|
|
77
|
+
<UniversalLink
|
|
78
|
+
href={remoteUrl}
|
|
79
|
+
openLinkInNewTab={
|
|
80
|
+
openExternalLinkInNewTab && !isInternalURL(remoteUrl)
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
{flattenToAppURL(remoteUrl)}
|
|
84
|
+
</UniversalLink>
|
|
85
|
+
</p>
|
|
86
|
+
)}
|
|
87
|
+
</Container>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default LinkView;
|
package/src/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-poli
|
|
|
5
5
|
|
|
6
6
|
const applyConfig = (config) => {
|
|
7
7
|
// #158717#note-25 any path that isn't static, en or controlpanel is treated as external
|
|
8
|
-
const notInEN = /^(?!.*(\/en|\/static|\/controlpanel|\/cypress)).*$/;
|
|
8
|
+
const notInEN = /^(?!.*(\/en|\/static|\/controlpanel|\/cypress|\/login|\/logout|\/contact-form)).*$/;
|
|
9
9
|
config.settings.externalRoutes = [
|
|
10
10
|
...(config.settings.externalRoutes || []),
|
|
11
11
|
{
|
|
@@ -17,6 +17,9 @@ const applyConfig = (config) => {
|
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
19
|
|
|
20
|
+
// #160689 Redirect contact-form to contact-us
|
|
21
|
+
config.settings.contactForm = '/en/about/contact-us';
|
|
22
|
+
|
|
20
23
|
// #137187 Keycloak integration
|
|
21
24
|
if (runtimeConfig['RAZZLE_KEYCLOAK'] === 'Yes') {
|
|
22
25
|
config.settings.externalRoutes = [
|