@eeacms/volto-bise-policy 1.2.45 → 1.2.47
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 +7 -7
- package/CHANGELOG.md +38 -1
- package/jest-addon.config.js +34 -13
- package/package.json +3 -2
- package/src/components/Widgets/EUNISObjectListWidget.jsx +8 -7
- package/src/components/Widgets/GeolocationWidget.jsx +1 -1
- package/src/components/Widgets/NRRWidgets.jsx +1 -1
- package/src/components/manage/Blocks/BodyClass/View.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.jsx +50 -64
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.test.jsx +15 -36
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyListing.test.jsx +13 -37
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyMap.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyMap.test.jsx +3 -51
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureInteraction.test.jsx +4 -14
- package/src/components/manage/Blocks/CaseStudyExplorer/InfoOverlay.test.jsx +12 -27
- package/src/components/manage/Blocks/CaseStudyExplorer/testUtils.js +84 -0
- package/src/components/manage/Blocks/CaseStudyExplorer/utils.test.js +1 -1
- package/src/components/manage/Blocks/CustomCSS/CustomCSSEdit.jsx +1 -1
- package/src/components/manage/Blocks/CustomJS/CustomJSEdit.jsx +1 -1
- package/src/components/manage/Blocks/FactsheetsListing/FactsheetsListingEdit.jsx +1 -1
- package/src/components/manage/Blocks/FactsheetsListing/FactsheetsListingView.jsx +2 -2
- package/src/components/manage/Blocks/KeyFacts/KeyFactsEdit.jsx +1 -1
- package/src/components/manage/Blocks/MaesViewer/MaesViewerEdit.jsx +1 -1
- package/src/components/manage/Blocks/MaesViewer/MaesViewerView.jsx +3 -4
- package/src/components/manage/Blocks/MaesViewer/utils.js +12 -9
- package/src/components/manage/Blocks/Navigation/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Navigation/View.jsx +2 -2
- package/src/components/manage/Blocks/schema.js +1 -1
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/Edit.jsx +1 -1
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/View.jsx +6 -6
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/templates/colored/View.jsx +1 -1
- package/src/customizations/@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/templates/smart/View.jsx +5 -4
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +3 -1
- package/src/customizations/@eeacms/volto-eea-website-theme/components/theme/SubsiteClass.jsx +2 -1
- package/src/customizations/volto/components/theme/Header/Header.jsx +7 -11
- package/src/customizations/volto/components/theme/View/View.jsx +10 -14
- package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +3 -6
- package/src/customizations/volto/reducers/navigation/navigation.js +3 -6
- package/src/customizations/volto/reducers/types/types.js +2 -5
- package/src/express-middleware.js +1 -1
- package/src/helpers.js +1 -1
- package/src/index.js +11 -6
- package/src/{styles-config.js → styles-config.jsx} +49 -60
- package/theme/globals/site.overrides +4 -0
- /package/src/components/manage/Blocks/MaesViewer/{schema.js → schema.jsx} +0 -0
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import FeatureInteraction from './FeatureInteraction';
|
|
4
4
|
import { scrollToElement, zoomMapToFeatures } from './utils';
|
|
5
|
+
import { createMockOl } from './testUtils';
|
|
5
6
|
|
|
6
7
|
jest.mock('@eeacms/volto-openlayers-map', () => ({
|
|
7
8
|
withOpenLayers: (Comp) => Comp,
|
|
@@ -25,15 +26,8 @@ jest.mock('./utils', () => ({
|
|
|
25
26
|
zoomMapToFeatures: jest.fn(),
|
|
26
27
|
}));
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Style: jest.fn(() => ({
|
|
31
|
-
image_: { getFill: () => ({ setColor: jest.fn() }) },
|
|
32
|
-
})),
|
|
33
|
-
Circle: jest.fn(() => ({})),
|
|
34
|
-
Fill: jest.fn(() => ({})),
|
|
35
|
-
Stroke: jest.fn(() => ({})),
|
|
36
|
-
},
|
|
29
|
+
let mockSelectCb;
|
|
30
|
+
const mockOl = createMockOl({
|
|
37
31
|
interaction: {
|
|
38
32
|
Select: jest.fn(() => ({
|
|
39
33
|
on: jest.fn((evt, cb) => {
|
|
@@ -43,12 +37,8 @@ const mockOl = {
|
|
|
43
37
|
}),
|
|
44
38
|
})),
|
|
45
39
|
},
|
|
46
|
-
|
|
47
|
-
click: jest.fn(),
|
|
48
|
-
},
|
|
49
|
-
};
|
|
40
|
+
});
|
|
50
41
|
|
|
51
|
-
let mockSelectCb;
|
|
52
42
|
const mockMap = {
|
|
53
43
|
addInteraction,
|
|
54
44
|
removeInteraction,
|
|
@@ -45,6 +45,13 @@ jest.mock('@plone/volto/helpers/Utils/usePrevious', () => ({
|
|
|
45
45
|
usePrevious: (val) => undefined,
|
|
46
46
|
}));
|
|
47
47
|
|
|
48
|
+
const defaultProps = {
|
|
49
|
+
layerId: 'layer1',
|
|
50
|
+
hideFilters: false,
|
|
51
|
+
ol: mockOl,
|
|
52
|
+
onFeatureSelect: jest.fn(),
|
|
53
|
+
};
|
|
54
|
+
|
|
48
55
|
describe('InfoOverlay', () => {
|
|
49
56
|
let overlayElement;
|
|
50
57
|
beforeEach(() => {
|
|
@@ -60,39 +67,21 @@ describe('InfoOverlay', () => {
|
|
|
60
67
|
|
|
61
68
|
it('renders FeatureDisplay when selectedFeature is provided', () => {
|
|
62
69
|
const { getByTestId } = render(
|
|
63
|
-
<InfoOverlay
|
|
64
|
-
selectedFeature={{ id: 1 }}
|
|
65
|
-
onFeatureSelect={jest.fn()}
|
|
66
|
-
layerId="layer1"
|
|
67
|
-
hideFilters={false}
|
|
68
|
-
ol={mockOl}
|
|
69
|
-
/>,
|
|
70
|
+
<InfoOverlay {...defaultProps} selectedFeature={{ id: 1 }} />,
|
|
70
71
|
);
|
|
71
72
|
expect(getByTestId('feature-display')).toBeInTheDocument();
|
|
72
73
|
});
|
|
73
74
|
|
|
74
75
|
it('does not render FeatureDisplay when selectedFeature is null', () => {
|
|
75
76
|
const { queryByTestId } = render(
|
|
76
|
-
<InfoOverlay
|
|
77
|
-
selectedFeature={null}
|
|
78
|
-
onFeatureSelect={jest.fn()}
|
|
79
|
-
layerId="layer1"
|
|
80
|
-
hideFilters={false}
|
|
81
|
-
ol={mockOl}
|
|
82
|
-
/>,
|
|
77
|
+
<InfoOverlay {...defaultProps} selectedFeature={null} />,
|
|
83
78
|
);
|
|
84
79
|
expect(queryByTestId('feature-display')).toBeNull();
|
|
85
80
|
});
|
|
86
81
|
|
|
87
82
|
it('attaches and detaches click handler on map', () => {
|
|
88
83
|
const { unmount } = render(
|
|
89
|
-
<InfoOverlay
|
|
90
|
-
selectedFeature={null}
|
|
91
|
-
onFeatureSelect={jest.fn()}
|
|
92
|
-
layerId="layer1"
|
|
93
|
-
hideFilters={false}
|
|
94
|
-
ol={mockOl}
|
|
95
|
-
/>,
|
|
84
|
+
<InfoOverlay {...defaultProps} selectedFeature={null} />,
|
|
96
85
|
);
|
|
97
86
|
expect(addOverlay).toHaveBeenCalled();
|
|
98
87
|
expect(onMap).toHaveBeenCalledWith('click', expect.any(Function));
|
|
@@ -106,11 +95,9 @@ describe('InfoOverlay', () => {
|
|
|
106
95
|
const onFeatureSelect = jest.fn();
|
|
107
96
|
render(
|
|
108
97
|
<InfoOverlay
|
|
98
|
+
{...defaultProps}
|
|
109
99
|
selectedFeature={{}}
|
|
110
100
|
onFeatureSelect={onFeatureSelect}
|
|
111
|
-
layerId="layer1"
|
|
112
|
-
hideFilters={false}
|
|
113
|
-
ol={mockOl}
|
|
114
101
|
/>,
|
|
115
102
|
);
|
|
116
103
|
|
|
@@ -131,11 +118,9 @@ describe('InfoOverlay', () => {
|
|
|
131
118
|
const onFeatureSelect = jest.fn();
|
|
132
119
|
render(
|
|
133
120
|
<InfoOverlay
|
|
121
|
+
{...defaultProps}
|
|
134
122
|
selectedFeature={{}}
|
|
135
123
|
onFeatureSelect={onFeatureSelect}
|
|
136
|
-
layerId="layer1"
|
|
137
|
-
hideFilters={false}
|
|
138
|
-
ol={mockOl}
|
|
139
124
|
/>,
|
|
140
125
|
);
|
|
141
126
|
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const createMockMap = (additionalProps = {}) => ({
|
|
2
|
+
on: jest.fn(),
|
|
3
|
+
un: jest.fn(),
|
|
4
|
+
addInteraction: jest.fn(),
|
|
5
|
+
removeInteraction: jest.fn(),
|
|
6
|
+
getView: jest.fn(() => ({
|
|
7
|
+
getZoom: () => 4,
|
|
8
|
+
getCenter: () => [111, 222],
|
|
9
|
+
})),
|
|
10
|
+
getInteractions: jest.fn(() => ({
|
|
11
|
+
array_: [
|
|
12
|
+
{},
|
|
13
|
+
{},
|
|
14
|
+
{},
|
|
15
|
+
{},
|
|
16
|
+
{},
|
|
17
|
+
{},
|
|
18
|
+
{},
|
|
19
|
+
{},
|
|
20
|
+
{},
|
|
21
|
+
{
|
|
22
|
+
getFeatures: jest.fn(() => ({
|
|
23
|
+
clear: jest.fn(),
|
|
24
|
+
push: jest.fn(),
|
|
25
|
+
})),
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
})),
|
|
29
|
+
getEventPixel: jest.fn(() => [10, 20]),
|
|
30
|
+
hasFeatureAtPixel: jest.fn(() => true),
|
|
31
|
+
getViewport: jest.fn(() => ({ style: {} })),
|
|
32
|
+
getPixelFromCoordinate: jest.fn(() => [100, 200]),
|
|
33
|
+
getFeaturesAtPixel: jest.fn(() => ['mockFeature']),
|
|
34
|
+
addOverlay: jest.fn(),
|
|
35
|
+
removeOverlay: jest.fn(),
|
|
36
|
+
...additionalProps,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const createMockOl = (additionalProps = {}) => ({
|
|
40
|
+
source: {
|
|
41
|
+
TileWMS: jest.fn(() => ({ type: 'TileWMS' })),
|
|
42
|
+
Vector: jest.fn(() => ({
|
|
43
|
+
clear: jest.fn(),
|
|
44
|
+
addFeatures: jest.fn(),
|
|
45
|
+
})),
|
|
46
|
+
Cluster: jest.fn(() => ({})),
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
Style: jest.fn(() => ({
|
|
50
|
+
image_: { getFill: () => ({ setColor: jest.fn() }) },
|
|
51
|
+
})),
|
|
52
|
+
Circle: jest.fn(() => ({})),
|
|
53
|
+
Fill: jest.fn(() => ({})),
|
|
54
|
+
Stroke: jest.fn(() => ({})),
|
|
55
|
+
Text: jest.fn(() => ({})),
|
|
56
|
+
},
|
|
57
|
+
interaction: {
|
|
58
|
+
Select: jest.fn(() => ({
|
|
59
|
+
on: jest.fn(),
|
|
60
|
+
})),
|
|
61
|
+
},
|
|
62
|
+
condition: {
|
|
63
|
+
click: jest.fn(),
|
|
64
|
+
},
|
|
65
|
+
proj: {
|
|
66
|
+
transform: jest.fn(() => [111, 222]),
|
|
67
|
+
fromLonLat: jest.fn(() => [333, 444]),
|
|
68
|
+
},
|
|
69
|
+
Overlay: jest.fn((config) => ({
|
|
70
|
+
element: config.element,
|
|
71
|
+
})),
|
|
72
|
+
...additionalProps,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const createMockPointsSource = (features = []) => ({
|
|
76
|
+
getFeatures: () => features,
|
|
77
|
+
clear: jest.fn(),
|
|
78
|
+
addFeatures: jest.fn(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const createMockFilters = () => ({
|
|
82
|
+
measures_implemented: { m1: 'Measure 1', m2: 'Measure 2' },
|
|
83
|
+
typology_of_measures: { sector1: 'Sector 1', sector2: 'Sector 2' },
|
|
84
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import FactsheetsListingView from './FactsheetsListingView';
|
|
3
3
|
import schema from './schema';
|
|
4
|
-
import
|
|
4
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
5
5
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
6
6
|
|
|
7
7
|
class Edit extends Component {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Container, Accordion } from 'semantic-ui-react';
|
|
3
|
-
import
|
|
3
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
4
4
|
|
|
5
5
|
import upSVG from '@plone/volto/icons/up-key.svg';
|
|
6
6
|
import downSVG from '@plone/volto/icons/down-key.svg';
|
|
7
7
|
import { Link } from 'react-router-dom';
|
|
8
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
8
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
9
9
|
|
|
10
10
|
const FactsheetsListingView = (props) => {
|
|
11
11
|
const { data, properties, id } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; // EditBlock
|
|
5
5
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
6
6
|
|
|
7
7
|
import schema from './schema';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { compose } from 'redux';
|
|
3
3
|
import cx from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; // EditBlock
|
|
5
5
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
6
6
|
|
|
7
7
|
import maesViewrSchema from './schema';
|
|
@@ -106,12 +106,11 @@ const View = ({ data, provider_data, id, ...rest }) => {
|
|
|
106
106
|
</div>
|
|
107
107
|
<div className="maes-viewer-charts">
|
|
108
108
|
{provider_data
|
|
109
|
-
? multiCharts.map((chart
|
|
109
|
+
? multiCharts.map((chart) => {
|
|
110
110
|
return (
|
|
111
|
-
|
|
111
|
+
<React.Fragment key={chart.title}>
|
|
112
112
|
<div>{chart.title}</div>
|
|
113
113
|
<LoadablePlot
|
|
114
|
-
key={index}
|
|
115
114
|
data={chart.data}
|
|
116
115
|
layout={chart.layout}
|
|
117
116
|
frames={[]}
|
|
@@ -122,7 +121,7 @@ const View = ({ data, provider_data, id, ...rest }) => {
|
|
|
122
121
|
}}
|
|
123
122
|
useResizeHandler={true}
|
|
124
123
|
/>
|
|
125
|
-
|
|
124
|
+
</React.Fragment>
|
|
126
125
|
);
|
|
127
126
|
})
|
|
128
127
|
: ''}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import uniq from 'lodash/uniq';
|
|
2
|
+
import keys from 'lodash/keys';
|
|
3
|
+
import fromPairs from 'lodash/fromPairs';
|
|
4
|
+
import map from 'lodash/map';
|
|
2
5
|
import { defaultHoverTemplate } from './constants';
|
|
3
6
|
|
|
4
7
|
export const colorscale = [
|
|
@@ -59,7 +62,7 @@ class ProviderData {
|
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
getUniqueColumnData(name) {
|
|
62
|
-
return
|
|
65
|
+
return uniq(this.data[name]);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
getEcosystems() {
|
|
@@ -95,7 +98,7 @@ class ProviderData {
|
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
getColumnNames() {
|
|
98
|
-
return
|
|
101
|
+
return keys(this.data);
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
getCellValue(columnName, rowIndex) {
|
|
@@ -136,7 +139,7 @@ class ProviderData {
|
|
|
136
139
|
export function mapByLevel(provider_data) {
|
|
137
140
|
const pd = new ProviderData(provider_data);
|
|
138
141
|
|
|
139
|
-
const byLevel =
|
|
142
|
+
const byLevel = fromPairs(pd.getEcosystems().map((l) => [l, {}]));
|
|
140
143
|
|
|
141
144
|
pd.forEachCountryAndLevel((country, level) => {
|
|
142
145
|
const filters = [
|
|
@@ -168,8 +171,8 @@ export function mapToAllEU(provider_data, byLevel) {
|
|
|
168
171
|
totalArea += EUByLevel[level];
|
|
169
172
|
});
|
|
170
173
|
|
|
171
|
-
const EUByLevelPercents =
|
|
172
|
-
|
|
174
|
+
const EUByLevelPercents = fromPairs(
|
|
175
|
+
map(Array.from(level2), (l) => {
|
|
173
176
|
return [l, (EUByLevel[l] / totalArea) * 100];
|
|
174
177
|
}),
|
|
175
178
|
);
|
|
@@ -198,7 +201,7 @@ export function makeTrace(
|
|
|
198
201
|
// first element: country name
|
|
199
202
|
// second element: square kilometers (km2)
|
|
200
203
|
// third element: square megameters (Mm2)
|
|
201
|
-
const hovertext =
|
|
204
|
+
const hovertext = map(data, (x) => [x[0], x[1] / 100, x[1] / 10000]);
|
|
202
205
|
|
|
203
206
|
const text = [
|
|
204
207
|
...data.slice(0, data.length - 1).map((_) => null),
|
|
@@ -335,8 +338,8 @@ export function makeChartTiles(
|
|
|
335
338
|
const byLevel = mapByLevel(provider_data);
|
|
336
339
|
const { EUByLevel, EUByLevelPercents } = mapToAllEU(provider_data, byLevel);
|
|
337
340
|
|
|
338
|
-
const ecosystems =
|
|
339
|
-
const countries =
|
|
341
|
+
const ecosystems = uniq(provider_data['Ecosystem_level2']);
|
|
342
|
+
const countries = uniq(provider_data['Country_name']);
|
|
340
343
|
|
|
341
344
|
const byArea = Object.fromEntries(ecosystems.map((l) => [l, {}]));
|
|
342
345
|
ecosystems.forEach((level) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
3
3
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
4
4
|
import schema from './schema';
|
|
5
5
|
import View from './View';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
3
|
import { Menu } from 'semantic-ui-react';
|
|
4
|
-
import
|
|
5
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
4
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
5
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
6
6
|
import { getFieldURL } from '@eeacms/volto-bise-policy/helpers';
|
|
7
7
|
|
|
8
8
|
import './styles.less';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { compose } from 'redux';
|
|
3
3
|
import { injectIntl } from 'react-intl';
|
|
4
|
-
import
|
|
4
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; // EditBlock
|
|
5
5
|
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
|
|
6
6
|
import config from '@plone/volto/registry';
|
|
7
7
|
import { VisibilitySensor } from '@eeacms/volto-datablocks/components';
|
|
@@ -12,8 +12,8 @@ const getAlignmentOfColumn = (col, idx) => {
|
|
|
12
12
|
return typeof col !== 'string' && col.textAlign
|
|
13
13
|
? col.textAlign
|
|
14
14
|
: idx === 0
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
? 'left'
|
|
16
|
+
: 'right';
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const getNameOfColumn = (col) => {
|
|
@@ -52,8 +52,8 @@ const SimpleDataTableView = (props) => {
|
|
|
52
52
|
(pagination.data[pagination.activePage]
|
|
53
53
|
? pagination.data[pagination.activePage]
|
|
54
54
|
: pagination.activePage !== pagination.prevPage
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
? pagination.data[pagination.prevPage]
|
|
56
|
+
: null) || props.provider_data;
|
|
57
57
|
const provider_data_length = getProviderDataLength(provider_data);
|
|
58
58
|
|
|
59
59
|
const TableView =
|
|
@@ -66,8 +66,8 @@ const SimpleDataTableView = (props) => {
|
|
|
66
66
|
? provider_data_length
|
|
67
67
|
: Math.min(pagination.itemsPerPage, provider_data_length) || 0
|
|
68
68
|
: max_count > 0
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
? Math.min(max_count, provider_data_length)
|
|
70
|
+
: provider_data_length;
|
|
71
71
|
|
|
72
72
|
const providerColumns = Object.keys(provider_data || {});
|
|
73
73
|
const showAllColumns = !Array.isArray(columns) || columns.length === 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
3
3
|
import { Table, Menu, Loader } from 'semantic-ui-react';
|
|
4
4
|
import RenderComponent from '@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/components';
|
|
5
5
|
import cx from 'classnames';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { connect } from 'react-redux';
|
|
3
|
-
import
|
|
3
|
+
import escapeRegExp from 'lodash/escapeRegExp';
|
|
4
|
+
import filter from 'lodash/filter';
|
|
4
5
|
import qs from 'querystring';
|
|
5
|
-
import
|
|
6
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
6
7
|
import { Table, Pagination, Search } from 'semantic-ui-react';
|
|
7
8
|
import RenderComponent from '@eeacms/volto-datablocks/components/manage/Blocks/SimpleDataTable/components';
|
|
8
9
|
|
|
@@ -75,7 +76,7 @@ const View = (props) => {
|
|
|
75
76
|
props.dispatch({ type: 'TABLE_CLEAN_QUERY' });
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const re = new RegExp(
|
|
79
|
+
const re = new RegExp(escapeRegExp(data.value), 'i');
|
|
79
80
|
const isMatch = (result) => {
|
|
80
81
|
for (let colDef of selectedColumns) {
|
|
81
82
|
if (re.test(result[colDef.column])) {
|
|
@@ -86,7 +87,7 @@ const View = (props) => {
|
|
|
86
87
|
};
|
|
87
88
|
props.dispatch({
|
|
88
89
|
type: 'TABLE_FINISH_SEARCH',
|
|
89
|
-
results:
|
|
90
|
+
results: filter(filteredTableData, isMatch),
|
|
90
91
|
payload: { activePage: data.activePage, row_size },
|
|
91
92
|
});
|
|
92
93
|
}, time);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-filename-extension */
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { Transition } from 'semantic-ui-react';
|
|
3
5
|
import { Container, Grid, List, Icon, Accordion } from 'semantic-ui-react';
|
|
4
6
|
|
|
5
|
-
import
|
|
7
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
6
8
|
|
|
7
9
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
|
8
10
|
|
package/src/customizations/@eeacms/volto-eea-website-theme/components/theme/SubsiteClass.jsx
CHANGED
|
@@ -3,7 +3,8 @@ import cx from 'classnames';
|
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
|
|
5
5
|
import config from '@plone/volto/registry';
|
|
6
|
-
import
|
|
6
|
+
import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
|
|
7
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
7
8
|
import { isSubsiteRoot } from 'volto-subsites/utils';
|
|
8
9
|
import { setSubsite } from 'volto-subsites/actions';
|
|
9
10
|
|
|
@@ -10,21 +10,17 @@ import Cookies from 'universal-cookie';
|
|
|
10
10
|
|
|
11
11
|
import { matchPath } from 'react-router';
|
|
12
12
|
import { withRouter, useParams } from 'react-router-dom';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
hasApiExpander,
|
|
17
|
-
flattenToAppURL,
|
|
18
|
-
} from '@plone/volto/helpers';
|
|
19
|
-
import { getNavigation } from '@plone/volto/actions';
|
|
13
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
14
|
+
import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
15
|
+
import { getNavigation } from '@plone/volto/actions/navigation/navigation';
|
|
20
16
|
import { Header, Logo } from '@eeacms/volto-eea-design-system/ui';
|
|
21
17
|
import { usePrevious } from '@eeacms/volto-eea-design-system/helpers';
|
|
22
18
|
import globeIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/global-line.svg';
|
|
23
19
|
import eeaFlag from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/eea.png';
|
|
24
|
-
|
|
20
|
+
import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
|
|
25
21
|
import config from '@plone/volto/registry';
|
|
26
22
|
import { compose } from 'recompose';
|
|
27
|
-
import
|
|
23
|
+
import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
|
|
28
24
|
import { withScreenSize } from '@eeacms/volto-resize-helper/hocs';
|
|
29
25
|
|
|
30
26
|
import cx from 'classnames';
|
|
@@ -374,8 +370,8 @@ const EEAHeader = ({ token, history, subsite, content, screen, ...props }) => {
|
|
|
374
370
|
item.title !== 'GO TO EXPERT VIEW' || !hideExpertView,
|
|
375
371
|
)
|
|
376
372
|
: isSubsite && !subsite.isRoot && !isN2KSpecies && !isN2KHabitat
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
? getSubsiteItems()
|
|
374
|
+
: items.filter((item) => item.url !== '/natura2000')
|
|
379
375
|
}
|
|
380
376
|
renderGlobalMenuItem={(item, { onClick }) => (
|
|
381
377
|
<a
|
|
@@ -12,20 +12,16 @@ import { Portal } from 'react-portal';
|
|
|
12
12
|
import { injectIntl } from 'react-intl';
|
|
13
13
|
import qs from 'query-string';
|
|
14
14
|
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from '@plone/volto/
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
flattenToAppURL,
|
|
26
|
-
getLayoutFieldname,
|
|
27
|
-
hasApiExpander,
|
|
28
|
-
} from '@plone/volto/helpers';
|
|
15
|
+
import ContentMetadataTags from '@plone/volto/components/theme/ContentMetadataTags/ContentMetadataTags';
|
|
16
|
+
import Comments from '@plone/volto/components/theme/Comments/Comments';
|
|
17
|
+
import Tags from '@plone/volto/components/theme/Tags/Tags';
|
|
18
|
+
import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar';
|
|
19
|
+
import { listActions } from '@plone/volto/actions/actions/actions';
|
|
20
|
+
import { getContent } from '@plone/volto/actions/content/content';
|
|
21
|
+
import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
|
|
22
|
+
import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
23
|
+
import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
|
|
24
|
+
import { getLayoutFieldname } from '@plone/volto/helpers/Content/Content';
|
|
29
25
|
|
|
30
26
|
import config from '@plone/volto/registry';
|
|
31
27
|
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
* @module reducers/breadcrumbs/breadcrumbs
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
flattenToAppURL,
|
|
9
|
-
getBaseUrl,
|
|
10
|
-
hasApiExpander,
|
|
11
|
-
} from '@plone/volto/helpers';
|
|
6
|
+
import map from 'lodash/map';
|
|
7
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
12
8
|
|
|
9
|
+
import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
|
|
13
10
|
import {
|
|
14
11
|
GET_BREADCRUMBS,
|
|
15
12
|
GET_CONTENT,
|
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
* @module reducers/navigation/navigation
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
flattenToAppURL,
|
|
9
|
-
getBaseUrl,
|
|
10
|
-
hasApiExpander,
|
|
11
|
-
} from '@plone/volto/helpers';
|
|
6
|
+
import map from 'lodash/map';
|
|
7
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
12
8
|
|
|
9
|
+
import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
|
|
13
10
|
import {
|
|
14
11
|
GET_CONTENT,
|
|
15
12
|
GET_NAVIGATION,
|
|
@@ -4,12 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { GET_CONTENT, GET_TYPES } from '@plone/volto/constants/ActionTypes';
|
|
7
|
-
import {
|
|
8
|
-
flattenToAppURL,
|
|
9
|
-
getBaseUrl,
|
|
10
|
-
hasApiExpander,
|
|
11
|
-
} from '@plone/volto/helpers';
|
|
7
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
12
8
|
|
|
9
|
+
import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
|
|
13
10
|
const initialState = {
|
|
14
11
|
error: null,
|
|
15
12
|
loaded: false,
|
package/src/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import isArray from 'lodash/isArray';
|
|
2
2
|
import isObject from 'lodash/isObject';
|
|
3
3
|
import isString from 'lodash/isString';
|
|
4
|
-
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
|
|
4
|
+
import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
5
5
|
|
|
6
6
|
export const getFieldURL = (data) => {
|
|
7
7
|
let url = data;
|