@eeacms/volto-cca-policy 0.3.131 → 1.0.1

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.
Files changed (181) hide show
  1. package/.eslintrc.js +7 -7
  2. package/CHANGELOG.md +44 -14
  3. package/docker-compose.yml +16 -16
  4. package/jest-addon.config.js +25 -420
  5. package/package.json +1 -2
  6. package/src/components/MigrationButtons.jsx +5 -1
  7. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationEdit.jsx +2 -1
  8. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.jsx +10 -4
  9. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.test.jsx +87 -35
  10. package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockEdit.jsx +1 -1
  11. package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockView.test.jsx +1 -1
  12. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockEdit.jsx +1 -1
  13. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.jsx +1 -1
  14. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.test.jsx +1 -1
  15. package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockEdit.jsx +1 -1
  16. package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/schema.js +0 -20
  17. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerEdit.test.jsx +1 -1
  18. package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerView.js → CaseStudyExplorerView.jsx} +1 -1
  19. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.test.jsx +2 -2
  20. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.test.jsx +1 -1
  21. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyMap.test.jsx +1 -1
  22. package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.jsx +2 -1
  23. package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.test.jsx +1 -1
  24. package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +0 -4
  25. package/src/components/manage/Blocks/CaseStudyExplorer/utils.js +0 -30
  26. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsEdit.jsx +1 -1
  27. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.jsx +3 -2
  28. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.test.jsx +1 -1
  29. package/src/components/manage/Blocks/ContentLinks/ContentLinksEdit.jsx +1 -1
  30. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.jsx +1 -1
  31. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.test.jsx +1 -1
  32. package/src/components/manage/Blocks/ContentLinks/DropdownListView.jsx +1 -1
  33. package/src/components/manage/Blocks/ContentLinks/DropdownListView.test.jsx +1 -1
  34. package/src/components/manage/Blocks/CountryMapHeatIndex/Filter.test.jsx +1 -1
  35. package/src/components/manage/Blocks/CountryMapHeatIndex/{View.js → View.jsx} +14 -10
  36. package/src/components/manage/Blocks/CountryMapHeatIndex/mapstyle.js +1 -3
  37. package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryEdit.jsx +2 -1
  38. package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +4 -3
  39. package/src/components/manage/Blocks/CountryMapProfile/Filter.test.jsx +1 -1
  40. package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +5 -12
  41. package/src/components/manage/Blocks/CountryProfileDetail/{CountryTabPane.js → CountryTabPane.jsx} +11 -4
  42. package/src/components/manage/Blocks/CountryProfileDetail/CountryTabPane.test.jsx +1 -1
  43. package/src/components/manage/Blocks/CountryProfileDetail/{View.js → View.jsx} +20 -15
  44. package/src/components/manage/Blocks/CountryProfileDetail/View.test.jsx +134 -20
  45. package/src/components/manage/Blocks/CountryProfileDetail/index.js +0 -1
  46. package/src/components/manage/Blocks/DataConnectedEmbedBlock/index.js +0 -2
  47. package/src/components/manage/Blocks/ECDEIndicators/ECDEIndicatorsView.jsx +1 -1
  48. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentEdit.jsx +3 -3
  49. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.jsx +2 -2
  50. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.test.jsx +1 -1
  51. package/src/components/manage/Blocks/FlourishEmbedBlock/FlourishEmbedBlockEdit.jsx +1 -1
  52. package/src/components/manage/Blocks/Listing/DropdownListingView.jsx +1 -1
  53. package/src/components/manage/Blocks/Listing/EventAccordionListingView.jsx +1 -1
  54. package/src/components/manage/Blocks/Listing/EventAccordionListingView.test.jsx +5 -3
  55. package/src/components/manage/Blocks/Listing/EventCardsListingView.jsx +2 -1
  56. package/src/components/manage/Blocks/Listing/EventCardsListingView.test.jsx +10 -4
  57. package/src/components/manage/Blocks/Listing/IndicatorCardsListingView.jsx +2 -2
  58. package/src/components/manage/Blocks/Listing/OrganisationCardsListingView.jsx +3 -1
  59. package/src/components/manage/Blocks/Listing/SimpleCardsListingView.jsx +1 -1
  60. package/src/components/manage/Blocks/Listing/SimpleCardsListingView.test.jsx +5 -3
  61. package/src/components/manage/Blocks/Listing/SimpleItemListingView.jsx +2 -2
  62. package/src/components/manage/Blocks/Listing/SimpleItemListingView.test.jsx +6 -4
  63. package/src/components/manage/Blocks/RASTBlock/ContextNavigation.jsx +0 -1
  64. package/src/components/manage/Blocks/RASTBlock/RASTAccordion.jsx +1 -1
  65. package/src/components/manage/Blocks/RASTBlock/RASTAccordion.test.jsx +1 -1
  66. package/src/components/manage/Blocks/RASTBlock/RASTAccordionContent.jsx +2 -2
  67. package/src/components/manage/Blocks/RASTBlock/RASTEdit.jsx +1 -1
  68. package/src/components/manage/Blocks/RASTBlock/RASTMap.jsx +1 -1
  69. package/src/components/manage/Blocks/RASTBlock/RASTMap.test.jsx +1 -1
  70. package/src/components/manage/Blocks/RASTBlock/RASTView.jsx +1 -1
  71. package/src/components/manage/Blocks/ReadMore/ReadMoreEdit.jsx +1 -1
  72. package/src/components/manage/Blocks/ReadMore/ReadMoreView.jsx +1 -1
  73. package/src/components/manage/Blocks/ReadMore/ReadMoreView.test.jsx +1 -1
  74. package/src/components/manage/Blocks/RedirectBlock/{RedirectBlock.test.js → RedirectBlock.test.jsx} +1 -1
  75. package/src/components/manage/Blocks/RedirectBlock/RedirectBlockEdit.jsx +2 -1
  76. package/src/components/manage/Blocks/RedirectBlock/RedirectBlockView.jsx +2 -2
  77. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentEdit.jsx +1 -1
  78. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.jsx +1 -1
  79. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.test.jsx +1 -1
  80. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentEdit.jsx +1 -1
  81. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.jsx +1 -1
  82. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.test.jsx +1 -1
  83. package/src/components/manage/Blocks/TabsBlock/Spotlight.jsx +2 -2
  84. package/src/components/manage/Blocks/TabsBlock/Spotlight.test.jsx +7 -1
  85. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectEdit.jsx +1 -1
  86. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.jsx +1 -1
  87. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.test.jsx +1 -1
  88. package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.jsx +5 -2
  89. package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.test.jsx +3 -6
  90. package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.jsx +1 -1
  91. package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.test.jsx +1 -1
  92. package/src/components/theme/ASTNavigation/ASTAccordion.test.jsx +1 -1
  93. package/src/components/theme/ASTNavigation/ASTLogoMap.jsx +1 -1
  94. package/src/components/theme/ASTNavigation/ASTLogoMap.test.jsx +1 -1
  95. package/src/components/theme/ASTNavigation/ASTNavigation.jsx +9 -5
  96. package/src/components/theme/ASTNavigation/ASTNavigation.test.jsx +323 -0
  97. package/src/components/theme/ASTNavigation/{utils.js → LinkWrap.jsx} +4 -9
  98. package/src/components/theme/ASTNavigation/UASTLogoMap.jsx +1 -1
  99. package/src/components/theme/ASTNavigation/UASTLogoMap.test.jsx +1 -1
  100. package/src/components/theme/Header/Header.jsx +5 -5
  101. package/src/components/theme/Header/LanguageSwitch.jsx +5 -5
  102. package/src/components/theme/MissionSignatoryProfile/MissionSignatoryProfileView.jsx +1 -1
  103. package/src/components/theme/TranslationDisclaimer/TranslationDisclaimer.jsx +1 -1
  104. package/src/components/theme/TranslationDisclaimer/TranslationInfo.jsx +1 -1
  105. package/src/components/theme/Views/AdaptationOptionView.jsx +1 -1
  106. package/src/components/theme/Views/AdaptationOptionView.test.jsx +5 -3
  107. package/src/components/theme/Views/ArchivedVersionListing.jsx +1 -1
  108. package/src/components/theme/Views/ArchivedVersionListing.test.jsx +2 -2
  109. package/src/components/theme/Views/ArchivedVersionNotice.jsx +1 -1
  110. package/src/components/theme/Views/ArchivedVersionNotice.test.jsx +1 -1
  111. package/src/components/theme/Views/BrokenLinks.jsx +1 -1
  112. package/src/components/theme/Views/BrokenLinks.test.jsx +1 -1
  113. package/src/components/theme/Views/CaseStudyView.test.jsx +1 -1
  114. package/src/components/theme/Views/DatabaseItemView.test.jsx +1 -1
  115. package/src/components/theme/Views/NewsItemView.jsx +1 -1
  116. package/src/components/theme/Views/ProjectView.test.jsx +1 -1
  117. package/src/components/theme/Views/VersionsGroup.jsx +1 -1
  118. package/src/components/theme/Views/VersionsGroup.test.jsx +1 -1
  119. package/src/components/theme/Widgets/GeocharsWidget.jsx +1 -1
  120. package/src/components/theme/Widgets/GeolocationWidget.jsx +1 -1
  121. package/src/components/theme/Widgets/GeolocationWidget.test.jsx +1 -1
  122. package/src/components/theme/Widgets/ImageWidget.jsx +29 -13
  123. package/src/components/theme/Widgets/ImageWidget.test.jsx +1 -1
  124. package/src/components/theme/Widgets/PromotionalImageWidget.jsx +6 -4
  125. package/src/components/theme/Widgets/utils.js +1 -1
  126. package/src/constants.js +539 -2
  127. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +1 -1
  128. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +52 -24
  129. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +1 -0
  130. package/src/customizations/@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground.jsx +2 -1
  131. package/src/customizations/@eeacms/volto-listing-block/blocks/Listing/item-templates/SimpleItemTemplates.jsx +2 -2
  132. package/src/customizations/@eeacms/volto-listing-block/components/UniversalCard/fragments/CardTitle.jsx +1 -1
  133. package/src/customizations/@plone/volto-slate/blocks/Table/TableBlockView.jsx +3 -3
  134. package/src/customizations/@plone/volto-slate/blocks/Text/{index.js → index.jsx} +2 -21
  135. package/src/customizations/@plone/volto-slate/editor/extensions/normalizeNode.js +1 -1
  136. package/src/customizations/@plone/volto-slate/utils/blocks.js +11 -8
  137. package/src/customizations/@plone/volto-slate/utils/volto-blocks.js +2 -2
  138. package/src/customizations/@plone/volto-slate/widgets/HtmlSlateWidget.jsx +2 -2
  139. package/src/customizations/@plone-collective/volto-authomatic/components/Login/Login.jsx +7 -4
  140. package/src/customizations/@plone-collective/volto-rss-provider/components/RSSFeedView.jsx +5 -8
  141. package/src/customizations/@plone-collective/volto-rss-provider/express-middleware.js +2 -1
  142. package/src/customizations/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +3 -3
  143. package/src/customizations/volto/components/manage/Blocks/Grid/templates.js +1 -1
  144. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +1 -1
  145. package/src/customizations/volto/components/manage/Controlpanels/ContentTypeLayout.jsx +12 -14
  146. package/src/customizations/volto/components/manage/Display/Display.jsx +10 -5
  147. package/src/customizations/volto/components/manage/Multilingual/TranslationObject.jsx +7 -6
  148. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +4 -1
  149. package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +12 -8
  150. package/src/customizations/volto/components/theme/App/App.jsx +16 -23
  151. package/src/customizations/volto/components/theme/Sitemap/Sitemap.jsx +3 -2
  152. package/src/customizations/volto/components/theme/View/DefaultView.jsx +5 -4
  153. package/src/customizations/volto/components/theme/View/LinkView.jsx +2 -2
  154. package/src/customizations/volto/components/theme/View/View.jsx +10 -11
  155. package/src/customizations/volto/helpers/Url/Url-old.js +2 -1
  156. package/src/customizations/volto/middleware/api.js +6 -4
  157. package/src/customizations/volto/reducers/actions/actions.js +2 -5
  158. package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +3 -6
  159. package/src/customizations/volto/reducers/navigation/navigation.js +3 -6
  160. package/src/customizations/volto/server.jsx +9 -8
  161. package/src/express-middleware.js +1 -1
  162. package/src/helpers/ContentMetadata.jsx +4 -4
  163. package/src/helpers/Utils.jsx +5 -5
  164. package/src/helpers/index.js +1 -8
  165. package/src/hocs/index.js +2 -0
  166. package/src/index.js +9 -7
  167. package/src/search/common.js +4 -41
  168. package/src/search/utils.test.js +1 -1
  169. package/src/search/vocabulary.js +2 -2
  170. package/src/store/reducers/physical-breadcrumbs.js +2 -2
  171. package/src/utils.js +1 -1
  172. package/src/helpers/Constants.jsx +0 -535
  173. package/theme/assets/images/administrative_support_service.png +0 -0
  174. /package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerEdit.js → CaseStudyExplorerEdit.jsx} +0 -0
  175. /package/src/components/manage/Blocks/CountryMapHeatIndex/{Edit.js → Edit.jsx} +0 -0
  176. /package/src/components/manage/Blocks/CountryMapProfile/{Edit.js → Edit.jsx} +0 -0
  177. /package/src/components/manage/Blocks/CountryProfileDetail/{Edit.js → Edit.jsx} +0 -0
  178. /package/src/components/manage/Blocks/ReadMore/{schema.js → schema.jsx} +0 -0
  179. /package/src/helpers/{clientOnly.js → clientOnly.jsx} +0 -0
  180. /package/src/{components/manage/Blocks/withResponsiveContainer.js → hocs/withResponsiveContainer.jsx} +0 -0
  181. /package/src/{components/manage/Blocks → hocs}/withVisibilitySensor.jsx +0 -0
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { SidebarPortal } from '@plone/volto/components';
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 C3SIndicatorsListingBlockView from './C3SIndicatorsListingBlockView';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { UniversalLink } from '@plone/volto/components';
2
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
3
3
 
