@eeacms/volto-n2k 1.0.35 → 1.1.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/.eslintrc.js +65 -0
- package/CHANGELOG.md +23 -8
- package/jest-addon.config.js +19 -4
- package/jest.setup.js +65 -0
- package/package.json +6 -5
- package/src/components/manage/Blocks/BodyClass/index.js +2 -2
- package/src/components/manage/Blocks/BodyClass/schema.js +3 -1
- package/src/components/manage/Blocks/BubbleChart/BubbleChart.jsx +4 -4
- package/src/components/manage/Blocks/BubbleChart/View.jsx +2 -2
- package/src/components/manage/Blocks/BubbleChart/index.js +2 -2
- package/src/components/manage/Blocks/CDDACountryProfileMap/View.jsx +4 -9
- package/src/components/manage/Blocks/CDDACountryProfileMap/index.js +2 -2
- package/src/components/manage/Blocks/CarouselHorizontal/index.js +19 -16
- package/src/components/manage/Blocks/CarouselHorizontal/schema.js +30 -11
- package/src/components/manage/Blocks/CddaShape/index.js +2 -2
- package/src/components/manage/Blocks/ConnectedLinkList/index.js +2 -2
- package/src/components/manage/Blocks/ContactBlock/index.js +2 -2
- package/src/components/manage/Blocks/ExplodedPiesChart/index.js +2 -2
- package/src/components/manage/Blocks/ExplodedPiesChart/style.less +1 -1
- package/src/components/manage/Blocks/ExploreHabitats/View.jsx +3 -8
- package/src/components/manage/Blocks/ExploreHabitats/index.js +2 -2
- package/src/components/manage/Blocks/ExploreHabitats/schema.js +3 -1
- package/src/components/manage/Blocks/ExploreSites/View.jsx +3 -8
- package/src/components/manage/Blocks/ExploreSites/index.js +2 -2
- package/src/components/manage/Blocks/ExploreSites/schema.js +3 -1
- package/src/components/manage/Blocks/ExploreSpecies/View.jsx +3 -8
- package/src/components/manage/Blocks/ExploreSpecies/index.js +2 -2
- package/src/components/manage/Blocks/ExploreSpecies/schema.js +3 -1
- package/src/components/manage/Blocks/HabitatClassification/index.js +2 -2
- package/src/components/manage/Blocks/HabitatDistribution/index.js +2 -2
- package/src/components/manage/Blocks/HabitatProtectedSites/index.js +2 -2
- package/src/components/manage/Blocks/HabitatsBanner/Edit.jsx +0 -1
- package/src/components/manage/Blocks/HabitatsBanner/View.jsx +46 -38
- package/src/components/manage/Blocks/HabitatsBanner/index.js +2 -2
- package/src/components/manage/Blocks/HabitatsBanner/style.less +0 -2
- package/src/components/manage/Blocks/ImageText/View.jsx +12 -5
- package/src/components/manage/Blocks/ImageText/index.js +2 -2
- package/src/components/manage/Blocks/ImageText/schema.js +69 -67
- package/src/components/manage/Blocks/LabeledList/index.js +2 -2
- package/src/components/manage/Blocks/LabeledList/style.less +1 -1
- package/src/components/manage/Blocks/Landing/EditBlockWrapper.jsx +3 -3
- package/src/components/manage/Blocks/Landing/index.js +3 -4
- package/src/components/manage/Blocks/List/View.jsx +6 -3
- package/src/components/manage/Blocks/List/index.js +2 -2
- package/src/components/manage/Blocks/List/style.less +1 -1
- package/src/components/manage/Blocks/N2KCountryProfileMap/View.jsx +2 -5
- package/src/components/manage/Blocks/N2KCountryProfileMap/index.js +2 -2
- package/src/components/manage/Blocks/NavigationAnchors/index.js +2 -2
- package/src/components/manage/Blocks/NavigationAnchors/schema.js +37 -35
- package/src/components/manage/Blocks/SimpleDataTable/index.js +2 -2
- package/src/components/manage/Blocks/SimpleDataTable/templates/colored/style.less +2 -2
- package/src/components/manage/Blocks/SiteBanner/index.js +2 -2
- package/src/components/manage/Blocks/SiteBanner/style.less +1 -1
- package/src/components/manage/Blocks/SiteHabitatsList/index.js +2 -2
- package/src/components/manage/Blocks/SiteHabitatsList/style.less +2 -2
- package/src/components/manage/Blocks/SiteProtectedHabitats/index.js +2 -2
- package/src/components/manage/Blocks/SiteProtectedHabitats/style.less +1 -1
- package/src/components/manage/Blocks/SiteProtectedSpecies/index.js +2 -2
- package/src/components/manage/Blocks/SiteProtectedSpecies/style.less +1 -1
- package/src/components/manage/Blocks/SiteShape/index.js +2 -2
- package/src/components/manage/Blocks/SiteSpeciesList/index.js +2 -2
- package/src/components/manage/Blocks/SlateSVG/styles.less +1 -1
- package/src/components/manage/Blocks/SpeciesBanner/Edit.jsx +0 -1
- package/src/components/manage/Blocks/SpeciesBanner/View.jsx +7 -4
- package/src/components/manage/Blocks/SpeciesBanner/index.js +2 -2
- package/src/components/manage/Blocks/SpeciesBanner/style.less +0 -2
- package/src/components/manage/Blocks/SpeciesClassification/index.js +2 -2
- package/src/components/manage/Blocks/SpeciesDistribution/index.js +2 -2
- package/src/components/manage/Blocks/SpeciesProtectedSites/index.js +2 -2
- package/src/components/manage/Blocks/StackedBarChart/StackedBars.jsx +4 -10
- package/src/components/manage/Blocks/StackedBarChart/View.jsx +2 -2
- package/src/components/manage/Blocks/StackedBarChart/index.js +2 -2
- package/src/components/manage/Blocks/StatusList/index.js +2 -2
- package/src/components/manage/Blocks/StatusList/style.less +1 -1
- package/src/components/manage/Blocks/TilesImages/index.js +2 -2
- package/src/components/manage/Blocks/TilesImages/schema.js +47 -45
- package/src/components/theme/AppExtras/index.js +2 -2
- package/src/customizations/@eeacms/volto-group-block/components/manage/Blocks/Group/EditBlockWrapper.jsx +2 -8
- package/src/less/styles.less +5 -5
- package/.project.eslintrc.js +0 -49
|
@@ -39,13 +39,10 @@ const View = (props) => {
|
|
|
39
39
|
}),
|
|
40
40
|
new source.TileWMS({
|
|
41
41
|
extent: [
|
|
42
|
-
-3603195.606899999,
|
|
43
|
-
3197087.8112000003,
|
|
44
|
-
3796164.5945000015,
|
|
42
|
+
-3603195.606899999, 3197087.8112000003, 3796164.5945000015,
|
|
45
43
|
1.1077138825000003e7,
|
|
46
44
|
],
|
|
47
|
-
url:
|
|
48
|
-
'https://bio.discomap.eea.europa.eu/arcgis/services/ProtectedSites/Natura2000Sites/MapServer/WMSServer',
|
|
45
|
+
url: 'https://bio.discomap.eea.europa.eu/arcgis/services/ProtectedSites/Natura2000Sites/MapServer/WMSServer',
|
|
49
46
|
params: { LAYERS: '2', TILED: true },
|
|
50
47
|
serverType: 'geoserver',
|
|
51
48
|
transition: 0,
|
|
@@ -65,9 +62,7 @@ const View = (props) => {
|
|
|
65
62
|
...options,
|
|
66
63
|
extent: new extent.buffer(
|
|
67
64
|
[
|
|
68
|
-
-3603195.606899999,
|
|
69
|
-
3197087.8112000003,
|
|
70
|
-
3796164.5945000015,
|
|
65
|
+
-3603195.606899999, 3197087.8112000003, 3796164.5945000015,
|
|
71
66
|
1.1077138825000003e7,
|
|
72
67
|
],
|
|
73
68
|
-3603195.606899999 * 0.01,
|
|
@@ -11,7 +11,7 @@ export function getActiveSitesURL(site_codes) {
|
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export default (config)
|
|
14
|
+
export default function applyConfig(config) {
|
|
15
15
|
config.blocks.blocksConfig.explore_sites_map = {
|
|
16
16
|
id: 'explore_sites_map',
|
|
17
17
|
title: 'Explore sites map',
|
|
@@ -21,4 +21,4 @@ export default (config) => {
|
|
|
21
21
|
view: ExploreSitesView,
|
|
22
22
|
};
|
|
23
23
|
return config;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -39,13 +39,10 @@ const View = (props) => {
|
|
|
39
39
|
}),
|
|
40
40
|
new source.TileWMS({
|
|
41
41
|
extent: [
|
|
42
|
-
-3690067.3068000004,
|
|
43
|
-
3129776.6937999986,
|
|
44
|
-
3858418.0045999996,
|
|
42
|
+
-3690067.3068000004, 3129776.6937999986, 3858418.0045999996,
|
|
45
43
|
1.1124223900300004e7,
|
|
46
44
|
],
|
|
47
|
-
url:
|
|
48
|
-
'https://bio.discomap.eea.europa.eu/arcgis/services/Article17/HabitatsDirective_ART_17_WMS_version_2020_08_public/MapServer/WmsServer',
|
|
45
|
+
url: 'https://bio.discomap.eea.europa.eu/arcgis/services/Article17/HabitatsDirective_ART_17_WMS_version_2020_08_public/MapServer/WmsServer',
|
|
49
46
|
params: { LAYERS: '7', TILED: true },
|
|
50
47
|
serverType: 'geoserver',
|
|
51
48
|
// Countries have transparency, so do not fade tiles:
|
|
@@ -66,9 +63,7 @@ const View = (props) => {
|
|
|
66
63
|
...options,
|
|
67
64
|
extent: new extent.buffer(
|
|
68
65
|
[
|
|
69
|
-
-3690067.3068000004,
|
|
70
|
-
3129776.6937999986,
|
|
71
|
-
3858418.0045999996,
|
|
66
|
+
-3690067.3068000004, 3129776.6937999986, 3858418.0045999996,
|
|
72
67
|
1.1124223900300004e7,
|
|
73
68
|
],
|
|
74
69
|
-3690067.3068000004 * 0.01,
|
|
@@ -11,7 +11,7 @@ export function getActiveSpeciesURL(site_codes) {
|
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export default (config)
|
|
14
|
+
export default function applyConfig(config) {
|
|
15
15
|
config.blocks.blocksConfig.explore_species_map = {
|
|
16
16
|
id: 'explore_species_map',
|
|
17
17
|
title: 'Explore species map',
|
|
@@ -21,4 +21,4 @@ export default (config) => {
|
|
|
21
21
|
view: ExploreSpeciesView,
|
|
22
22
|
};
|
|
23
23
|
return config;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import HabitatClassification from './View';
|
|
2
2
|
import getSchema from './schema';
|
|
3
3
|
|
|
4
|
-
export default (config)
|
|
4
|
+
export default function applyConfig(config) {
|
|
5
5
|
config.blocks.blocksConfig.custom_connected_block = {
|
|
6
6
|
...config.blocks.blocksConfig.custom_connected_block,
|
|
7
7
|
blocks: {
|
|
@@ -14,4 +14,4 @@ export default (config) => {
|
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
return config;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -7,7 +7,7 @@ export function getHabitatDistributionURL(code_2000) {
|
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export default (config)
|
|
10
|
+
export default function applyConfig(config) {
|
|
11
11
|
config.blocks.blocksConfig.custom_connected_block = {
|
|
12
12
|
...config.blocks.blocksConfig.custom_connected_block,
|
|
13
13
|
blocks: {
|
|
@@ -20,4 +20,4 @@ export default (config) => {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
return config;
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -7,7 +7,7 @@ export function getHabitatProtectedSitesURL(code_2000) {
|
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export default (config)
|
|
10
|
+
export default function applyConfig(config) {
|
|
11
11
|
config.blocks.blocksConfig.custom_connected_block = {
|
|
12
12
|
...config.blocks.blocksConfig.custom_connected_block,
|
|
13
13
|
blocks: {
|
|
@@ -20,4 +20,4 @@ export default (config) => {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
return config;
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -3,7 +3,6 @@ import { SidebarPortal } from '@plone/volto/components';
|
|
|
3
3
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
4
4
|
import getSchema from './schema';
|
|
5
5
|
import View from './View';
|
|
6
|
-
import './style.less';
|
|
7
6
|
|
|
8
7
|
const Edit = (props) => {
|
|
9
8
|
const schema = useMemo(() => getSchema(props), [props]);
|
|
@@ -9,6 +9,7 @@ import { connectToMultipleProviders } from '@eeacms/volto-datablocks/hocs';
|
|
|
9
9
|
import { replaceQueryParam } from '@eeacms/volto-n2k/helpers';
|
|
10
10
|
import arrowLeft from '@eeacms/volto-n2k/icons/arrow-left.svg';
|
|
11
11
|
import arrowRight from '@eeacms/volto-n2k/icons/arrow-right.svg';
|
|
12
|
+
|
|
12
13
|
import './style.less';
|
|
13
14
|
|
|
14
15
|
const SwiperLoader = loadable.lib(() => import('swiper'));
|
|
@@ -30,13 +31,18 @@ const _View = (props) => {
|
|
|
30
31
|
props.data.habitat_pictures_provider,
|
|
31
32
|
);
|
|
32
33
|
const habitat = props.providers_data?.[habitat_provider] || {};
|
|
33
|
-
const habitat_pictures =
|
|
34
|
-
props.providers_data?.[habitat_pictures_provider] || {}
|
|
34
|
+
const habitat_pictures = useMemo(
|
|
35
|
+
() => props.providers_data?.[habitat_pictures_provider] || {},
|
|
36
|
+
[props.providers_data, habitat_pictures_provider],
|
|
37
|
+
);
|
|
35
38
|
|
|
36
39
|
const { code_2000 = [], scientific_name = [] } = habitat;
|
|
37
40
|
const { attribution_copyright = [] } = habitat_pictures;
|
|
38
41
|
|
|
39
|
-
const pictures =
|
|
42
|
+
const pictures = useMemo(
|
|
43
|
+
() => habitat_pictures?.['WebURL'] || [],
|
|
44
|
+
[habitat_pictures],
|
|
45
|
+
);
|
|
40
46
|
const pictures_length = useMemo(
|
|
41
47
|
() => pictures.filter((picture) => !!picture)?.length,
|
|
42
48
|
[pictures],
|
|
@@ -111,39 +117,41 @@ const _View = (props) => {
|
|
|
111
117
|
<p>{attribution_copyright[activeSlide]}</p>
|
|
112
118
|
)}
|
|
113
119
|
</div>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
120
|
+
{__CLIENT__ && (
|
|
121
|
+
<SwiperLoader>
|
|
122
|
+
{() => {
|
|
123
|
+
return (
|
|
124
|
+
<SwiperReactLoader>
|
|
125
|
+
{({ Swiper, SwiperSlide }) => {
|
|
126
|
+
return (
|
|
127
|
+
<>
|
|
128
|
+
<Swiper
|
|
129
|
+
loop={true}
|
|
130
|
+
allowTouchMove={false}
|
|
131
|
+
initialSlide={0}
|
|
132
|
+
slidesPerView={1}
|
|
133
|
+
spaceBetween={0}
|
|
134
|
+
onBeforeInit={(swiper) => {
|
|
135
|
+
swiperEl.current = swiper;
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
{pictures.map((source, index) => (
|
|
139
|
+
<SwiperSlide>
|
|
140
|
+
<img
|
|
141
|
+
src={getSource(source)}
|
|
142
|
+
alt={pictures[index]}
|
|
143
|
+
/>
|
|
144
|
+
</SwiperSlide>
|
|
145
|
+
))}
|
|
146
|
+
</Swiper>
|
|
147
|
+
</>
|
|
148
|
+
);
|
|
149
|
+
}}
|
|
150
|
+
</SwiperReactLoader>
|
|
151
|
+
);
|
|
152
|
+
}}
|
|
153
|
+
</SwiperLoader>
|
|
154
|
+
)}
|
|
147
155
|
</div>
|
|
148
156
|
)}
|
|
149
157
|
</div>
|
|
@@ -162,10 +170,10 @@ const View = compose(
|
|
|
162
170
|
})),
|
|
163
171
|
)(_View);
|
|
164
172
|
|
|
165
|
-
export default (props)
|
|
173
|
+
export default function $View(props) {
|
|
166
174
|
return (
|
|
167
175
|
<VisibilitySensor Placeholder={() => <div>loading.... </div>}>
|
|
168
176
|
<View {...props} />
|
|
169
177
|
</VisibilitySensor>
|
|
170
178
|
);
|
|
171
|
-
}
|
|
179
|
+
}
|
|
@@ -2,7 +2,7 @@ import worldSVG from '@plone/volto/icons/world.svg';
|
|
|
2
2
|
import Edit from './Edit';
|
|
3
3
|
import View from './View';
|
|
4
4
|
|
|
5
|
-
export default (config)
|
|
5
|
+
export default function applyConfig(config) {
|
|
6
6
|
config.blocks.blocksConfig.habitats_banner = {
|
|
7
7
|
id: 'habitats_banner',
|
|
8
8
|
title: 'Habitats banner',
|
|
@@ -21,4 +21,4 @@ export default (config) => {
|
|
|
21
21
|
blockHasOwnFocusManagement: false,
|
|
22
22
|
};
|
|
23
23
|
return config;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { UniversalLink } from '@plone/volto/components';
|
|
3
3
|
import { serializeNodes } from '@plone/volto-slate/editor/render';
|
|
4
|
-
import {
|
|
4
|
+
import { createEditor } from 'slate';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import './styles.less';
|
|
7
7
|
|
|
8
8
|
const View = (props) => {
|
|
9
9
|
const { data = {} } = props;
|
|
10
|
-
const value
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const [value, setValue] = useState(createEditor());
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setValue((value) => {
|
|
14
|
+
value.children = data.value || [];
|
|
15
|
+
return value;
|
|
16
|
+
});
|
|
17
|
+
}, [data.value]);
|
|
18
|
+
|
|
19
|
+
const valueUndefined = !value.children.length || value.string([]) === '';
|
|
13
20
|
|
|
14
21
|
const ImageText = () => {
|
|
15
22
|
return (
|
|
@@ -2,7 +2,7 @@ import ImageTextEdit from './Edit';
|
|
|
2
2
|
import ImageTextView from './View';
|
|
3
3
|
import worldSVG from '@plone/volto/icons/world.svg';
|
|
4
4
|
|
|
5
|
-
export default (config)
|
|
5
|
+
export default function applyConfig(config) {
|
|
6
6
|
config.blocks.blocksConfig.image_text = {
|
|
7
7
|
id: 'image_text',
|
|
8
8
|
title: 'Image text',
|
|
@@ -21,4 +21,4 @@ export default (config) => {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
return config;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
export default ()
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export default function getSchema() {
|
|
2
|
+
return {
|
|
3
|
+
title: 'Image text',
|
|
4
|
+
fieldsets: [
|
|
5
|
+
{
|
|
6
|
+
id: 'default',
|
|
7
|
+
title: 'Default',
|
|
8
|
+
fields: ['theme', 'hasBorder', 'rounded'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 'image',
|
|
12
|
+
title: 'Image',
|
|
13
|
+
fields: ['image', 'imageSize', 'imageTitle'],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'link',
|
|
17
|
+
title: 'Link',
|
|
18
|
+
fields: ['linkTitle', 'href', 'target'],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
properties: {
|
|
22
|
+
theme: {
|
|
23
|
+
title: 'Theme',
|
|
24
|
+
choices: [
|
|
25
|
+
['light', 'Light'],
|
|
26
|
+
['grey', 'Grey'],
|
|
27
|
+
['dark', 'Dark'],
|
|
28
|
+
],
|
|
29
|
+
default: 'light',
|
|
30
|
+
},
|
|
31
|
+
hasBorder: {
|
|
32
|
+
title: 'With border',
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
rounded: {
|
|
37
|
+
title: 'Rounded',
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
default: true,
|
|
40
|
+
},
|
|
41
|
+
image: {
|
|
42
|
+
title: 'Image',
|
|
43
|
+
widget: 'object_by_path',
|
|
44
|
+
},
|
|
45
|
+
imageSize: {
|
|
46
|
+
title: 'Size',
|
|
47
|
+
type: 'number',
|
|
48
|
+
},
|
|
49
|
+
imageTitle: {
|
|
50
|
+
title: 'Title',
|
|
51
|
+
},
|
|
52
|
+
linkTitle: {
|
|
53
|
+
title: 'Title',
|
|
54
|
+
},
|
|
55
|
+
href: {
|
|
56
|
+
title: 'Url',
|
|
57
|
+
widget: 'textarea',
|
|
58
|
+
},
|
|
59
|
+
target: {
|
|
60
|
+
title: 'Target',
|
|
61
|
+
choices: [
|
|
62
|
+
['_blank', 'New tab'],
|
|
63
|
+
['_self', 'Same tab'],
|
|
64
|
+
],
|
|
65
|
+
defaultValue: '_self',
|
|
66
|
+
},
|
|
8
67
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fields: ['image', 'imageSize', 'imageTitle'],
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'link',
|
|
16
|
-
title: 'Link',
|
|
17
|
-
fields: ['linkTitle', 'href', 'target'],
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
properties: {
|
|
21
|
-
theme: {
|
|
22
|
-
title: 'Theme',
|
|
23
|
-
choices: [
|
|
24
|
-
['light', 'Light'],
|
|
25
|
-
['grey', 'Grey'],
|
|
26
|
-
['dark', 'Dark'],
|
|
27
|
-
],
|
|
28
|
-
default: 'light',
|
|
29
|
-
},
|
|
30
|
-
hasBorder: {
|
|
31
|
-
title: 'With border',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
default: true,
|
|
34
|
-
},
|
|
35
|
-
rounded: {
|
|
36
|
-
title: 'Rounded',
|
|
37
|
-
type: 'boolean',
|
|
38
|
-
default: true,
|
|
39
|
-
},
|
|
40
|
-
image: {
|
|
41
|
-
title: 'Image',
|
|
42
|
-
widget: 'object_by_path',
|
|
43
|
-
},
|
|
44
|
-
imageSize: {
|
|
45
|
-
title: 'Size',
|
|
46
|
-
type: 'number',
|
|
47
|
-
},
|
|
48
|
-
imageTitle: {
|
|
49
|
-
title: 'Title',
|
|
50
|
-
},
|
|
51
|
-
linkTitle: {
|
|
52
|
-
title: 'Title',
|
|
53
|
-
},
|
|
54
|
-
href: {
|
|
55
|
-
title: 'Url',
|
|
56
|
-
widget: 'textarea',
|
|
57
|
-
},
|
|
58
|
-
target: {
|
|
59
|
-
title: 'Target',
|
|
60
|
-
choices: [
|
|
61
|
-
['_blank', 'New tab'],
|
|
62
|
-
['_self', 'Same tab'],
|
|
63
|
-
],
|
|
64
|
-
defaultValue: '_self',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
required: [],
|
|
68
|
-
});
|
|
68
|
+
required: [],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import LabeledListView from './View';
|
|
2
2
|
import getSchema from './schema';
|
|
3
3
|
|
|
4
|
-
export default (config)
|
|
4
|
+
export default function applyConfig(config) {
|
|
5
5
|
config.blocks.blocksConfig.custom_connected_block = {
|
|
6
6
|
...config.blocks.blocksConfig.custom_connected_block,
|
|
7
7
|
blocks: {
|
|
@@ -14,4 +14,4 @@ export default (config) => {
|
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
return config;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -115,9 +115,9 @@ class EditBlockWrapper extends React.Component {
|
|
|
115
115
|
basic
|
|
116
116
|
title="Add block"
|
|
117
117
|
onClick={() => {
|
|
118
|
-
this.setState({
|
|
119
|
-
addNewBlockOpened: !
|
|
120
|
-
});
|
|
118
|
+
this.setState((prevState) => ({
|
|
119
|
+
addNewBlockOpened: !prevState.addNewBlockOpened,
|
|
120
|
+
}));
|
|
121
121
|
}}
|
|
122
122
|
className="column-block-add-button"
|
|
123
123
|
>
|
|
@@ -57,8 +57,7 @@ export const tiles = [
|
|
|
57
57
|
image: toolkit,
|
|
58
58
|
title: 'Toolkit',
|
|
59
59
|
description: 'TOOLKIT',
|
|
60
|
-
link:
|
|
61
|
-
'https://op.europa.eu/:lang/publication-detail/-/publication/e33a1119-8fa2-11ec-8c40-01aa75ed71a1',
|
|
60
|
+
link: 'https://op.europa.eu/:lang/publication-detail/-/publication/e33a1119-8fa2-11ec-8c40-01aa75ed71a1',
|
|
62
61
|
},
|
|
63
62
|
];
|
|
64
63
|
|
|
@@ -84,7 +83,7 @@ export const getStyle = (props) => {
|
|
|
84
83
|
};
|
|
85
84
|
};
|
|
86
85
|
|
|
87
|
-
export default (config)
|
|
86
|
+
export default function applyConfig(config) {
|
|
88
87
|
config.blocks.blocksConfig.landing_block = {
|
|
89
88
|
id: 'landing_block',
|
|
90
89
|
title: 'Landing block',
|
|
@@ -103,4 +102,4 @@ export default (config) => {
|
|
|
103
102
|
blockHasOwnFocusManagement: true,
|
|
104
103
|
};
|
|
105
104
|
return config;
|
|
106
|
-
}
|
|
105
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { Icon } from '@plone/volto/components';
|
|
3
3
|
|
|
4
4
|
import arrowSVG from '@plone/volto/icons/up-key.svg';
|
|
@@ -7,8 +7,11 @@ import './style.less';
|
|
|
7
7
|
|
|
8
8
|
const View = (props) => {
|
|
9
9
|
const { data = {} } = props;
|
|
10
|
-
const provider_data =
|
|
11
|
-
|
|
10
|
+
const provider_data = useMemo(
|
|
11
|
+
() => props.provider_data || {},
|
|
12
|
+
[props.provider_data],
|
|
13
|
+
);
|
|
14
|
+
const columns = useMemo(() => {
|
|
12
15
|
const temp = provider_data[Object.keys(provider_data)?.[0]]?.length || 0;
|
|
13
16
|
if (data.count < temp && data.count > 0) {
|
|
14
17
|
return data.count;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ListView from './View';
|
|
2
2
|
import getSchema from './schema';
|
|
3
3
|
|
|
4
|
-
export default (config)
|
|
4
|
+
export default function applyConfig(config) {
|
|
5
5
|
config.blocks.blocksConfig.custom_connected_block = {
|
|
6
6
|
...config.blocks.blocksConfig.custom_connected_block,
|
|
7
7
|
blocks: {
|
|
@@ -14,4 +14,4 @@ export default (config) => {
|
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
return config;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -91,8 +91,7 @@ const View = (props) => {
|
|
|
91
91
|
.replaceAll(' ', '')
|
|
92
92
|
.replaceAll('{country}', country),
|
|
93
93
|
},
|
|
94
|
-
url:
|
|
95
|
-
'https://bio.discomap.eea.europa.eu/arcgis/rest/services/ProtectedSites/Natura2000Sites/MapServer',
|
|
94
|
+
url: 'https://bio.discomap.eea.europa.eu/arcgis/rest/services/ProtectedSites/Natura2000Sites/MapServer',
|
|
96
95
|
}),
|
|
97
96
|
]);
|
|
98
97
|
fetch(
|
|
@@ -142,9 +141,7 @@ const View = (props) => {
|
|
|
142
141
|
view={{
|
|
143
142
|
center: [0, 0],
|
|
144
143
|
extent: extent || [
|
|
145
|
-
-6319125.804807394,
|
|
146
|
-
3070702.923644739,
|
|
147
|
-
9584655.106275197,
|
|
144
|
+
-6319125.804807394, 3070702.923644739, 9584655.106275197,
|
|
148
145
|
12091128.659149397,
|
|
149
146
|
],
|
|
150
147
|
zoom: 2,
|
|
@@ -2,7 +2,7 @@ import worldSVG from '@plone/volto/icons/world.svg';
|
|
|
2
2
|
import Edit from './Edit';
|
|
3
3
|
import View from './View';
|
|
4
4
|
|
|
5
|
-
export default (config)
|
|
5
|
+
export default function applyConfig(config) {
|
|
6
6
|
config.blocks.blocksConfig.n2k_country_profile_map = {
|
|
7
7
|
id: 'n2k_country_profile_map',
|
|
8
8
|
title: 'N2K country profile map',
|
|
@@ -21,4 +21,4 @@ export default (config) => {
|
|
|
21
21
|
blockHasOwnFocusManagement: false,
|
|
22
22
|
};
|
|
23
23
|
return config;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -2,7 +2,7 @@ import NavigationAnchorsEdit from './Edit';
|
|
|
2
2
|
import NavigationAnchorsView from './View';
|
|
3
3
|
import worldSVG from '@plone/volto/icons/world.svg';
|
|
4
4
|
|
|
5
|
-
export default (config)
|
|
5
|
+
export default function applyConfig(config) {
|
|
6
6
|
config.blocks.blocksConfig.navigation_anchors = {
|
|
7
7
|
id: 'navigation_anchors',
|
|
8
8
|
title: 'Navigation anchors',
|
|
@@ -20,4 +20,4 @@ export default (config) => {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
return config;
|
|
23
|
-
}
|
|
23
|
+
}
|