@eeacms/volto-eea-website-theme 0.6.9 → 0.6.12

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 CHANGED
@@ -4,9 +4,35 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [0.6.12](https://github.com/eea/volto-eea-website-theme/compare/0.6.11...0.6.12)
8
+
9
+ - change(footer): updated logos order and added climate observatory [`96ddddf`](https://github.com/eea/volto-eea-website-theme/commit/96ddddffd0530ffb10d50a1d011f82bb97e6ba2b)
10
+
11
+ #### [0.6.11](https://github.com/eea/volto-eea-website-theme/compare/0.6.10...0.6.11)
12
+
13
+ > 16 June 2022
14
+
15
+ - content box fixes [`#43`](https://github.com/eea/volto-eea-website-theme/pull/43)
16
+ - change(website): removed container from styles that implement content-box [`c513000`](https://github.com/eea/volto-eea-website-theme/commit/c513000ce374f3209f57a3d050c29a0fbff0916c)
17
+ - Optimize Content Box SVG [`ba0d417`](https://github.com/eea/volto-eea-website-theme/commit/ba0d417ad30bfb3994855716d0d387463317d24e)
18
+ - Add preview for Content Box preset styles [`cbed054`](https://github.com/eea/volto-eea-website-theme/commit/cbed05403113cb46bc2ed63dd9c47fc6168ac492)
19
+ - Remove pluggableStyles previewText as if creates confusion [`467320d`](https://github.com/eea/volto-eea-website-theme/commit/467320df0142e8058487df20da01af5d496f2f1b)
20
+
21
+ #### [0.6.10](https://github.com/eea/volto-eea-website-theme/compare/0.6.9...0.6.10)
22
+
23
+ > 16 June 2022
24
+
25
+ - fix(header): add homepage logic only on view and edit [`#42`](https://github.com/eea/volto-eea-website-theme/pull/42)
26
+ - Use window.searchContext.resetSearch for search widget [`#41`](https://github.com/eea/volto-eea-website-theme/pull/41)
27
+ - change(header): add homepage class also on edit page [`0a10847`](https://github.com/eea/volto-eea-website-theme/commit/0a108477a3a15f9d0e2172286837ddfd94e078fa)
28
+ - Use window.searchContext.resetSearch [`c3a968b`](https://github.com/eea/volto-eea-website-theme/commit/c3a968b91646102dad461541a1501b93a653e2c9)
29
+ - fix(header): homepage is now true only on view page [`a0618a7`](https://github.com/eea/volto-eea-website-theme/commit/a0618a74431a280c3ccb95597d7f771385fac2eb)
30
+
7
31
  #### [0.6.9](https://github.com/eea/volto-eea-website-theme/compare/0.6.8...0.6.9)
8
32
 
9
- - Add custom styles: Content Box [`724257a`](https://github.com/eea/volto-eea-website-theme/commit/724257a840ff52a4be525540272d7a4839ffab34)
33
+ > 14 June 2022
34
+
35
+ - Add custom styles: Content Box [`#40`](https://github.com/eea/volto-eea-website-theme/pull/40)
10
36
 
11
37
  #### [0.6.8](https://github.com/eea/volto-eea-website-theme/compare/0.6.7...0.6.8)
12
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.6.9",
3
+ "version": "0.6.12",
4
4
  "description": "@eeacms/volto-eea-website-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
package/src/config.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import biseLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/bise.svg';
2
2
  import energyLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/energy.svg';
3
3
  import insituLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/insitu.svg';
4
- import ipchemLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/ipchem.svg';
5
4
  import freshwaterLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/freshwater.svg';
6
5
  import fiseLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/fise.svg';
7
6
  import ccaLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/cca.svg';
@@ -10,6 +9,7 @@ import industryLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/as
10
9
  import marineLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/marine.svg';
11
10
  import eionetLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eionet.svg';
12
11
  import eeaLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eea.svg';
12
+ import climateLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/climate-health.svg';
13
13
 
14
14
  // TODO: to be consolidated with headerLinks
15
15
  // Footer.jsx config options
@@ -37,26 +37,31 @@ export const footerOpts = {
37
37
  },
38
38
  ],
39
39
  sites: [
40
+ {
41
+ link: 'https://water.europa.eu/marine',
42
+ src: marineLogo,
43
+ alt: 'WISE marine',
44
+ },
40
45
  {
41
46
  link: 'https://biodiversity.europa.eu/',
42
47
  src: biseLogo,
43
48
  alt: 'Biodiversity',
44
49
  },
45
50
  {
46
- link: 'https://climate-energy.eea.europa.eu/',
47
- src: energyLogo,
48
- alt: 'Climate and energy in the EU',
51
+ link: 'https://climate-adapt.eea.europa.eu/observatory',
52
+ src: climateLogo,
53
+ alt: 'European Climate and Health Observatory',
54
+ },
55
+ {
56
+ link: 'https://industry.eea.europa.eu/',
57
+ src: industryLogo,
58
+ alt: 'European industrial emissions portal',
49
59
  },
50
60
  {
51
61
  link: 'https://insitu.copernicus.eu/',
52
62
  src: insituLogo,
53
63
  alt: 'Copernicus in situ',
54
64
  },
55
- {
56
- link: 'https://ipchem.jrc.ec.europa.eu/RDSIdiscovery/ipchem/index.html',
57
- src: ipchemLogo,
58
- alt: 'Information platform for chemical monitoring',
59
- },
60
65
  {
61
66
  link: 'https://water.europa.eu/freshwater',
62
67
  src: freshwaterLogo,
@@ -72,21 +77,16 @@ export const footerOpts = {
72
77
  src: ccaLogo,
73
78
  alt: 'Climate adapt',
74
79
  },
80
+ {
81
+ link: 'https://climate-energy.eea.europa.eu/',
82
+ src: energyLogo,
83
+ alt: 'Climate and energy in the EU',
84
+ },
75
85
  {
76
86
  link: 'https://land.copernicus.eu/',
77
87
  src: copernicusLogo,
78
88
  alt: 'Copernicus land monitoring service',
79
89
  },
80
- {
81
- link: 'https://industry.eea.europa.eu/',
82
- src: industryLogo,
83
- alt: 'European industrial emissions portal',
84
- },
85
- {
86
- link: 'https://water.europa.eu/marine',
87
- src: marineLogo,
88
- alt: 'WISE marine',
89
- },
90
90
  ],
91
91
  managedBy: [
92
92
  {
@@ -16,6 +16,11 @@ function HeaderSearchPopUp({ history, onClose, triggerRefs = [] }) {
16
16
 
17
17
  const onSubmit = (event) => {
18
18
  history.push(`/en/advanced-search?q=${text}`);
19
+
20
+ if (window?.searchContext?.resetSearch) {
21
+ window.searchContext.resetSearch({ searchTerm: text });
22
+ }
23
+
19
24
  onClose();
20
25
  event.preventDefault();
21
26
  };
@@ -25,6 +25,7 @@ import eeaFlag from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/
25
25
 
26
26
  import config from '@plone/volto/registry';
27
27
  import { compose } from 'recompose';
28
+ import { BodyClass } from '@plone/volto/helpers';
28
29
 
29
30
  /**
30
31
  * EEA Specific Header component.
@@ -34,8 +35,18 @@ const EEAHeader = ({ pathname, token, items, history }) => {
34
35
  const translations = useSelector(
35
36
  (state) => state.content.data?.['@components']?.translations?.items,
36
37
  );
38
+
39
+ const router_pathname = useSelector((state) => {
40
+ return state.router?.location?.pathname || '';
41
+ });
42
+
37
43
  const isHomePageInverse = useSelector((state) => {
38
- return state.content?.data?.layout === 'homepage_inverse_view';
44
+ const layout = state.content?.data?.layout;
45
+ const has_home_layout = layout === 'homepage_inverse_view';
46
+ return (
47
+ has_home_layout &&
48
+ (pathname === router_pathname || router_pathname.endsWith('/edit'))
49
+ );
39
50
  });
40
51
 
41
52
  const { eea } = config.settings;
@@ -48,9 +59,9 @@ const EEAHeader = ({ pathname, token, items, history }) => {
48
59
 
49
60
  React.useEffect(() => {
50
61
  const { settings } = config;
51
- const base = getBaseUrl(pathname);
52
- if (!hasApiExpander('navigation', base)) {
53
- dispatch(getNavigation(base, settings.navDepth));
62
+ const base_url = getBaseUrl(pathname);
63
+ if (!hasApiExpander('navigation', base_url)) {
64
+ dispatch(getNavigation(base_url, settings.navDepth));
54
65
  }
55
66
  }, [pathname, dispatch]);
56
67
 
@@ -66,6 +77,7 @@ const EEAHeader = ({ pathname, token, items, history }) => {
66
77
 
67
78
  return (
68
79
  <Header menuItems={items}>
80
+ {isHomePageInverse && <BodyClass className="homepage" />}
69
81
  <Header.TopHeader>
70
82
  <Header.TopItem className="official-union">
71
83
  <Image src={eeaFlag} alt="eea flag"></Image>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+ <svg width="90mm" height="90mm" version="1.1" viewBox="0 0 90 90" xmlns="http://www.w3.org/2000/svg">
4
+ <text x="44.72715" y="38.463978" fill="#000000" font-family="sans-serif" font-size="16.933px" letter-spacing="0px" stroke-width=".26458" text-align="center" text-anchor="middle" word-spacing="0px" style="line-height:1.5" xml:space="preserve"><tspan x="44.72715" y="38.463978" text-align="center">Content</tspan><tspan x="44.72715" y="63.863926" text-align="center">Box</tspan></text>
5
+ </svg>
package/src/index.js CHANGED
@@ -6,6 +6,8 @@ import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/Dr
6
6
  import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
7
7
  import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
8
8
  import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
9
+ import { Icon } from '@plone/volto/components';
10
+ import contentBoxSVG from './icons/content-box.svg';
9
11
 
10
12
  const applyConfig = (config) => {
11
13
  // EEA specific settings
@@ -69,56 +71,61 @@ const applyConfig = (config) => {
69
71
  ];
70
72
 
71
73
  // Custom block styles
74
+ config.settings.previewText = '';
72
75
  config.settings.pluggableStyles = [
73
76
  ...(config.settings.pluggableStyles || []),
74
77
  {
75
78
  id: 'content-box-gray',
76
- title: 'Content Box',
79
+ title: 'Default',
80
+ previewComponent: () => (
81
+ <Icon name={contentBoxSVG} size="88px" className="default" />
82
+ ),
77
83
  viewComponent: (props) => {
78
84
  return (
79
85
  <div className="content-box">
80
- <div className="content-box-inner ui container">
81
- {props.children}
82
- </div>
86
+ <div className="content-box-inner">{props.children}</div>
83
87
  </div>
84
88
  );
85
89
  },
86
90
  },
87
91
  {
88
92
  id: 'content-box-primary',
89
- title: 'Content Box (primary)',
93
+ title: 'Primary',
94
+ previewComponent: () => (
95
+ <Icon name={contentBoxSVG} size="88px" className="primary" />
96
+ ),
90
97
  viewComponent: (props) => {
91
98
  return (
92
99
  <div className="content-box primary">
93
- <div className="content-box-inner ui container">
94
- {props.children}
95
- </div>
100
+ <div className="content-box-inner">{props.children}</div>
96
101
  </div>
97
102
  );
98
103
  },
99
104
  },
100
105
  {
101
106
  id: 'content-box-secondary',
102
- title: 'Content Box (secondary)',
107
+ title: 'Secondary',
108
+ previewComponent: () => (
109
+ <Icon name={contentBoxSVG} size="88px" className="secondary" />
110
+ ),
103
111
  viewComponent: (props) => {
104
112
  return (
105
113
  <div className="content-box secondary">
106
- <div className="content-box-inner ui container">
107
- {props.children}
108
- </div>
114
+ <div className="content-box-inner">{props.children}</div>
109
115
  </div>
110
116
  );
111
117
  },
112
118
  },
113
119
  {
114
120
  id: 'content-box-tertiary',
115
- title: 'Content Box (tertiary)',
121
+ title: 'Tertiary',
122
+ previewComponent: () => (
123
+ <Icon name={contentBoxSVG} size="88px" className="tertiary" />
124
+ ),
116
125
  viewComponent: (props) => {
117
126
  return (
118
127
  <div className="content-box tertiary">
119
- <div className="content-box-inner ui container">
120
- {props.children}
121
- </div>
128
+ <div className="content-box-inner">{props.children}</div>
122
129
  </div>
123
130
  );
124
131
  },