@eeacms/volto-cca-policy 0.2.18 → 0.2.19
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 +10 -0
- package/package.json +1 -1
- package/src/components/manage/Blocks/RedirectBlock/RedirectBlock.test.js +1 -1
- package/src/components/manage/Blocks/RedirectBlock/RedirectBlockEdit.jsx +2 -1
- package/src/components/manage/Blocks/RedirectBlock/RedirectBlockView.jsx +6 -4
- package/src/index.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ 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
|
+
### [0.2.19](https://github.com/eea/volto-cca-policy/compare/0.2.18...0.2.19) - 7 May 2024
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: use DefaultView in layoutViews [kreafox - [`a87f13f`](https://github.com/eea/volto-cca-policy/commit/a87f13fc22374b40b3fbf2d0faff30059b65a610)]
|
|
12
|
+
- fix: update tests [kreafox - [`9f71324`](https://github.com/eea/volto-cca-policy/commit/9f7132455a988c09fed5a064a1c3e7f63856e27f)]
|
|
13
|
+
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
- Don't show content of redirection block [Tiberiu Ichim - [`65a1537`](https://github.com/eea/volto-cca-policy/commit/65a153714e4fe360c67f89575d1397d697a14711)]
|
|
7
17
|
### [0.2.18](https://github.com/eea/volto-cca-policy/compare/0.2.17...0.2.18) - 7 May 2024
|
|
8
18
|
|
|
9
19
|
#### :nail_care: Enhancements
|
package/package.json
CHANGED
|
@@ -5,9 +5,10 @@ import Schema from './schema';
|
|
|
5
5
|
export default function CountryMapObservatoryEdit(props) {
|
|
6
6
|
const { block, data, onChangeBlock, selected } = props;
|
|
7
7
|
const schema = Schema(data);
|
|
8
|
+
|
|
8
9
|
return (
|
|
9
10
|
<div className="redirection-block-edit">
|
|
10
|
-
<RedirectBlockDetails data={data} />
|
|
11
|
+
<RedirectBlockDetails data={data} token={true} />
|
|
11
12
|
|
|
12
13
|
<SidebarPortal selected={selected}>
|
|
13
14
|
<BlockDataForm
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { useHistory } from 'react-router-dom';
|
|
4
4
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
5
5
|
|
|
6
|
-
export function RedirectBlockDetails({ data }) {
|
|
7
|
-
return (
|
|
6
|
+
export function RedirectBlockDetails({ data, token }) {
|
|
7
|
+
return token ? (
|
|
8
8
|
<div className="redirect-block">
|
|
9
9
|
<h5>Redirection block</h5>
|
|
10
10
|
<p className="discreet">
|
|
@@ -16,16 +16,18 @@ export function RedirectBlockDetails({ data }) {
|
|
|
16
16
|
)}
|
|
17
17
|
</p>
|
|
18
18
|
</div>
|
|
19
|
-
);
|
|
19
|
+
) : null;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export default function RedirectBlockView({ data, token }) {
|
|
23
23
|
const target = data?.href?.[0]?.['@id'];
|
|
24
24
|
const history = useHistory();
|
|
25
|
+
|
|
25
26
|
React.useEffect(() => {
|
|
26
27
|
if (!token) {
|
|
27
28
|
history.push(flattenToAppURL(target));
|
|
28
29
|
}
|
|
29
30
|
}, [token, target, history]);
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
return <RedirectBlockDetails data={data} token={token} />;
|
|
31
33
|
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { compose } from 'redux';
|
|
2
2
|
import { Sitemap } from '@plone/volto/components';
|
|
3
|
+
import DefaultView from '@plone/volto/components/theme/View/DefaultView';
|
|
3
4
|
import {
|
|
4
5
|
RASTWidgetView,
|
|
5
6
|
TranslationDisclaimer,
|
|
@@ -290,6 +291,14 @@ const applyConfig = (config) => {
|
|
|
290
291
|
|
|
291
292
|
config.views.layoutViewsNamesMapping.view_cca_event = 'CCA Event View';
|
|
292
293
|
|
|
294
|
+
config.views.layoutViews = {
|
|
295
|
+
...config.views.layoutViews,
|
|
296
|
+
document_view: DefaultView,
|
|
297
|
+
album_view: DefaultView,
|
|
298
|
+
summary_view: DefaultView,
|
|
299
|
+
tabular_view: DefaultView,
|
|
300
|
+
};
|
|
301
|
+
|
|
293
302
|
config.settings.contextNavigationLocations = [
|
|
294
303
|
{
|
|
295
304
|
title: 'Adaptation',
|