4
4
  export default function C3SIndicatorsListingBlockView(props) {
5
5
  const { metadata, properties, mode = 'view' } = props;
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import C3SIndicatorsListingBlockView from './C3SIndicatorsListingBlockView';
8
8
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { SidebarPortal } from '@plone/volto/components';
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 C3SIndicatorsOverviewBlockView from './C3SIndicatorsOverviewBlockView';
@@ -1,23 +1,3 @@
1
- // const fields = ['category'];
2
- //
3
- // category: {
4
- // title: 'Category',
5
- // type: 'string',
6
- // factory: 'Choice',
7
- // choices: [
8
- // ['health', 'Health'],
9
- // ['agriculture', 'Agriculture'],
10
- // ['forestry', 'Forestry'],
11
- // ['energy', 'Energy'],
12
- // ['tourism', 'Tourism'],
13
- // ['water-and-coastal', 'Water and Coastal'],
14
- // ],
15
- // default: 'health',
16
- // description: 'Choose indicators category to be used as filter.',
17
- // required: true,
18
- // noValueOption: false,
19
- // },
20
-
21
1
  const schema = {
22
2
  title: 'C3S Indicators Overview',
23
3
 
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import CaseStudyExplorerEdit from './CaseStudyExplorerEdit';
8
8
  import { useCases } from './hooks';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Grid } from 'semantic-ui-react'; // Dropdown,
3
- import { addAppURL } from '@plone/volto/helpers';
3
+ import { addAppURL } from '@plone/volto/helpers/Url/Url';
4
4
 
5
5
  import CaseStudyMap from './CaseStudyMap';
6
6
  import CaseStudyFilters from './CaseStudyFilters';
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import CaseStudyExplorerView from './CaseStudyExplorerView';
8
8
  import { useCases } from './hooks';
@@ -22,7 +22,7 @@ jest.mock('./utils', () => ({
22
22
  getFilters: jest.fn(),
23
23
  }));
24
24
 
25
- jest.mock('@plone/volto/helpers', () => ({
25
+ jest.mock('@plone/volto/helpers/Url/Url', () => ({
26
26
  addAppURL: jest.fn((url) => url),
27
27
  }));
28
28
 
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import CaseStudyFilters from './CaseStudyFilters';
8
8
 
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import CaseStudyMap from './CaseStudyMap';
8
8
  import * as utils from './utils';
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FormattedMessage } from 'react-intl';
3
3
  import { Icon } from 'semantic-ui-react';
4
+ import Image from '@plone/volto/components/theme/Image/Image';
4
5
 
5
6
  export default function FeatureDisplay({ feature, onClose }) {
6
7
  return feature ? (
@@ -30,7 +31,7 @@ export default function FeatureDisplay({ feature, onClose }) {
30
31
  {feature.image && (
31
32
  <span className="img">
32
33
  <center>
33
- <img src={feature.image} alt={feature.title} />
34
+ <Image src={feature.image} alt={feature.title} />
34
35
  </center>
35
36
  </span>
36
37
  )}
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import FeatureDisplay from './FeatureDisplay';
8
8
 
@@ -100,10 +100,6 @@
100
100
  margin-right: 5px;
101
101
  background-color: #005c96 !important;
102
102
  background-color: #bbb;
103
-
104
- // &.light-blue {
105
- // background-color: #00ffff !important;
106
- // }
107
103
  }
108
104
  }
109
105
  }
@@ -23,7 +23,6 @@ export function getFeatures(cases, ol) {
23
23
  },
24
24
  false,
25
25
  );
26
- //return new Feature({ labelPoint: point, index: index });
27
26
  return point;
28
27
  });
