@eeacms/volto-n2k 1.0.18 → 1.0.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 +5 -0
- package/package.json +4 -4
- package/src/components/manage/Blocks/ConnectedLinkList/View.jsx +31 -0
- package/src/components/manage/Blocks/ConnectedLinkList/index.js +17 -0
- package/src/components/manage/Blocks/ConnectedLinkList/schema.js +39 -0
- package/src/components/manage/Blocks/ConnectedLinkList/style.less +0 -0
- package/src/index.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ 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.0.19](https://github.com/eea/volto-n2k/compare/1.0.18...1.0.19) - 6 March 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Add connected link list [Miu Razvan - [`633f1de`](https://github.com/eea/volto-n2k/commit/633f1ded7a208f42f1c25dee271c9671c53c01c3)]
|
|
7
12
|
### [1.0.18](https://github.com/eea/volto-n2k/compare/1.0.17...1.0.18) - 25 February 2023
|
|
8
13
|
|
|
9
14
|
#### :rocket: New Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-n2k",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "volto-n2k: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"url": "git@github.com:eea/volto-n2k.git"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@eeacms/volto-bise": "*",
|
|
27
28
|
"@eeacms/volto-datablocks": "*",
|
|
28
|
-
"@eeacms/volto-resize-helper": "*",
|
|
29
29
|
"@eeacms/volto-openlayers-map": "*",
|
|
30
|
+
"@eeacms/volto-resize-helper": "*",
|
|
30
31
|
"@eeacms/volto-tabs-block": "*",
|
|
31
|
-
"@eeacms/volto-bise": "*",
|
|
32
32
|
"d3": "^7.6.1",
|
|
33
33
|
"d3-shape": "^3.1.0",
|
|
34
34
|
"react-lazy-load-image-component": "1.5.1",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"slick-carousel": "1.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@plone/scripts": "*",
|
|
42
41
|
"@cypress/code-coverage": "^3.10.0",
|
|
42
|
+
"@plone/scripts": "*",
|
|
43
43
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
44
44
|
"md5": "^2.3.0"
|
|
45
45
|
},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-no-target-blank */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedValue } from '@eeacms/volto-datablocks/Utils';
|
|
4
|
+
import './style.less';
|
|
5
|
+
|
|
6
|
+
const View = (props) => {
|
|
7
|
+
const { data = {} } = props;
|
|
8
|
+
const provider_data = props.provider_data || {};
|
|
9
|
+
const columns = provider_data[Object.keys(provider_data)?.[0]]?.length || 0;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="connected-list">
|
|
13
|
+
{props.mode === 'edit' ? <p>Connected link list</p> : ''}
|
|
14
|
+
<p>
|
|
15
|
+
{Array(Math.max(0, columns))
|
|
16
|
+
.fill()
|
|
17
|
+
.map((_, column) => (
|
|
18
|
+
<FormattedValue
|
|
19
|
+
textTemplate={data.textTemplate}
|
|
20
|
+
linkTemplate={data.linkTemplate}
|
|
21
|
+
value={provider_data[data.value]?.[column]}
|
|
22
|
+
linkValue={provider_data[data.linkValue]?.[column]}
|
|
23
|
+
link={true}
|
|
24
|
+
/>
|
|
25
|
+
))}
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default View;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ConnectedLinkList from './View';
|
|
2
|
+
import getSchema from './schema';
|
|
3
|
+
|
|
4
|
+
export default (config) => {
|
|
5
|
+
config.blocks.blocksConfig.custom_connected_block = {
|
|
6
|
+
...config.blocks.blocksConfig.custom_connected_block,
|
|
7
|
+
blocks: {
|
|
8
|
+
...config.blocks.blocksConfig.custom_connected_block.blocks,
|
|
9
|
+
connected_link_list: {
|
|
10
|
+
view: ConnectedLinkList,
|
|
11
|
+
getSchema: getSchema,
|
|
12
|
+
title: 'Connected link list',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const getSchema = (props) => {
|
|
2
|
+
const data = props.provider_data || {};
|
|
3
|
+
const choices = Object.keys(data).map((key) => [key, key]);
|
|
4
|
+
|
|
5
|
+
return {
|
|
6
|
+
title: 'Connected link list',
|
|
7
|
+
|
|
8
|
+
fieldsets: [
|
|
9
|
+
{
|
|
10
|
+
id: 'default',
|
|
11
|
+
title: 'Default',
|
|
12
|
+
fields: ['value', 'linkValue', 'textTemplate', 'linkTemplate'],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
properties: {
|
|
16
|
+
value: {
|
|
17
|
+
title: 'Value',
|
|
18
|
+
type: 'array',
|
|
19
|
+
choices,
|
|
20
|
+
},
|
|
21
|
+
linkValue: {
|
|
22
|
+
title: 'Link value',
|
|
23
|
+
type: 'array',
|
|
24
|
+
choices,
|
|
25
|
+
},
|
|
26
|
+
textTemplate: {
|
|
27
|
+
title: 'Text template',
|
|
28
|
+
description: 'Add suffix/prefix to text. Use {} for value placeholder',
|
|
29
|
+
},
|
|
30
|
+
linkTemplate: {
|
|
31
|
+
title: 'Link template',
|
|
32
|
+
description: 'Add suffix/prefix to link. Use {} for value placeholder',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: [],
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default getSchema;
|
|
File without changes
|
package/src/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import installBubbleChart from './components/manage/Blocks/BubbleChart';
|
|
|
14
14
|
import installCarouselHorizontal from './components/manage/Blocks/CarouselHorizontal';
|
|
15
15
|
import installCddaShape from './components/manage/Blocks/CddaShape';
|
|
16
16
|
import installConnectedList from './components/manage/Blocks/List';
|
|
17
|
+
import installConnectedLinkList from './components/manage/Blocks/ConnectedLinkList';
|
|
17
18
|
import installContactBlock from './components/manage/Blocks/ContactBlock';
|
|
18
19
|
import installExplodedPiesChart from './components/manage/Blocks/ExplodedPiesChart';
|
|
19
20
|
import installExploreHabitats from './components/manage/Blocks/ExploreHabitats';
|
|
@@ -173,6 +174,7 @@ const applyConfig = (config) => {
|
|
|
173
174
|
installCarouselHorizontal,
|
|
174
175
|
installCddaShape,
|
|
175
176
|
installConnectedList,
|
|
177
|
+
installConnectedLinkList,
|
|
176
178
|
installContactBlock,
|
|
177
179
|
installExplodedPiesChart,
|
|
178
180
|
installExploreHabitats,
|