@eeacms/volto-eea-website-theme 0.7.6 → 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.
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
2
2
 
3
3
  function applyDefault(api) {
4
4
  const voltoBabel = defaultBabel(api);
5
- voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
5
+ voltoBabel.plugins.push('istanbul');
6
6
  return voltoBabel;
7
7
  }
8
8
 
@@ -0,0 +1 @@
1
+ module.exports = require('@plone/volto/babel');
package/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ 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.0](https://github.com/eea/volto-eea-website-theme/compare/0.7.7...1.0.0) - 28 October 2022
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`025ef41`](https://github.com/eea/volto-eea-website-theme/commit/025ef419feff51ab9c8d838bbdb8863ed2e6ed9c)]
12
+ - change(theme): added human-readable labels for homepage views [David Ichim - [`bd320c3`](https://github.com/eea/volto-eea-website-theme/commit/bd320c3f04a330ea3e6831edc6dcaf55f05fa25f)]
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - test(cypress): Upgrade to Cypress 10 / Razzle 4 [Alin Voinea - [`a0b0b85`](https://github.com/eea/volto-eea-website-theme/commit/a0b0b85cb18a3041b23fd4abc76f2839b4109ae8)]
17
+ - Cleanup [Alin Voinea - [`c42299e`](https://github.com/eea/volto-eea-website-theme/commit/c42299ec830d0704d4103651efc41ecc99f647e3)]
18
+ - Update dependencies [Alin Voinea - [`6c2bddd`](https://github.com/eea/volto-eea-website-theme/commit/6c2bdddd5bb122b67bf29edaed58191a3cf3bfa3)]
19
+ ### [0.7.7](https://github.com/eea/volto-eea-website-theme/compare/0.7.6...0.7.7) - 19 October 2022
20
+
21
+ #### :hammer_and_wrench: Others
22
+
23
+ - feature(theme): added context copyright component [g-stamatis - [`ab4079c`](https://github.com/eea/volto-eea-website-theme/commit/ab4079c2be9bc7eff46f84ef83d552431f8e79bc)]
24
+ - Fix hardcoded search link [kreafox - [`c42d32e`](https://github.com/eea/volto-eea-website-theme/commit/c42d32eee8f1e0974da1526dccb8ac12e92d4bef)]
25
+ - Better handling of active view [kreafox - [`944ce20`](https://github.com/eea/volto-eea-website-theme/commit/944ce20fa3cc10beb02d05cf1f8261d3988520ac)]
7
26
  ### [0.7.6](https://github.com/eea/volto-eea-website-theme/compare/0.7.5...0.7.6) - 5 October 2022
8
27
 
9
28
  #### :rocket: New Features
@@ -26,7 +45,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
26
45
 
27
46
  #### :hammer_and_wrench: Others
28
47
 
29
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
30
48
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
31
49
 
32
50
  #### :hammer_and_wrench: Others
@@ -294,7 +312,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
294
312
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
295
313
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
296
314
  - feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
297
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
298
315
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
299
316
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
300
317
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -336,5 +353,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
336
353
 
337
354
  #### :hammer_and_wrench: Others
338
355
 
339
- - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
340
356
  - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
package/README.md CHANGED
@@ -15,36 +15,14 @@
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-website-theme-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme-develop)
16
16
 
17
17
 
18
- [Volto](https://github.com/plone/volto) add-on
18
+ EEA Website [Volto](https://github.com/plone/volto) Theme
19
19
 
20
- ## Features
20
+ ## Demo
21
21
 
22
- Demo GIF
22
+ - https://demo-www.eea.europa.eu
23
23
 
24
24
  ## Getting started
25
25
 
26
- ### Try volto-eea-website-theme with Docker
27
-
28
- 1. Get the latest Docker images
29
-
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
34
-
35
- 1. Start Plone backend
36
- ```
37
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
38
- ```
39
-
40
- 1. Start Volto frontend
41
-
42
- ```
43
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-eea-website-theme" plone/volto
44
- ```
45
-
46
- 1. Go to http://localhost:3000
47
-
48
26
  ### Add volto-eea-website-theme to your Volto project
49
27
 
50
28
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (api) {
2
2
  api.cache(true);
3
- const presets = ['razzle/babel'];
3
+ const presets = ['razzle'];
4
4
  const plugins = [
5
5
  [
6
6
  'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -9,18 +9,18 @@ module.exports = {
9
9
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
10
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
11
  '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@root/(.*)$': '<rootDir>/src/$1',
12
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
- 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '@plone/volto-slate':
16
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
15
17
  '~/(.*)$': '<rootDir>/src/$1',
16
18
  'load-volto-addons':
17
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
18
21
  },
19
22
  transform: {
20
23
  '^.+\\.js(x)?$': 'babel-jest',
21
- '^.+\\.css$': 'jest-css-modules',
22
- '^.+\\.less$': 'jest-css-modules',
23
- '^.+\\.scss$': 'jest-css-modules',
24
24
  '^.+\\.(png)$': 'jest-file',
25
25
  '^.+\\.(jpg)$': 'jest-file',
26
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "0.7.6",
3
+ "version": "1.0.0",
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",
@@ -8,6 +8,7 @@
8
8
  "homepage": "https://github.com/eea/volto-eea-website-theme",
9
9
  "keywords": [
10
10
  "volto-addon",
11
+ "volto-theme",
11
12
  "volto",
12
13
  "plone",
13
14
  "react"
@@ -20,31 +21,33 @@
20
21
  "url": "git@github.com:eea/volto-eea-website-theme.git"
21
22
  },
22
23
  "dependencies": {
23
- "@plone/scripts": "*",
24
24
  "@eeacms/volto-eea-design-system": "*",
25
25
  "slate": "^0.71.0",
26
26
  "slate-react": "^0.71.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@cypress/code-coverage": "^3.9.5",
29
+ "@plone/scripts": "*",
30
+ "@cypress/code-coverage": "^3.10.0",
30
31
  "babel-plugin-transform-class-properties": "^6.24.1",
31
32
  "md5": "^2.3.0"
32
33
  },
33
34
  "scripts": {
34
35
  "release": "release-it",
36
+ "release-major-beta": "release-it major --preRelease=beta",
37
+ "release-beta": "release-it --preRelease=beta",
35
38
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
36
39
  "test": "make test",
37
40
  "test:fix": "make test-update",
38
41
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
39
- "stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
40
- "stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
41
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
42
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
43
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
44
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
45
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
46
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
47
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
48
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
42
+ "stylelint": "make stylelint",
43
+ "stylelint:overrides": "make stylelint-overrides",
44
+ "stylelint:fix": "make stylelint-fix",
45
+ "prettier": "make prettier",
46
+ "prettier:fix": "make prettier-fix",
47
+ "lint": "make lint",
48
+ "lint:fix": "make lint-fix",
49
+ "i18n": "make i18n",
50
+ "cypress:run": "make cypress-run",
51
+ "cypress:open": "make cypress-open"
49
52
  }
50
53
  }
package/src/config.js CHANGED
@@ -248,6 +248,21 @@ export const websiteTitle = 'Site';
248
248
  export const organisationName = 'European Environment Agency';
249
249
  export const logoTargetUrl = '/';
250
250
 
251
+ export const headerSearchBox = [
252
+ {
253
+ isDefault: true,
254
+ path: '/en/advanced-search',
255
+ placeholder: 'Search...',
256
+ },
257
+ {
258
+ path: '/en/datahub',
259
+ placeholder: 'Search Datahub...',
260
+ description:
261
+ 'Looking for more information? Try searching the full EEA website content',
262
+ buttonTitle: 'Go to full site search',
263
+ },
264
+ ];
265
+
251
266
  export const colors = [
252
267
  // Primary & shades
253
268
  '#007B6C',
@@ -2,14 +2,23 @@ import React from 'react';
2
2
  import { Container, Input } from 'semantic-ui-react';
3
3
  import { withRouter } from 'react-router-dom';
4
4
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
+ import config from '@plone/volto/registry';
5
6
 
6
7
  function HeaderSearchPopUp({
7
8
  history,
9
+ location,
8
10
  onClose,
9
11
  searchInputRef,
10
12
  triggerRefs = [],
11
13
  }) {
12
14
  const nodeRef = React.useRef();
15
+ const { eea } = config.settings;
16
+ const defaultView = eea.headerSearchBox.filter((v) => v.isDefault);
17
+ const localView = eea.headerSearchBox.filter((v) =>
18
+ location.pathname.includes(v.path),
19
+ );
20
+ const activeView = localView.length > 0 ? localView[0] : defaultView[0];
21
+
13
22
  const [text, setText] = React.useState('');
14
23
 
15
24
  useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
@@ -20,7 +29,7 @@ function HeaderSearchPopUp({
20
29
  };
21
30
 
22
31
  const onSubmit = (event) => {
23
- history.push(`/en/advanced-search?q=${text}`);
32
+ history.push(`${activeView.path}?q=${text}`);
24
33
 
25
34
  if (window?.searchContext?.resetSearch) {
26
35
  window.searchContext.resetSearch({ searchTerm: text });
@@ -31,24 +40,40 @@ function HeaderSearchPopUp({
31
40
  };
32
41
 
33
42
  return (
34
- <form id="search-box" ref={nodeRef} method="get" onSubmit={onSubmit}>
35
- <Container>
36
- <div className="wrapper">
37
- <Input
38
- ref={searchInputRef}
39
- className="search"
40
- onChange={onChangeText}
41
- icon={{
42
- className: 'ri-search-line',
43
- link: true,
44
- onClick: onSubmit,
45
- }}
46
- placeholder="Search..."
47
- fluid
48
- />
43
+ <div id="search-box" ref={nodeRef}>
44
+ <form method="get" onSubmit={onSubmit}>
45
+ <Container>
46
+ <div className="wrapper">
47
+ <Input
48
+ ref={searchInputRef}
49
+ className="search"
50
+ onChange={onChangeText}
51
+ icon={{
52
+ className: 'ri-search-line',
53
+ link: true,
54
+ onClick: onSubmit,
55
+ }}
56
+ placeholder={activeView.placeholder}
57
+ fluid
58
+ />
59
+ </div>
60
+ </Container>
61
+ </form>
62
+ {(activeView.description || activeView.buttonTitle) && (
63
+ <div className="advanced-search">
64
+ <Container>
65
+ <p>{activeView.description}</p>
66
+ <a
67
+ href={defaultView[0].path}
68
+ className="ui button white inverted"
69
+ title="Advanced search"
70
+ >
71
+ {activeView.buttonTitle}
72
+ </a>
73
+ </Container>
49
74
  </div>
50
- </Container>
51
- </form>
75
+ )}
76
+ </div>
52
77
  );
53
78
  }
54
79
 
package/src/index.js CHANGED
@@ -25,7 +25,11 @@ const applyConfig = (config) => {
25
25
  homepage_view: HomePageView,
26
26
  homepage_inverse_view: HomePageInverseView,
27
27
  };
28
-
28
+ config.views.layoutViewsNamesMapping = {
29
+ ...(config.views.layoutViewsNamesMapping || {}),
30
+ homepage_view: 'Homepage view',
31
+ homepage_inverse_view: 'Homepage white view',
32
+ };
29
33
  // Apply accordion block customization
30
34
  if (config.blocks.blocksConfig.accordion) {
31
35
  config.blocks.blocksConfig.accordion.semanticIcon = 'ri-arrow-down-s-line';
@@ -109,6 +109,7 @@
109
109
  @callout : 'eea';
110
110
  @quote : 'eea';
111
111
  @hero : 'eea';
112
+ @copyright : 'eea';
112
113
 
113
114
  /*******************************
114
115
  Folders
package/cypress.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "baseUrl": "http://localhost:3000",
3
- "viewportWidth": 1280,
4
- "defaultCommandTimeout": 8888,
5
- "chromeWebSecurity": false,
6
- "reporter": "junit",
7
- "video": true,
8
- "retries": {
9
- "runMode": 8,
10
- "openMode": 0
11
- },
12
- "reporterOptions": {
13
- "mochaFile": "cypress/reports/cypress-[hash].xml",
14
- "jenkinsMode": true,
15
- "toConsole": true
16
- }
17
- }