@eeacms/volto-cca-policy 0.3.131 → 1.0.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 +7 -7
- package/CHANGELOG.md +9 -14
- package/docker-compose.yml +16 -16
- package/jest-addon.config.js +25 -420
- package/package.json +1 -1
- package/src/components/MigrationButtons.jsx +5 -1
- package/src/components/manage/Blocks/ASTNavigation/ASTNavigationEdit.jsx +2 -1
- package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.jsx +10 -4
- package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.test.jsx +87 -35
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockEdit.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockView.test.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockEdit.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.test.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockEdit.jsx +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/schema.js +0 -20
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerEdit.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerView.js → CaseStudyExplorerView.jsx} +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.test.jsx +2 -2
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyMap.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.jsx +2 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.test.jsx +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +0 -4
- package/src/components/manage/Blocks/CaseStudyExplorer/utils.js +0 -30
- package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsEdit.jsx +1 -1
- package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.jsx +3 -2
- package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.test.jsx +1 -1
- package/src/components/manage/Blocks/ContentLinks/ContentLinksEdit.jsx +1 -1
- package/src/components/manage/Blocks/ContentLinks/ContentLinksView.jsx +1 -1
- package/src/components/manage/Blocks/ContentLinks/ContentLinksView.test.jsx +1 -1
- package/src/components/manage/Blocks/ContentLinks/DropdownListView.jsx +1 -1
- package/src/components/manage/Blocks/ContentLinks/DropdownListView.test.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapHeatIndex/Filter.test.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapHeatIndex/{View.js → View.jsx} +14 -10
- package/src/components/manage/Blocks/CountryMapHeatIndex/mapstyle.js +1 -3
- package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryEdit.jsx +2 -1
- package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +4 -3
- package/src/components/manage/Blocks/CountryMapProfile/Filter.test.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +5 -12
- package/src/components/manage/Blocks/CountryProfileDetail/{CountryTabPane.js → CountryTabPane.jsx} +11 -4
- package/src/components/manage/Blocks/CountryProfileDetail/CountryTabPane.test.jsx +1 -1
- package/src/components/manage/Blocks/CountryProfileDetail/{View.js → View.jsx} +20 -15
- package/src/components/manage/Blocks/CountryProfileDetail/View.test.jsx +134 -20
- package/src/components/manage/Blocks/CountryProfileDetail/index.js +0 -1
- package/src/components/manage/Blocks/DataConnectedEmbedBlock/index.js +0 -2
- package/src/components/manage/Blocks/ECDEIndicators/ECDEIndicatorsView.jsx +1 -1
- package/src/components/manage/Blocks/FilterAceContent/FilterAceContentEdit.jsx +3 -3
- package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.jsx +2 -2
- package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.test.jsx +1 -1
- package/src/components/manage/Blocks/FlourishEmbedBlock/FlourishEmbedBlockEdit.jsx +1 -1
- package/src/components/manage/Blocks/Listing/DropdownListingView.jsx +1 -1
- package/src/components/manage/Blocks/Listing/EventAccordionListingView.jsx +1 -1
- package/src/components/manage/Blocks/Listing/EventAccordionListingView.test.jsx +5 -3
- package/src/components/manage/Blocks/Listing/EventCardsListingView.jsx +2 -1
- package/src/components/manage/Blocks/Listing/EventCardsListingView.test.jsx +10 -4
- package/src/components/manage/Blocks/Listing/IndicatorCardsListingView.jsx +2 -2
- package/src/components/manage/Blocks/Listing/OrganisationCardsListingView.jsx +3 -1
- package/src/components/manage/Blocks/Listing/SimpleCardsListingView.jsx +1 -1
- package/src/components/manage/Blocks/Listing/SimpleCardsListingView.test.jsx +5 -3
- package/src/components/manage/Blocks/Listing/SimpleItemListingView.jsx +2 -2
- package/src/components/manage/Blocks/Listing/SimpleItemListingView.test.jsx +6 -4
- package/src/components/manage/Blocks/RASTBlock/ContextNavigation.jsx +0 -1
- package/src/components/manage/Blocks/RASTBlock/RASTAccordion.jsx +1 -1
- package/src/components/manage/Blocks/RASTBlock/RASTAccordion.test.jsx +1 -1
- package/src/components/manage/Blocks/RASTBlock/RASTAccordionContent.jsx +2 -2
- package/src/components/manage/Blocks/RASTBlock/RASTEdit.jsx +1 -1
- package/src/components/manage/Blocks/RASTBlock/RASTMap.jsx +1 -1
- package/src/components/manage/Blocks/RASTBlock/RASTMap.test.jsx +1 -1
- package/src/components/manage/Blocks/RASTBlock/RASTView.jsx +1 -1
- package/src/components/manage/Blocks/ReadMore/ReadMoreEdit.jsx +1 -1
- package/src/components/manage/Blocks/ReadMore/ReadMoreView.jsx +1 -1
- package/src/components/manage/Blocks/ReadMore/ReadMoreView.test.jsx +1 -1
- package/src/components/manage/Blocks/RedirectBlock/{RedirectBlock.test.js → RedirectBlock.test.jsx} +1 -1
- package/src/components/manage/Blocks/RedirectBlock/RedirectBlockEdit.jsx +2 -1
- package/src/components/manage/Blocks/RedirectBlock/RedirectBlockView.jsx +2 -2
- package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentEdit.jsx +1 -1
- package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.jsx +1 -1
- package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.test.jsx +1 -1
- package/src/components/manage/Blocks/SearchAceContent/SearchAceContentEdit.jsx +1 -1
- package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.jsx +1 -1
- package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.test.jsx +1 -1
- package/src/components/manage/Blocks/TabsBlock/Spotlight.jsx +2 -2
- package/src/components/manage/Blocks/TabsBlock/Spotlight.test.jsx +7 -1
- package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectEdit.jsx +1 -1
- package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.jsx +1 -1
- package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.test.jsx +1 -1
- package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.jsx +5 -2
- package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.test.jsx +3 -6
- package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.jsx +1 -1
- package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.test.jsx +1 -1
- package/src/components/theme/ASTNavigation/ASTAccordion.test.jsx +1 -1
- package/src/components/theme/ASTNavigation/ASTLogoMap.jsx +1 -1
- package/src/components/theme/ASTNavigation/ASTLogoMap.test.jsx +1 -1
- package/src/components/theme/ASTNavigation/ASTNavigation.jsx +9 -5
- package/src/components/theme/ASTNavigation/ASTNavigation.test.jsx +323 -0
- package/src/components/theme/ASTNavigation/{utils.js → LinkWrap.jsx} +4 -9
- package/src/components/theme/ASTNavigation/UASTLogoMap.jsx +1 -1
- package/src/components/theme/ASTNavigation/UASTLogoMap.test.jsx +1 -1
- package/src/components/theme/Header/Header.jsx +5 -5
- package/src/components/theme/Header/LanguageSwitch.jsx +5 -5
- package/src/components/theme/MissionSignatoryProfile/MissionSignatoryProfileView.jsx +1 -1
- package/src/components/theme/TranslationDisclaimer/TranslationDisclaimer.jsx +1 -1
- package/src/components/theme/TranslationDisclaimer/TranslationInfo.jsx +1 -1
- package/src/components/theme/Views/AdaptationOptionView.jsx +1 -1
- package/src/components/theme/Views/AdaptationOptionView.test.jsx +5 -3
- package/src/components/theme/Views/ArchivedVersionListing.jsx +1 -1
- package/src/components/theme/Views/ArchivedVersionListing.test.jsx +2 -2
- package/src/components/theme/Views/ArchivedVersionNotice.jsx +1 -1
- package/src/components/theme/Views/ArchivedVersionNotice.test.jsx +1 -1
- package/src/components/theme/Views/BrokenLinks.jsx +1 -1
- package/src/components/theme/Views/BrokenLinks.test.jsx +1 -1
- package/src/components/theme/Views/CaseStudyView.test.jsx +1 -1
- package/src/components/theme/Views/DatabaseItemView.test.jsx +1 -1
- package/src/components/theme/Views/NewsItemView.jsx +1 -1
- package/src/components/theme/Views/ProjectView.test.jsx +1 -1
- package/src/components/theme/Views/VersionsGroup.jsx +1 -1
- package/src/components/theme/Views/VersionsGroup.test.jsx +1 -1
- package/src/components/theme/Widgets/GeocharsWidget.jsx +1 -1
- package/src/components/theme/Widgets/GeolocationWidget.jsx +1 -1
- package/src/components/theme/Widgets/GeolocationWidget.test.jsx +1 -1
- package/src/components/theme/Widgets/ImageWidget.jsx +7 -8
- package/src/components/theme/Widgets/ImageWidget.test.jsx +1 -1
- package/src/components/theme/Widgets/PromotionalImageWidget.jsx +6 -4
- package/src/components/theme/Widgets/utils.js +1 -1
- package/src/constants.js +538 -2
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +1 -1
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +52 -24
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +1 -0
- package/src/customizations/@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground.jsx +2 -1
- package/src/customizations/@eeacms/volto-listing-block/blocks/Listing/item-templates/SimpleItemTemplates.jsx +2 -2
- package/src/customizations/@eeacms/volto-listing-block/components/UniversalCard/fragments/CardTitle.jsx +1 -1
- package/src/customizations/@plone/volto-slate/blocks/Table/TableBlockView.jsx +3 -3
- package/src/customizations/@plone/volto-slate/blocks/Text/{index.js → index.jsx} +2 -21
- package/src/customizations/@plone/volto-slate/editor/extensions/normalizeNode.js +1 -1
- package/src/customizations/@plone/volto-slate/utils/blocks.js +11 -8
- package/src/customizations/@plone/volto-slate/utils/volto-blocks.js +2 -2
- package/src/customizations/@plone/volto-slate/widgets/HtmlSlateWidget.jsx +2 -2
- package/src/customizations/@plone-collective/volto-authomatic/components/Login/Login.jsx +7 -4
- package/src/customizations/@plone-collective/volto-rss-provider/components/RSSFeedView.jsx +5 -8
- package/src/customizations/@plone-collective/volto-rss-provider/express-middleware.js +2 -1
- package/src/customizations/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +3 -3
- package/src/customizations/volto/components/manage/Blocks/Grid/templates.js +1 -1
- package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +1 -1
- package/src/customizations/volto/components/manage/Controlpanels/ContentTypeLayout.jsx +12 -14
- package/src/customizations/volto/components/manage/Display/Display.jsx +10 -5
- package/src/customizations/volto/components/manage/Multilingual/TranslationObject.jsx +7 -6
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +4 -1
- package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +12 -8
- package/src/customizations/volto/components/theme/App/App.jsx +16 -23
- package/src/customizations/volto/components/theme/Sitemap/Sitemap.jsx +3 -2
- package/src/customizations/volto/components/theme/View/DefaultView.jsx +5 -4
- package/src/customizations/volto/components/theme/View/LinkView.jsx +2 -2
- package/src/customizations/volto/components/theme/View/View.jsx +10 -11
- package/src/customizations/volto/helpers/Url/Url-old.js +2 -1
- package/src/customizations/volto/middleware/api.js +6 -4
- package/src/customizations/volto/reducers/actions/actions.js +2 -5
- package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +3 -6
- package/src/customizations/volto/reducers/navigation/navigation.js +3 -6
- package/src/customizations/volto/server.jsx +9 -8
- package/src/express-middleware.js +1 -1
- package/src/helpers/ContentMetadata.jsx +4 -4
- package/src/helpers/Utils.jsx +5 -5
- package/src/helpers/index.js +1 -8
- package/src/hocs/index.js +2 -0
- package/src/index.js +9 -7
- package/src/search/common.js +4 -41
- package/src/search/utils.test.js +1 -1
- package/src/search/vocabulary.js +2 -2
- package/src/store/reducers/physical-breadcrumbs.js +2 -2
- package/src/utils.js +1 -1
- package/src/helpers/Constants.jsx +0 -535
- package/theme/assets/images/administrative_support_service.png +0 -0
- /package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerEdit.js → CaseStudyExplorerEdit.jsx} +0 -0
- /package/src/components/manage/Blocks/CountryMapHeatIndex/{Edit.js → Edit.jsx} +0 -0
- /package/src/components/manage/Blocks/CountryMapProfile/{Edit.js → Edit.jsx} +0 -0
- /package/src/components/manage/Blocks/CountryProfileDetail/{Edit.js → Edit.jsx} +0 -0
- /package/src/components/manage/Blocks/ReadMore/{schema.js → schema.jsx} +0 -0
- /package/src/helpers/{clientOnly.js → clientOnly.jsx} +0 -0
- /package/src/{components/manage/Blocks/withResponsiveContainer.js → hocs/withResponsiveContainer.jsx} +0 -0
- /package/src/{components/manage/Blocks → hocs}/withVisibilitySensor.jsx +0 -0
|
@@ -15,9 +15,11 @@ import { makeStyles } from './mapstyle';
|
|
|
15
15
|
import { Interactions } from './Interactions';
|
|
16
16
|
import { useCountriesMetadata } from './hooks';
|
|
17
17
|
import Filter from './Filter';
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import {
|
|
19
|
+
withResponsiveContainer,
|
|
20
|
+
withVisibilitySensor,
|
|
21
|
+
} from '@eeacms/volto-cca-policy/hocs';
|
|
22
|
+
import { addAppURL } from '@plone/volto/helpers/Url/Url';
|
|
21
23
|
|
|
22
24
|
import './styles.less';
|
|
23
25
|
|
|
@@ -92,15 +94,6 @@ const View = (props) => {
|
|
|
92
94
|
}, [geofeatures, countries_metadata, thematicMapMode, euCountryNames, ol]);
|
|
93
95
|
|
|
94
96
|
const baseUrl = props.path || props.location?.pathname || '';
|
|
95
|
-
|
|
96
|
-
// const onFeatureClick = React.useCallback(
|
|
97
|
-
// (feature) => {
|
|
98
|
-
// const country = feature.get('na');
|
|
99
|
-
// // history.push(`${baseUrl}/${country.toLowerCase()}`);
|
|
100
|
-
// },
|
|
101
|
-
// [baseUrl, history],
|
|
102
|
-
// );
|
|
103
|
-
// console.log('thematicMapMode', thematicMapMode);
|
|
104
97
|
return (
|
|
105
98
|
<div className="ol-country-map">
|
|
106
99
|
<Grid columns="12">
|
package/src/components/manage/Blocks/CountryProfileDetail/{CountryTabPane.js → CountryTabPane.jsx}
RENAMED
|
@@ -24,7 +24,7 @@ export default function CountryTabPane(props) {
|
|
|
24
24
|
if (element.type === 'accordeon') {
|
|
25
25
|
return element.value.map((accordion, index) => {
|
|
26
26
|
return (
|
|
27
|
-
<Accordion className="secondary">
|
|
27
|
+
<Accordion className="secondary" key={`${indexKey}_${index}`}>
|
|
28
28
|
<Accordion.Title
|
|
29
29
|
role="button"
|
|
30
30
|
tabIndex={0}
|
|
@@ -49,7 +49,10 @@ export default function CountryTabPane(props) {
|
|
|
49
49
|
}
|
|
50
50
|
if (element.type === 'table') {
|
|
51
51
|
return (
|
|
52
|
-
<div
|
|
52
|
+
<div
|
|
53
|
+
key={indexKey}
|
|
54
|
+
dangerouslySetInnerHTML={{ __html: element.value }}
|
|
55
|
+
></div>
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -58,8 +61,12 @@ export default function CountryTabPane(props) {
|
|
|
58
61
|
for (let i = 0; i < element.value.length; i++) {
|
|
59
62
|
_html_value += element.value[i];
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
key={indexKey}
|
|
67
|
+
dangerouslySetInnerHTML={{ __html: _html_value }}
|
|
68
|
+
></div>
|
|
69
|
+
);
|
|
63
70
|
}
|
|
64
71
|
return null;
|
|
65
72
|
})}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import CountryTabPane from './CountryTabPane';
|
|
8
8
|
|
|
@@ -6,14 +6,14 @@ import { FormattedMessage } from 'react-intl';
|
|
|
6
6
|
import './styles.less';
|
|
7
7
|
|
|
8
8
|
export default function View(props) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const dataJson = props?.properties['@components']?.countryprofile?.html || {};
|
|
9
|
+
const dataJson =
|
|
10
|
+
props?.properties?.['@components']?.countryprofile?.html || {};
|
|
11
|
+
|
|
13
12
|
const [activePanes, setActivePanes] = React.useState({});
|
|
14
13
|
const isNonEN = props?.properties?.language !== 'en';
|
|
15
14
|
|
|
16
15
|
const panes = [];
|
|
16
|
+
|
|
17
17
|
if (dataJson?.menu) {
|
|
18
18
|
dataJson.menu.forEach((element, index) => {
|
|
19
19
|
panes.push({
|
|
@@ -22,10 +22,10 @@ export default function View(props) {
|
|
|
22
22
|
<TabPane>
|
|
23
23
|
<CountryTabPane
|
|
24
24
|
_index={index}
|
|
25
|
-
contents={dataJson.content[index]}
|
|
25
|
+
contents={dataJson.content?.[index]}
|
|
26
26
|
activePanes={activePanes}
|
|
27
27
|
setActivePanes={setActivePanes}
|
|
28
|
-
|
|
28
|
+
/>
|
|
29
29
|
</TabPane>
|
|
30
30
|
),
|
|
31
31
|
});
|
|
@@ -42,35 +42,39 @@ export default function View(props) {
|
|
|
42
42
|
/>
|
|
43
43
|
</Message>
|
|
44
44
|
)}
|
|
45
|
+
|
|
45
46
|
{dataJson.message_top ? (
|
|
46
47
|
<div className="eea callout">{dataJson.message_top}</div>
|
|
47
48
|
) : null}
|
|
49
|
+
|
|
48
50
|
{dataJson.top_accordeon ? (
|
|
49
51
|
<div className="top-accordion">
|
|
50
52
|
{dataJson.top_accordeon.map((accordion, index) => (
|
|
51
|
-
<Accordion className="secondary">
|
|
53
|
+
<Accordion className="secondary" key={accordion.title}>
|
|
52
54
|
<Accordion.Title
|
|
53
55
|
role="button"
|
|
54
56
|
tabIndex={0}
|
|
55
|
-
active={activePanes[
|
|
56
|
-
onClick={(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
active={activePanes[`_${index}`] || false}
|
|
58
|
+
onClick={() => {
|
|
59
|
+
setActivePanes({
|
|
60
|
+
...activePanes,
|
|
61
|
+
[`_${index}`]: !(activePanes[`_${index}`] || false),
|
|
62
|
+
});
|
|
61
63
|
}}
|
|
62
64
|
>
|
|
63
65
|
<span className="item-title">{accordion.title}</span>
|
|
64
66
|
<Icon className="ri-arrow-down-s-line" />
|
|
65
67
|
</Accordion.Title>
|
|
68
|
+
|
|
66
69
|
<Accordion.Content
|
|
67
|
-
active={activePanes[
|
|
70
|
+
active={activePanes[`_${index}`] || false}
|
|
68
71
|
dangerouslySetInnerHTML={{ __html: accordion.value }}
|
|
69
|
-
|
|
72
|
+
/>
|
|
70
73
|
</Accordion>
|
|
71
74
|
))}
|
|
72
75
|
</div>
|
|
73
76
|
) : null}
|
|
77
|
+
|
|
74
78
|
<Tab
|
|
75
79
|
className="secondary menu"
|
|
76
80
|
panes={panes}
|
|
@@ -85,6 +89,7 @@ export default function View(props) {
|
|
|
85
89
|
tabIndex: 0,
|
|
86
90
|
}}
|
|
87
91
|
/>
|
|
92
|
+
|
|
88
93
|
{dataJson.updated ? (
|
|
89
94
|
<p>Reported updated until: {dataJson.updated}</p>
|
|
90
95
|
) : null}
|
|
@@ -1,39 +1,153 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
|
-
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
4
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import View from './View';
|
|
8
8
|
|
|
9
|
+
jest.mock('./CountryTabPane', () => (props) => (
|
|
10
|
+
<div data-testid={`country-tab-pane-${props._index}`}>
|
|
11
|
+
CountryTabPane {props.contents}
|
|
12
|
+
</div>
|
|
13
|
+
));
|
|
14
|
+
|
|
9
15
|
const mockStore = configureStore();
|
|
10
16
|
|
|
17
|
+
const renderView = (properties) => {
|
|
18
|
+
const store = mockStore({
|
|
19
|
+
userSession: { token: '1234' },
|
|
20
|
+
intl: {
|
|
21
|
+
locale: 'en',
|
|
22
|
+
messages: {},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return render(
|
|
27
|
+
<Provider store={store}>
|
|
28
|
+
<MemoryRouter>
|
|
29
|
+
<View properties={properties} />
|
|
30
|
+
</MemoryRouter>
|
|
31
|
+
</Provider>,
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
11
35
|
describe('View', () => {
|
|
12
|
-
it('
|
|
13
|
-
const
|
|
36
|
+
it('renders the component', () => {
|
|
37
|
+
const { container } = renderView({
|
|
38
|
+
language: 'en',
|
|
39
|
+
'@components': {
|
|
40
|
+
countryprofile: {
|
|
41
|
+
html: {
|
|
42
|
+
menu: [],
|
|
43
|
+
content: [],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
expect(container).toBeTruthy();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('renders non-English warning message', () => {
|
|
53
|
+
renderView({
|
|
54
|
+
language: 'ro',
|
|
14
55
|
'@components': {
|
|
15
56
|
countryprofile: {
|
|
16
|
-
html:
|
|
57
|
+
html: {
|
|
58
|
+
menu: [],
|
|
59
|
+
content: [],
|
|
60
|
+
},
|
|
17
61
|
},
|
|
18
62
|
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
expect(
|
|
66
|
+
screen.getByText(
|
|
67
|
+
'Officially reported governmental information is only available in English',
|
|
68
|
+
),
|
|
69
|
+
).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('renders top message', () => {
|
|
73
|
+
renderView({
|
|
74
|
+
language: 'en',
|
|
75
|
+
'@components': {
|
|
76
|
+
countryprofile: {
|
|
77
|
+
html: {
|
|
78
|
+
menu: [],
|
|
79
|
+
content: [],
|
|
80
|
+
message_top: 'This is the top message',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
27
83
|
},
|
|
28
84
|
});
|
|
29
85
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
86
|
+
expect(screen.getByText('This is the top message')).toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('renders updated date', () => {
|
|
90
|
+
renderView({
|
|
91
|
+
language: 'en',
|
|
92
|
+
'@components': {
|
|
93
|
+
countryprofile: {
|
|
94
|
+
html: {
|
|
95
|
+
menu: [],
|
|
96
|
+
content: [],
|
|
97
|
+
updated: '2024-01-01',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
expect(
|
|
104
|
+
screen.getByText('Reported updated until: 2024-01-01'),
|
|
105
|
+
).toBeInTheDocument();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('renders and opens top accordion', () => {
|
|
109
|
+
renderView({
|
|
110
|
+
language: 'en',
|
|
111
|
+
'@components': {
|
|
112
|
+
countryprofile: {
|
|
113
|
+
html: {
|
|
114
|
+
menu: [],
|
|
115
|
+
content: [],
|
|
116
|
+
top_accordeon: [
|
|
117
|
+
{
|
|
118
|
+
title: 'Accordion title',
|
|
119
|
+
value: '<p>Accordion content</p>',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
expect(screen.getByText('Accordion title')).toBeInTheDocument();
|
|
128
|
+
|
|
129
|
+
fireEvent.click(screen.getByRole('button'));
|
|
130
|
+
|
|
131
|
+
expect(screen.getByText('Accordion content')).toBeInTheDocument();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('renders tabs and CountryTabPane', () => {
|
|
135
|
+
renderView({
|
|
136
|
+
language: 'en',
|
|
137
|
+
'@components': {
|
|
138
|
+
countryprofile: {
|
|
139
|
+
html: {
|
|
140
|
+
menu: ['Tab one', 'Tab two'],
|
|
141
|
+
content: ['Content one', 'Content two'],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
expect(screen.getByText('Tab one')).toBeInTheDocument();
|
|
148
|
+
expect(screen.getByText('Tab two')).toBeInTheDocument();
|
|
149
|
+
expect(screen.getByTestId('country-tab-pane-0')).toHaveTextContent(
|
|
150
|
+
'Content one',
|
|
36
151
|
);
|
|
37
|
-
expect(container).toBeTruthy();
|
|
38
152
|
});
|
|
39
153
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import worldSVG from '@plone/volto/icons/world.svg';
|
|
2
2
|
import Edit from './Edit';
|
|
3
3
|
import View from './View';
|
|
4
|
-
// import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
|
|
5
4
|
|
|
6
5
|
export default function installCountryProfileDetailBlock(config) {
|
|
7
6
|
config.blocks.blocksConfig.countryProfileDetail = {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { composeSchema } from '@eeacms/volto-cca-policy/schema-utils';
|
|
2
|
-
// import { addLanguageParamField } from './schema';
|
|
3
2
|
import DataConnectedEmbedBlockView from './DataConnectedEmbedBlockView';
|
|
4
3
|
|
|
5
4
|
export default function applyConfig(config) {
|
|
6
5
|
const { data_connected_embed } = config.blocks.blocksConfig;
|
|
7
6
|
|
|
8
7
|
data_connected_embed.schemaEnhancer = composeSchema(
|
|
9
|
-
// addLanguageParamField,
|
|
10
8
|
data_connected_embed.schemaEnhancer,
|
|
11
9
|
);
|
|
12
10
|
data_connected_embed.view = DataConnectedEmbedBlockView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import superagent from 'superagent';
|
|
3
3
|
import { Dropdown, Grid } from 'semantic-ui-react';
|
|
4
|
-
import { searchContent } from '@plone/volto/actions';
|
|
4
|
+
import { searchContent } from '@plone/volto/actions/search/search';
|
|
5
5
|
import ECDEIndicator from './ECDEIndicator';
|
|
6
6
|
import { useDispatch, useSelector } from 'react-redux';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSelector, useDispatch } from 'react-redux';
|
|
3
|
-
import { getVocabulary } from '@plone/volto/actions';
|
|
4
|
-
import
|
|
3
|
+
import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies';
|
|
4
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
5
5
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
6
|
-
import { BIOREGIONS, OTHER_REGIONS } from '@eeacms/volto-cca-policy/
|
|
6
|
+
import { BIOREGIONS, OTHER_REGIONS } from '@eeacms/volto-cca-policy/constants';
|
|
7
7
|
import FilterSchema from './schema';
|
|
8
8
|
import FilterAceContentView from './FilterAceContentView';
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import loadable from '@loadable/component';
|
|
3
3
|
import ListingBody from '@plone/volto/components/manage/Blocks/Listing/ListingBody';
|
|
4
4
|
import { useSelector, useDispatch } from 'react-redux';
|
|
5
|
-
import { getVocabulary } from '@plone/volto/actions';
|
|
6
|
-
import { OTHER_REGIONS } from '@eeacms/volto-cca-policy/
|
|
5
|
+
import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies';
|
|
6
|
+
import { OTHER_REGIONS } from '@eeacms/volto-cca-policy/constants';
|
|
7
7
|
import { Link } from 'react-router-dom';
|
|
8
8
|
import {
|
|
9
9
|
Option,
|
|
@@ -3,7 +3,7 @@ import { MemoryRouter } from 'react-router-dom';
|
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import renderer from 'react-test-renderer';
|
|
5
5
|
|
|
6
|
-
import '@testing-library/jest-dom
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
7
|
import { Provider } from 'react-intl-redux';
|
|
8
8
|
import FilterAceContentView from './FilterAceContentView';
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
2
2
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
3
3
|
import FlourishEmbedBlockView from './FlourishEmbedBlockView';
|
|
4
4
|
import schema from './schema';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import { Dropdown } from 'semantic-ui-react';
|
|
5
|
-
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
5
|
+
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
6
6
|
import { useIntl, defineMessages } from 'react-intl';
|
|
7
7
|
|
|
8
8
|
import './styles.less';
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
5
5
|
import { Icon, Accordion, Button } from 'semantic-ui-react';
|
|
6
|
-
import
|
|
6
|
+
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
|
|
7
7
|
import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
|
|
8
8
|
|
|
9
9
|
import './styles.less';
|
|
@@ -7,9 +7,11 @@ import EventAccordionListingView from './EventAccordionListingView';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
jest.mock(
|
|
11
|
-
ConditionalLink
|
|
12
|
-
|
|
10
|
+
jest.mock(
|
|
11
|
+
'@plone/volto/components/manage/ConditionalLink/ConditionalLink',
|
|
12
|
+
() =>
|
|
13
|
+
({ children }) => <div>{children}</div>,
|
|
14
|
+
);
|
|
13
15
|
|
|
14
16
|
jest.mock('@plone/volto/components/theme/View/EventDatesInfo', () => ({
|
|
15
17
|
When: () => <div>Event Date Info</div>,
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { useSelector } from 'react-redux';
|
|
5
5
|
import { Card, Grid, Icon, Label, Image } from 'semantic-ui-react';
|
|
6
|
-
import
|
|
6
|
+
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
|
|
7
|
+
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
|
|
7
8
|
import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
|
|
8
9
|
import { capitalizeFirstLetter } from '@eeacms/volto-cca-policy/helpers';
|
|
9
10
|
import config from '@plone/volto/registry';
|
|
@@ -8,10 +8,16 @@ import EventCardsListingView from './EventCardsListingView';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock(
|
|
12
|
-
ConditionalLink
|
|
13
|
-
|
|
14
|
-
})
|
|
11
|
+
jest.mock(
|
|
12
|
+
'@plone/volto/components/manage/ConditionalLink/ConditionalLink',
|
|
13
|
+
() =>
|
|
14
|
+
({ children }) => <div>{children}</div>,
|
|
15
|
+
);
|
|
16
|
+
jest.mock(
|
|
17
|
+
'@plone/volto/components/manage/UniversalLink/UniversalLink',
|
|
18
|
+
() =>
|
|
19
|
+
({ children }) => <button>{children}</button>,
|
|
20
|
+
);
|
|
15
21
|
|
|
16
22
|
jest.mock('@plone/volto/components/theme/View/EventDatesInfo', () => ({
|
|
17
23
|
When: () => <span>EventDatesInfo</span>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
4
|
-
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers';
|
|
3
|
+
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
|
|
4
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
5
5
|
|
|
6
6
|
import './styles.less';
|
|
7
7
|
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
Card,
|
|
8
8
|
} from 'semantic-ui-react';
|
|
9
9
|
|
|
10
|
+
import Image from '@plone/volto/components/theme/Image/Image';
|
|
11
|
+
|
|
10
12
|
import './styles.less';
|
|
11
13
|
|
|
12
14
|
const OrganisationCardsListingView = ({ items }) => {
|
|
@@ -18,7 +20,7 @@ const OrganisationCardsListingView = ({ items }) => {
|
|
|
18
20
|
<CardHeader>
|
|
19
21
|
<div className="image">
|
|
20
22
|
<div className="img-container">
|
|
21
|
-
<
|
|
23
|
+
<Image
|
|
22
24
|
src={item['@id'] + '/@@images/logo/preview'}
|
|
23
25
|
alt={item.title}
|
|
24
26
|
className="ui image"
|
|
@@ -8,9 +8,11 @@ import SimpleCardsListingView from './SimpleCardsListingView';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock(
|
|
12
|
-
ConditionalLink
|
|
13
|
-
|
|
11
|
+
jest.mock(
|
|
12
|
+
'@plone/volto/components/manage/ConditionalLink/ConditionalLink',
|
|
13
|
+
() =>
|
|
14
|
+
({ children }) => <div>{children}</div>,
|
|
15
|
+
);
|
|
14
16
|
|
|
15
17
|
describe('SimpleCardsListingView', () => {
|
|
16
18
|
it('renders card titles and placeholders when no image', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import
|
|
3
|
-
import { getBaseUrl } from '@plone/volto/helpers';
|
|
2
|
+
import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
|
|
3
|
+
import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
4
4
|
|
|
5
5
|
const SimpleItemListingView = ({ items, isEditMode }) => {
|
|
6
6
|
return (
|
|
@@ -8,11 +8,13 @@ import SimpleItemListingView from './SimpleItemListingView';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
jest.mock(
|
|
12
|
-
ConditionalLink
|
|
13
|
-
|
|
11
|
+
jest.mock(
|
|
12
|
+
'@plone/volto/components/manage/ConditionalLink/ConditionalLink',
|
|
13
|
+
() =>
|
|
14
|
+
({ children }) => <div>{children}</div>,
|
|
15
|
+
);
|
|
14
16
|
|
|
15
|
-
jest.mock('@plone/volto/helpers', () => ({
|
|
17
|
+
jest.mock('@plone/volto/helpers/Url/Url', () => ({
|
|
16
18
|
getBaseUrl: (id) => id,
|
|
17
19
|
}));
|
|
18
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Accordion } from 'semantic-ui-react';
|
|
3
3
|
import { useHistory } from 'react-router-dom';
|
|
4
|
-
import
|
|
4
|
+
import Icon from '@plone/volto/components/theme/Icon/Icon';
|
|
5
5
|
|
|
6
6
|
import RASTAccordionContent from './RASTAccordionContent';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import RASTAccordion from './RASTAccordion';
|
|
8
8
|
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { List } from 'semantic-ui-react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import { compose } from 'redux';
|
|
5
|
-
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers';
|
|
5
|
+
import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url';
|
|
6
6
|
import { useDispatch, useSelector } from 'react-redux';
|
|
7
|
-
import { getContent } from '@plone/volto/actions';
|
|
7
|
+
import { getContent } from '@plone/volto/actions/content/content';
|
|
8
8
|
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
|
|
4
4
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
5
5
|
|
|
6
6
|
import RASTView from './RASTView';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
import RASTMap from './RASTMap';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import './styles.less';
|
|
3
3
|
import ContextNavigation from './ContextNavigation';
|
|
4
4
|
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
-
import { getContent } from '@plone/volto/actions';
|
|
5
|
+
import { getContent } from '@plone/volto/actions/content/content';
|
|
6
6
|
|
|
7
7
|
function useChildren(location) {
|
|
8
8
|
const dispatch = useDispatch();
|