@eeacms/volto-bise-policy 1.0.7 → 1.0.9

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,6 +4,30 @@ 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
+ ### [1.0.9](https://github.com/eea/volto-bise-policy/compare/1.0.8...1.0.9) - 6 June 2023
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - change(inline-styles): enabled only primary secondary and tertiary inline styles [David Ichim - [`b9392ba`](https://github.com/eea/volto-bise-policy/commit/b9392baba2bd7255d7afe07fd7c82d43543bd7ec)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - update slate inline styles [Miu Razvan - [`ad5f9db`](https://github.com/eea/volto-bise-policy/commit/ad5f9db710ca50586aba1ba96e04dc8f84b33ac9)]
16
+ - fixes [Miu Razvan - [`cb680f2`](https://github.com/eea/volto-bise-policy/commit/cb680f268f297f7ed577081a00b358f60cc627ad)]
17
+ - update [Miu Razvan - [`4c0d4f2`](https://github.com/eea/volto-bise-policy/commit/4c0d4f269c7b05976a4de5dc915fdb3338c976a6)]
18
+ ### [1.0.8](https://github.com/eea/volto-bise-policy/compare/1.0.7...1.0.8) - 29 May 2023
19
+
20
+ #### :hammer_and_wrench: Others
21
+
22
+ - update [Miu Razvan - [`baf4a08`](https://github.com/eea/volto-bise-policy/commit/baf4a082ddb5841cf3380cc30ff94b77ed9e168f)]
23
+ - update [Miu Razvan - [`c75abcb`](https://github.com/eea/volto-bise-policy/commit/c75abcb25b1f0984567ec6e9afc0d61820edb32d)]
24
+ - clean up [Miu Razvan - [`0fcd494`](https://github.com/eea/volto-bise-policy/commit/0fcd494a87c2c3cdf519e16ffa6c43403dbe8315)]
25
+ - fix z-index on navigation menu [Miu Razvan - [`5fbd3fd`](https://github.com/eea/volto-bise-policy/commit/5fbd3fdb2c0705ec15d7968651900f9f7bba9f6f)]
26
+ - update for url widget [tedw87 - [`78df6cb`](https://github.com/eea/volto-bise-policy/commit/78df6cb7f944ce718c0bf89b97a462ccc1d1dcb7)]
27
+ - fix import [tedw87 - [`7bb66ba`](https://github.com/eea/volto-bise-policy/commit/7bb66badc31b872532e3a528af2cd496b4455344)]
28
+ - update [tedw87 - [`3d502b1`](https://github.com/eea/volto-bise-policy/commit/3d502b1054d03e1bf5114eaa08c7c064c52474d0)]
29
+ - fix prettier [tedw87 - [`2632d29`](https://github.com/eea/volto-bise-policy/commit/2632d294b4859da014635c72ffcc231fc4b09287)]
30
+ - update with getFieldUrl function [tedw87 - [`bea0cf1`](https://github.com/eea/volto-bise-policy/commit/bea0cf1572496ef159d5b12c59b1c20cb9948ee7)]
7
31
  ### [1.0.7](https://github.com/eea/volto-bise-policy/compare/1.0.6...1.0.7) - 23 May 2023
8
32
 
9
33
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-bise-policy",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "@eeacms/volto-bise-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
3
3
  import { Menu } from 'semantic-ui-react';
4
4
  import { UniversalLink } from '@plone/volto/components';
5
5
  import { flattenToAppURL } from '@plone/volto/helpers';
6
+ import { getFieldURL } from '@eeacms/volto-bise-policy/helpers';
6
7
 
7
8
  import './styles.less';
8
9
 
@@ -13,9 +14,9 @@ const View = ({ history, data, navigation, ...props }) => {
13
14
  const items = useMemo(() => {
14
15
  return [
15
16
  ...(navigation.filter(
16
- (item) => flattenToAppURL(item.url) === flattenToAppURL(data.parent),
17
+ (item) => flattenToAppURL(item.url) === getFieldURL(data.parent),
17
18
  )[0]?.items || []),
18
- ...pages,
19
+ ...pages.map((page) => ({ ...page, url: getFieldURL(page.url) })),
19
20
  ];
20
21
  }, [navigation, pages, data.parent]);
21
22
 
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
2
  import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
3
3
  import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
4
+ import { getFieldURL } from '@eeacms/volto-bise-policy/helpers';
4
5
  import schema from './schema';
5
6
 
6
7
  const Edit = (props) => {
7
8
  return (
8
9
  <>
9
- {props.data.url && <p>Redirect to {props.data.url}</p>}
10
+ {props.data.url && <p>Redirect to {getFieldURL(props.data.url)}</p>}
10
11
  {!props.data.url && <p>Select redirect target</p>}
11
12
 
12
13
  <SidebarPortal selected={props.selected}>
@@ -1,9 +1,9 @@
1
1
  import { useEffect } from 'react';
2
- import { flattenToAppURL } from '@plone/volto/helpers';
2
+ import { getFieldURL } from '@eeacms/volto-bise-policy/helpers';
3
3
 
4
4
  const View = (props) => {
5
5
  useEffect(() => {
6
- props.history.push(flattenToAppURL(props.data.url));
6
+ props.history.push(getFieldURL(props.data.url));
7
7
  /* eslint-disable-next-line */
8
8
  }, []);
9
9
 
@@ -4,7 +4,6 @@ import installFactsheetsListing from './FactsheetsListing';
4
4
  import installKeyFacts from './KeyFacts';
5
5
  import installMaesViewer from './MaesViewer';
6
6
  import installNavigation from './Navigation';
7
- import installNewsletter from './NewsletterSignup';
8
7
 
9
8
  export default (config) => {
10
9
  return [
@@ -14,6 +13,5 @@ export default (config) => {
14
13
  installKeyFacts,
15
14
  installMaesViewer,
16
15
  installNavigation,
17
- installNewsletter,
18
16
  ].reduce((acc, apply) => apply(acc), config);
19
17
  };
@@ -239,39 +239,54 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
239
239
  if (pathName.indexOf(element.url) !== -1) {
240
240
  defaultIndex = index;
241
241
  }
242
+ const hasItems = element.items?.length > 0;
243
+ let overview = cloneDeep(element);
244
+
242
245
  x.title = (
243
- <Accordion.Title key={`title-${index}`} index={index} as="button">
244
- {element.title}
245
- <Icon className="ri-arrow-down-s-line" size="small" />
246
+ <Accordion.Title
247
+ key={`title-${index}`}
248
+ index={index}
249
+ as="button"
250
+ active={hasItems ? false : undefined}
251
+ >
252
+ {hasItems ? (
253
+ <>
254
+ {element.title}
255
+ <Icon className="ri-arrow-down-s-line" size="small" />
256
+ </>
257
+ ) : (
258
+ renderMenuItem(overview)
259
+ )}
246
260
  </Accordion.Title>
247
261
  );
248
- let overview = cloneDeep(element);
249
- x.content = (
250
- <Accordion.Content key={index}>
251
- <div className="mega-menu-title">
252
- {/* Inverted right labeled button as a category title - Mobile */}
253
- {renderMenuItem(
254
- overview,
255
- { className: 'ui button inverted icon right labeled' },
256
- {
257
- iconPosition: 'right',
258
- children: (
259
- <>
260
- {/* Add word overview to titles */}
261
- <span> overview</span>
262
- <Icon className={'arrow right icon'} alt={'Title icon'} />
263
- </>
264
- ),
265
- },
266
- )}
267
- </div>
268
- <FirstLevelContent
269
- element={element}
270
- renderMenuItem={renderMenuItem}
271
- pathName={pathName}
272
- />
273
- </Accordion.Content>
274
- );
262
+ if (hasItems) {
263
+ x.content = (
264
+ <Accordion.Content key={index}>
265
+ <div className="mega-menu-title">
266
+ {/* Inverted right labeled button as a category title - Mobile */}
267
+ {renderMenuItem(
268
+ overview,
269
+ { className: 'ui button inverted icon right labeled' },
270
+ {
271
+ iconPosition: 'right',
272
+ children: (
273
+ <>
274
+ {/* Add word overview to titles */}
275
+ <span> overview</span>
276
+ <Icon className={'arrow right icon'} alt={'Title icon'} />
277
+ </>
278
+ ),
279
+ },
280
+ )}
281
+ </div>
282
+ <FirstLevelContent
283
+ element={element}
284
+ renderMenuItem={renderMenuItem}
285
+ pathName={pathName}
286
+ />
287
+ </Accordion.Content>
288
+ );
289
+ }
275
290
  rootPanels.push(x);
276
291
  });
277
292
 
@@ -8,7 +8,8 @@ import { Dropdown, Image, Sticky } from 'semantic-ui-react';
8
8
  import { connect, useDispatch, useSelector } from 'react-redux';
9
9
  import Cookies from 'universal-cookie';
10
10
 
11
- import { withRouter } from 'react-router-dom';
11
+ import { matchPath } from 'react-router';
12
+ import { withRouter, useParams } from 'react-router-dom';
12
13
  import { UniversalLink } from '@plone/volto/components';
13
14
  import {
14
15
  getBaseUrl,
@@ -51,6 +52,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
51
52
  const dispatch = useDispatch();
52
53
  const [language, setLanguage] = useState(getLanguage());
53
54
  const previousToken = usePrevious(token);
55
+ const params = useParams();
54
56
  const { items } = props;
55
57
  const { eea } = config.settings;
56
58
  const { headerOpts, headerSearchBox } = eea || {};
@@ -58,10 +60,9 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
58
60
 
59
61
  const width = useSelector((state) => state.screen?.width);
60
62
 
61
- const router_pathname = useSelector(
62
- (state) => removeTrailingSlash(state.router?.location?.pathname) || '',
63
- );
64
- let pathname = router_pathname;
63
+ const pathname = removeTrailingSlash(props.pathname);
64
+
65
+ const _pathname = removeTrailingSlash(history.location.pathname);
65
66
 
66
67
  const content_pathname = useMemo(
67
68
  () => flattenToAppURL(content.data?.['@id']),
@@ -70,12 +71,28 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
70
71
 
71
72
  const isSubsite = subsite?.['@type'] === 'Subsite';
72
73
 
73
- if (content.get.loading && content_pathname !== router_pathname) {
74
- pathname = content_pathname;
75
- }
74
+ const isN2KSite = useMemo(() => {
75
+ return !!matchPath(pathname, {
76
+ path: ['/natura2000/sites/site', '/natura2000/sites/site_cdda'],
77
+ exact: false,
78
+ });
79
+ }, [pathname]);
80
+
81
+ const isN2KSpecies = useMemo(() => {
82
+ return !!matchPath(pathname, {
83
+ path: '/natura2000/species/species',
84
+ exact: false,
85
+ });
86
+ }, [pathname]);
76
87
 
77
- const isHomePageInverse =
78
- content_pathname === '' && ['', '/'].includes(pathname);
88
+ const isN2KHabitat = useMemo(() => {
89
+ return !!matchPath(pathname, {
90
+ path: '/natura2000/habitats/habitat',
91
+ exact: false,
92
+ });
93
+ }, [pathname]);
94
+
95
+ const isHomePageInverse = content_pathname === '' && _pathname === '';
79
96
 
80
97
  const isMultilingual =
81
98
  config.settings.isMultilingual || (isSubsite && subsite.isMultilingual);
@@ -124,6 +141,11 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
124
141
  return (
125
142
  <Header menuItems={items}>
126
143
  {isHomePageInverse && <BodyClass className="homepage homepage-inverse" />}
144
+ {isSubsite && !subsite.isRoot && !isN2KSpecies && !isN2KHabitat && (
145
+ <BodyClass className="with-n2k-navigation" />
146
+ )}
147
+ {isSubsite && isN2KSite && <BodyClass className="is-n2k-site" />}
148
+
127
149
  <Header.TopHeader>
128
150
  <Header.TopItem className="official-union">
129
151
  <Image src={eeaFlag} alt="eea flag"></Image>
@@ -194,7 +216,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
194
216
  </Header.TopItem>
195
217
  )}
196
218
 
197
- {isMultilingual && (
219
+ {isMultilingual && !isN2KSite && !isN2KSpecies && !isN2KHabitat && (
198
220
  <Header.TopItem>
199
221
  <Header.TopDropdownMenu
200
222
  id="language-switcher"
@@ -235,7 +257,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
235
257
  'g',
236
258
  );
237
259
  const matches = [
238
- ...router_pathname.matchAll(multilingualSubsiteRe),
260
+ ...pathname.matchAll(multilingualSubsiteRe),
239
261
  ][0];
240
262
  if (matches && matches[2] !== `/${item.code}/`) {
241
263
  changeLanguage(item.code);
@@ -261,7 +283,7 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
261
283
  context={__CLIENT__ && document.querySelector('.content-area')}
262
284
  >
263
285
  <Header.Main
264
- pathname={router_pathname}
286
+ pathname={pathname}
265
287
  headerSearchBox={headerSearchBox}
266
288
  inverted={isHomePageInverse ? true : false}
267
289
  transparency={isHomePageInverse ? true : false}
@@ -275,7 +297,32 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
275
297
  />
276
298
  }
277
299
  menuItems={
278
- isSubsite && !subsite.isRoot
300
+ isN2KSite
301
+ ? [
302
+ {
303
+ title: 'AT A GLANCE',
304
+ url: '#',
305
+ items: [],
306
+ className: 'at-glance',
307
+ onClick: (e) => {
308
+ e.preventDefault();
309
+ window.scrollTo({
310
+ top: document.body.scrollHeight,
311
+ behavior: 'smooth',
312
+ });
313
+ },
314
+ },
315
+ {
316
+ title: 'GO TO EXPERT VIEW',
317
+ url: params.site_code
318
+ ? `https://natura2000.eea.europa.eu/Natura2000/SDF.aspx?site=${params.site_code}`
319
+ : '#',
320
+ items: [],
321
+ className: 'deep-dive',
322
+ target: params.site_code ? '_blank' : null,
323
+ },
324
+ ]
325
+ : isSubsite && !subsite.isRoot && !isN2KSpecies && !isN2KHabitat
279
326
  ? getSubsiteItems()
280
327
  : items.filter((item) => item.url !== '/natura2000')
281
328
  }
@@ -283,9 +330,16 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
283
330
  <a
284
331
  href={item.url || '/'}
285
332
  title={item.title}
333
+ target={item.target || '_self'}
334
+ className={item.className}
286
335
  onClick={(e) => {
287
- e.preventDefault();
288
- onClick(e, item);
336
+ if (!isN2KSite) {
337
+ e.preventDefault();
338
+ onClick(e, item);
339
+ }
340
+ if (item.onClick) {
341
+ item.onClick(e, item);
342
+ }
289
343
  }}
290
344
  >
291
345
  {item.title}
@@ -297,8 +351,13 @@ const EEAHeader = ({ token, history, subsite, content, ...props }) => {
297
351
  title={item.nav_title || item.title}
298
352
  {...(options || {})}
299
353
  className={cx(options?.className, {
300
- active: item.url === router_pathname,
354
+ active: item.url === pathname,
301
355
  })}
356
+ onClick={(e) => {
357
+ if (item.onClick) {
358
+ item.onClick(e);
359
+ }
360
+ }}
302
361
  >
303
362
  {props?.iconPosition !== 'right' && props?.children}
304
363
  <span>{item.nav_title || item.title}</span>
package/src/helpers.js ADDED
@@ -0,0 +1,19 @@
1
+ import isArray from 'lodash/isArray';
2
+ import isObject from 'lodash/isObject';
3
+ import isString from 'lodash/isString';
4
+ import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
5
+
6
+ export const getFieldURL = (data) => {
7
+ let url = data;
8
+ const _isObject = data && isObject(data) && !isArray(data);
9
+ if (_isObject && data['@type'] === 'URL') {
10
+ url = data['value'] ?? data['url'] ?? data['href'] ?? data;
11
+ } else if (_isObject) {
12
+ url = data['@id'] ?? data['url'] ?? data['href'] ?? data;
13
+ }
14
+ if (isArray(data)) {
15
+ url = data.map((item) => getFieldURL(item));
16
+ }
17
+ if (isString(url) && isInternalURL(url)) return flattenToAppURL(url);
18
+ return url;
19
+ };
@@ -0,0 +1,14 @@
1
+ <svg width="90mm" height="90mm" version="1.1" viewBox="0 0 90 90" xmlns="http://www.w3.org/2000/svg">
2
+ <g stroke-width=".26458" aria-label="ContentBox">
3
+ <path d="m21.961 27.071v1.7611q-0.84334-0.78547-1.8024-1.1741-0.95083-0.3886-2.0257-0.3886-2.1166 0-3.2411 1.2981-1.1245 1.2898-1.1245 3.7372 0 2.4391 1.1245 3.7372 1.1245 1.2898 3.2411 1.2898 1.0748 0 2.0257-0.3886 0.9591-0.3886 1.8024-1.1741v1.7446q-0.87642 0.5953-1.8603 0.89295-0.97563 0.29765-2.067 0.29765-2.8029 0-4.4151-1.7115-1.6123-1.7198-1.6123-4.688 0-2.9765 1.6123-4.688 1.6123-1.7198 4.4151-1.7198 1.1079 0 2.0836 0.29765 0.9839 0.28938 1.8438 0.87642z"/>
4
+ <path d="m28.063 30.27q-1.2237 0-1.9347 0.9591-0.71105 0.95083-0.71105 2.6127 0 1.6619 0.70278 2.621 0.71105 0.95083 1.943 0.95083 1.2154 0 1.9265-0.9591 0.71105-0.9591 0.71105-2.6127 0-1.6453-0.71105-2.6044-0.71105-0.96736-1.9265-0.96736zm0-1.2898q1.9843 0 3.1171 1.2898 1.1327 1.2898 1.1327 3.5718 0 2.2737-1.1327 3.5718-1.1327 1.2898-3.1171 1.2898-1.9926 0-3.1253-1.2898-1.1245-1.2981-1.1245-3.5718 0-2.282 1.1245-3.5718 1.1327-1.2898 3.1253-1.2898z"/>
5
+ <path d="m42.532 32.875v5.5892h-1.5213v-5.5396q0-1.3146-0.51262-1.9678-0.51262-0.65318-1.5379-0.65318-1.2319 0-1.943 0.78547-0.71105 0.78547-0.71105 2.1414v5.2337h-1.5296v-9.2602h1.5296v1.4386q0.54569-0.83508 1.2816-1.2485 0.74413-0.4134 1.7115-0.4134 1.5957 0 2.4143 0.99217 0.81854 0.9839 0.81854 2.9021z"/>
6
+ <path d="m47.071 26.574v2.6292h3.1336v1.1823h-3.1336v5.027q0 1.1327 0.30592 1.4552 0.31419 0.32246 1.265 0.32246h1.5627v1.2733h-1.5627q-1.7611 0-2.4308-0.65318-0.66971-0.66145-0.66971-2.3977v-5.027h-1.1162v-1.1823h1.1162v-2.6292z"/>
7
+ <path d="m60.126 33.454v0.74413h-6.9948q0.09922 1.5709 0.94256 2.3977 0.85161 0.81854 2.3647 0.81854 0.87642 0 1.695-0.21497 0.82681-0.21497 1.6371-0.64491v1.4386q-0.81854 0.34726-1.6784 0.52916-0.85988 0.1819-1.7446 0.1819-2.2158 0-3.5139-1.2898-1.2898-1.2898-1.2898-3.4891 0-2.2737 1.2237-3.6049 1.2319-1.3394 3.3155-1.3394 1.8686 0 2.9517 1.2071 1.0914 1.1989 1.0914 3.2659zm-1.5213-0.44648q-0.01654-1.2485-0.70279-1.9926-0.67798-0.74413-1.8024-0.74413-1.2733 0-2.0422 0.71932-0.76066 0.71932-0.87642 2.0257z"/>
8
+ <path d="m70.321 32.875v5.5892h-1.5213v-5.5396q0-1.3146-0.51262-1.9678-0.51262-0.65318-1.5379-0.65318-1.2319 0-1.943 0.78547-0.71105 0.78547-0.71105 2.1414v5.2337h-1.5296v-9.2602h1.5296v1.4386q0.54569-0.83508 1.2816-1.2485 0.74413-0.4134 1.7115-0.4134 1.5957 0 2.4143 0.99217 0.81854 0.9839 0.81854 2.9021z"/>
9
+ <path d="m74.86 26.574v2.6292h3.1336v1.1823h-3.1336v5.027q0 1.1327 0.30592 1.4552 0.31419 0.32246 1.265 0.32246h1.5627v1.2733h-1.5627q-1.7611 0-2.4308-0.65318-0.66971-0.66145-0.66971-2.3977v-5.027h-1.1162v-1.1823h1.1162v-2.6292z"/>
10
+ <path d="m32.321 57.969v4.5226h2.6789q1.3477 0 1.9926-0.55396 0.65318-0.56223 0.65318-1.7115 0-1.1575-0.65318-1.7032-0.64491-0.55396-1.9926-0.55396zm0-5.0766v3.7206h2.4722q1.2237 0 1.819-0.45474 0.60357-0.46301 0.60357-1.4056 0-0.93429-0.60357-1.3973-0.5953-0.46301-1.819-0.46301zm-1.6702-1.3725h4.2663q1.9099 0 2.9434 0.79374 1.0335 0.79373 1.0335 2.2572 0 1.1327-0.52916 1.8024-0.52916 0.66971-1.5544 0.83507 1.2319 0.26458 1.9099 1.1079 0.68625 0.83508 0.68625 2.0918 0 1.6536-1.1245 2.5548-1.1245 0.90122-3.1997 0.90122h-4.4317z"/>
11
+ <path d="m45.79 55.67q-1.2237 0-1.9347 0.9591-0.71105 0.95083-0.71105 2.6127 0 1.6619 0.70279 2.621 0.71105 0.95083 1.943 0.95083 1.2154 0 1.9265-0.9591 0.71105-0.9591 0.71105-2.6127 0-1.6453-0.71105-2.6044-0.71105-0.96736-1.9265-0.96736zm0-1.2898q1.9843 0 3.1171 1.2898 1.1327 1.2898 1.1327 3.5718 0 2.2737-1.1327 3.5718-1.1327 1.2898-3.1171 1.2898-1.9926 0-3.1253-1.2898-1.1245-1.2981-1.1245-3.5718 0-2.282 1.1245-3.5718 1.1327-1.2898 3.1253-1.2898z"/>
12
+ <path d="m59.738 54.604-3.3486 4.5061 3.5222 4.7541h-1.7942l-2.6954-3.6379-2.6954 3.6379h-1.7942l3.5966-4.8451-3.2907-4.4151h1.7942l2.4556 3.299 2.4556-3.299z"/>
13
+ </g>
14
+ </svg>
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ import installLink from '@plone/volto-slate/editor/plugins/AdvancedLink';
3
3
  import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-bise-policy/components/manage/Blocks/schema';
4
4
 
5
5
  import installBlocks from './components/manage/Blocks';
6
- import installStyles from './components/manage/Styles';
6
+ import installStyles from './styles-config';
7
7
 
8
8
  import biseLogo from '@eeacms/volto-bise-policy/../theme//assets/images/Header/bise-logo.svg';
9
9
  import biseWhiteLogo from '@eeacms/volto-bise-policy/../theme//assets/images/Header/bise-logo-white.svg';
@@ -120,18 +120,6 @@ const applyConfig = (config) => {
120
120
  config.blocks.blocksConfig.hero_image_left.schemaEnhancer = addStylingFieldsetSchemaEnhancer;
121
121
  }
122
122
 
123
- // Plotly bise color
124
- config.settings.plotlyCustomColors = [
125
- {
126
- title: 'Biodiversity Default',
127
- colorscale: ['#094238', '#12957D', '#19C4A5'],
128
- },
129
- {
130
- title: '',
131
- colorscale: ['#12957D', '#F9EA8A', '#DD552B', '#AEB0B3'],
132
- },
133
- ];
134
-
135
123
  // Disable some blocks
136
124
  restrictedBlocks.forEach((block) => {
137
125
  if (config.blocks.blocksConfig[block]) {
@@ -1,14 +1,7 @@
1
- export default (config) => {
2
- // config.settings.plotlyChartsColorScale = [
3
- // '#ee252c',
4
- // '#d5e843',
5
- // '#33b540',
6
- // '#352d4e',
7
- // '#f9ae79',
8
- // '#87d6cb',
9
- // ...(config.settings.plotlyChartsColorScale || []),
10
- // ];
1
+ import { Icon } from '@plone/volto/components';
2
+ import contentBoxSVG from '@eeacms/volto-bise-policy/icons/content-box.svg';
11
3
 
4
+ export default (config) => {
12
5
  config.settings.available_colors = [
13
6
  '#005248', // primary color
14
7
  '#00A390', // secondary color
@@ -83,20 +76,30 @@ export default (config) => {
83
76
  { cssClass: 'white-text', label: 'White text' },
84
77
  { cssClass: 'primary-text', label: 'Primary text' },
85
78
  { cssClass: 'secondary-text', label: 'Secondary text' },
79
+ { cssClass: 'tertiary-text', label: 'Tertiary text' },
86
80
  { cssClass: 'dark-green-text', label: 'Dark green text' },
87
81
  { cssClass: 'blue-text', label: 'Blue text' },
88
82
  { cssClass: 'red-text', label: 'Red text' },
89
83
  { cssClass: 'yellow-text', label: 'Yellow text' },
90
84
  { cssClass: 'grey-text', label: 'Grey text' },
91
85
  ];
92
- // config.settings.slate.styleMenu.blockStyles = [
93
- // ...config.settings.slate.styleMenu.blockStyles,
94
- // { cssClass: 'green-block-text', label: 'Green Text' },
95
- // { cssClass: 'underline-block-text', label: 'Underline Text' },
96
- // ];
97
86
 
98
87
  config.settings.pluggableStyles = [
99
88
  ...(config.settings.pluggableStyles || []),
89
+ {
90
+ id: 'content-box-tertiary',
91
+ title: 'Tertiary',
92
+ previewComponent: () => (
93
+ <Icon name={contentBoxSVG} size="88px" className="tertiary" />
94
+ ),
95
+ viewComponent: (props) => {
96
+ return (
97
+ <div className="content-box tertiary">
98
+ <div className="content-box-inner">{props.children}</div>
99
+ </div>
100
+ );
101
+ },
102
+ },
100
103
  {
101
104
  id: 'borderBlock',
102
105
  title: 'Border',
@@ -159,5 +162,25 @@ export default (config) => {
159
162
  },
160
163
  ];
161
164
 
165
+ // Plotly bise color
166
+ config.settings.plotlyCustomColors = [
167
+ {
168
+ title: 'A2',
169
+ colorscale: [
170
+ '#3D2201',
171
+ '#603808',
172
+ '#8B5E34',
173
+ '#BC8A5F',
174
+ '#E7BC91',
175
+ '#FFEDD8',
176
+ '#FFF6EC',
177
+ ],
178
+ },
179
+ {
180
+ title: 'A1',
181
+ colorscale: ['#12957D', '#F9EA8A', '#DD552B', '#AEB0B3'],
182
+ },
183
+ ];
184
+
162
185
  return config;
163
186
  };
@@ -26,10 +26,6 @@
26
26
  text-decoration: none;
27
27
  }
28
28
 
29
- .eea.header {
30
- z-index: 4;
31
- }
32
-
33
29
  .eea.header .main.bar > .ui.container .ui.grid .column {
34
30
  display: flex;
35
31
  align-items: center;
@@ -1,16 +1,13 @@
1
1
  .primary-big-text {
2
- font-size: 45px;
3
- line-height: 45px;
2
+ font-size: 1.625rem;
4
3
  }
5
4
 
6
5
  .medium-text {
7
- font-size: 30px;
8
- line-height: 30px;
6
+ font-size: 1.25rem;
9
7
  }
10
8
 
11
9
  .small-text {
12
- font-size: 20px;
13
- line-height: 20px;
10
+ font-size: 0.8rem;
14
11
  }
15
12
 
16
13
  .white-text {
@@ -27,6 +24,10 @@
27
24
  color: @secondaryColor;
28
25
  }
29
26
 
27
+ .tertiary-text {
28
+ color: @tertiaryColor;
29
+ }
30
+
30
31
  .dark-green-text {
31
32
  color: @bottleGreen;
32
33
  }
@@ -45,4 +46,4 @@
45
46
 
46
47
  .grey-text {
47
48
  color: @tertiaryColor;
48
- }
49
+ }
@@ -50,4 +50,127 @@
50
50
  }
51
51
  }
52
52
  }
53
+ }
54
+
55
+ .is-n2k-site {
56
+ .eea.header .main.bar {
57
+ .ui.grid, .main-menu, .main-menu > ul, .main-menu > ul > li {
58
+ height: 100%;
59
+ }
60
+ }
61
+
62
+ .eea.header .main.bar .main-menu > ul > li {
63
+ padding: 0 0.5rem !important;
64
+
65
+ > a {
66
+ align-self: center;
67
+ }
68
+ }
69
+
70
+ #mega-menu {
71
+ display: grid !important;
72
+ align-content: center;
73
+
74
+
75
+ .ui.container {
76
+ width: 100%;
77
+ padding-bottom: 0;
78
+ }
79
+
80
+ .ui.accordion > button > a {
81
+ color: #fff !important;
82
+ }
83
+ }
84
+ }
85
+
86
+
87
+ .at-glance {
88
+ height: 100%;
89
+ padding: 0 2rem;
90
+ background: @secondaryColor 0% 0% no-repeat padding-box;
91
+ border-bottom: 4px solid @secondaryColor !important;
92
+ margin-bottom: -16px;
93
+ padding-bottom: 16px;
94
+ height: calc(100% + 16px);
95
+ border-bottom-left-radius: 10px;
96
+ border-bottom-right-radius: 10px;
97
+ color: #fff !important;
98
+ cursor: pointer;
99
+ display: flex;
100
+ align-items: center;
101
+
102
+ &:hover {
103
+ color: #fff !important;
104
+ border-bottom: 4px solid @secondaryColor !important;
105
+ }
106
+ }
107
+
108
+ .deep-dive {
109
+ color: @secondaryColor !important;
110
+ border-bottom: 4px solid transparent !important;
111
+
112
+ &:hover {
113
+ border-bottom: 4px solid transparent !important;
114
+ }
115
+ }
116
+
117
+ .at-glance,
118
+ .deep-dive {
119
+ font-weight: bold;
120
+ }
121
+
122
+ .with-n2k-navigation {
123
+ .eea.header {
124
+ .main.bar .ui.grid {
125
+ > :first-child:not(:last-child) {
126
+ width: 200px !important;
127
+
128
+ img {
129
+ object-fit: fill;
130
+ }
131
+ }
132
+
133
+ > :last-child:not(:first-child) {
134
+ width: calc(100% - 200px) !important;
135
+ }
136
+
137
+ @media @smallMonitorUp {
138
+ .main-menu {
139
+ justify-content: center;
140
+
141
+ ul {
142
+ padding-inline-start: 0;
143
+ justify-content: center !important;
144
+ }
145
+ }
146
+ }
147
+
148
+ }
149
+ }
150
+ }
151
+
152
+
153
+ .tabs-block {
154
+ .columns-header {
155
+ display: none;
156
+ }
157
+ }
158
+
159
+ .tabs-block.carousel_n2k {
160
+ overflow: hidden;
161
+
162
+ .slick-arrows {
163
+ .learn-more {
164
+ position: absolute;
165
+ left: 0;
166
+ width: 130px;
167
+ color: #fff !important;
168
+ text-align: left;
169
+ transform: translate(-100%, 0);
170
+
171
+ @media only screen and (max-width: 1700px) {
172
+ display: none;
173
+ }
174
+ }
175
+ }
53
176
  }
@@ -255,9 +255,9 @@ p.has--clear--both:empty {
255
255
  }
256
256
  }
257
257
 
258
- .ui.overlay.sidebar {
259
- z-index: 800;
260
- }
258
+ // .ui.overlay.sidebar {
259
+ // z-index: 800;
260
+ // }
261
261
  }
262
262
 
263
263
  .subsite.subsite-natura2000:not(.subsite-root) {
@@ -266,9 +266,9 @@ p.has--clear--both:empty {
266
266
  }
267
267
  }
268
268
 
269
- #toolbar {
270
- z-index: 6;
271
- }
269
+ // #toolbar {
270
+ // z-index: 6;
271
+ // }
272
272
 
273
273
  .simple-data-table {
274
274
  padding: 0;
@@ -0,0 +1,21 @@
1
+ .eea.header {
2
+ z-index: @zIndex;
3
+ }
4
+
5
+ .eea.header .ui.sticky {
6
+ z-index: @zIndex;
7
+ }
8
+
9
+ .sticky-navigation-anchors.full-width:not(.sticky-broken) {
10
+ z-index: @zIndex;
11
+ }
12
+
13
+ .sticky-broken {
14
+ .ui.sticky {
15
+ z-index: unset !important;
16
+ }
17
+ }
18
+
19
+ // #toolbar {
20
+ // z-index: @zIndex + 1;
21
+ // }
@@ -83,7 +83,7 @@
83
83
  @banner : 'eea';
84
84
  @timeline : 'eea';
85
85
  @footer : 'eea';
86
- @header : 'eea';
86
+ @header : 'mirage';
87
87
  @tag : 'eea';
88
88
  @tags : 'eea';
89
89
  @tagList : 'eea';
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { BlockDataForm, SidebarPortal } from '@plone/volto/components';
3
- import View from './View';
4
-
5
- import schema from './schema';
6
-
7
- const Edit = (props) => {
8
- return (
9
- <>
10
- <View {...props} mode="edit" />
11
- <SidebarPortal selected={props.selected}>
12
- <BlockDataForm
13
- schema={schema}
14
- title={schema.title}
15
- onChangeField={(id, value) => {
16
- props.onChangeBlock(props.block, {
17
- ...props.data,
18
- [id]: value,
19
- });
20
- }}
21
- onChangeBlock={props.onChangeBlock}
22
- formData={props.data}
23
- block={props.block}
24
- />
25
- </SidebarPortal>
26
- </>
27
- );
28
- };
29
-
30
- export default Edit;
@@ -1,13 +0,0 @@
1
- import { withBlockExtensions } from '@plone/volto/helpers';
2
-
3
- const View = (props) => {
4
- const Renderer = props.variation.render;
5
-
6
- return (
7
- <>
8
- <Renderer {...props} />
9
- </>
10
- );
11
- };
12
-
13
- export default withBlockExtensions(View);
@@ -1,49 +0,0 @@
1
- import imageSVG from '@plone/volto/icons/image.svg';
2
- import NavigationBlockView from './View';
3
- import NavigationBlockEdit from './Edit';
4
-
5
- export default (config) => {
6
- config.blocks.blocksConfig.newsletterSignup = {
7
- id: 'newsletterSignup',
8
- title: 'Newsletter signup',
9
- icon: imageSVG,
10
- group: 'common',
11
- view: NavigationBlockView,
12
- edit: NavigationBlockEdit,
13
- restricted: false,
14
- mostUsed: false,
15
- variations: [
16
- {
17
- id: 'default',
18
- title: 'Default',
19
- isDefault: true,
20
- render: (props) => {
21
- const { hasImage, imgSrc } = props.data;
22
-
23
- return (
24
- <>
25
- View mode
26
- {hasImage && imgSrc && (
27
- <img src={`${props.data.imgSrc}/@@images/image`} alt="asda" />
28
- )}
29
- </>
30
- );
31
- },
32
- },
33
- {
34
- id: 'enisa_newsletter',
35
- title: 'Enisa newsletter',
36
- render: () => 'is enisa newsletter',
37
- schemaEnhancer: ({ schema, formData, intl }) => {
38
- return schema;
39
- },
40
- },
41
- ],
42
- sidebarTab: 1,
43
- security: {
44
- addPermission: [],
45
- view: [],
46
- },
47
- };
48
- return config;
49
- };
@@ -1,25 +0,0 @@
1
- export default {
2
- title: 'Newsletter signup',
3
-
4
- fieldsets: [
5
- {
6
- id: 'default',
7
- title: 'Default',
8
- fields: ['hasImage', 'imgSrc'],
9
- },
10
- ],
11
-
12
- properties: {
13
- hasImage: {
14
- title: 'Has image',
15
- type: 'boolean',
16
- default: true,
17
- },
18
- imgSrc: {
19
- title: 'Image',
20
- widget: 'attachedimage',
21
- },
22
- },
23
-
24
- required: [],
25
- };