@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,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/extend-expect';
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('should render the component', () => {
13
- const properties = {
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: '{"menu":[],"content":[],"html":"","updated":"","message_top":"", "top_accordeon":""}',
57
+ html: {
58
+ menu: [],
59
+ content: [],
60
+ },
17
61
  },
18
62
  },
19
- };
20
- const data = { properties: properties };
21
-
22
- const store = mockStore({
23
- userSession: { token: '1234' },
24
- intl: {
25
- locale: 'en',
26
- messages: {},
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
- const { container } = render(
31
- <Provider store={store}>
32
- <MemoryRouter>
33
- <View {...data} />
34
- </MemoryRouter>
35
- </Provider>,
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 { SidebarPortal } from '@plone/volto/components';
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/helpers';
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/helpers';
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/extend-expect';
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 { SidebarPortal } from '@plone/volto/components';
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 { ConditionalLink } from '@plone/volto/components';
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('@plone/volto/components', () => ({
11
- ConditionalLink: ({ children }) => <div>{children}</div>,
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 { ConditionalLink, UniversalLink } from '@plone/volto/components';
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('@plone/volto/components', () => ({
12
- ConditionalLink: ({ children }) => <div>{children}</div>,
13
- UniversalLink: ({ children }) => <button>{children}</button>,
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 { ConditionalLink } from '@plone/volto/components';
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
- <img
23
+ <Image
22
24
  src={item['@id'] + '/@@images/logo/preview'}
23
25
  alt={item.title}
24
26
  className="ui image"
@@ -6,7 +6,7 @@ import {
6
6
  CardHeader,
7
7
  CardContent,
8
8
  } from 'semantic-ui-react';
9
- import { ConditionalLink } from '@plone/volto/components';
9
+ import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
10
10
 
11
11
  import './styles.less';
12
12
 
@@ -8,9 +8,11 @@ import SimpleCardsListingView from './SimpleCardsListingView';
8
8
 
9
9
  const mockStore = configureStore();
10
10
 
11
- jest.mock('@plone/volto/components', () => ({
12
- ConditionalLink: ({ children }) => <div>{children}</div>,
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 { ConditionalLink } from '@plone/volto/components';
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('@plone/volto/components', () => ({
12
- ConditionalLink: ({ children }) => <div>{children}</div>,
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
 
@@ -51,5 +51,4 @@ export function ContextNavigationComponent(props) {
51
51
  );
52
52
  }
53
53
 
54
- // withContentNavigation
55
54
  export default compose()(ContextNavigationComponent);
@@ -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 { Icon } from '@plone/volto/components';
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/extend-expect';
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 { 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 RASTView from './RASTView';
@@ -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
  import cx from 'classnames';
4
4
  import './styles.less';
5
5
 
@@ -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 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();
@@ -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 BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
4
4
  import ReadMoreView from './ReadMoreView';
5
5
  import schema from './schema';
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useState, useEffect } from 'react';
2
2
  import { Button, Icon } from 'semantic-ui-react';
3
- import { BodyClass } from '@plone/volto/helpers';
3
+ import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
4
4
  import cx from 'classnames';
5
5
 
6
6
  import './style.less';
@@ -1,4 +1,4 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import '@testing-library/jest-dom';
2
2
  import { render, screen, fireEvent } from '@testing-library/react';
3
3
  import ReadMoreView from './ReadMoreView';
4
4
 
@@ -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 { RedirectBlockDetails } from './RedirectBlockView';
8
8
 
@@ -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 { RedirectBlockDetails } from './RedirectBlockView';
3
4
  import Schema from './schema';
4
5
 
@@ -1,7 +1,7 @@
1
- import { UniversalLink } from '@plone/volto/components';
1
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
2
2
  import React from 'react';
3
3
  import { useHistory } from 'react-router-dom';
4
- import { flattenToAppURL } from '@plone/volto/helpers';
4
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
5
5
 
6
6
  export function RedirectBlockDetails({ data, token }) {
7
7
  return token ? (
@@ -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, ListItem, ListContent, ListIcon } from 'semantic-ui-react';
3
3
  import { Link } from 'react-router-dom';
4
- import { flattenToAppURL } from '@plone/volto/helpers';
4
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
5
5
 
6
6
  const RelevantAceContentView = (props) => {
7
7
  const { data, mode = 'view' } = props;
@@ -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/extend-expect';
6
+ import '@testing-library/jest-dom';
7
7
  import { Provider } from 'react-intl-redux';
8
8
  import RelevantAceContentView from './RelevantAceContentView';
9
9
 
@@ -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,6 +1,6 @@
1
1
  import { List, Icon, ListItem, ListContent, ListIcon } from 'semantic-ui-react';
2
2
  import { Link } from 'react-router-dom';
3
- import { flattenToAppURL } from '@plone/volto/helpers';
3
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
4
4
  import { useIntl, FormattedMessage } from 'react-intl';
5
5
 
6
6
  export default function SearchAceContentView(props) {
@@ -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/extend-expect';
6
+ import '@testing-library/jest-dom';
7
7
  import { Provider } from 'react-intl-redux';
8
8
  import SearchAceContentView from './SearchAceContentView';
9
9
 
@@ -3,14 +3,14 @@ import { compose } from 'redux';
3
3
  import { withRouter } from 'react-router';
4
4
  import cx from 'classnames';
5
5
  import { Menu, Tab, Container, Icon, Image } from 'semantic-ui-react';
6
- import { RenderBlocks } from '@plone/volto/components';
6
+ import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
7
7
  import { withScrollToTarget } from '@eeacms/volto-tabs-block/hocs';
8
8
  import {
9
9
  SimpleMarkdown,
10
10
  getMenuPosition,
11
11
  } from '@eeacms/volto-tabs-block/utils';
12
12
 
13
- import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
13
+ import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers/Url/Url';
14
14
 
15
15
  import '@eeacms/volto-tabs-block/less/menu.less';
16
16
  import './spotlight.less';
@@ -1,4 +1,4 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import '@testing-library/jest-dom';
2
2
 
3
3
  import { render } from '@testing-library/react';
4
4
  import React from 'react';
@@ -8,6 +8,12 @@ import { Provider } from 'react-intl-redux';
8
8
 
9
9
  import Spotlight from './Spotlight';
10
10
 
11
+ jest.mock('@eeacms/volto-tabs-block/hocs', () => ({
12
+ withScrollToTarget: (WrappedComponent) => (props) => (
13
+ <WrappedComponent {...props} scrollToTarget={jest.fn()} />
14
+ ),
15
+ }));
16
+
11
17
  const mockStore = configureStore();
12
18
 
13
19
  describe('Filter', () => {