@eeacms/volto-marine-policy 2.0.2 → 2.0.4

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 (40) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/jest-addon.config.js +4 -4
  3. package/package.json +9 -8
  4. package/src/components/Blocks/DemoSitesExplorer/DemoSitesExplorerEdit.js +5 -0
  5. package/src/components/Blocks/DemoSitesExplorer/DemoSitesExplorerView.js +115 -0
  6. package/src/components/Blocks/DemoSitesExplorer/DemoSitesFilters.jsx +406 -0
  7. package/src/components/Blocks/DemoSitesExplorer/DemoSitesFilters.test.jsxZ +91 -0
  8. package/src/components/Blocks/DemoSitesExplorer/DemoSitesListing.jsx +383 -0
  9. package/src/components/Blocks/DemoSitesExplorer/DemoSitesMap.jsx +230 -0
  10. package/src/components/Blocks/DemoSitesExplorer/FeatureDisplay.jsx +97 -0
  11. package/src/components/Blocks/DemoSitesExplorer/FeatureDisplay.test.jsxZ +48 -0
  12. package/src/components/Blocks/DemoSitesExplorer/FeatureInteraction.jsx +95 -0
  13. package/src/components/Blocks/DemoSitesExplorer/InfoOverlay.jsx +79 -0
  14. package/src/components/Blocks/DemoSitesExplorer/hooks.js +20 -0
  15. package/src/components/Blocks/DemoSitesExplorer/images/icon-depth.png +0 -0
  16. package/src/components/Blocks/DemoSitesExplorer/images/icon-light.png +0 -0
  17. package/src/components/Blocks/DemoSitesExplorer/images/search.svg +3 -0
  18. package/src/components/Blocks/DemoSitesExplorer/index.js +16 -0
  19. package/src/components/Blocks/DemoSitesExplorer/mockJsdom.js +8 -0
  20. package/src/components/Blocks/DemoSitesExplorer/styles.less +376 -0
  21. package/src/components/Blocks/DemoSitesExplorer/utils.js +193 -0
  22. package/src/components/Blocks/DemoSitesExplorer/utils.test.jsZ +63 -0
  23. package/src/components/index.js +1 -0
  24. package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +0 -1
  25. package/src/express-middleware.js +37 -0
  26. package/src/index.js +13 -12
  27. package/theme/extras/print.less +64 -0
  28. package/theme/globals/site.overrides +11 -6
  29. package/theme/globals/site.variables +1 -0
  30. package/src/components/Blocks/ContextNavigation/Accordion.jsx +0 -85
  31. package/src/components/Blocks/ContextNavigation/Accordion.test.jsx +0 -106
  32. package/src/components/Blocks/ContextNavigation/AccordionContent.jsx +0 -66
  33. package/src/components/Blocks/ContextNavigation/ContextNavigation.jsx +0 -41
  34. package/src/components/Blocks/ContextNavigation/Edit.jsx +0 -41
  35. package/src/components/Blocks/ContextNavigation/Edit.test.jsx +0 -71
  36. package/src/components/Blocks/ContextNavigation/View.jsx +0 -42
  37. package/src/components/Blocks/ContextNavigation/View.test.jsx +0 -71
  38. package/src/components/Blocks/ContextNavigation/index.js +0 -25
  39. package/src/components/Blocks/ContextNavigation/schema.js +0 -43
  40. package/src/components/Blocks/ContextNavigation/styles.less +0 -65
