@eeacms/volto-cca-policy 0.1.49 → 0.1.51
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/CHANGELOG.md +22 -0
- package/package.json +1 -1
- package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/styles.css +0 -2
- package/src/components/manage/Blocks/RASTBlock/ContextNavigation.jsx +44 -0
- package/src/components/manage/Blocks/RASTBlock/RASTAccordion.jsx +79 -0
- package/src/components/manage/Blocks/RASTBlock/RASTAccordion.test.jsx +42 -0
- package/src/components/manage/Blocks/RASTBlock/RASTAccordionContent.jsx +44 -0
- package/src/components/manage/Blocks/RASTBlock/RASTMap.jsx +371 -0
- package/src/components/manage/Blocks/RASTBlock/RASTView.jsx +21 -346
- package/src/components/manage/Blocks/RASTBlock/schema.js +8 -30
- package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.test.jsx +44 -0
- package/src/components/theme/Views/AdaptationOptionView.jsx +1 -1
- package/src/components/theme/Views/AdaptationOptionView.test.jsx +53 -0
- package/src/components/theme/Views/CaseStudyView.jsx +1 -1
- package/src/components/theme/Views/CaseStudyView.test.jsx +42 -0
- package/src/components/theme/Views/CcaEventView.jsx +1 -1
- package/src/components/theme/Views/GuidanceView.test.jsx +41 -0
- package/src/components/theme/Views/IndicatorView.test.jsx +41 -0
- package/src/components/theme/Views/InformationPortalView.test.jsx +41 -0
- package/src/components/theme/Views/OrganisationView.test.jsx +41 -0
- package/src/components/theme/Views/ProjectView.test.jsx +41 -0
- package/src/components/theme/Views/PublicationReportView.test.jsx +41 -0
- package/src/components/theme/Views/ToolView.test.jsx +41 -0
- package/src/components/theme/Views/VideoView.test.jsx +41 -0
- package/src/helpers/Utils.jsx +1 -1
|
@@ -8,7 +8,7 @@ function CcaEventView(props) {
|
|
|
8
8
|
const {
|
|
9
9
|
blocks: { blocksConfig },
|
|
10
10
|
} = config;
|
|
11
|
-
const TitleBlockView = blocksConfig
|
|
11
|
+
const TitleBlockView = blocksConfig?.title?.view;
|
|
12
12
|
const { content } = props;
|
|
13
13
|
// cca_files: [content.agenda_file]}
|
|
14
14
|
if (content.agenda_file) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import GuidanceView from './GuidanceView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('GuidanceView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My GuidanceView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<GuidanceView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import IndicatorView from './IndicatorView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('IndicatorView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My IndicatorView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<IndicatorView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import InformationPortalView from './InformationPortalView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('InformationPortalView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My InformationPortalView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<InformationPortalView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import OrganisationView from './OrganisationView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('OrganisationView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My OrganisationView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<OrganisationView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import ProjectView from './ProjectView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('ProjectView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My ProjectView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<ProjectView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import PublicationReportView from './PublicationReportView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('PublicationReportView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My PublicationReportView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<PublicationReportView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import ToolView from './ToolView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('ToolView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My ToolView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<ToolView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
+
import configureStore from 'redux-mock-store';
|
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
5
|
+
import { Provider } from 'react-intl-redux';
|
|
6
|
+
import VideoView from './ToolView';
|
|
7
|
+
import renderer from 'react-test-renderer';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
jest.mock('semantic-ui-react', () => ({
|
|
12
|
+
...jest.requireActual('semantic-ui-react'),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('VideoView', () => {
|
|
16
|
+
it('should render the component', () => {
|
|
17
|
+
const content = {
|
|
18
|
+
title: 'My VideoView',
|
|
19
|
+
geochars:
|
|
20
|
+
'{\r\n "geoElements":{"element":"GLOBAL",\r\n "macrotrans":null,"biotrans":null,"countries":[],\r\n "subnational":[],"city":""}}',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const store = mockStore({
|
|
24
|
+
userSession: { token: '1234' },
|
|
25
|
+
intl: {
|
|
26
|
+
locale: 'en',
|
|
27
|
+
messages: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const component = renderer.create(
|
|
32
|
+
<Provider store={store}>
|
|
33
|
+
<MemoryRouter>
|
|
34
|
+
<VideoView content={content} />
|
|
35
|
+
</MemoryRouter>
|
|
36
|
+
</Provider>,
|
|
37
|
+
);
|
|
38
|
+
const json = component.toJSON();
|
|
39
|
+
expect(json).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|