@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.
Files changed (204) hide show
  1. package/CHANGELOG.md +148 -3
  2. package/jest-addon.config.js +5 -0
  3. package/package.json +20 -17
  4. package/src/actions/datasets_by_uid/datasets_by_uid.test.js +14 -0
  5. package/src/actions/downloadtool/downloadtool.test.js +54 -0
  6. package/src/actions/downloadtool/get_downloadtool.js +22 -1
  7. package/src/actions/extra_breadcrumbs/extra_breadcrumb.test.js +16 -0
  8. package/src/actions/format_conversion_table/format_conversion_table.test.js +16 -0
  9. package/src/actions/geonetwork/import_geonetwork.test.js +15 -0
  10. package/src/actions/index.js +2 -0
  11. package/src/actions/meeting/meeting.test.js +41 -0
  12. package/src/actions/newsletter/get_newsletter_subscribers.test.js +14 -0
  13. package/src/actions/projections/get_projections.test.js +13 -0
  14. package/src/actions/registry/registry.test.js +15 -0
  15. package/src/actions/subscription/post_subscription.js +0 -3
  16. package/src/actions/subscription/post_subscription.test.js +64 -0
  17. package/src/actions/tokens/tokens.test.js +39 -0
  18. package/src/actions/userschema/userschema.test.js +14 -0
  19. package/src/components/Blocks/CclButtonBlock/CclButtonBlockEdit.test.jsx +123 -0
  20. package/src/components/Blocks/CclButtonBlock/CclButtonBlockView.jsx +8 -11
  21. package/src/components/Blocks/CclButtonBlock/CclButtonBlockView.test.jsx +42 -0
  22. package/src/components/Blocks/CclButtonBlock/__snapshots__/CclButtonBlockEdit.test.jsx.snap +27 -0
  23. package/src/components/Blocks/CclButtonBlock/__snapshots__/CclButtonBlockView.test.jsx.snap +56 -0
  24. package/src/components/Blocks/CclCardBlock/CclCardBlockEdit.jsx +8 -8
  25. package/src/components/Blocks/CclCardBlock/CclCardBlockEdit.test.jsx +159 -0
  26. package/src/components/Blocks/CclCardBlock/CclCardBlockView.test.jsx +61 -0
  27. package/src/components/Blocks/CclCardBlock/__snapshots__/CclCardBlockEdit.test.jsx.snap +45 -0
  28. package/src/components/Blocks/CclCardContainerBlock/CclCardContainerBlockEdit.jsx +8 -12
  29. package/src/components/Blocks/CclCardContainerBlock/CclCardContainerBlockView.jsx +3 -3
  30. package/src/components/Blocks/CclContextNavigationBlock/CclContextNavigationBlockEdit.test.jsx +42 -0
  31. package/src/components/Blocks/CclContextNavigationBlock/CclContextNavigationBlockView.test.jsx +42 -0
  32. package/src/components/Blocks/CclContextNavigationBlock/__snapshots__/CclContextNavigationBlockEdit.test.jsx.snap +12 -0
  33. package/src/components/Blocks/CclContextNavigationBlock/__snapshots__/CclContextNavigationBlockView.test.jsx.snap +3 -0
  34. package/src/components/Blocks/CclHomeBgImageBlock/CclHomeImageEditor.jsx +43 -41
  35. package/src/components/Blocks/CclHomeProductsBlock/CclHomeProductsBlockView.test.jsx +54 -0
  36. package/src/components/Blocks/CclHomeProductsBlock/__snapshots__/CclHomeProductsBlockView.test.jsx.snap +57 -0
  37. package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockEdit.jsx +9 -10
  38. package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockView.jsx +28 -9
  39. package/src/components/Blocks/CclHomeSearchBlock/CclHomeSearchBlockView.test.jsx +113 -0
  40. package/src/components/Blocks/CclHomeSearchBlock/__snapshots__/CclHomeSearchBlockView.test.jsx.snap +310 -0
  41. package/src/components/Blocks/CclHomeUsersBlock/CclHomeUserBlockView.test.jsx +61 -0
  42. package/src/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockEdit.jsx +180 -146
  43. package/src/components/Blocks/CclHomeUsersBlock/CclHomeUsersBlockView.jsx +8 -1
  44. package/src/components/Blocks/CclHomeUsersBlock/HomeUsersSchema.js +0 -1
  45. package/src/components/Blocks/CclRelatedListingBlock/CclRelatedListingEdit.jsx +4 -6
  46. package/src/components/Blocks/CclRelatedListingBlock/CclRelatedListingView.jsx +26 -23
  47. package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselEdit.jsx +4 -10
  48. package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselView.jsx +2 -6
  49. package/src/components/Blocks/CclUseCaseList/CclUseCaseListEdit.jsx +16 -13
  50. package/src/components/Blocks/CclUseCaseList/CclUseCaseListView.jsx +17 -19
  51. package/src/components/Blocks/CclUseCaseList/utils.js +1 -1
  52. package/src/components/Blocks/CustomTemplates/VoltoArcgisBlock/CclMapMenu.jsx +2 -2
  53. package/src/components/Blocks/CustomTemplates/VoltoFormBlock/customIdFieldSchema.js +2 -2
  54. package/src/components/Blocks/CustomTemplates/VoltoListingBlock/CclListingCards.jsx +0 -3
  55. package/src/components/Blocks/CustomTemplates/VoltoListingBlock/CclListingCards.test.jsx +247 -0
  56. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionFacet.jsx +82 -0
  57. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/RightModalFacets.jsx +37 -31
  58. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/WithType.jsx +8 -0
  59. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/index.js +3 -3
  60. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx +17 -48
  61. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclTabsView.jsx +11 -55
  62. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalFaqTabsView.jsx +17 -17
  63. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalTabsView.jsx +24 -15
  64. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/RoutingHOC.jsx +18 -48
  65. package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/TabsWidget.jsx +11 -8
  66. package/src/components/Blocks/customBlocks.js +57 -155
  67. package/src/components/Blocks/{CclCardContainerBlock/utils.js → utils.js} +0 -0
  68. package/src/components/CLMSDatasetDetailView/BoundingBoxComponent.test.jsx +27 -0
  69. package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.jsx +14 -21
  70. package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.test.jsx +194 -0
  71. package/src/components/CLMSDatasetDetailView/ContactComponent.test.jsx +34 -0
  72. package/src/components/CLMSDatasetDetailView/DataSetInfoContent.jsx +155 -101
  73. package/src/components/CLMSDatasetDetailView/DataSetInfoContent.test.jsx +63 -0
  74. package/src/components/CLMSDatasetDetailView/DistributionInfoComponent.test.jsx +24 -0
  75. package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.jsx +1 -13
  76. package/src/components/CLMSDatasetDetailView/DownloadDataSetContent.test.jsx +136 -0
  77. package/src/components/CLMSDatasetDetailView/index.js +0 -1
  78. package/src/components/CLMSDownloadCartView/CLMSCartContent.jsx +202 -144
  79. package/src/components/CLMSDownloadCartView/CLMSCartContent.test.jsx +5 -0
  80. package/src/components/CLMSDownloadCartView/CLMSDownloadCartView.jsx +39 -45
  81. package/src/components/CLMSDownloadCartView/CLMSDownloadCartView.test.jsx +5 -0
  82. package/src/components/CLMSDownloadCartView/cartUtils.js +9 -7
  83. package/src/components/CLMSDownloadCartView/cartUtils.test.js +5 -0
  84. package/src/components/CLMSDownloadCartView/conversion.js +1 -2
  85. package/src/components/CLMSDownloadCartView/conversion.test.js +5 -0
  86. package/src/components/CLMSDownloadableFileView/CLMSDownloadableFile.test.jsx +5 -0
  87. package/src/components/CLMSDownloadableFileView/CLMSDownloadableFileView.jsx +10 -1
  88. package/src/components/CLMSDownloadsView/CLMSDownloadTasks.jsx +196 -0
  89. package/src/components/CLMSDownloadsView/CLMSDownloadTasks.test.jsx +5 -0
  90. package/src/components/CLMSDownloadsView/CLMSDownloadsView.jsx +141 -0
  91. package/src/components/CLMSDownloadsView/CLMSDownloadsView.test.jsx +5 -0
  92. package/src/components/CLMSDownloadsView/FileCard.jsx +231 -0
  93. package/src/components/CLMSDownloadsView/FileCard.test.jsx +5 -0
  94. package/src/components/CLMSDownloadsView/filecard.less +21 -0
  95. package/src/components/CLMSMapViewerView/CLMSMapViewerView.jsx +3 -3
  96. package/src/components/CLMSMapViewerView/CLMSMapViewerView.test.jsx +5 -0
  97. package/src/components/CLMSMeetingView/CLMSMeetingEmailView.test.jsx +5 -0
  98. package/src/components/CLMSMeetingView/CLMSMeetingEmailsView.jsx +6 -5
  99. package/src/components/CLMSMeetingView/CLMSMeetingEmailsView.test.jsx +5 -0
  100. package/src/components/CLMSMeetingView/CLMSMeetingSubscriberVew.test.jsx +5 -0
  101. package/src/components/CLMSMeetingView/CLMSMeetingSubscriberView.test.jsx +5 -0
  102. package/src/components/CLMSMeetingView/CLMSMeetingSubscribersView.test.jsx +5 -0
  103. package/src/components/CLMSMeetingView/CLMSMeetingView.jsx +49 -36
  104. package/src/components/CLMSNewsItemView/CLMSNewsItemView.test.jsx +44 -0
  105. package/src/components/CLMSProfileView/CLMSApiTokensView.test.jsx +5 -0
  106. package/src/components/CLMSProfileView/CLMSNewsletterSubscriberView.test.jsx +5 -0
  107. package/src/components/CLMSProfileView/CLMSProfileView.jsx +6 -3
  108. package/src/components/CLMSProfileView/CLMSProfileView.test.jsx +5 -0
  109. package/src/components/CLMSProfileView/CLMSUserProfileView.test.jsx +5 -0
  110. package/src/components/CLMSSubscriptionView/ConfirmSubscriptionView.jsx +18 -12
  111. package/src/components/CLMSSubscriptionView/ConfirmSubscriptionView.test.jsx +5 -0
  112. package/src/components/CLMSSubscriptionView/SubscriptionView.jsx +33 -33
  113. package/src/components/CLMSSubscriptionView/SubscriptionView.test.jsx +5 -0
  114. package/src/components/CLMSSubscriptionView/subscription_utils.test.js +5 -0
  115. package/src/components/CclButton/CclButton.jsx +4 -3
  116. package/src/components/CclButton/CclButton.test.js +76 -0
  117. package/src/components/CclCard/CclCard.jsx +5 -34
  118. package/src/components/CclCard/CclCard.test.jsx +133 -0
  119. package/src/components/CclCitation/CclCitation.test.jsx +11 -0
  120. package/src/components/CclCitation/__snapshots__/CclCitation.test.jsx.snap +14 -0
  121. package/src/components/CclDownloadTable/CclDownloadTable.jsx +145 -40
  122. package/src/components/CclDownloadTable/CclDownloadTable.test.jsx +5 -0
  123. package/src/components/CclDownloadTable/download-table.less +14 -1
  124. package/src/components/CclDownloadTable/modkData.test.js +5 -0
  125. package/src/components/CclExpandableFilter/CclExpandableFilter.test.jsx +60 -0
  126. package/src/components/CclFiltersModal/CclFiltersModal.test.jsx +5 -0
  127. package/src/components/CclFooterColumn/CclFooterColumn.test.jsx +5 -0
  128. package/src/components/CclInfoDescription/CclInfoContainer.test.js +16 -0
  129. package/src/components/CclInfoDescription/CclInfoDescription.test.js +18 -0
  130. package/src/components/CclLanguageSelector/CclLanguageSelector.jsx +80 -109
  131. package/src/components/CclLanguageSelector/CclLanguageSelector.test.jsx +117 -0
  132. package/src/components/CclLanguageSelector/__snapshots__/CclLanguageSelector.test.jsx.snap +43 -0
  133. package/src/components/CclLoginModal/CclLoginModal.jsx +3 -1
  134. package/src/components/CclLoginModal/CclLoginModal.test.jsx +5 -0
  135. package/src/components/CclModal/CclModal.test.js +71 -0
  136. package/src/components/CclTab/CclTab.jsx +8 -3
  137. package/src/components/CclTab/CclTab.test.jsx +55 -0
  138. package/src/components/CclTab/CclTabs.jsx +10 -11
  139. package/src/components/CclTab/CclTabs.test.jsx +5 -0
  140. package/src/components/CclTopMainMenu/CclFooterMenu.jsx +4 -4
  141. package/src/components/CclTopMainMenu/CclFooterMenu.test.jsx +5 -0
  142. package/src/components/CclTopMainMenu/CclTopMainMenu.jsx +6 -6
  143. package/src/components/CclTopMainMenu/CclTopMainMenu.test.jsx +5 -0
  144. package/src/components/CclTopMainMenu/multilingualPath.js +1 -3
  145. package/src/components/CclTopMainMenu/multilingualPath.test.js +5 -0
  146. package/src/components/CclUtils/StringToHTML.test.jsx +5 -0
  147. package/src/components/CclVerticalFilterMenu/CclVerticalFilterMenu.jsx +2 -2
  148. package/src/components/CclVerticalFilterMenu/CclVerticalFilterMenu.test.jsx +30 -0
  149. package/src/components/Widgets/BoundingWidget.test.jsx +5 -0
  150. package/src/components/Widgets/ContactWidget.test.jsx +5 -0
  151. package/src/components/Widgets/DistributionInfoWidget.test.jsx +5 -0
  152. package/src/components/Widgets/DownloadableFilesWidget.test.jsx +5 -0
  153. package/src/components/Widgets/GeonetworkIdentifiersWidget.test.jsx +5 -0
  154. package/src/components/Widgets/MapLayersWidget.jsx +8 -1
  155. package/src/components/Widgets/MapLayersWidget.test.jsx +5 -0
  156. package/src/components/Widgets/TextLinkWidget.test.jsx +5 -0
  157. package/src/customizations/volto/components/manage/Toolbar/Toolbar.test.jsx +5 -0
  158. package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.test.jsx +5 -0
  159. package/src/customizations/volto/components/theme/Footer/Footer.jsx +58 -34
  160. package/src/customizations/volto/components/theme/Footer/Footer.test.jsx +5 -0
  161. package/src/customizations/volto/components/theme/Header/Header.jsx +57 -71
  162. package/src/customizations/volto/components/theme/Header/Header.test.jsx +5 -0
  163. package/src/customizations/volto/components/theme/Logo/Logo.test.jsx +5 -0
  164. package/src/customizations/volto/components/theme/Logout/Logout.jsx +74 -0
  165. package/src/customizations/volto/components/theme/Logout/Logout.test.jsx +5 -0
  166. package/src/customizations/volto/components/theme/Navigation/ContextNavigation.test.jsx +5 -0
  167. package/src/customizations/volto/components/theme/Navigation/Navigation.test.jsx +5 -0
  168. package/src/customizations/volto/components/theme/SearchWidget/SerachWidget.test.jsx +5 -0
  169. package/src/index.js +9 -5
  170. package/src/reducers/datasets_by_uid/datasets_by_uid.test.js +53 -0
  171. package/src/reducers/downloadtool/downloadtool_reducer.js +34 -66
  172. package/src/reducers/downloadtool/downloadtool_reducer.test.js +340 -0
  173. package/src/reducers/downloadtool/nutsnames_reducer.js +45 -0
  174. package/src/reducers/downloadtool/nutsnames_reducer.test.js +61 -0
  175. package/src/reducers/extra_breadcrumbs/extra_breadcrumb_reducer.js +21 -1
  176. package/src/reducers/extra_breadcrumbs/extra_breadcrumb_reducer.test.js +51 -0
  177. package/src/reducers/geonetwork/import_geonetwork_reducer.test.js +60 -0
  178. package/src/reducers/index.js +4 -4
  179. package/src/reducers/meeting/meeting_register_reducer.test.js +82 -0
  180. package/src/reducers/meeting/meeting_subscribers_reducer.js +4 -2
  181. package/src/reducers/meeting/meeting_subscribers_reducer.test.js +149 -0
  182. package/src/reducers/newsletter/get_newsletter_reducer.test.js +75 -0
  183. package/src/reducers/registry/registry.test.js +74 -0
  184. package/src/reducers/subscription/subscription_reducer.test.js +71 -0
  185. package/src/reducers/tokens/tokens.test.js +221 -0
  186. package/src/reducers/userschema/userschema.js +1 -1
  187. package/src/reducers/userschema/userschema.test.js +63 -0
  188. package/theme/clms/css/carousel.css +1 -1
  189. package/theme/clms/css/header.css +4 -0
  190. package/theme/clms/css/home.css +4 -4
  191. package/theme/clms/css/styles.less +17 -4
  192. package/src/components/Blocks/CclHomeUsersBlock/utils.js +0 -27
  193. package/src/components/Blocks/CclProductLeftMenu/CclProductLeftMenuEdit.jsx +0 -124
  194. package/src/components/Blocks/CclProductLeftMenu/CclProductLeftMenuView.jsx +0 -48
  195. package/src/components/Blocks/CclProductLeftMenu/LeftMenuSchema.js +0 -78
  196. package/src/components/Blocks/CclProductLeftMenu/utils.js +0 -25
  197. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionCheckboxFacet.jsx +0 -56
  198. package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/AccordionLabelFacet.jsx +0 -58
  199. package/src/components/CLMSDatasetDetailView/MetadataContent.jsx +0 -255
  200. package/src/components/CLMSDownloadCartView/CLMSTasksInProgress.jsx +0 -238
  201. package/src/components/CLMSEventView/CLMSEventView.jsx +0 -53
  202. package/src/components/CclTable/CclTable.jsx +0 -95
  203. package/src/components/CclTable/table.less +0 -42
  204. package/src/i18n.js +0 -183
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { Checkbox } from 'semantic-ui-react';
3
-
4
- const AccordionCheckboxFacet = (props) => {
5
- const { facet, choices, isMulti, onChange, value, isEditMode } = props;
6
- const facetValue = value;
7
- var [open, setOpen] = React.useState(false);
8
-
9
- return (
10
- <fieldset className="ccl-fieldset">
11
- <div
12
- className="ccl-expandable__button"
13
- aria-expanded={open}
14
- onClick={() => setOpen(!open)}
15
- onKeyDown={() => setOpen(!open)}
16
- tabIndex={0}
17
- role={'button'}
18
- >
19
- <legend className="ccl-form-legend">{facet.title}</legend>
20
- </div>
21
- <div className="ccl-form">
22
- {choices.map(({ label, value }, i) => (
23
- <div className="ccl-form-group" key={value}>
24
- <Checkbox
25
- disabled={isEditMode}
26
- label={label}
27
- radio={!isMulti}
28
- checked={
29
- isMulti
30
- ? !!facetValue?.find((f) => f.value === value)
31
- : facetValue && facetValue.value === value
32
- }
33
- onChange={(e, { checked }) =>
34
- onChange(
35
- facet.field.value,
36
- isMulti
37
- ? [
38
- ...facetValue
39
- .filter((f) => f.value !== value)
40
- .map((f) => f.value),
41
- ...(checked ? [value] : []),
42
- ]
43
- : checked
44
- ? value
45
- : null,
46
- )
47
- }
48
- />
49
- </div>
50
- ))}
51
- </div>
52
- </fieldset>
53
- );
54
- };
55
-
56
- export default AccordionCheckboxFacet;
@@ -1,58 +0,0 @@
1
- import React from 'react';
2
- import { Checkbox } from 'semantic-ui-react';
3
-
4
- const AccordionLabelFacet = (props) => {
5
- const { facet, choices, isMulti, onChange, value, isEditMode } = props;
6
- const facetValue = value;
7
- var [open, setOpen] = React.useState(false);
8
-
9
- return (
10
- <fieldset className="ccl-fieldset">
11
- <div
12
- className="ccl-expandable__button"
13
- aria-expanded={open}
14
- onClick={() => setOpen(!open)}
15
- onKeyDown={() => setOpen(!open)}
16
- tabIndex={0}
17
- role={'button'}
18
- >
19
- <legend className="ccl-form-legend">{facet.title}</legend>
20
- </div>
21
- <div>
22
- <div className="filters-tag-container">
23
- {choices.map(({ label, value }, i) => (
24
- <div className="filters-tag" key={value}>
25
- <Checkbox
26
- disabled={isEditMode}
27
- label={label}
28
- radio={!isMulti}
29
- checked={
30
- isMulti
31
- ? !!facetValue?.find((f) => f.value === value)
32
- : facetValue && facetValue.value === value
33
- }
34
- onChange={(e, { checked }) =>
35
- onChange(
36
- facet.field.value,
37
- isMulti
38
- ? [
39
- ...facetValue
40
- .filter((f) => f.value !== value)
41
- .map((f) => f.value),
42
- ...(checked ? [value] : []),
43
- ]
44
- : checked
45
- ? value
46
- : null,
47
- )
48
- }
49
- />
50
- </div>
51
- ))}
52
- </div>
53
- </div>
54
- </fieldset>
55
- );
56
- };
57
-
58
- export default AccordionLabelFacet;
@@ -1,255 +0,0 @@
1
- import { CclInfoContainer, CclInfoDescription } from '../CclInfoDescription';
2
-
3
- import BoundingBoxComponent from './BoundingBoxComponent';
4
- import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
5
- import ContactComponent from './ContactComponent';
6
- import DistributionInfoComponent from './DistributionInfoComponent';
7
- import { Label } from 'semantic-ui-react';
8
- import React from 'react';
9
- import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
10
-
11
- const MetadataContent = (data) => {
12
- return (
13
- <>
14
- {data?.geonetwork_identifiers?.items.map((item, key) => {
15
- return (
16
- <CclButton
17
- key={key}
18
- className="ccl-button ccl-button--default download-dataset-metadata"
19
- url={
20
- item.type === 'EEA'
21
- ? 'https://sdi.eea.europa.eu/catalogue/srv/api/records/' +
22
- item.id +
23
- '/formatters/xsl-view?output=pdf&language=eng&approved=true'
24
- : 'https://land.copernicus.vgt.vito.be/geonetwork/srv/api/records/' +
25
- item.id +
26
- '/formatters/xsl-view?root=div&output=pdf'
27
- }
28
- download={true}
29
- >
30
- Download metadata: {item.title}
31
- </CclButton>
32
- );
33
- })}
34
-
35
- <CclInfoContainer>
36
- <h2>Data identification</h2>
37
- {data?.dataResourceTitle && (
38
- <CclInfoDescription
39
- title="Resource title"
40
- tooltip="Name by which the cited resource is known"
41
- description={data?.dataResourceTitle}
42
- />
43
- )}
44
- {data?.resourceEffective && (
45
- <CclInfoDescription
46
- title="Date of publication"
47
- tooltip=""
48
- description={new Date(data?.resourceEffective).toLocaleDateString()}
49
- />
50
- )}
51
- {data?.resourceModified && (
52
- <CclInfoDescription
53
- title="Revision date"
54
- tooltip=""
55
- description={new Date(data?.resourceModified).toLocaleDateString()}
56
- />
57
- )}
58
- <CclInfoDescription
59
- title="Resource abstract"
60
- tooltip="Brief narrative summary of the content of the resource(s) with coverage, main attributes, data sources, important of the work, etc."
61
- description={
62
- <StringToHTML string={data?.dataResourceAbstract?.data || ''} />
63
- }
64
- />
65
- <CclInfoDescription
66
- title="Keywords"
67
- tooltip=""
68
- description={
69
- data?.keywords &&
70
- data?.keywords?.length > 0 && (
71
- <Label.Group>
72
- {data?.keywords.map((keyword, key) => {
73
- return (
74
- <Label key={key} color="olive">
75
- {keyword}
76
- </Label>
77
- );
78
- })}
79
- </Label.Group>
80
- )
81
- }
82
- />
83
- {data?.geographicCoverage?.geolocation && (
84
- <CclInfoDescription
85
- title="Geographic coverage"
86
- tooltip=""
87
- description={
88
- <Label.Group>
89
- {data?.geographicCoverage?.geolocation.map((location, key) => {
90
- return (
91
- <Label key={key} color="olive">
92
- {location.label}
93
- </Label>
94
- );
95
- })}
96
- </Label.Group>
97
- }
98
- />
99
- )}
100
- {data?.accessAndUseLimitationPublic_line && (
101
- <CclInfoDescription
102
- title="Limitation of public access"
103
- tooltip=""
104
- description={data?.accessAndUseLimitationPublic_line}
105
- />
106
- )}
107
- <CclInfoDescription
108
- title="Conditions applying to access and use"
109
- tooltip=""
110
- description={
111
- <StringToHTML string={data?.accessAndUseConstraints?.data || ''} />
112
- }
113
- />
114
- <CclInfoDescription
115
- title="Spatial Resolution"
116
- tooltip=""
117
- description={data?.qualitySpatialResolution_line}
118
- />
119
- {data?.classificationTopicCategory && (
120
- <CclInfoDescription
121
- title="Topic of Category"
122
- tooltip=""
123
- description={
124
- <Label.Group>
125
- {data?.classificationTopicCategory &&
126
- data?.classificationTopicCategory.map((topic, key) => {
127
- return (
128
- <Label key={key} color="olive">
129
- {topic.title}
130
- </Label>
131
- );
132
- })}
133
- </Label.Group>
134
- }
135
- />
136
- )}
137
- {data?.geographicBoundingBox?.items?.length > 0 && (
138
- <CclInfoDescription
139
- title="Bounding Boxes"
140
- tooltip=""
141
- description={data?.geographicBoundingBox?.items.map((bbox, key) => {
142
- return <BoundingBoxComponent key={key} bbox={bbox} />;
143
- })}
144
- />
145
- )}
146
- {data?.temporalCoverage && (
147
- <CclInfoDescription
148
- title="Temporal Extent"
149
- tooltip=""
150
- description={
151
- <Label.Group>
152
- {data?.temporalCoverage &&
153
- data?.temporalCoverage.map((year, key) => {
154
- return (
155
- <Label key={key} color="olive">
156
- {year}
157
- </Label>
158
- );
159
- })}
160
- </Label.Group>
161
- }
162
- />
163
- )}
164
- </CclInfoContainer>
165
- {data?.dataResourceType && (
166
- <CclInfoContainer>
167
- <h2>Hierarchy Level</h2>
168
- <CclInfoDescription
169
- title="Resource Type"
170
- tooltip=""
171
- description={data?.dataResourceType}
172
- />
173
- </CclInfoContainer>
174
- )}
175
- {data?.responsiblePartyWithRole?.items &&
176
- data?.responsiblePartyWithRole?.items?.length > 0 && (
177
- <CclInfoContainer>
178
- <h2>Contacts</h2>
179
- <CclInfoDescription
180
- title="Responsible Party with Role"
181
- tooltip=""
182
- description={data?.responsiblePartyWithRole?.items.map(
183
- (item, key) => {
184
- return <ContactComponent key={key} contact={item} />;
185
- },
186
- )}
187
- />
188
- </CclInfoContainer>
189
- )}
190
- {data?.coordinateReferenceSystemList &&
191
- data?.coordinateReferenceSystemList.length > 0 && (
192
- <CclInfoContainer>
193
- <h2>Reference system info</h2>
194
- <CclInfoDescription
195
- title="Coordinate Reference System"
196
- tooltip="CRS of the resource"
197
- description={
198
- <Label.Group>
199
- {data?.coordinateReferenceSystemList &&
200
- data?.coordinateReferenceSystemList.map(
201
- (reference, key) => {
202
- return (
203
- <Label key={key} color="olive">
204
- {reference}
205
- </Label>
206
- );
207
- },
208
- )}
209
- </Label.Group>
210
- }
211
- />
212
- </CclInfoContainer>
213
- )}
214
- <CclInfoContainer>
215
- <h2>Data quality info</h2>
216
- <CclInfoDescription
217
- title="Specification"
218
- tooltip="A citation of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification to which a particular resource conforms"
219
- description={
220
- <StringToHTML string={data?.conformitySpecification?.data} />
221
- }
222
- />
223
- <CclInfoDescription
224
- title="Pass"
225
- tooltip=""
226
- description={data?.conformityPass?.title}
227
- />
228
- <CclInfoDescription
229
- title="Lineage"
230
- tooltip="General explanation of the data produce knowledge's about the lineage of a dataset"
231
- description={<StringToHTML string={data?.qualityLineage?.data} />}
232
- />
233
- </CclInfoContainer>
234
- {data?.distributionInfo?.items &&
235
- data?.distributionInfo?.items?.length > 0 && (
236
- <CclInfoContainer>
237
- <h2>Distribution info</h2>
238
- <CclInfoDescription
239
- title="Resource Locator and Services"
240
- tooltip=""
241
- description={data?.distributionInfo?.items.map(
242
- (resource, key) => {
243
- return (
244
- <DistributionInfoComponent key={key} resource={resource} />
245
- );
246
- },
247
- )}
248
- />
249
- </CclInfoContainer>
250
- )}
251
- </>
252
- );
253
- };
254
-
255
- export default MetadataContent;
@@ -1,238 +0,0 @@
1
- /**
2
- * CLMSInProgressTask container.
3
- * @module components/CLMSInProgressTask/CLMSInProgressTask
4
- */
5
-
6
- import './task_in_progress.less';
7
-
8
- // import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9
- import { Loader, Popup } from 'semantic-ui-react';
10
- import React, { useEffect, useState } from 'react';
11
- import { deleteDownloadtool, getDownloadtool } from '../../actions';
12
- import { useDispatch, useSelector } from 'react-redux';
13
-
14
- import { Icon } from '@plone/volto/components';
15
- import cancelledSVG from '@plone/volto/icons/spam.svg';
16
- import downloadSVG from '@plone/volto/icons/download.svg';
17
- import removeSVG from '@plone/volto/icons/delete.svg';
18
-
19
- const CLMSTasksInProgress = (props) => {
20
- const dispatch = useDispatch();
21
- const [taskInProgress, setTaskInProgress] = useState([]);
22
- const [showDeleteTaskLoading, setShowDeleteTaskLoading] = useState(false);
23
- const download_in_progress = useSelector(
24
- (state) => state.downloadtool.download_in_progress,
25
- );
26
-
27
- const user_id = useSelector((state) => state.users.user.id);
28
- const datasets = useSelector((state) => state.datasetsByUid.datasets.items);
29
-
30
- useEffect(() => {
31
- dispatch(getDownloadtool());
32
- }, [dispatch]);
33
-
34
- useEffect(() => {
35
- let progress_keys = Object.keys(download_in_progress);
36
- let tasks_in_progress = [];
37
- progress_keys.forEach((progress_key) => {
38
- tasks_in_progress.push({
39
- ...download_in_progress[progress_key],
40
- TaskID: progress_key,
41
- });
42
- });
43
- setTaskInProgress(tasks_in_progress);
44
- }, [download_in_progress]);
45
-
46
- useEffect(() => {
47
- if (datasets?.length > 0) {
48
- addDatasetName();
49
- }
50
- // eslint-disable-next-line react-hooks/exhaustive-deps
51
- }, [datasets]);
52
-
53
- function addDatasetName() {
54
- let tasks_in_progress = [...taskInProgress];
55
- tasks_in_progress.forEach((task) => {
56
- task.Datasets.forEach((dataset) => {
57
- const requestedItem = datasets.find(
58
- (requestedItem) => requestedItem.UID === dataset.DatasetID,
59
- );
60
- if (requestedItem) {
61
- dataset.name = requestedItem.title;
62
- }
63
- });
64
- });
65
- setTaskInProgress(tasks_in_progress);
66
- }
67
-
68
- const deleteTaskInProgress = (task_id) => {
69
- setShowDeleteTaskLoading(task_id);
70
- dispatch(deleteDownloadtool(task_id));
71
- setTimeout(() => {
72
- dispatch(getDownloadtool(user_id));
73
- setShowDeleteTaskLoading(false);
74
- }, 1000); // We need delete response to check if remove_task request is completed successfully
75
- };
76
- return (
77
- <>
78
- {taskInProgress.length !== 0 && (
79
- <div className="custom-table cart-table">
80
- <h2>Tasks In Progress</h2>
81
- <table>
82
- <thead>
83
- <tr>
84
- <th>TaskID</th>
85
- <th>List of datasets</th>
86
- <th>OutputFormat</th>
87
- <th>Status</th>
88
- <th></th>
89
- <th></th>
90
- </tr>
91
- </thead>
92
- <tbody>
93
- {taskInProgress &&
94
- taskInProgress.map((item, key) => (
95
- <tr
96
- key={key}
97
- style={{ opacity: 0.5, backgroundColor: '#f5f5f5' }}
98
- >
99
- <td>{item.TaskID}</td>
100
- <td>
101
- {item.Datasets.length === 1 && item.Datasets[0].name}
102
- {item.Datasets.length > 1 && (
103
- <ul>
104
- {item.Datasets.map((dataset) => (
105
- <li>{dataset['name']}</li>
106
- ))}
107
- </ul>
108
- )}
109
- </td>
110
- <td>
111
- {item.Datasets.length === 1 &&
112
- item.Datasets[0].OutputFormat}
113
- {item.Datasets.length > 1 && (
114
- <ul>
115
- {item.Datasets.map((dataset) => {
116
- return dataset['OutputFormat'] ? (
117
- <li>{dataset['OutputFormat']}</li>
118
- ) : (
119
- <li>Pre-packaged</li>
120
- );
121
- })}
122
- </ul>
123
- )}
124
- </td>
125
-
126
- <td>
127
- {item.Status === 'In_progress' && (
128
- <Popup
129
- content="In progress"
130
- size="small"
131
- trigger={
132
- <Loader active inline indeterminate size="small" />
133
- }
134
- />
135
- )}
136
- {item.Status === 'Cancelled' && (
137
- <Popup
138
- content="Cancelled task"
139
- size="small"
140
- trigger={
141
- <Icon
142
- name={cancelledSVG}
143
- size="32px"
144
- title={'Cancelled task'}
145
- />
146
- }
147
- />
148
- )}
149
- </td>
150
- <td>
151
- {item.Status !== 'Cancelled' && (
152
- <Popup
153
- content="Download (Pending)"
154
- size="small"
155
- trigger={
156
- <button
157
- // disabled={true}
158
- onClick={() => {
159
- // deleteTaskInProgress(item.TaskID);
160
- }}
161
- style={{
162
- backgroundColor: 'none',
163
- color: 'inherit',
164
- border: 'none',
165
- padding: 0,
166
- font: 'inherit',
167
- cursor: 'pointer',
168
- outline: 'inherit',
169
- }}
170
- >
171
- <Icon
172
- name={downloadSVG}
173
- size="32px"
174
- color="#A0B128"
175
- title={'Download'}
176
- />
177
- </button>
178
- }
179
- />
180
- )}
181
- </td>
182
- <td>
183
- {item.Status !== 'Cancelled' &&
184
- (showDeleteTaskLoading === item.TaskID ? (
185
- <Loader
186
- active
187
- inline
188
- indeterminate
189
- size="small"
190
- className="red-loader"
191
- />
192
- ) : (
193
- <Popup
194
- content="Remove in progress task"
195
- size="small"
196
- trigger={
197
- <button
198
- onClick={() => {
199
- deleteTaskInProgress(item.TaskID);
200
- }}
201
- style={{
202
- backgroundColor: 'none',
203
- color: 'inherit',
204
- border: 'none',
205
- padding: 0,
206
- font: 'inherit',
207
- cursor: 'pointer',
208
- outline: 'inherit',
209
- }}
210
- >
211
- <Icon
212
- name={removeSVG}
213
- size="32px"
214
- color="#e40166"
215
- title={'Remove in progress task'}
216
- />
217
- </button>
218
- }
219
- />
220
- ))}
221
- {/* <FontAwesomeIcon
222
- icon={['fas', 'trash']}
223
- style={{ cursor: 'pointer' }}
224
- onClick={() => {
225
- deleteTaskInProgress(item.TaskID);
226
- }}
227
- /> */}
228
- </td>
229
- </tr>
230
- ))}
231
- </tbody>
232
- </table>
233
- </div>
234
- )}
235
- </>
236
- );
237
- };
238
- export default CLMSTasksInProgress;
@@ -1,53 +0,0 @@
1
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
2
- import React from 'react';
3
- import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
4
-
5
- export const CLMSEventView = (props) => {
6
- const { content } = props;
7
- return (
8
- <div className="ccl-container">
9
- <h1 className="page-title">{content.title}</h1>
10
- <div className="event-detail">
11
- <div className="event-detail-date">
12
- {new Date(content?.effective).toLocaleDateString()}
13
- </div>
14
- {content?.image && (
15
- <figure className="news-detail-image">
16
- <img
17
- src={
18
- content?.image
19
- ? content?.image?.download
20
- : 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
21
- }
22
- alt={content?.image ? content?.image?.filename : 'Placeholder'}
23
- />
24
- <figcaption>{content?.image_caption}</figcaption>
25
- </figure>
26
- )}
27
- <div className="event-detail-when">
28
- <FontAwesomeIcon icon={['far', 'calendar-alt']} />
29
- <div className="event-detail-when-text">
30
- {content?.whole_day
31
- ? new Date(content?.start).toLocaleDateString()
32
- : new Date(content?.start).toLocaleDateString() +
33
- ' - ' +
34
- new Date(content?.end).toLocaleDateString()}
35
- </div>
36
- </div>
37
- {content?.location ? (
38
- <div className="event-detail-where">
39
- <FontAwesomeIcon icon={['fas', 'map-marker-alt']} />{' '}
40
- <div className="event-detail-where-text">{content?.location}</div>
41
- </div>
42
- ) : (
43
- ''
44
- )}
45
- <div className="event-detail-content">
46
- <StringToHTML string={content.text?.data || ''} />
47
- </div>
48
- </div>
49
- </div>
50
- );
51
- };
52
-
53
- export default CLMSEventView;