@@ -1,71 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import ContextNavigationView from './View';
4
- import { Router } from 'react-router-dom';
5
- import { Provider } from 'react-intl-redux';
6
- import configureStore from 'redux-mock-store';
7
- import { createMemoryHistory } from 'history';
8
- import '@testing-library/jest-dom/extend-expect';
9
-
10
- const mockStore = configureStore();
11
-
12
- const store = mockStore({
13
- userSession: { token: '1234' },
14
- intl: {
15
- locale: 'en',
16
- messages: {},
17
- },
18
- content: {
19
- subrequests: {},
20
- },
21
- types: {
22
- types: {},
23
- },
24
- });
25
-
26
- jest.mock(
27
- '@eeacms/volto-marine-policy/components/Blocks/ContextNavigation/ContextNavigation',
28
- () => {
29
- return {
30
- __esModule: true,
31
- default: ({ params }) => {
32
- return <div>ContextNavigation {params}</div>;
33
- },
34
- };
35
- },
36
- );
37
-
38
- describe('ContextNavigationView', () => {
39
- let history;
40
- beforeEach(() => {
41
- history = createMemoryHistory();
42
- });
43
-
44
- it('renders corectly', () => {
45
- const { container } = render(
46
- <Provider store={store}>
47
- <Router history={history}>
48
- <ContextNavigationView />
49
- </Router>
50
- </Provider>,
51
- );
52
-
53
- expect(container.firstChild).toHaveTextContent('ContextNavigation');
54
- });
55
-
56
- it('renders corectly', () => {
57
- const { container } = render(
58
- <Provider store={store}>
59
- <Router history={history}>
60
- <ContextNavigationView
61
- data={{
62
- navProps: { root_path: 'https://localhost:3000/test' },
63
- root_node: [{ '@id': 'root_node' }],
64
- }}
65
- />
66
- </Router>
67
- </Provider>,
68
- );
69
- expect(container.firstChild).toHaveTextContent('ContextNavigation');
70
- });
71
- });
@@ -1,25 +0,0 @@
1
- import zoomSVG from '@plone/volto/icons/zoom.svg';
2
- import Edit from './Edit';
3
- import View from './View';
4
-
5
- export default function installBlock(config) {
6
- const blocksConfig = config.blocks.blocksConfig;
7
-
8
- blocksConfig.contextNavigation = {
9
- id: 'contextNavigation',
10
- title: 'Context Navigation',
11
- icon: zoomSVG,
12
- group: 'site',
13
- view: View,
14
- edit: Edit,
15
- sidebarTab: 1,
16
- security: {
17
- addPermission: [],
18
- view: [],
19
- },
20
- variations: [],
21
- restricted: false,
22
- };
23
-
24
- return config;
25
- }
@@ -1,43 +0,0 @@
1
- const fields = ['root_path', 'title', 'types'];
2
-
3
- const schema = ({ contentTypes }) => {
4
- const availableTypes = contentTypes.map((type) => [
5
- type.id,
6
- type.title || type.name,
7
- ]);
8
- return {
9
- title: 'RAST',
10
-
11
- fieldsets: [
12
- {
13
- id: 'default',
14
- title: 'Default',
15
- fields,
16
- },
17
- ],
18
-
19
- properties: {
20
- root_path: {
21
- title: 'Rooth path',
22
- type: 'string',
23
- description:
24
- 'Ex: /en/knowledge-and-data/regional-adaptation-support-tool',
25
- required: true,
26
- noValueOption: false,
27
- },
28
- title: {
29
- title: 'Title',
30
- },
31
- types: {
32
- title: 'Display content types',
33
- description: 'Choose content types displayed as children',
34
- choices: availableTypes,
35
- isMulti: true,
36
- },
37
- },
38
-
39
- required: [],
40
- };
41
- };
42
-
43
- export default schema;
@@ -1,65 +0,0 @@
1
- @type: 'extra';
2
- @element: 'custom';
3
-
4
- @import (multiple, reference, optional) '../../theme.config';
5
-
6
- .rast-block {
7
- a rect.circle:hover {
8
- fill: #183 !important;
9
- }
10
-
11
- .ui.accordion[class*='ary'] > .active.title,
12
- .ui.accordion[class*='ary'].inverted > .title,
13
- .ui.accordion[class*='ary'].inverted > .icon,
14
- .ui.accordion[class*='ary'] > .filter {
15
- --text-color-secondary: #ffffff;
16
- --text-color-hover: #0079cf;
17
- --text-color: #0079cf;
18
- border-bottom: 0.0625rem solid #e6e7e8;
19
- font-weight: bold;
20
- }
21
-
22
- .ui.accordion[class*='ary'] > .title,
23
- .ui.accordion[class*='ary'].inverted > .title,
24
- .ui.accordion[class*='ary'].inverted > .icon,
25
- .ui.accordion[class*='ary'] > .filter {
26
- color: var(--text-color);
27
- font-weight: bold;
28
-
29
- .icon {
30
- color: var(--text-color);
31
- }
32
- }
33
-
34
- .ui.accordion .content.active {
35
- --bg-color: #ffffff;
36
- border-bottom: 0.0625rem solid #e6e7e8;
37
-
38
- .item > .content {
39
- &:hover {
40
- background: #f9f9f9;
41
-
42
- a {
43
- color: var(--text-color-hover, #0079cf);
44
- }
45
- }
46
- }
47
-
48
- a {
49
- color: var(--text-color);
50
- }
51
- }
52
-
53
- a rect.circle {
54
- pointer-events: all !important;
55
- }
56
-
57
- svg,
58
- svg * {
59
- pointer-events: none;
60
- }
61
-
62
- .item.active a {
63
- font-weight: bold;
64
- }
65
- }