@eeacms/volto-clms-theme 1.0.63 → 1.0.67
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 +148 -3
- package/jest-addon.config.js +5 -0
- package/package.json +20 -17
- package/src/actions/datasets_by_uid/datasets_by_uid.test.js +14 -0
- package/src/actions/downloadtool/downloadtool.test.js +54 -0
- package/src/actions/downloadtool/get_downloadtool.js +22 -1
- package/src/actions/extra_breadcrumbs/extra_breadcrumb.test.js +16 -0
- package/src/actions/format_conversion_table/format_conversion_table.test.js +16 -0
- package/src/actions/geonetwork/import_geonetwork.test.js +15 -0
- package/src/actions/index.js +2 -0
- package/src/actions/meeting/meeting.test.js +41 -0
- package/src/actions/newsletter/get_newsletter_subscribers.test.js +14 -0
- package/src/actions/projections/get_projections.test.js +13 -0
- package/src/actions/registry/registry.test.js +15 -0
- package/src/actions/subscription/post_subscription.js +0 -3
- package/src/actions/subscription/post_subscription.test.js +64 -0
- package/src/actions/tokens/tokens.test.js +39 -0
- package/src/actions/userschema/userschema.test.js +14 -0
- package/src/components/Blocks/CclButtonBlock/CclButtonBlockEdit.test.jsx +123 -0
- package/src/components/Blocks/CclButtonBlock/CclButtonBlockView.jsx +8 -11
- package/src/components/Blocks/CclButtonBlock/CclButtonBlockView.test.jsx +42 -0
- package/src/components/Blocks/CclButtonBlock/__snapshots__/CclButtonBlockEdit.test.jsx.snap +27 -0
- package/src/components/Blocks/CclButtonBlock/__snapshots__/CclButtonBlockView.test.jsx.snap +56 -0
- package/src/components/Blocks/CclCardBlock/CclCardBlockEdit.jsx +8 -8
- package/src/components/Blocks/CclCardBlock/CclCardBlockEdit.test.jsx +159 -0
- package/src/components/Blocks/CclCardBlock/CclCardBlockView.test.jsx +61 -0
- package/src/components/Blocks/CclCardBlock/__snapshots__/CclCardBlockEdit.test.jsx.snap +45 -0
- package/src/components/Blocks/CclCardContainerBlock/CclCardContainerBlockEdit.jsx +8 -12
- package/src/components/Blocks/CclCardContainerBlock/CclCardContainerBlockView.jsx +3 -3
- package/src/components/Blocks/CclContextNavigationBlock/CclContextNavigationBlockEdit.test.jsx +42 -0
- package/src/components/Blocks/CclContextNavigationBlock/CclContextNavigationBlockView.test.jsx +42 -0
- package/src/components/Blocks/CclContextNavigationBlock/__snapshots__/CclContextNavigationBlockEdit.test.jsx.snap +12 -0
- package/src/components/Blocks/CclContextNavigationBlock/__snapshots__/CclContextNavigationBlockView.test.jsx.snap +3 -0
- package/src/components/Blocks/CclHomeBgImageBlock/CclHomeImageEditor.jsx +43 -41
- package/src/components/Blocks/CclHomeProductsBlock/CclHomeProductsBlockView.test.jsx +54 -0
- package/src/components/Blocks/CclHomeProductsBlock/__snapshots__/CclHomeProductsBlockView.test.jsx.snap +57 -0
- package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockEdit.jsx +9 -10
- package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockView.jsx +28 -9
- package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockView.test.jsx +113 -0
- package/src/components/Blocks/CclHomeSearchBlock/__snapshots__/CclHomeSearchBlockView.test.jsx.snap +310 -0
- package/src/components/Blocks/CclHomeUsersBlock/CclHomeUserBlockView.test.jsx +61 -0
- package/src/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockEdit.jsx +180 -146
- package/src/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockView.jsx +8 -1
- package/src/components/Blocks/CclHomeUsersBlock/HomeUsersSchema.js +0 -1
- package/src/components/Blocks/CclRelatedListingBlock/CclRelatedListingEdit.jsx +4 -6
- package/src/components/Blocks/CclRelatedListingBlock/CclRelatedListingView.jsx +26 -23
- package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselEdit.jsx +4 -10
- package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselView.jsx +2 -6
- package/src/components/Blocks/CclUseCaseList/CclUseCaseListEdit.jsx +16 -13
- package/src/components/Blocks/CclUseCaseList/CclUseCaseListView.jsx +17 -19
- package/src/components/Blocks/CclUseCaseList/utils.js +1 -1
- package/src/components/Blocks/CustomTemplates/VoltoArcgisBlock/CclMapMenu.jsx +2 -2
- package/src/components/Blocks/CustomTemplates/VoltoFormBlock/customIdFieldSchema.js +2 -2
- package/src/components/Blocks/CustomTemplates/VoltoListingBlock/CclListingCards.jsx +0 -3
- package/src/components/Blocks/CustomTemplates/VoltoListingBlock/CclListingCards.test.jsx +247 -0
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionFacet.jsx +82 -0
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/RightModalFacets.jsx +37 -31
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/WithType.jsx +8 -0
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/index.js +3 -3
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx +17 -48
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx +11 -55
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx +17 -17
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalTabsView.jsx +24 -15
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/RoutingHOC.jsx +18 -48
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/TabsWidget.jsx +11 -8
- package/src/components/Blocks/customBlocks.js +57 -155
- package/src/components/Blocks/{CclCardContainerBlock/utils.js → utils.js} +0 -0
- package/src/components/CLMSDatasetDetailView/BoundingBoxComponent.test.jsx +27 -0
- package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.jsx +14 -21
- package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.test.jsx +194 -0
- package/src/components/CLMSDatasetDetailView/ContactComponent.test.jsx +34 -0
- package/src/components/CLMSDatasetDetailView/DataSetInfoContent.jsx +155 -101
- package/src/components/CLMSDatasetDetailView/DataSetInfoContent.test.jsx +63 -0
- package/src/components/CLMSDatasetDetailView/DistributionInfoComponent.test.jsx +24 -0
- package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.jsx +1 -13
- package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.test.jsx +136 -0
- package/src/components/CLMSDatasetDetailView/index.js +0 -1
- package/src/components/CLMSDownloadCartView/CLMSCartContent.jsx +202 -144
- package/src/components/CLMSDownloadCartView/CLMSCartContent.test.jsx +5 -0
- package/src/components/CLMSDownloadCartView/CLMSDownloadCartView.jsx +39 -45
- package/src/components/CLMSDownloadCartView/CLMSDownloadCartView.test.jsx +5 -0
- package/src/components/CLMSDownloadCartView/cartUtils.js +9 -7
- package/src/components/CLMSDownloadCartView/cartUtils.test.js +5 -0
- package/src/components/CLMSDownloadCartView/conversion.js +1 -2
- package/src/components/CLMSDownloadCartView/conversion.test.js +5 -0
- package/src/components/CLMSDownloadableFileView/CLMSDownloadableFile.test.jsx +5 -0
- package/src/components/CLMSDownloadableFileView/CLMSDownloadableFileView.jsx +10 -1
- package/src/components/CLMSDownloadsView/CLMSDownloadTasks.jsx +196 -0
- package/src/components/CLMSDownloadsView/CLMSDownloadTasks.test.jsx +5 -0
- package/src/components/CLMSDownloadsView/CLMSDownloadsView.jsx +141 -0
- package/src/components/CLMSDownloadsView/CLMSDownloadsView.test.jsx +5 -0
- package/src/components/CLMSDownloadsView/FileCard.jsx +231 -0
- package/src/components/CLMSDownloadsView/FileCard.test.jsx +5 -0
- package/src/components/CLMSDownloadsView/filecard.less +21 -0
- package/src/components/CLMSMapViewerView/CLMSMapViewerView.jsx +3 -3
- package/src/components/CLMSMapViewerView/CLMSMapViewerView.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingEmailView.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingEmailsView.jsx +6 -5
- package/src/components/CLMSMeetingView/CLMSMeetingEmailsView.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingSubscriberVew.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingSubscriberView.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingSubscribersView.test.jsx +5 -0
- package/src/components/CLMSMeetingView/CLMSMeetingView.jsx +49 -36
- package/src/components/CLMSNewsItemView/CLMSNewsItemView.test.jsx +44 -0
- package/src/components/CLMSProfileView/CLMSApiTokensView.test.jsx +5 -0
- package/src/components/CLMSProfileView/CLMSNewsletterSubscriberView.test.jsx +5 -0
- package/src/components/CLMSProfileView/CLMSProfileView.jsx +6 -3
- package/src/components/CLMSProfileView/CLMSProfileView.test.jsx +5 -0
- package/src/components/CLMSProfileView/CLMSUserProfileView.test.jsx +5 -0
- package/src/components/CLMSSubscriptionView/ConfirmSubscriptionView.jsx +18 -12
- package/src/components/CLMSSubscriptionView/ConfirmSubscriptionView.test.jsx +5 -0
- package/src/components/CLMSSubscriptionView/SubscriptionView.jsx +33 -33
- package/src/components/CLMSSubscriptionView/SubscriptionView.test.jsx +5 -0
- package/src/components/CLMSSubscriptionView/subscription_utils.test.js +5 -0
- package/src/components/CclButton/CclButton.jsx +4 -3
- package/src/components/CclButton/CclButton.test.js +76 -0
- package/src/components/CclCard/CclCard.jsx +5 -34
- package/src/components/CclCard/CclCard.test.jsx +133 -0
- package/src/components/CclCitation/CclCitation.test.jsx +11 -0
- package/src/components/CclCitation/__snapshots__/CclCitation.test.jsx.snap +14 -0
- package/src/components/CclDownloadTable/CclDownloadTable.jsx +145 -40
- package/src/components/CclDownloadTable/CclDownloadTable.test.jsx +5 -0
- package/src/components/CclDownloadTable/download-table.less +14 -1
- package/src/components/CclDownloadTable/modkData.test.js +5 -0
- package/src/components/CclExpandableFilter/CclExpandableFilter.test.jsx +60 -0
- package/src/components/CclFiltersModal/CclFiltersModal.test.jsx +5 -0
- package/src/components/CclFooterColumn/CclFooterColumn.test.jsx +5 -0
- package/src/components/CclInfoDescription/CclInfoContainer.test.js +16 -0
- package/src/components/CclInfoDescription/CclInfoDescription.test.js +18 -0
- package/src/components/CclLanguageSelector/CclLanguageSelector.jsx +80 -109
- package/src/components/CclLanguageSelector/CclLanguageSelector.test.jsx +117 -0
- package/src/components/CclLanguageSelector/__snapshots__/CclLanguageSelector.test.jsx.snap +43 -0
- package/src/components/CclLoginModal/CclLoginModal.jsx +3 -1
- package/src/components/CclLoginModal/CclLoginModal.test.jsx +5 -0
- package/src/components/CclModal/CclModal.test.js +71 -0
- package/src/components/CclTab/CclTab.jsx +8 -3
- package/src/components/CclTab/CclTab.test.jsx +55 -0
- package/src/components/CclTab/CclTabs.jsx +10 -11
- package/src/components/CclTab/CclTabs.test.jsx +5 -0
- package/src/components/CclTopMainMenu/CclFooterMenu.jsx +4 -4
- package/src/components/CclTopMainMenu/CclFooterMenu.test.jsx +5 -0
- package/src/components/CclTopMainMenu/CclTopMainMenu.jsx +6 -6
- package/src/components/CclTopMainMenu/CclTopMainMenu.test.jsx +5 -0
- package/src/components/CclTopMainMenu/multilingualPath.js +1 -3
- package/src/components/CclTopMainMenu/multilingualPath.test.js +5 -0
- package/src/components/CclUtils/StringToHTML.test.jsx +5 -0
- package/src/components/CclVerticalFilterMenu/CclVerticalFilterMenu.jsx +2 -2
- package/src/components/CclVerticalFilterMenu/CclVerticalFilterMenu.test.jsx +30 -0
- package/src/components/Widgets/BoundingWidget.test.jsx +5 -0
- package/src/components/Widgets/ContactWidget.test.jsx +5 -0
- package/src/components/Widgets/DistributionInfoWidget.test.jsx +5 -0
- package/src/components/Widgets/DownloadableFilesWidget.test.jsx +5 -0
- package/src/components/Widgets/GeonetworkIdentifiersWidget.test.jsx +5 -0
- package/src/components/Widgets/MapLayersWidget.jsx +8 -1
- package/src/components/Widgets/MapLayersWidget.test.jsx +5 -0
- package/src/components/Widgets/TextLinkWidget.test.jsx +5 -0
- package/src/customizations/volto/components/manage/Toolbar/Toolbar.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Footer/Footer.jsx +58 -34
- package/src/customizations/volto/components/theme/Footer/Footer.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Header/Header.jsx +57 -71
- package/src/customizations/volto/components/theme/Header/Header.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Logo/Logo.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Logout/Logout.jsx +74 -0
- package/src/customizations/volto/components/theme/Logout/Logout.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Navigation/ContextNavigation.test.jsx +5 -0
- package/src/customizations/volto/components/theme/Navigation/Navigation.test.jsx +5 -0
- package/src/customizations/volto/components/theme/SearchWidget/SerachWidget.test.jsx +5 -0
- package/src/index.js +9 -5
- package/src/reducers/datasets_by_uid/datasets_by_uid.test.js +53 -0
- package/src/reducers/downloadtool/downloadtool_reducer.js +34 -66
- package/src/reducers/downloadtool/downloadtool_reducer.test.js +340 -0
- package/src/reducers/downloadtool/nutsnames_reducer.js +45 -0
- package/src/reducers/downloadtool/nutsnames_reducer.test.js +61 -0
- package/src/reducers/extra_breadcrumbs/extra_breadcrumb_reducer.js +21 -1
- package/src/reducers/extra_breadcrumbs/extra_breadcrumb_reducer.test.js +51 -0
- package/src/reducers/geonetwork/import_geonetwork_reducer.test.js +60 -0
- package/src/reducers/index.js +4 -4
- package/src/reducers/meeting/meeting_register_reducer.test.js +82 -0
- package/src/reducers/meeting/meeting_subscribers_reducer.js +4 -2
- package/src/reducers/meeting/meeting_subscribers_reducer.test.js +149 -0
- package/src/reducers/newsletter/get_newsletter_reducer.test.js +75 -0
- package/src/reducers/registry/registry.test.js +74 -0
- package/src/reducers/subscription/subscription_reducer.test.js +71 -0
- package/src/reducers/tokens/tokens.test.js +221 -0
- package/src/reducers/userschema/userschema.js +1 -1
- package/src/reducers/userschema/userschema.test.js +63 -0
- package/theme/clms/css/carousel.css +1 -1
- package/theme/clms/css/header.css +4 -0
- package/theme/clms/css/home.css +4 -4
- package/theme/clms/css/styles.less +17 -4
- package/src/components/Blocks/CclHomeUsersBlock/utils.js +0 -27
- package/src/components/Blocks/CclProductLeftMenu/CclProductLeftMenuEdit.jsx +0 -124
- package/src/components/Blocks/CclProductLeftMenu/CclProductLeftMenuView.jsx +0 -48
- package/src/components/Blocks/CclProductLeftMenu/LeftMenuSchema.js +0 -78
- package/src/components/Blocks/CclProductLeftMenu/utils.js +0 -25
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionCheckboxFacet.jsx +0 -56
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionLabelFacet.jsx +0 -58
- package/src/components/CLMSDatasetDetailView/MetadataContent.jsx +0 -255
- package/src/components/CLMSDownloadCartView/CLMSTasksInProgress.jsx +0 -238
- package/src/components/CLMSEventView/CLMSEventView.jsx +0 -53
- package/src/components/CclTable/CclTable.jsx +0 -95
- package/src/components/CclTable/table.less +0 -42
- package/src/i18n.js +0 -183
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccordionFacet,
|
|
3
|
+
RightModalFacets,
|
|
4
|
+
WithType,
|
|
5
|
+
} from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoSearchBlock';
|
|
1
6
|
import {
|
|
2
7
|
CclCarouselView,
|
|
3
8
|
CclProductTabsView,
|
|
@@ -39,26 +44,20 @@ import CclHomeSearchBlockView from '@eeacms/volto-clms-theme/components/Blocks/C
|
|
|
39
44
|
import CclHomeUsersBlockEdit from '@eeacms/volto-clms-theme/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockEdit';
|
|
40
45
|
import CclHomeUsersBlockView from '@eeacms/volto-clms-theme/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockView';
|
|
41
46
|
import CclMapMenu from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoArcgisBlock/CclMapMenu';
|
|
42
|
-
import CclProductLeftMenuEdit from '@eeacms/volto-clms-theme/components/Blocks/CclProductLeftMenu/CclProductLeftMenuEdit';
|
|
43
|
-
import CclProductLeftMenuView from '@eeacms/volto-clms-theme/components/Blocks/CclProductLeftMenu/CclProductLeftMenuView';
|
|
44
47
|
import CclRelatedListingEdit from '@eeacms/volto-clms-theme/components/Blocks/CclRelatedListingBlock/CclRelatedListingEdit';
|
|
45
48
|
import CclRelatedListingView from '@eeacms/volto-clms-theme/components/Blocks/CclRelatedListingBlock/CclRelatedListingView';
|
|
46
49
|
import CclUseCaseListEdit from '@eeacms/volto-clms-theme/components/Blocks/CclUseCaseList/CclUseCaseListEdit';
|
|
47
50
|
import CclUseCaseListView from '@eeacms/volto-clms-theme/components/Blocks/CclUseCaseList/CclUseCaseListView';
|
|
48
51
|
import CclWhiteBgView from '@eeacms/volto-clms-theme/components/Blocks/CclHomeBgImageBlock/CclWhiteBgView';
|
|
49
|
-
import RightModalFacets from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoSearchBlock/RightModalFacets';
|
|
50
|
-
import customIdFieldSchema from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoFormBlock/customIdFieldSchema';
|
|
51
|
-
import AccordionCheckboxFacet from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionCheckboxFacet';
|
|
52
|
-
import AccordionLabelFacet from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionLabelFacet';
|
|
53
52
|
import RelatedListingSchema from '@eeacms/volto-clms-theme/components/Blocks/CclRelatedListingBlock/schema';
|
|
54
53
|
import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants';
|
|
55
54
|
import TextLinkCarouselEdit from '@eeacms/volto-clms-theme/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselEdit';
|
|
56
55
|
import TextLinkCarouselView from '@eeacms/volto-clms-theme/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselView';
|
|
57
56
|
import cardSVG from '@plone/volto/icons/indent.svg';
|
|
58
57
|
import containerSVG from '@plone/volto/icons/apps.svg';
|
|
58
|
+
import customIdFieldSchema from '@eeacms/volto-clms-theme/components/Blocks/CustomTemplates/VoltoFormBlock/customIdFieldSchema';
|
|
59
59
|
import downSVG from '@plone/volto/icons/down-key.svg';
|
|
60
60
|
import homeBand from '@plone/volto/icons/image-wide.svg';
|
|
61
|
-
import leftMenuSVG from '@plone/volto/icons/nav.svg';
|
|
62
61
|
import linkSVG from '@plone/volto/icons/link.svg';
|
|
63
62
|
import navSVG from '@plone/volto/icons/nav.svg';
|
|
64
63
|
import upSVG from '@plone/volto/icons/up-key.svg';
|
|
@@ -74,6 +73,53 @@ export const customGroupBlocksOrder = [
|
|
|
74
73
|
},
|
|
75
74
|
];
|
|
76
75
|
|
|
76
|
+
function listingVariation(id, isDefault, title, template, isWO = false) {
|
|
77
|
+
return {
|
|
78
|
+
id: id,
|
|
79
|
+
isDefault: isDefault,
|
|
80
|
+
title: title,
|
|
81
|
+
template: VariationHOC(
|
|
82
|
+
isWO ? CclListingWorkOpportunities : CclListingCards,
|
|
83
|
+
template,
|
|
84
|
+
),
|
|
85
|
+
fullobjects: true,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const availableVariations = [
|
|
90
|
+
listingVariation('CclCardsdoc', true, 'Line list', 'doc'),
|
|
91
|
+
listingVariation('CclCardsline', false, 'Line list with Image', 'line'),
|
|
92
|
+
listingVariation(
|
|
93
|
+
'CclCardsline-color',
|
|
94
|
+
false,
|
|
95
|
+
'Colored Line list with Image',
|
|
96
|
+
'line-color',
|
|
97
|
+
),
|
|
98
|
+
listingVariation('CclCardsblock', false, '2 Column Cards list', 'block'),
|
|
99
|
+
listingVariation(
|
|
100
|
+
'CclCardsthreeColumns',
|
|
101
|
+
false,
|
|
102
|
+
'3 Column Cards list',
|
|
103
|
+
'threeColumns',
|
|
104
|
+
),
|
|
105
|
+
listingVariation('CclCardsnews', false, 'News Line list', 'news'),
|
|
106
|
+
listingVariation('CclCardsevent', false, 'Events Line list', 'event'),
|
|
107
|
+
listingVariation(
|
|
108
|
+
'CclWOOpenTenders',
|
|
109
|
+
false,
|
|
110
|
+
'Open Work Opportunities',
|
|
111
|
+
'OpenTenders',
|
|
112
|
+
true,
|
|
113
|
+
),
|
|
114
|
+
listingVariation(
|
|
115
|
+
'CclWOCloseTenders',
|
|
116
|
+
false,
|
|
117
|
+
'Closed Work Opportunities',
|
|
118
|
+
'CloseTenders',
|
|
119
|
+
true,
|
|
120
|
+
),
|
|
121
|
+
];
|
|
122
|
+
|
|
77
123
|
const customBlocks = (config) => ({
|
|
78
124
|
...config.blocks.blocksConfig,
|
|
79
125
|
video: {
|
|
@@ -140,71 +186,7 @@ const customBlocks = (config) => ({
|
|
|
140
186
|
listing: {
|
|
141
187
|
...config.blocks.blocksConfig.listing,
|
|
142
188
|
showLinkMore: true,
|
|
143
|
-
variations:
|
|
144
|
-
{
|
|
145
|
-
id: 'CclCardsdoc',
|
|
146
|
-
isDefault: true,
|
|
147
|
-
title: 'Line list',
|
|
148
|
-
template: VariationHOC(CclListingCards, 'doc'),
|
|
149
|
-
fullobjects: true,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'CclCardsline',
|
|
153
|
-
isDefault: false,
|
|
154
|
-
title: 'Line list with Image',
|
|
155
|
-
template: VariationHOC(CclListingCards, 'line'),
|
|
156
|
-
fullobjects: true,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: 'CclCardsline-color',
|
|
160
|
-
isDefault: false,
|
|
161
|
-
title: 'Colored Line list with Image',
|
|
162
|
-
template: VariationHOC(CclListingCards, 'line-color'),
|
|
163
|
-
fullobjects: true,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
id: 'CclCardsblock',
|
|
167
|
-
isDefault: false,
|
|
168
|
-
title: '2 Column Cards list',
|
|
169
|
-
template: VariationHOC(CclListingCards, 'block'),
|
|
170
|
-
fullobjects: true,
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
id: 'CclCardsthreeColumns',
|
|
174
|
-
isDefault: false,
|
|
175
|
-
title: '3 Column Cards list',
|
|
176
|
-
template: VariationHOC(CclListingCards, 'threeColumns'),
|
|
177
|
-
fullobjects: true,
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: 'CclCardsnews',
|
|
181
|
-
isDefault: false,
|
|
182
|
-
title: 'News Line list',
|
|
183
|
-
template: VariationHOC(CclListingCards, 'news'),
|
|
184
|
-
fullobjects: true,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
id: 'CclCardsevent',
|
|
188
|
-
isDefault: false,
|
|
189
|
-
title: 'Events Line list',
|
|
190
|
-
template: VariationHOC(CclListingCards, 'event'),
|
|
191
|
-
fullobjects: true,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: 'CclWOOpenTenders',
|
|
195
|
-
isDefault: false,
|
|
196
|
-
title: 'Open Work Opportunities',
|
|
197
|
-
template: VariationHOC(CclListingWorkOpportunities, 'OpenTenders'),
|
|
198
|
-
fullobjects: true,
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
id: 'CclWOCloseTenders',
|
|
202
|
-
isDefault: false,
|
|
203
|
-
title: 'Closed Work Opportunities',
|
|
204
|
-
template: VariationHOC(CclListingWorkOpportunities, 'CloseTenders'),
|
|
205
|
-
fullobjects: true,
|
|
206
|
-
},
|
|
207
|
-
],
|
|
189
|
+
variations: availableVariations,
|
|
208
190
|
},
|
|
209
191
|
accordion: {
|
|
210
192
|
...config.blocks.blocksConfig.accordion,
|
|
@@ -246,22 +228,6 @@ const customBlocks = (config) => ({
|
|
|
246
228
|
view: [], // Future proof (not implemented yet) view user role(s)
|
|
247
229
|
},
|
|
248
230
|
},
|
|
249
|
-
productLeftMenu: {
|
|
250
|
-
id: 'productLeftMenu', // The name (id) of the block
|
|
251
|
-
title: 'Product Left Menu', // The display name of the block
|
|
252
|
-
icon: leftMenuSVG, // The icon used in the block chooser
|
|
253
|
-
group: 'ccl_blocks', // The group (blocks can be grouped, displayed in the chooser)
|
|
254
|
-
view: CclProductLeftMenuView, // The view mode component
|
|
255
|
-
edit: CclProductLeftMenuEdit, // The edit mode component
|
|
256
|
-
restricted: false, // If the block is restricted, it won't show in the chooser
|
|
257
|
-
mostUsed: false, // A meta group `most used`, appearing at the top of the chooser
|
|
258
|
-
blockHasOwnFocusManagement: false, // Set this to true if the block manages its own focus
|
|
259
|
-
sidebarTab: 1, // The sidebar tab you want to be selected when selecting the block
|
|
260
|
-
security: {
|
|
261
|
-
addPermission: [], // Future proof (not implemented yet) add user permission role(s)
|
|
262
|
-
view: [], // Future proof (not implemented yet) view user role(s)
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
231
|
useCaseList: {
|
|
266
232
|
id: 'useCaseList', // The name (id) of the block
|
|
267
233
|
title: 'UseCase List', // The display name of the block
|
|
@@ -295,71 +261,7 @@ const customBlocks = (config) => ({
|
|
|
295
261
|
addPermission: [], // Future proof (not implemented yet) add user permission role(s)
|
|
296
262
|
view: [], // Future proof (not implemented yet) view user role(s)
|
|
297
263
|
},
|
|
298
|
-
variations:
|
|
299
|
-
{
|
|
300
|
-
id: 'CclCardsdoc',
|
|
301
|
-
isDefault: true,
|
|
302
|
-
title: 'Line list',
|
|
303
|
-
template: VariationHOC(CclListingCards, 'doc'),
|
|
304
|
-
fullobjects: true,
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
id: 'CclCardsline',
|
|
308
|
-
isDefault: false,
|
|
309
|
-
title: 'Line list with Image',
|
|
310
|
-
template: VariationHOC(CclListingCards, 'line'),
|
|
311
|
-
fullobjects: true,
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
id: 'CclCardsline-color',
|
|
315
|
-
isDefault: false,
|
|
316
|
-
title: 'Colored Line list with Image',
|
|
317
|
-
template: VariationHOC(CclListingCards, 'line-color'),
|
|
318
|
-
fullobjects: true,
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
id: 'CclCardsblock',
|
|
322
|
-
isDefault: false,
|
|
323
|
-
title: '2 Column Cards list',
|
|
324
|
-
template: VariationHOC(CclListingCards, 'block'),
|
|
325
|
-
fullobjects: true,
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
id: 'CclCardsthreeColumns',
|
|
329
|
-
isDefault: false,
|
|
330
|
-
title: '3 Column Cards list',
|
|
331
|
-
template: VariationHOC(CclListingCards, 'threeColumns'),
|
|
332
|
-
fullobjects: true,
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
id: 'CclCardsnews',
|
|
336
|
-
isDefault: false,
|
|
337
|
-
title: 'News Line list',
|
|
338
|
-
template: VariationHOC(CclListingCards, 'news'),
|
|
339
|
-
fullobjects: true,
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
id: 'CclCardsevent',
|
|
343
|
-
isDefault: false,
|
|
344
|
-
title: 'Events Line list',
|
|
345
|
-
template: VariationHOC(CclListingCards, 'event'),
|
|
346
|
-
fullobjects: true,
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
id: 'CclWOOpenTenders',
|
|
350
|
-
isDefault: false,
|
|
351
|
-
title: 'Open Work Opportunities',
|
|
352
|
-
template: VariationHOC(CclListingWorkOpportunities, 'OpenTenders'),
|
|
353
|
-
fullobjects: true,
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
id: 'CclWOCloseTenders',
|
|
357
|
-
isDefault: false,
|
|
358
|
-
title: 'Closed Work Opportunities',
|
|
359
|
-
template: VariationHOC(CclListingWorkOpportunities, 'CloseTenders'),
|
|
360
|
-
fullobjects: true,
|
|
361
|
-
},
|
|
362
|
-
],
|
|
264
|
+
variations: availableVariations,
|
|
363
265
|
},
|
|
364
266
|
cardContainer: {
|
|
365
267
|
id: 'cardContainer', // The name (id) of the block
|
|
@@ -412,13 +314,13 @@ const customBlocks = (config) => ({
|
|
|
412
314
|
{
|
|
413
315
|
id: 'accordionCheckboxFacet',
|
|
414
316
|
title: 'Accordion Checkbox',
|
|
415
|
-
view:
|
|
317
|
+
view: WithType(AccordionFacet, 'checkbox'),
|
|
416
318
|
isDefault: true,
|
|
417
319
|
},
|
|
418
320
|
{
|
|
419
321
|
id: 'accordionLabelFacet',
|
|
420
322
|
title: 'Accordion Label',
|
|
421
|
-
view:
|
|
323
|
+
view: WithType(AccordionFacet, 'label'),
|
|
422
324
|
isDefault: false,
|
|
423
325
|
},
|
|
424
326
|
...config.blocks.blocksConfig.search.extensions.facetWidgets.types,
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BoundingBoxComponent from './BoundingBoxComponent';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
import Enzyme from 'enzyme';
|
|
6
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
7
|
+
import { mount } from 'enzyme';
|
|
8
|
+
Enzyme.configure({ adapter: new Adapter() });
|
|
9
|
+
|
|
10
|
+
//jest test for BoundingBoxComponent
|
|
11
|
+
describe('BoundingBoxComponent', () => {
|
|
12
|
+
//test for BoundingBoxComponent rendering
|
|
13
|
+
it('Check if BoundingBoxComponent is rendered', () => {
|
|
14
|
+
const boundingBox = {
|
|
15
|
+
west: -180,
|
|
16
|
+
east: 180,
|
|
17
|
+
north: 90,
|
|
18
|
+
south: -90,
|
|
19
|
+
};
|
|
20
|
+
const wrapper = mount(
|
|
21
|
+
<MemoryRouter>
|
|
22
|
+
<BoundingBoxComponent bbox={boundingBox} />
|
|
23
|
+
</MemoryRouter>,
|
|
24
|
+
);
|
|
25
|
+
expect(wrapper).toBeDefined();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import {
|
|
7
7
|
DataSetInfoContent,
|
|
8
8
|
DownloadDataSetContent,
|
|
9
|
-
MetadataContent,
|
|
10
9
|
} from '@eeacms/volto-clms-theme/components/CLMSDatasetDetailView';
|
|
11
10
|
import { Modal, Segment } from 'semantic-ui-react';
|
|
12
11
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -19,19 +18,10 @@ import React from 'react';
|
|
|
19
18
|
import { compose } from 'redux';
|
|
20
19
|
import { connect } from 'react-redux';
|
|
21
20
|
import { getUser } from '@plone/volto/actions';
|
|
22
|
-
import { injectIntl } from 'react-intl';
|
|
23
21
|
import jwtDecode from 'jwt-decode';
|
|
24
22
|
import { postImportGeonetwork } from '../../actions';
|
|
25
23
|
import { useLocation } from 'react-router-dom';
|
|
26
24
|
|
|
27
|
-
// import {
|
|
28
|
-
// mockDatabaseInfo,
|
|
29
|
-
// mockMetadata,
|
|
30
|
-
// mockDownloadDataset,
|
|
31
|
-
// } from './mockDatasetInfo';
|
|
32
|
-
// import CclCitation from '../CclCitation/CclCitation';
|
|
33
|
-
// import { CclInfoContainer, CclInfoDescription } from '../CclInfoDescription';
|
|
34
|
-
|
|
35
25
|
/**
|
|
36
26
|
* Full view component class.
|
|
37
27
|
* @function CLMSDatasetDetailView
|
|
@@ -45,8 +35,6 @@ const CLMSDatasetDetailView = ({ content, token }) => {
|
|
|
45
35
|
const geonetwork_importation = useSelector(
|
|
46
36
|
(state) => state.geonetwork_importation,
|
|
47
37
|
);
|
|
48
|
-
// const userSession = useSelector((state) => state.userSession);
|
|
49
|
-
// const user_token = userSession.token ? jwtDecode(userSession.token).sub : '';
|
|
50
38
|
const user = useSelector((state) => state.users?.user);
|
|
51
39
|
React.useEffect(() => {
|
|
52
40
|
dispatch(getUser(token));
|
|
@@ -192,13 +180,19 @@ const CLMSDatasetDetailView = ({ content, token }) => {
|
|
|
192
180
|
)}
|
|
193
181
|
<CclTabs routing={true}>
|
|
194
182
|
<div tabTitle="General Info">{DataSetInfoContent(content)}</div>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
183
|
+
{content?.downloadable_dataset &&
|
|
184
|
+
content?.downloadable_files?.items?.length > 0 && (
|
|
185
|
+
<div tabTitle="Download">{DownloadDataSetContent(content)}</div>
|
|
186
|
+
)}
|
|
187
|
+
{content?.downloadable_dataset &&
|
|
188
|
+
content?.downloadable_files?.items?.length === 0 && (
|
|
189
|
+
<div
|
|
190
|
+
tabTitle="Download"
|
|
191
|
+
redirect={`${location.pathname}/download-by-area`}
|
|
192
|
+
>
|
|
193
|
+
{''}
|
|
194
|
+
</div>
|
|
195
|
+
)}
|
|
202
196
|
|
|
203
197
|
<div underPanel={true}>
|
|
204
198
|
<nav className="left-menu-detail">
|
|
@@ -282,10 +276,9 @@ CLMSDatasetDetailView.propTypes = {
|
|
|
282
276
|
};
|
|
283
277
|
|
|
284
278
|
export default compose(
|
|
285
|
-
injectIntl,
|
|
286
279
|
connect((state) => ({
|
|
287
280
|
token: state.userSession.token
|
|
288
|
-
? jwtDecode(state.userSession.token)
|
|
281
|
+
? jwtDecode(state.userSession.token)?.sub
|
|
289
282
|
: '',
|
|
290
283
|
})),
|
|
291
284
|
)(CLMSDatasetDetailView);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderer from 'react-test-renderer';
|
|
3
|
+
import CLMSDatasetDetailView from './CLMSDatasetDetailView';
|
|
4
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
import { Provider } from 'react-redux';
|
|
7
|
+
import configureStore from 'redux-mock-store';
|
|
8
|
+
|
|
9
|
+
const mockStore = configureStore();
|
|
10
|
+
|
|
11
|
+
describe('CLMSDatasetDetailView', () => {
|
|
12
|
+
it('Check metadata view', () => {
|
|
13
|
+
const content = {
|
|
14
|
+
title: 'Test title!',
|
|
15
|
+
url: './example',
|
|
16
|
+
description: 'Description test',
|
|
17
|
+
download: true,
|
|
18
|
+
dataResourceTitle: 'example title',
|
|
19
|
+
dataResourceAbstract: {
|
|
20
|
+
data: 'exampledata',
|
|
21
|
+
},
|
|
22
|
+
dataSources: {
|
|
23
|
+
title: 'example title',
|
|
24
|
+
description: 'example description',
|
|
25
|
+
tooltip: 'example tooltip',
|
|
26
|
+
data: 'Source data',
|
|
27
|
+
},
|
|
28
|
+
dataResourceLocator: 'Resource locator',
|
|
29
|
+
image: {
|
|
30
|
+
src:
|
|
31
|
+
'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg',
|
|
32
|
+
alt: 'Placeholder',
|
|
33
|
+
},
|
|
34
|
+
downloadable_dataset: true,
|
|
35
|
+
downloadable_files: [
|
|
36
|
+
{
|
|
37
|
+
title: 'example title',
|
|
38
|
+
description: 'example description',
|
|
39
|
+
tooltip: 'example tooltip',
|
|
40
|
+
url: './example',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: 'example title',
|
|
44
|
+
description: 'example description',
|
|
45
|
+
tooltip: 'example tooltip',
|
|
46
|
+
url: './example',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
const store = mockStore({
|
|
51
|
+
content: {
|
|
52
|
+
...content,
|
|
53
|
+
},
|
|
54
|
+
intl: {
|
|
55
|
+
locale: 'en',
|
|
56
|
+
messages: {},
|
|
57
|
+
},
|
|
58
|
+
search: {
|
|
59
|
+
subrequest: {
|
|
60
|
+
'123': { items: [] },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
users: {
|
|
64
|
+
user: { roles: ['Manager'] },
|
|
65
|
+
},
|
|
66
|
+
userSession: {
|
|
67
|
+
token:
|
|
68
|
+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY0NDM4MzA0NCwiZnVsbG5hbWUiOm51bGx9.cB_q3Q0Jhu8h2m_SDmmknodpDxDLfb4o-qY6Y2plE04',
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const DatasetDetailView = renderer
|
|
73
|
+
.create(
|
|
74
|
+
<Provider store={store}>
|
|
75
|
+
<MemoryRouter>
|
|
76
|
+
<CLMSDatasetDetailView content={content}>
|
|
77
|
+
<p>Metadata view test</p>
|
|
78
|
+
</CLMSDatasetDetailView>
|
|
79
|
+
</MemoryRouter>
|
|
80
|
+
</Provider>,
|
|
81
|
+
)
|
|
82
|
+
.toJSON();
|
|
83
|
+
expect(DatasetDetailView).toBeDefined();
|
|
84
|
+
});
|
|
85
|
+
it('Check metadata view without downloadable files', () => {
|
|
86
|
+
const content = {
|
|
87
|
+
title: 'Test title!',
|
|
88
|
+
url: './example',
|
|
89
|
+
description: 'Description test',
|
|
90
|
+
download: true,
|
|
91
|
+
dataResourceTitle: 'example title',
|
|
92
|
+
dataResourceAbstract: {
|
|
93
|
+
data: 'exampledata',
|
|
94
|
+
},
|
|
95
|
+
dataSources: {
|
|
96
|
+
title: 'example title',
|
|
97
|
+
description: 'example description',
|
|
98
|
+
tooltip: 'example tooltip',
|
|
99
|
+
data: 'Source data',
|
|
100
|
+
},
|
|
101
|
+
dataResourceLocator: 'Resource locator',
|
|
102
|
+
image: {
|
|
103
|
+
src:
|
|
104
|
+
'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg',
|
|
105
|
+
alt: 'Placeholder',
|
|
106
|
+
},
|
|
107
|
+
downloadable_dataset: true,
|
|
108
|
+
downloadable_files: [],
|
|
109
|
+
};
|
|
110
|
+
const store = mockStore({
|
|
111
|
+
content: {
|
|
112
|
+
...content,
|
|
113
|
+
},
|
|
114
|
+
intl: {
|
|
115
|
+
locale: 'en',
|
|
116
|
+
messages: {},
|
|
117
|
+
},
|
|
118
|
+
search: {
|
|
119
|
+
subrequest: {
|
|
120
|
+
'123': { items: [] },
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
users: {
|
|
124
|
+
user: { roles: ['Manager'] },
|
|
125
|
+
},
|
|
126
|
+
userSession: {
|
|
127
|
+
token:
|
|
128
|
+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY0NDM4MzA0NCwiZnVsbG5hbWUiOm51bGx9.cB_q3Q0Jhu8h2m_SDmmknodpDxDLfb4o-qY6Y2plE04',
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const DatasetDetailView = renderer
|
|
133
|
+
.create(
|
|
134
|
+
<Provider store={store}>
|
|
135
|
+
<MemoryRouter>
|
|
136
|
+
<CLMSDatasetDetailView content={content}>
|
|
137
|
+
<p>Metadata view test</p>
|
|
138
|
+
</CLMSDatasetDetailView>
|
|
139
|
+
</MemoryRouter>
|
|
140
|
+
</Provider>,
|
|
141
|
+
)
|
|
142
|
+
.toJSON();
|
|
143
|
+
expect(DatasetDetailView).toBeDefined();
|
|
144
|
+
});
|
|
145
|
+
it('Check metadata view with geonetwork_identifiers items lenght > 0 user roles exists and user roles includes manager', () => {
|
|
146
|
+
const content = {
|
|
147
|
+
geonetwork_identifiers: [
|
|
148
|
+
{
|
|
149
|
+
title: 'example title',
|
|
150
|
+
description: 'example description',
|
|
151
|
+
tooltip: 'example tooltip',
|
|
152
|
+
url: './example',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
title: 'example title',
|
|
156
|
+
description: 'example description',
|
|
157
|
+
tooltip: 'example tooltip',
|
|
158
|
+
url: './example',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
const store = mockStore({
|
|
163
|
+
content: {
|
|
164
|
+
...content,
|
|
165
|
+
},
|
|
166
|
+
intl: {
|
|
167
|
+
locale: 'en',
|
|
168
|
+
messages: {},
|
|
169
|
+
},
|
|
170
|
+
search: {
|
|
171
|
+
subrequest: {
|
|
172
|
+
'123': { items: [] },
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
user: { roles: ['Manager'] },
|
|
176
|
+
userSession: {
|
|
177
|
+
token:
|
|
178
|
+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY0NDM4MzA0NCwiZnVsbG5hbWUiOm51bGx9.cB_q3Q0Jhu8h2m_SDmmknodpDxDLfb4o-qY6Y2plE04',
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
const DatasetDetailView = renderer
|
|
182
|
+
.create(
|
|
183
|
+
<Provider store={store}>
|
|
184
|
+
<MemoryRouter>
|
|
185
|
+
<CLMSDatasetDetailView content={content}>
|
|
186
|
+
<p>Metadata view test</p>
|
|
187
|
+
</CLMSDatasetDetailView>
|
|
188
|
+
</MemoryRouter>
|
|
189
|
+
</Provider>,
|
|
190
|
+
)
|
|
191
|
+
.toJSON();
|
|
192
|
+
expect(DatasetDetailView).toBeDefined();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import ContactComponent from './ContactComponent';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import renderer from 'react-test-renderer';
|
|
4
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
import Enzyme from 'enzyme';
|
|
7
|
+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
|
8
|
+
Enzyme.configure({ adapter: new Adapter() });
|
|
9
|
+
//jest test for ContactComponent
|
|
10
|
+
describe('ContactComponent', () => {
|
|
11
|
+
//test for ContactComponent rendering
|
|
12
|
+
it('Check if ContactComponent is rendered', () => {
|
|
13
|
+
const contact = {
|
|
14
|
+
organisationName: 'Test',
|
|
15
|
+
deliveryPoint: 'Test',
|
|
16
|
+
city: 'Test',
|
|
17
|
+
administrativeArea: 'Test',
|
|
18
|
+
postalCode: 'Test',
|
|
19
|
+
country: 'Test',
|
|
20
|
+
electronicMailAddress: 'Test',
|
|
21
|
+
url: 'Test',
|
|
22
|
+
urlTitle: 'Test',
|
|
23
|
+
roleCode: 'Test',
|
|
24
|
+
};
|
|
25
|
+
const contactComponent = renderer
|
|
26
|
+
.create(
|
|
27
|
+
<MemoryRouter>
|
|
28
|
+
<ContactComponent contact={contact} />
|
|
29
|
+
</MemoryRouter>,
|
|
30
|
+
)
|
|
31
|
+
.toJSON();
|
|
32
|
+
expect(contactComponent).toBeDefined();
|
|
33
|
+
});
|
|
34
|
+
});
|