@eeacms/volto-marine-policy 1.0.0

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 (154) hide show
  1. package/.coverage.babel.config.js +9 -0
  2. package/.eslintrc.js +65 -0
  3. package/.husky/pre-commit +2 -0
  4. package/.release-it.json +17 -0
  5. package/CHANGELOG.md +5 -0
  6. package/DEVELOP.md +53 -0
  7. package/DEVELOP.md.tpl +106 -0
  8. package/Jenkinsfile.tpl +416 -0
  9. package/LICENSE.md +9 -0
  10. package/Makefile.tpl +165 -0
  11. package/README.md +172 -0
  12. package/README.md.tpl +93 -0
  13. package/RELEASE.md +74 -0
  14. package/babel.config.js +17 -0
  15. package/bootstrap +41 -0
  16. package/cypress.config.js +24 -0
  17. package/docker-compose.yml +32 -0
  18. package/jest-addon.config.js +35 -0
  19. package/jest-addon.config.js.tpl +51 -0
  20. package/jest.setup.js +65 -0
  21. package/locales/de/LC_MESSAGES/volto.po +14 -0
  22. package/locales/en/LC_MESSAGES/volto.po +14 -0
  23. package/locales/it/LC_MESSAGES/volto.po +14 -0
  24. package/locales/ro/LC_MESSAGES/volto.po +14 -0
  25. package/locales/volto.pot +16 -0
  26. package/package.json +68 -0
  27. package/package.json.tpl +70 -0
  28. package/razzle.extend.js +29 -0
  29. package/src/components/Blocks/CustomBlockTemplates/customBlockTemplates.js +25 -0
  30. package/src/components/Blocks/MsfdDataExplorerBlock/Edit.jsx +29 -0
  31. package/src/components/Blocks/MsfdDataExplorerBlock/View.jsx +105 -0
  32. package/src/components/Blocks/MsfdDataExplorerBlock/index.js +23 -0
  33. package/src/components/Blocks/MsfdDataExplorerBlock/schema.jsx +30 -0
  34. package/src/components/Result/MarineMeasureItem.jsx +83 -0
  35. package/src/components/Widgets/MeasureViewWidget.jsx +233 -0
  36. package/src/components/Widgets/String.jsx +15 -0
  37. package/src/components/Widgets/TextAlign.jsx +41 -0
  38. package/src/components/Widgets/measure.css +101 -0
  39. package/src/components/index.js +15 -0
  40. package/src/components/theme/AppExtras/PrintPage/PrintPage.jsx +61 -0
  41. package/src/components/theme/AppExtras/PrintPage/css/printpage.less +29 -0
  42. package/src/components/theme/AppExtras/PrintPage/index.js +3 -0
  43. package/src/components/theme/AppExtras/ScrollToTop/ScrollToTop.jsx +61 -0
  44. package/src/components/theme/AppExtras/ScrollToTop/css/scrolltop.less +19 -0
  45. package/src/components/theme/AppExtras/ScrollToTop/index.js +3 -0
  46. package/src/components/theme/AppExtras/index.js +18 -0
  47. package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +39 -0
  48. package/src/components/theme/DatabaseItemView/style.less +87 -0
  49. package/src/components/theme/Header/HeroSection.jsx +45 -0
  50. package/src/components/theme/Header/StickyHeader.jsx +51 -0
  51. package/src/components/theme/Header/less/globals.less +18 -0
  52. package/src/components/theme/Header/less/herosection.less +64 -0
  53. package/src/components/theme/Header/less/herosection.variables +18 -0
  54. package/src/components/theme/ItemMetadata/ItemMetadata.jsx +217 -0
  55. package/src/components/theme/ItemMetadata/ItemMetadataSnippet.jsx +69 -0
  56. package/src/components/theme/ItemMetadata/ItemTitle.jsx +29 -0
  57. package/src/components/theme/MetadataListingView/MapPreview.jsx +105 -0
  58. package/src/components/theme/MetadataListingView/MetadataHeader.jsx +66 -0
  59. package/src/components/theme/MetadataListingView/MetadataListingView.jsx +36 -0
  60. package/src/components/theme/MetadataListingView/style.less +219 -0
  61. package/src/components/theme/SimpleListingView/SimpleListingView.jsx +97 -0
  62. package/src/components/theme/SimpleListingView/style.less +33 -0
  63. package/src/components/theme/Tableau/TableauDownload.jsx +86 -0
  64. package/src/components/theme/Tableau/TableauFullscreen.jsx +78 -0
  65. package/src/components/theme/Tableau/TableauShare.jsx +128 -0
  66. package/src/components/theme/View/FullwidthView.jsx +102 -0
  67. package/src/components/theme/View/HeroSectionView.jsx +125 -0
  68. package/src/constants/ActionTypes.js +12 -0
  69. package/src/constants/measureFields.js +56 -0
  70. package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +217 -0
  71. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +358 -0
  72. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
  73. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
  74. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/Logo.jsx +32 -0
  75. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/marine_logo.svg +63 -0
  76. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +81 -0
  77. package/src/customizations/volto/components/manage/Contents/README.md +1 -0
  78. package/src/customizations/volto/components/manage/Toolbar/PersonalTools.jsx +205 -0
  79. package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +624 -0
  80. package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +49 -0
  81. package/src/customizations/volto/components/theme/Breadcrumbs/README.md +1 -0
  82. package/src/customizations/volto/components/theme/Header/Header.jsx +272 -0
  83. package/src/helpers/index.js +2 -0
  84. package/src/helpers/useCopyToClipboard.js +25 -0
  85. package/src/helpers/useOutsideClick.js +20 -0
  86. package/src/icons/arrow.svg +3 -0
  87. package/src/icons/basket.svg +3 -0
  88. package/src/icons/newspaper.svg +3 -0
  89. package/src/icons/popup.svg +3 -0
  90. package/src/icons/search.svg +3 -0
  91. package/src/icons/star-full.svg +3 -0
  92. package/src/icons/user.svg +3 -0
  93. package/src/index.js +466 -0
  94. package/src/reducers/breadcrumb/breadcrumb.js +59 -0
  95. package/src/reducers/index.js +2 -0
  96. package/src/reducers/localnavigation/localnavigation.js +69 -0
  97. package/src/search/config.js +98 -0
  98. package/src/search/facets.js +85 -0
  99. package/src/search/index.js +48 -0
  100. package/src/search/views.js +15 -0
  101. package/src/slate-styles.less +43 -0
  102. package/src/static/bise_logo.svg +1 -0
  103. package/src/static/cca_logo.svg +20 -0
  104. package/src/static/ec_logo.svg +343 -0
  105. package/src/static/ec_logo_white.svg +10 -0
  106. package/src/static/eea_logo.svg +14 -0
  107. package/src/static/footer-fishes.svg +21 -0
  108. package/src/static/forest_logo.svg +30 -0
  109. package/src/static/freshwater_logo.svg +12 -0
  110. package/src/static/marine_logo.svg +63 -0
  111. package/src/static/marine_logo_white.svg +44 -0
  112. package/src/utils.js +38 -0
  113. package/theme/assets/fonts/Poppins/Poppins-Bold.ttf +0 -0
  114. package/theme/assets/fonts/Poppins/Poppins-Bold.woff +0 -0
  115. package/theme/assets/fonts/Poppins/Poppins-Bold.woff2 +0 -0
  116. package/theme/assets/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  117. package/theme/assets/fonts/Poppins/Poppins-Light.ttf +0 -0
  118. package/theme/assets/fonts/Poppins/Poppins-Light.woff +0 -0
  119. package/theme/assets/fonts/Poppins/Poppins-Light.woff2 +0 -0
  120. package/theme/assets/fonts/Poppins/Poppins-Regular.ttf +0 -0
  121. package/theme/assets/fonts/Poppins/Poppins-Regular.woff +0 -0
  122. package/theme/assets/fonts/Poppins/Poppins-Regular.woff2 +0 -0
  123. package/theme/assets/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  124. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff +0 -0
  125. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff2 +0 -0
  126. package/theme/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  127. package/theme/assets/fonts/Roboto/Roboto-Light.woff +0 -0
  128. package/theme/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
  129. package/theme/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  130. package/theme/assets/fonts/Roboto/Roboto-Medium.woff +0 -0
  131. package/theme/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  132. package/theme/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  133. package/theme/assets/fonts/Roboto/Roboto-Regular.woff +0 -0
  134. package/theme/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  135. package/theme/assets/images/Footer/ec_logo.svg +10 -0
  136. package/theme/assets/images/Header/climate-adapt-logo-1.svg +20 -0
  137. package/theme/assets/images/Header/climate-adapt-logo.svg +22 -0
  138. package/theme/assets/images/spinner.svg +1 -0
  139. package/theme/collections/table.variables +17 -0
  140. package/theme/elements/button.overrides +22 -0
  141. package/theme/extras/banner.variables +5 -0
  142. package/theme/extras/contextNavigation.overrides +60 -0
  143. package/theme/extras/contextNavigation.variables +32 -0
  144. package/theme/extras/footer.variables +6 -0
  145. package/theme/extras/header.overrides +20 -0
  146. package/theme/extras/header.variables +7 -0
  147. package/theme/extras/hero.overrides +4 -0
  148. package/theme/extras/inpageNavigation.variables +5 -0
  149. package/theme/extras/mixins.less +8 -0
  150. package/theme/globals/site.overrides +349 -0
  151. package/theme/globals/site.variables +997 -0
  152. package/theme/theme.config +136 -0
  153. package/theme/tokens/colors.less +9 -0
  154. package/theme/tokens/tokens.less +1 -0