29
28
  }
@@ -45,35 +44,16 @@ export function filterCases(cases, activeFilters) {
45
44
  impacts: false,
46
45
  };
47
46
 
48
- // activeFilters.sectors.forEach((filter) => {
49
- // if (_case.properties.sectors.includes(',' + filter + ','))
50
- // flag.sectors = true;
51
- // });
52
47
  flag.sectors = activeFilters.sectors.every((sub) =>
53
48
  _case.properties.sectors.includes(sub),
54
49
  );
55
-
56
- // ADAPTATION APPROACHES
57
- // activeFilters.elements.forEach((filter) => {
58
- // if (_case.properties.elements.includes(',' + filter + ','))
59
- // flag.elements = true;
60
- // });
61
50
  flag.elements = activeFilters.elements.every((sub) =>
62
51
  _case.properties.elements.includes(sub),
63
52
  );
64
53
 
65
- // activeFilters.impacts.forEach((filter) => {
66
- // if (_case.properties.impacts.includes(',' + filter + ','))
67
- // flag.impacts = true;
68
- // });
69
54
  flag.impacts = activeFilters.impacts.every((sub) =>
70
55
  _case.properties.impacts.includes(sub),
71
56
  );
72
-
73
- // activeFilters.measures.forEach((filter) => {
74
- // if (_case.properties.ktms.includes(',' + filter + ','))
75
- // flag.measures = true;
76
- // });
77
57
  flag.measures = activeFilters.measures.every((sub) =>
78
58
  _case.properties.ktms.includes(sub),
79
59
  );
