@eeacms/volto-cca-policy 1.0.6 → 1.0.7
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 +23 -0
- package/locales/bg/LC_MESSAGES/volto.po +63 -63
- package/locales/cs/LC_MESSAGES/volto.po +63 -63
- package/locales/da/LC_MESSAGES/volto.po +63 -63
- package/locales/de/LC_MESSAGES/volto.po +63 -63
- package/locales/el/LC_MESSAGES/volto.po +63 -63
- package/locales/en/LC_MESSAGES/volto.po +63 -63
- package/locales/es/LC_MESSAGES/volto.po +63 -63
- package/locales/et/LC_MESSAGES/volto.po +63 -63
- package/locales/fi/LC_MESSAGES/volto.po +63 -63
- package/locales/fr/LC_MESSAGES/volto.po +63 -63
- package/locales/ga/LC_MESSAGES/volto.po +63 -63
- package/locales/hr/LC_MESSAGES/volto.po +63 -63
- package/locales/hu/LC_MESSAGES/volto.po +63 -63
- package/locales/is/LC_MESSAGES/volto.po +63 -63
- package/locales/it/LC_MESSAGES/volto.po +63 -63
- package/locales/lt/LC_MESSAGES/volto.po +63 -63
- package/locales/lv/LC_MESSAGES/volto.po +63 -63
- package/locales/mt/LC_MESSAGES/volto.po +63 -63
- package/locales/nl/LC_MESSAGES/volto.po +63 -63
- package/locales/nn/LC_MESSAGES/volto.po +63 -63
- package/locales/pl/LC_MESSAGES/volto.po +63 -63
- package/locales/pt/LC_MESSAGES/volto.po +63 -63
- package/locales/ro/LC_MESSAGES/volto.po +63 -63
- package/locales/sk/LC_MESSAGES/volto.po +63 -63
- package/locales/sl/LC_MESSAGES/volto.po +63 -63
- package/locales/sv/LC_MESSAGES/volto.po +63 -63
- package/locales/tr/LC_MESSAGES/volto.po +63 -63
- package/locales/volto.pot +64 -64
- package/package.json +2 -2
- package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.jsx +3 -2
- package/src/components/index.js +26 -10
- package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsEdit.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapHeatIndex/View.jsx +2 -2
- package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +2 -2
- package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +2 -2
- package/src/components/{theme → manage}/Widgets/GeolocationWidget.jsx +1 -1
- package/src/components/{theme → manage}/Widgets/GeolocationWidget.test.jsx +1 -1
- package/src/components/{theme → manage}/Widgets/ImageWidget.jsx +2 -2
- package/src/components/manage/Widgets/ImageWidget.test.jsx +187 -0
- package/src/components/{theme → manage}/Widgets/PromotionalImageWidget.test.jsx +9 -3
- package/src/components/theme/Content/Fields/BooleanField.jsx +7 -0
- package/src/components/theme/Content/Fields/HTMLField.jsx +14 -0
- package/src/components/theme/Content/Fields/TextField.jsx +12 -0
- package/src/components/theme/Content/Fields/VocabularyField.jsx +26 -0
- package/src/components/theme/Content/Fields/index.js +4 -0
- package/src/components/theme/Content/Sections/ContentBannerTitle.jsx +26 -0
- package/src/{helpers → components/theme/Content/Sections}/ContentMetadata.jsx +11 -312
- package/src/components/theme/Content/Sections/ContentRelatedItems.jsx +35 -0
- package/src/components/theme/Content/Sections/DocumentsList.jsx +80 -0
- package/src/components/theme/Content/Sections/EventDetails.jsx +90 -0
- package/src/components/theme/Content/Sections/GeographicMetadata.jsx +83 -0
- package/src/components/theme/Content/Sections/ImageGallery/index.js +1 -0
- package/src/components/theme/Content/Sections/ItemLogo.jsx +29 -0
- package/src/components/theme/Content/Sections/LinkedMetadataItemList.jsx +63 -0
- package/src/components/theme/Content/Sections/LinksList.jsx +48 -0
- package/src/components/theme/Content/Sections/MetadataItemList.jsx +43 -0
- package/src/components/theme/Content/Sections/PublicationDateInfo.jsx +62 -0
- package/src/components/theme/Content/Sections/PublishedModifiedInfo.jsx +33 -0
- package/src/components/theme/Content/Sections/ReferenceInfo.jsx +137 -0
- package/src/components/theme/Content/Sections/ShareInfoButton.jsx +24 -0
- package/src/components/theme/Content/Sections/SubjectTags.jsx +19 -0
- package/src/components/theme/Content/Sections/Versioning/index.js +3 -0
- package/src/components/theme/Content/Sections/geographicMetadataUtils.js +177 -0
- package/src/components/theme/Content/Sections/index.js +17 -0
- package/src/components/theme/Content/index.js +20 -0
- package/src/components/theme/Views/AdaptationOptionView.jsx +6 -8
- package/src/components/theme/Views/AdaptationOptionView.test.jsx +5 -8
- package/src/components/theme/Views/C3SIndicatorView.jsx +5 -5
- package/src/components/theme/Views/CaseStudyView.jsx +6 -8
- package/src/components/theme/Views/CcaEventView.jsx +4 -4
- package/src/components/theme/Views/DatabaseItemView.jsx +14 -18
- package/src/components/theme/Views/EventView.jsx +3 -3
- package/src/components/theme/Views/ExtendedToolView.jsx +6 -8
- package/src/components/theme/Views/ExtendedToolView.test.jsx +10 -16
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/MissionSignatoryProfileView.jsx +5 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/MissionSignatoryProfileView.test.jsx +2 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/ActionTab.jsx +1 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/ActionTab.test.jsx +3 -0
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/AssessmentTab.jsx +1 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/AssessmentTab.test.jsx +11 -1
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/GovernanceTab.jsx +1 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/PlanningTab.jsx +1 -2
- package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/PlanningTab.test.jsx +11 -1
- package/src/components/theme/Views/NewsItemView.jsx +5 -2
- package/src/components/theme/Views/ProjectView.jsx +4 -6
- package/src/constants.js +7 -0
- package/src/helpers/countryMap.js +1 -4
- package/src/helpers/embed.js +11 -0
- package/src/helpers/index.js +13 -101
- package/src/helpers/string.js +4 -0
- package/src/hocs/index.js +1 -0
- package/src/{helpers/clientOnly.jsx → hocs/withClientOnly.jsx} +1 -1
- package/src/index.js +3 -3
- package/src/search/queryUtils.js +64 -0
- package/src/components/theme/ShareInfoButton/ShareInfoButton.jsx +0 -26
- package/src/components/theme/Widgets/ImageWidget.test.jsx +0 -90
- package/src/helpers/Utils.jsx +0 -620
- /package/src/components/manage/{TransparentOverlay.jsx → Blocks/CollectionStatistics/TransparentOverlay.jsx} +0 -0
- /package/src/components/{theme → manage}/Widgets/GeocharsWidget.jsx +0 -0
- /package/src/components/{theme → manage}/Widgets/GeolocationWidgetMapContainer.jsx +0 -0
- /package/src/components/{theme → manage}/Widgets/PromotionalImageWidget.jsx +0 -0
- /package/src/components/{theme → manage}/Widgets/RASTWidgetView.jsx +0 -0
- /package/src/components/{theme → manage}/Widgets/__mocks__/GeolocationWidgetMapContainer.jsx +0 -0
- /package/src/components/{theme → manage}/Widgets/utils.js +0 -0
- /package/src/components/theme/{ImageGallery → Content/Sections/ImageGallery}/ImageGallery.jsx +0 -0
- /package/src/components/theme/{ImageGallery → Content/Sections/ImageGallery}/ImageGallery.test.jsx +0 -0
- /package/src/components/theme/{ImageGallery → Content/Sections/ImageGallery}/styles.less +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/ArchivedVersionListing.jsx +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/ArchivedVersionListing.test.jsx +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/ArchivedVersionNotice.jsx +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/ArchivedVersionNotice.test.jsx +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/VersionsGroup.jsx +0 -0
- /package/src/components/theme/{Views → Content/Sections/Versioning}/VersionsGroup.test.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/ItemsSection.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/ItemsSection.test.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/NoDataReported.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/NoDataReported.test.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/StatisticSection.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/StatisticSection.test.jsx +0 -0
- /package/src/components/theme/{MissionSignatoryProfile → Views/MissionSignatoryProfile}/TabSections/GovernanceTab.test.jsx +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { OBSERVATORY_PARTNERS } from '@eeacms/volto-cca-policy/constants';
|
|
2
|
+
|
|
3
|
+
const addFilterParams = (params, filters) => {
|
|
4
|
+
filters.forEach((f, i) => {
|
|
5
|
+
params.set(`filters[${i}][field]`, f.field);
|
|
6
|
+
params.set(`filters[${i}][type]`, f.type);
|
|
7
|
+
(f.values || []).forEach((val, vi) => {
|
|
8
|
+
params.set(`filters[${i}][values][${vi}]`, val);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const makeContributionsSearchQuery = ({ id } = {}) => {
|
|
14
|
+
const organisation = OBSERVATORY_PARTNERS?.[id];
|
|
15
|
+
const base = '/en/observatory/advanced-search';
|
|
16
|
+
|
|
17
|
+
// If partner is missing, fall back to base (or return null if you prefer)
|
|
18
|
+
if (!organisation) return `${base}?size=n_10_n`;
|
|
19
|
+
|
|
20
|
+
const params = new URLSearchParams();
|
|
21
|
+
params.set('size', 'n_10_n');
|
|
22
|
+
|
|
23
|
+
addFilterParams(params, [
|
|
24
|
+
{
|
|
25
|
+
field: 'cca_partner_contributors.keyword',
|
|
26
|
+
type: 'any',
|
|
27
|
+
values: [organisation],
|
|
28
|
+
},
|
|
29
|
+
{ field: 'issued.date', type: 'any', values: ['All time'] },
|
|
30
|
+
{ field: 'language', type: 'any', values: ['en'] },
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
params.set('sort-field', 'issued.date');
|
|
34
|
+
params.set('sort-direction', 'desc');
|
|
35
|
+
|
|
36
|
+
return `${base}?${params.toString()}`;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const makeAdvancedSearchQuery = ({ field, value } = {}) => {
|
|
40
|
+
const base = '/en/data-and-downloads/';
|
|
41
|
+
const params = new URLSearchParams();
|
|
42
|
+
params.set('size', 'n_10_n');
|
|
43
|
+
|
|
44
|
+
const filters = [
|
|
45
|
+
{ field: 'issued.date', values: ['All time'], type: 'any' },
|
|
46
|
+
{ field: 'language', values: ['en'], type: 'any' },
|
|
47
|
+
// { field: 'objectProvides', values: [contentType], type: 'any' },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
if (field) {
|
|
51
|
+
filters.push({ field, values: [value], type: 'all' });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
addFilterParams(params, filters);
|
|
55
|
+
|
|
56
|
+
params.set('sort-field', 'issued.date');
|
|
57
|
+
params.set('sort-direction', 'desc');
|
|
58
|
+
|
|
59
|
+
if (!field) {
|
|
60
|
+
params.set('q', value ?? '');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return `${base}?${params.toString()}`;
|
|
64
|
+
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Link } from 'react-router-dom';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import { Button, Icon } from 'semantic-ui-react';
|
|
4
|
-
import { FormattedMessage } from 'react-intl';
|
|
5
|
-
|
|
6
|
-
const ShareInfoButton = (props) => {
|
|
7
|
-
const currentLang = useSelector((state) => state.intl.locale);
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<div className="share-info">
|
|
12
|
-
<Link to={`/${currentLang + '/help/share-your-info'}`}>
|
|
13
|
-
<Button icon primary labelPosition="left">
|
|
14
|
-
<FormattedMessage
|
|
15
|
-
id="Share your information"
|
|
16
|
-
defaultMessage="Share your information"
|
|
17
|
-
/>
|
|
18
|
-
<Icon className="ri-share-line" />
|
|
19
|
-
</Button>
|
|
20
|
-
</Link>
|
|
21
|
-
</div>
|
|
22
|
-
</>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default ShareInfoButton;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MemoryRouter } from 'react-router-dom';
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
import '@testing-library/jest-dom';
|
|
5
|
-
import { Provider } from 'react-intl-redux';
|
|
6
|
-
import configureStore from 'redux-mock-store';
|
|
7
|
-
|
|
8
|
-
import ImageWidget from './ImageWidget';
|
|
9
|
-
|
|
10
|
-
global.__SERVER__ = false;
|
|
11
|
-
|
|
12
|
-
// mock Dropzone (avoids drag/drop complexity)
|
|
13
|
-
jest.mock(
|
|
14
|
-
'react-dropzone',
|
|
15
|
-
() => (props) =>
|
|
16
|
-
props.children({
|
|
17
|
-
getRootProps: () => ({}),
|
|
18
|
-
getInputProps: () => ({}),
|
|
19
|
-
}),
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
// mock loadable
|
|
23
|
-
jest.mock('@loadable/component', () => (importFn) => {
|
|
24
|
-
const Component = (props) => {
|
|
25
|
-
const Loaded = require('react-dropzone');
|
|
26
|
-
return <Loaded {...props} />;
|
|
27
|
-
};
|
|
28
|
-
return Component;
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const mockStore = configureStore();
|
|
32
|
-
|
|
33
|
-
describe('ImageUploadWidget', () => {
|
|
34
|
-
it('renders empty state', () => {
|
|
35
|
-
const store = mockStore({
|
|
36
|
-
intl: {
|
|
37
|
-
locale: 'en',
|
|
38
|
-
messages: {},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const props = {
|
|
43
|
-
id: 'image',
|
|
44
|
-
title: 'Image',
|
|
45
|
-
value: null,
|
|
46
|
-
onChange: jest.fn(),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const { container } = render(
|
|
50
|
-
<Provider store={store}>
|
|
51
|
-
<MemoryRouter>
|
|
52
|
-
<ImageWidget {...props} />
|
|
53
|
-
</MemoryRouter>
|
|
54
|
-
</Provider>,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
expect(container).toBeTruthy();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('renders with image value', () => {
|
|
61
|
-
const store = mockStore({
|
|
62
|
-
intl: {
|
|
63
|
-
locale: 'en',
|
|
64
|
-
messages: {},
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const props = {
|
|
69
|
-
id: 'image',
|
|
70
|
-
title: 'Image',
|
|
71
|
-
value: {
|
|
72
|
-
data: 'fakebase64',
|
|
73
|
-
encoding: 'base64',
|
|
74
|
-
'content-type': 'image/png',
|
|
75
|
-
filename: 'test.png',
|
|
76
|
-
},
|
|
77
|
-
onChange: jest.fn(),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const { getByText } = render(
|
|
81
|
-
<Provider store={store}>
|
|
82
|
-
<MemoryRouter>
|
|
83
|
-
<ImageWidget {...props} />
|
|
84
|
-
</MemoryRouter>
|
|
85
|
-
</Provider>,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
expect(getByText('test.png')).toBeInTheDocument();
|
|
89
|
-
});
|
|
90
|
-
});
|