@@ -0,0 +1,87 @@
1
+ @type: 'extra';
2
+ @element: 'custom';
3
+
4
+ @import (multiple, reference, optional) '../../theme.config';
5
+
6
+ .database-item-view {
7
+ .breadcrumbs,
8
+ .herosection {
9
+ display: none;
10
+ }
11
+
12
+ .content-area {
13
+ padding-top: 0;
14
+ }
15
+
16
+ .ui.container.tags {
17
+ display: none;
18
+ }
19
+
20
+ .item-snippet-type {
21
+ display: none;
22
+ }
23
+
24
+ .metadata-header {
25
+ margin-top: 2em;
26
+
27
+ h1 {
28
+ padding-bottom: 10px;
29
+ border-bottom: 1px solid #e7e7e7;
30
+ margin-top: 0 !important;
31
+ margin-bottom: 10px;
32
+ }
33
+
34
+ .item-modal-metadata {
35
+ display: flex;
36
+ flex-direction: row;
37
+
38
+ @media only screen and (max-width: 600px) {
39
+ flex-direction: column;
40
+ }
41
+ }
42
+
43
+ .metadata-section {
44
+ margin-right: 15px;
45
+ font-size: 13px;
46
+ }
47
+ }
48
+
49
+ .item-table.item-metadata-table {
50
+ margin: 2.5em 0;
51
+
52
+ .ui.table {
53
+ td {
54
+ @media only screen and (max-width: @tabletBreakpoint) {
55
+ padding-right: 0 !important;
56
+ padding-left: 0 !important;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ .item-type {
63
+ margin-bottom: 0.5em;
64
+ color: #7fc1d0;
65
+ font-size: 20px;
66
+ text-transform: uppercase;
67
+ }
68
+
69
+ .item-table .ui.definition.table tr td:first-child:not(.ignored),
70
+ .item-table .ui.definition.table tr td.definition {
71
+ font-size: 17px;
72
+ font-weight: 500;
73
+ }
74
+
75
+ .resources-link {
76
+ display: inline-block;
77
+ color: #747474;
78
+ font-size: 15px;
79
+ font-weight: 400;
80
+
81
+ svg {
82
+ position: relative;
83
+ top: 5px;
84
+ margin-right: 8px;
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+
3
+ import './less/herosection.less';
4
+
5
+ function HeroSection(props) {
6
+ const {
7
+ image_caption,
8
+ image_url,
9
+ content_description,
10
+ content_title,
11
+ } = props;
12
+
13
+ return (
14
+ <>
15
+ {image_url && (
16
+ <div className="herosection">
17
+ <div className="herosection-content-wrapper">
18
+ <div
19
+ className="herosection-content-image document-image"
20
+ style={{
21
+ backgroundImage: `url(${image_url})`,
22
+ }}
23
+ />
24
+ <div className="herosection-content-image-overlay" />
25
+ <div className="ui container herosection-content">
26
+ <h1 className="herosection-content-title">{content_title}</h1>
27
+ {content_description && (
28
+ <p className={'herosection-content-description'}>
29
+ {content_description}
30
+ </p>
31
+ )}
32
+ {image_caption && (
33
+ <p className="herosection-content-image-caption">
34
+ {image_caption}
35
+ </p>
36
+ )}
37
+ </div>
38
+ </div>
39
+ </div>
40
+ )}
41
+ </>
42
+ );
43
+ }
44
+
45
+ export default HeroSection;
@@ -0,0 +1,51 @@
1
+ import React, { useEffect, useState, useCallback } from 'react';
2
+ import cx from 'classnames';
3
+
4
+ const StickyHeader = (props) => {
5
+ const { stickyBreakpoint } = props;
6
+ const innerWidth = __CLIENT__ && window && window.innerWidth;
7
+ const scrollY = __CLIENT__ && window && window.scrollY;
8
+
9
+ const [width, setWidth] = useState(innerWidth);
10
+ const [y, setY] = useState(scrollY);
11
+ const [scrollingUp, setScrollingUp] = useState(false);
12
+
13
+ const handleScroll = useCallback(
14
+ (e) => {
15
+ const window = e.currentTarget;
16
+ if (y > window.scrollY && window.pageYOffset > 100) {
17
+ setScrollingUp(true);
18
+ } else {
19
+ setScrollingUp(false);
20
+ }
21
+ setY(window.scrollY);
22
+ },
23
+ [y],
24
+ );
25
+
26
+ const handleWindowResize = () => {
27
+ setWidth(window.innerWidth);
28
+ };
29
+
30
+ useEffect(() => {
31
+ setY(window.scrollY);
32
+ window.addEventListener('resize', handleWindowResize);
33
+ window.addEventListener('scroll', handleScroll);
34
+ return () => {
35
+ window.removeEventListener('resize', handleWindowResize);
36
+ window.removeEventListener('scroll', handleScroll);
37
+ };
38
+ }, [handleScroll]);
39
+
40
+ return (
41
+ <div
42
+ className={cx({
43
+ 'sticky-header': scrollingUp && width < stickyBreakpoint,
44
+ })}
45
+ >
46
+ {props.children}
47
+ </div>
48
+ );
49
+ };
50
+
51
+ export default StickyHeader;
@@ -0,0 +1,18 @@
1
+ @type: 'extra';
2
+ @element: 'custom';
3
+
4
+ @import (multiple, reference, optional) '../../theme.config';
5
+
6
+ /* Enables customization of addons */
7
+ .loadAddonOverrides() {
8
+ @import (optional) '@{siteFolder}/@{type}s/@{element}.overrides';
9
+ @import (optional)
10
+ '@{siteFolder}/../addons/@{addon}/@{addontype}/@{addonelement}.overrides';
11
+ }
12
+
13
+ /* Helper to load variables */
14
+ .loadAddonVariables() {
15
+ @import (optional) '@{addonelement}.variables';
16
+ @import (optional)
17
+ '@{siteFolder}/../addons/@{addon}/@{addontype}/@{addonelement}.variables';
18
+ }
@@ -0,0 +1,64 @@
1
+ @type: 'extra';
2
+ @element: 'custom';
3
+
4
+ @import './globals.less';
5
+
6
+ @addon: 'volto-freshwater';
7
+ @addontype: 'header';
8
+ @addonelement: 'herosection';
9
+
10
+ .loadAddonVariables();
11
+
12
+ /*******************************
13
+ Custom Style
14
+ *******************************/
15
+ .herosection-content {
16
+ position: absolute;
17
+ right: 0;
18
+ bottom: 1rem;
19
+ left: 0;
20
+ margin: @heroSectionContentMargin;
21
+ color: @heroSectionContentColor;
22
+ }
23
+
24
+ .herosection-content-image {
25
+ height: 100%;
26
+ min-height: @heroSectionContentImageMinHeight;
27
+ background-position: center;
28
+ background-repeat: no-repeat;
29
+ background-size: cover;
30
+ }
31
+
32
+ .herosection-content-image-overlay {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 100%;
37
+ height: 100%;
38
+ background: @heroSectionContentImageOverlayBackground;
39
+ }
40
+
41
+ .herosection-content-title {
42
+ margin: @heroSectionContentTitleMargin;
43
+ color: @heroSectionContentColor;
44
+ font-size: @heroSectionContentTitleSize;
45
+ text-shadow: @heroSectionContentTitleShadow;
46
+ }
47
+
48
+ .herosection-content-description {
49
+ margin: @heroSectionContentDescriptionMargin;
50
+ text-shadow: @heroSectionContentDescriptionShadow;
51
+ }
52
+
53
+ .herosection-content-image-caption {
54
+ font-size: @heroSectionContentImageCaptionFontSize;
55
+ font-style: @heroSectionContentImageCaptionFontStyle;
56
+ opacity: @heroSectionContentImageCaptionOpacity;
57
+ text-shadow: @heroSectionContentImageCaptionShadow;
58
+ }
59
+
60
+ /*******************************
61
+ End Custom Style
62
+ *******************************/
63
+
64
+ .loadAddonOverrides();
@@ -0,0 +1,18 @@
1
+ @heroSectionContentColor: #FFF;
2
+ @heroSectionContentMargin: 0 0 0.25rem 0;
3
+
4
+ @heroSectionContentImageMinHeight: 360px;
5
+ @heroSectionContentImageOverlayBackground: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5) 100%);
6
+
7
+ @heroSectionContentTitleMargin: 0 0 1.5rem 0 !important;
8
+ @heroSectionContentTitleSize: 40px;
9
+ @heroSectionContentTitleWeight: bold;
10
+ @heroSectionContentTitleShadow: 0 1px 1px black;
11
+
12
+ @heroSectionContentDescriptionMargin: -2rem 0 2rem 0 !important;
13
+ @heroSectionContentDescriptionShadow: @heroSectionContentTitleShadow;
14
+
15
+ @heroSectionContentImageCaptionFontSize: 11px;
16
+ @heroSectionContentImageCaptionFontStyle: italic;
17
+ @heroSectionContentImageCaptionOpacity: 0.8;
18
+ @heroSectionContentImageCaptionShadow: @heroSectionContentTitleShadow;
@@ -0,0 +1,217 @@
1
+ import React from 'react';
2
+ import { Icon } from '@plone/volto/components';
3
+ import { Table, Button } from 'semantic-ui-react';
4
+ import { MapPreview } from '@eeacms/volto-marine-policy/components';
5
+ import { getPath } from '@eeacms/volto-marine-policy/utils';
6
+ import { useCopyToClipboard } from '@eeacms/volto-marine-policy/helpers';
7
+ import config from '@plone/volto/registry';
8
+ import shareSVG from '@plone/volto/icons/share.svg';
9
+
10
+ const EEA_LICENSE =
11
+ 'EEA standard re-use policy: unless otherwise indicated, ' +
12
+ 're-use of content on the EEA website for commercial or ' +
13
+ 'non-commercial purposes is permitted free of charge, ' +
14
+ 'provided that the source is acknowledged ' +
15
+ '(https://www.eea.europa.eu/legal/copyright)';
16
+
17
+ const ItemMetadata = (props) => {
18
+ const { settings } = config;
19
+ const { item, map_preview, shareItem, item_view } = props;
20
+ const source = item?.source?.[0] || item;
21
+
22
+ const {
23
+ description,
24
+ lineage,
25
+ embed_url,
26
+ webmap_url,
27
+ rights,
28
+ publisher,
29
+ dpsir_type,
30
+ theme,
31
+ report_type,
32
+ original_source,
33
+ temporal_coverage,
34
+ geo_coverage,
35
+ } = source;
36
+
37
+ const subject = source.Subject || source.subjects;
38
+ const item_path = shareItem ? getPath(source.getURL).replace('/api', '') : '';
39
+ const share_url = settings.publicURL + item_path;
40
+ const copyright = rights === 'EEA' ? EEA_LICENSE : rights;
41
+ const [copyUrlStatus, copyUrl] = useCopyToClipboard(share_url);
42
+ const [confirmationText, setConfirmationText] = React.useState(false);
43
+
44
+ React.useEffect(() => {
45
+ if (copyUrlStatus === 'copied') {
46
+ setConfirmationText('Share URL is copied to clipboard.');
47
+ } else if (copyUrlStatus === 'failed') {
48
+ setConfirmationText('Copy failed. Please try again.');
49
+ }
50
+ }, [copyUrlStatus]);
51
+
52
+ return (
53
+ <>
54
+ <div className="metadata-icons">
55
+ {shareItem && (
56
+ <div className="toolbar-button-wrapper">
57
+ <Button className="toolbar-button" title="Share" onClick={copyUrl}>
58
+ <Icon name={shareSVG} size="26px" />
59
+ </Button>
60
+ <span className="btn-text">Share</span>
61
+ </div>
62
+ )}
63
+
64
+ {map_preview && (embed_url || webmap_url) && (
65
+ <div className="map-preview">
66
+ <MapPreview
67
+ item={item}
68
+ tableau_url={embed_url}
69
+ map_url={webmap_url}
70
+ item_view={item_view}
71
+ />
72
+ </div>
73
+ )}
74
+ </div>
75
+
76
+ <div className="item-metadata-table">
77
+ <Table celled definition basic="very">
78
+ <Table.Body>
79
+ {source && (
80
+ <>
81
+ {description && (
82
+ <Table.Row>
83
+ <Table.Cell>Description</Table.Cell>
84
+ <Table.Cell>
85
+ {description}
86
+ {lineage && (
87
+ <p style={{ paddingTop: '1rem' }}>{lineage}</p>
88
+ )}
89
+ </Table.Cell>
90
+ </Table.Row>
91
+ )}
92
+
93
+ {temporal_coverage &&
94
+ Object.keys(temporal_coverage).length > 0 && (
95
+ <Table.Row>
96
+ <Table.Cell>Temporal coverage</Table.Cell>
97
+ <Table.Cell>
98
+ <div className="tag-types">
99
+ {temporal_coverage.temporal.map((temp, i) => (
100
+ <div key={i}>
101
+ <p>{temp.label}</p>
102
+ </div>
103
+ ))}
104
+ </div>
105
+ </Table.Cell>
106
+ </Table.Row>
107
+ )}
108
+
109
+ {geo_coverage && Object.keys(geo_coverage).length > 0 && (
110
+ <Table.Row>
111
+ <Table.Cell>Spatial coverage</Table.Cell>
112
+ <Table.Cell>
113
+ <div className="geo-tags tag-types">
114
+ {geo_coverage.geolocation.map((geo, i) => (
115
+ <div key={i}>
116
+ <p>{geo.label}</p>
117
+ </div>
118
+ ))}
119
+ </div>
120
+ </Table.Cell>
121
+ </Table.Row>
122
+ )}
123
+ {theme && Array.isArray(theme) ? (
124
+ <Table.Row>
125
+ <Table.Cell>Theme</Table.Cell>
126
+ <Table.Cell>
127
+ <div className="tag-types">
128
+ {theme.map((item, i) => (
129
+ <div key={i}>
130
+ <p>{item}</p>
131
+ </div>
132
+ ))}
133
+ </div>
134
+ </Table.Cell>
135
+ </Table.Row>
136
+ ) : (
137
+ <Table.Row>
138
+ <Table.Cell>Theme</Table.Cell>
139
+ <Table.Cell>{theme}</Table.Cell>
140
+ </Table.Row>
141
+ )}
142
+ {publisher && (
143
+ <Table.Row>
144
+ <Table.Cell>Organisation</Table.Cell>
145
+ <Table.Cell>
146
+ <div className="tag-types">
147
+ {publisher.map((item, i) => (
148
+ <div key={i}>
149
+ <p>{item.title}</p>
150
+ </div>
151
+ ))}
152
+ </div>
153
+ </Table.Cell>
154
+ </Table.Row>
155
+ )}
156
+ {original_source && (
157
+ <Table.Row>
158
+ <Table.Cell>Source</Table.Cell>
159
+ <Table.Cell>
160
+ <a href={original_source} target="_blank" rel="noopener">
161
+ {original_source}
162
+ </a>
163
+ </Table.Cell>
164
+ </Table.Row>
165
+ )}
166
+
167
+ {rights && (
168
+ <Table.Row>
169
+ <Table.Cell>Rights</Table.Cell>
170
+ <Table.Cell>{copyright}</Table.Cell>
171
+ </Table.Row>
172
+ )}
173
+
174
+ {subject && subject.length > 0 && (
175
+ <Table.Row>
176
+ <Table.Cell>Keywords</Table.Cell>
177
+ <Table.Cell>
178
+ <div className="tag-types">
179
+ {subject.map((tag, i) => (
180
+ <div key={i}>
181
+ <p>{tag}</p>
182
+ </div>
183
+ ))}
184
+ </div>
185
+ </Table.Cell>
186
+ </Table.Row>
187
+ )}
188
+
189
+ {dpsir_type && (
190
+ <Table.Row>
191
+ <Table.Cell>DPSIR</Table.Cell>
192
+ <Table.Cell>{dpsir_type.title || dpsir_type}</Table.Cell>
193
+ </Table.Row>
194
+ )}
195
+
196
+ {report_type && (
197
+ <Table.Row>
198
+ <Table.Cell>Report type</Table.Cell>
199
+ <Table.Cell>
200
+ {report_type.title || source.report_type}
201
+ </Table.Cell>
202
+ </Table.Row>
203
+ )}
204
+ </>
205
+ )}
206
+ </Table.Body>
207
+ </Table>
208
+ </div>
209
+
210
+ {copyUrlStatus === 'copied' && (
211
+ <div className="copy-box">{confirmationText}</div>
212
+ )}
213
+ </>
214
+ );
215
+ };
216
+
217
+ export default ItemMetadata;
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { formatItemType } from '@eeacms/volto-marine-policy/utils';
3
+
4
+ const ItemMetadataSnippet = (props) => {
5
+ const { item } = props;
6
+ const source = item?.source?.[0] || item;
7
+ const type = item?.source?.[0]['@type'] || item['@type'];
8
+ const { topics, publication_year, legislative_reference } = source;
9
+
10
+ return (
11
+ <>
12
+ <div className="item-modal-metadata">
13
+ {type && (
14
+ <div className="metadata-tab-section item-snippet-type">
15
+ <span className="metadata-tab-title">Item: </span>
16
+ <span>{formatItemType(type)}</span>
17
+ </div>
18
+ )}
19
+
20
+ {topics && topics.length > 0 && (
21
+ <div className="metadata-tab-section">
22
+ <span className="metadata-tab-title">Topics: </span>
23
+ {Array.isArray(topics) ? (
24
+ <>
25
+ {topics.map((topic, i) => (
26
+ <span key={i}>
27
+ {topic.title}
28
+ {i < topics.length - 1 ? ', ' : ''}
29
+ </span>
30
+ ))}
31
+ </>
32
+ ) : (
33
+ <span>{topics.title}</span>
34
+ )}
35
+ </div>
36
+ )}
37
+
38
+ {publication_year && (
39
+ <div className="metadata-tab-section">
40
+ <span className="metadata-tab-title">Publication year: </span>
41
+ <span>{publication_year}</span>
42
+ </div>
43
+ )}
44
+
45
+ {legislative_reference && legislative_reference.length > 0 && (
46
+ <div className="metadata-tab-section">
47
+ <span className="metadata-tab-title">Legislative reference: </span>
48
+ {Array.isArray(legislative_reference) ? (
49
+ <>
50
+ {legislative_reference.map((tag, i) => (
51
+ <span key={i}>
52
+ {tag.title || tag}
53
+ {i < legislative_reference.length - 1 ? ', ' : ''}
54
+ </span>
55
+ ))}
56
+ </>
57
+ ) : (
58
+ <span>
59
+ {legislative_reference.title || legislative_reference}
60
+ </span>
61
+ )}
62
+ </div>
63
+ )}
64
+ </div>
65
+ </>
66
+ );
67
+ };
68
+
69
+ export default ItemMetadataSnippet;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { Link } from 'react-router-dom';
3
+ import { connect } from 'react-redux';
4
+ import { compose } from 'redux';
5
+
6
+ const ItemTitle = (props) => {
7
+ const { item, token } = props;
8
+ const url = item.source ? item.source[0]['@id'] : item['@id'];
9
+
10
+ return item ? (
11
+ <>
12
+ {token ? (
13
+ <h3>
14
+ <Link to={url}>{item.title}</Link>
15
+ </h3>
16
+ ) : (
17
+ <h3>{item.title}</h3>
18
+ )}
19
+ </>
20
+ ) : (
21
+ ''
22
+ );
23
+ };
24
+
25
+ export default compose(
26
+ connect((state) => ({
27
+ token: state.userSession.token,
28
+ })),
29
+ )(ItemTitle);