@@ -121,16 +101,6 @@ export function getFilters(cases) {
121
101
  _filters.elements[elementKeys[i + 1]] = elementNames[i];
122
102
  }
123
103
  }
124
-
125
- // let ktmKeys = _case.properties.ktms.split(',');
126
- // let ktmNames = _case.properties.impacts_str.split(',');
127
- // for (let i = 0; i < ktmKeys.length; i++) {
128
- // if (!_filters.ktms.hasOwnProperty(ktmKeys[i])) {
129
- // _filters.ktms[ktmKeys[i]] = 1;
130
- // }
131
- // }
132
104
  }
133
- // console.log('getFilters:', _filters);
134
-
135
105
  return _filters;
136
106
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SidebarPortal } from '@plone/volto/components';
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 './CollectionStatsView';
@@ -3,8 +3,9 @@ import { useSelector, useDispatch } from 'react-redux';
3
3
  import { useLocation } from 'react-router-dom';
4
4
  import { getQueryStats } from '@eeacms/volto-cca-policy/store';
5
5
  import { getBaseUrl as getBase } from '@eeacms/volto-cca-policy/utils';
6
- import { getBaseUrl } from '@plone/volto/helpers';
7
- import { Icon, UniversalLink } from '@plone/volto/components';
6
+ import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
7
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
8
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
8
9
  import { Icon as UiIcon } from 'semantic-ui-react';
9
10
  import config from '@plone/volto/registry';
10
11
  import { useIntl } from 'react-intl';
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import CollectionStatsView from './CollectionStatsView';
8
8
  import config from '@plone/volto/registry';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { SidebarPortal } from '@plone/volto/components';
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 schema from './schema';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { List } from 'semantic-ui-react';
3
3
  import { Link, useLocation } from 'react-router-dom';
4
- import { flattenToAppURL } from '@plone/volto/helpers';
4
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
5
5
  import config from '@plone/volto/registry';
6
6
  import cx from 'classnames';
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 renderer from 'react-test-renderer';
5
- import '@testing-library/jest-dom/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import ContentLinksView from './ContentLinksView';
8
8
  import config from '@plone/volto/registry';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Link } from 'react-router-dom';
3
3
  import { Dropdown } from 'semantic-ui-react';
4
4
  import { useIntl, defineMessages } from 'react-intl';
5
- import { flattenToAppURL } from '@plone/volto/helpers';
5
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
6
6
 
7
7
  const messages = defineMessages({
8
8
  select: {
@@ -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 renderer from 'react-test-renderer';
5
- import '@testing-library/jest-dom/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import DropdownListView from './DropdownListView';
8
8
  import config from '@plone/volto/registry';
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import Filter from './Filter';
8
8
 
@@ -3,7 +3,7 @@ import { compose } from 'redux';
3
3
  import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
4
4
 
5
5
  import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
6
- import { openlayers as ol } from '@eeacms/volto-openlayers-map';
6
+ import { withOpenLayers } from '@eeacms/volto-openlayers-map';
7
7
  import {
8
8
  euCountryNames as euCountryNamesRaw,
9
9
  tooltipStyle,
@@ -11,16 +11,17 @@ import {
11
11
  adjustEuCountryNames,
12
12
  } from '@eeacms/volto-cca-policy/helpers/country_map/countryMap';
13
13
  import { withGeoJsonData } from '@eeacms/volto-cca-policy/helpers/country_map/hocs';
14
-
15
- import withResponsiveContainer from '../withResponsiveContainer';
16
- import withVisibilitySensor from '../withVisibilitySensor';
14
+ import {
15
+ withResponsiveContainer,
16
+ withVisibilitySensor,
17
+ } from '@eeacms/volto-cca-policy/hocs';
17
18
  import { makeStyles } from './mapstyle';
18
19
  import { Interactions } from './Interactions';
19
20
 
20
21
  import Filter from './Filter';
21
22
  import { Grid } from 'semantic-ui-react';
22
23
  import { useCountriesMetadata } from './hooks';
23
- import { addAppURL } from '@plone/volto/helpers';
24
+ import { addAppURL } from '@plone/volto/helpers/Url/Url';
24
25
 
25
26
  import './styles.less';
26
27
 
@@ -28,13 +29,15 @@ import './styles.less';
28
29
  // 'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/2021/4326/20M/cntrg.json';
29
30
 
30
31
  const View = (props) => {
31
- const { geofeatures, projection } = props;
32
+ const { geofeatures, projection, ol } = props;
32
33
 
33
34
  const highlight = React.useRef();
34
35
  const [stateHighlight, setStateHighlight] = React.useState();
35
36
 
36
- // eslint-disable-next-line react-hooks/exhaustive-deps
37
- const styles = React.useMemo(() => makeStyles(highlight), [stateHighlight]);
37
+ const styles = React.useMemo(
38
+ () => makeStyles(highlight, ol),
39
+ [stateHighlight, ol], // eslint-disable-line react-hooks/exhaustive-deps
40
+ );
38
41
  const tooltipRef = React.useRef();
39
42
  const [tileWMSSources, setTileWMSSources] = React.useState();
40
43
  const [euCountriesSource, setEuCountriessource] = React.useState();
@@ -124,7 +127,7 @@ const View = (props) => {
124
127
 
125
128
  const euSource = new ol.source.Vector({ features: filtered });
126
129
  setEuCountriessource(euSource);
127
- }, [geofeatures, countries_metadata, thematicMapMode, euCountryNames]);
130
+ }, [geofeatures, countries_metadata, thematicMapMode, euCountryNames, ol]);
128
131
 
129
132
  return (
130
133
  <div>
@@ -186,8 +189,9 @@ const View = (props) => {
186
189
  };
187
190
 
188
191
  export default compose(
189
- withGeoJsonData(),
190
192
  clientOnly,
193
+ withGeoJsonData(),
191
194
  withResponsiveContainer('countryMapHeatIndex'),
192
195
  withVisibilitySensor(),
196
+ withOpenLayers,
193
197
  )(View);
@@ -1,5 +1,3 @@
1
- import { openlayers as ol } from '@eeacms/volto-openlayers-map';
2
-
3
1
  // const flagRenderer = ({ stroke, fill }) => (pixelCoordinates, state) => {
4
2
  // const context = state.context;
5
3
  // const geometry = state.geometry.clone();
@@ -29,7 +27,7 @@ import { openlayers as ol } from '@eeacms/volto-openlayers-map';
29
27
  // context.restore();
30
28
  // };
31
29
 
32
- export const makeStyles = (highlight) => {
30
+ export const makeStyles = (highlight, ol) => {
33
31
  const stroke = new ol.style.Stroke({
34
32
  // color: 'rgba(255,255,255,0.8)',
35
33
  color: '#d1d1d1',
@@ -1,4 +1,5 @@
1
- import { BlockDataForm, SidebarPortal } from '@plone/volto/components';
1
+ import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
2
+ import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
2
3
  import CountryMapObservatoryView from './CountryMapObservatoryOLView';
3
4
  import Schema from './schema';
4
5
 
@@ -12,9 +12,10 @@ import {
12
12
  getImageUrl,
13
13
  } from '@eeacms/volto-cca-policy/helpers/country_map/countryMap';
14
14
  import { withGeoJsonData } from '@eeacms/volto-cca-policy/helpers/country_map/hocs';
15
-
16
- import withResponsiveContainer from '../withResponsiveContainer';
17
- import withVisibilitySensor from '../withVisibilitySensor';
15
+ import {
16
+ withResponsiveContainer,
17
+ withVisibilitySensor,
18
+ } from '@eeacms/volto-cca-policy/hocs';
18
19
  import { makeStyles } from './mapstyle';
19
20
  import { Interactions } from './Interactions';
20
21
 
@@ -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/extend-expect';
5
+ import '@testing-library/jest-dom';
6
6
  import { Provider } from 'react-intl-redux';
7
7
  import Filter from './Filter';
8
8
 
@@ -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 withResponsiveContainer from '../withResponsiveContainer';
19
- import withVisibilitySensor from '../withVisibilitySensor';
20
- import { addAppURL } from '@plone/volto/helpers';
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">
@@ -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 dangerouslySetInnerHTML={{ __html: element.value }}></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
- // return <table>{_html_value}</table>;
62
- return <div dangerouslySetInnerHTML={{ __html: _html_value }}></div>;
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/extend-expect';
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
- // const dataJson = JSON.parse(
10
- // props?.properties['@components']?.countryprofile?.html,
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
- ></CountryTabPane>
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['_' + index] || false}
56
- onClick={(e) => {
57
- const temp = JSON.parse(JSON.stringify(activePanes));
58
- let val = temp['_' + index] || false;
59
- temp['_' + index] = !val;
60
- setActivePanes(temp);
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['_' + index] || false}
70
+ active={activePanes[`_${index}`] || false}
68
71
  dangerouslySetInnerHTML={{ __html: accordion.value }}
69
- ></Accordion.Content>
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}