@eeacms/volto-eea-website-theme 1.18.0 → 1.19.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,28 @@ 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.19.0](https://github.com/eea/volto-eea-website-theme/compare/1.18.1...1.19.0) - 17 August 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(filter): switch arrows for closed and opened states as before the refactoring [David Ichim - [`e228390`](https://github.com/eea/volto-eea-website-theme/commit/e228390bdcd675360b9edd61b550dc1c382d7010)]
12
+ - fix: align token widget to EEA DS - refs #256406 [Alin Voinea - [`f936549`](https://github.com/eea/volto-eea-website-theme/commit/f9365495b7ffb748429751c47ecc70daa33a25af)]
13
+
14
+ #### :nail_care: Enhancements
15
+
16
+ - refactor: Rename ThemesWidget to TopicsWidget and register it on topics id - refs #256408 [Alin Voinea - [`7648b3d`](https://github.com/eea/volto-eea-website-theme/commit/7648b3d47f1a59a5f570465503014792b3f8ed85)]
17
+
18
+ #### :house: Documentation changes
19
+
20
+ - docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`5e25196`](https://github.com/eea/volto-eea-website-theme/commit/5e2519698c2720e36e63723879518d972fcaad7a)]
21
+
22
+ #### :hammer_and_wrench: Others
23
+
24
+ - bump package release version [David Ichim - [`19ecef9`](https://github.com/eea/volto-eea-website-theme/commit/19ecef9a61025fc7b3095d09aff62c67d3e36b36)]
25
+ - Undo previous commit [laszlocseh - [`65db1ac`](https://github.com/eea/volto-eea-website-theme/commit/65db1acef78ecbc0a72add0bef01a5deb7cd4051)]
26
+ - Added renderLinkElement to volto-slate/editor/render.jsx customization [laszlocseh - [`21799ec`](https://github.com/eea/volto-eea-website-theme/commit/21799ecd2dca868ebcdd4c8e12b56207f1a578ac)]
27
+ ### [1.18.1](https://github.com/eea/volto-eea-website-theme/compare/1.18.0...1.18.1) - 26 June 2023
28
+
7
29
  ### [1.18.0](https://github.com/eea/volto-eea-website-theme/compare/1.17.2...1.18.0) - 20 June 2023
8
30
 
9
31
  #### :rocket: New Features
@@ -22,6 +44,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
22
44
 
23
45
  #### :hammer_and_wrench: Others
24
46
 
47
+ - Release 1.18.0 #154 from eea/develop [ichim-david - [`9e47abb`](https://github.com/eea/volto-eea-website-theme/commit/9e47abb88ec371b142caf177d114ccff49a53082)]
25
48
  - Refs #254132 - Bump to 1.18.0. [GhitaB - [`51f483b`](https://github.com/eea/volto-eea-website-theme/commit/51f483b3dba6cff13471fc512d372b577991f6f4)]
26
49
  - Refs #254132 - Do not initialize actions with []. Make sure actions in footerOpts are used if set. [GhitaB - [`8c0afb5`](https://github.com/eea/volto-eea-website-theme/commit/8c0afb539b0c96928545bc9a6974a189c9e886b8)]
27
50
  - test: Fix sonarqube - Convert the conditional to a boolean to avoid leaked value [Alin Voinea - [`195eb19`](https://github.com/eea/volto-eea-website-theme/commit/195eb19b8aa40a95bca6aafc7720bdc6b8e02340)]
package/DEVELOP.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## Develop
4
4
 
5
+ 1. Make sure you have `docker` and `docker compose` installed and running on your machine:
6
+
7
+ ```Bash
8
+ git clone https://github.com/eea/volto-eea-website-theme.git
9
+ cd volto-eea-website-theme
10
+ git checkout -b bugfix-123456 develop
11
+ make
12
+ make start
13
+ ```
14
+
15
+ 1. Wait for `Volto started at 0.0.0.0:3000` meesage
16
+
17
+ 1. Go to http://localhost:3000
18
+
19
+ 1. Happy hacking!
20
+
21
+ ```Bash
22
+ cd src/addons/volto-eea-website-theme/
23
+ ```
24
+
25
+ ### Or add @eeacms/volto-eea-website-theme to your Volto project
26
+
5
27
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
28
 
7
29
  1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
@@ -49,3 +71,37 @@ Before starting make sure your development environment is properly set. See [Vol
49
71
  1. Happy hacking!
50
72
 
51
73
  cd src/addons/volto-eea-website-theme/
74
+
75
+ ## Cypress
76
+
77
+ To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
78
+
79
+ You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
80
+ project where you added `volto-eea-website-theme` to `mrs.developer.json`
81
+
82
+ Go to:
83
+
84
+ ```BASH
85
+ cd src/addons/volto-eea-website-theme/
86
+ ```
87
+
88
+ Start:
89
+
90
+ ```Bash
91
+ make
92
+ make start
93
+ ```
94
+
95
+ This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-eea-website-theme` block installed.
96
+
97
+ Open Cypress Interface:
98
+
99
+ ```Bash
100
+ make cypress-open
101
+ ```
102
+
103
+ Or run it:
104
+
105
+ ```Bash
106
+ make cypress-run
107
+ ```
package/README.md CHANGED
@@ -23,10 +23,23 @@ EEA Website [Volto](https://github.com/plone/volto) Theme
23
23
 
24
24
  ## Getting started
25
25
 
26
+ ### Try volto-eea-website-theme with Docker
27
+
28
+ git clone https://github.com/eea/volto-eea-website-theme.git
29
+ cd volto-eea-website-theme
30
+ make
31
+ make start
32
+
33
+ Go to http://localhost:3000
34
+
26
35
  ### Add volto-eea-website-theme to your Volto project
27
36
 
28
37
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
29
38
 
39
+ ```Bash
40
+ docker compose up backend
41
+ ```
42
+
30
43
  1. Start Volto frontend
31
44
 
32
45
  * If you already have a volto project, just update `package.json`:
@@ -0,0 +1,28 @@
1
+ version: "3"
2
+ services:
3
+ backend:
4
+ image: plone/plone-backend:${PLONE_VERSION:-6}
5
+ ports:
6
+ - "8080:8080"
7
+ environment:
8
+ SITE: "Plone"
9
+
10
+ frontend:
11
+ build:
12
+ context: ./
13
+ dockerfile: ./Dockerfile
14
+ args:
15
+ ADDON_NAME: "${ADDON_NAME}"
16
+ ADDON_PATH: "${ADDON_PATH}"
17
+ VOLTO_VERSION: ${VOLTO_VERSION:-16}
18
+ ports:
19
+ - "3000:3000"
20
+ - "3001:3001"
21
+ depends_on:
22
+ - backend
23
+ volumes:
24
+ - ./:/app/src/addons/${ADDON_PATH}
25
+ environment:
26
+ RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
27
+ RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
28
+ HOST: "0.0.0.0"
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
package/locales/volto.pot CHANGED
@@ -0,0 +1,16 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Plone\n"
4
+ "POT-Creation-Date: 2023-06-28T10:48:22.678Z\n"
5
+ "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
+ "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
+ "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=utf-8\n"
9
+ "Content-Transfer-Encoding: 8bit\n"
10
+ "Plural-Forms: nplurals=1; plural=0;\n"
11
+ "Language-Code: en\n"
12
+ "Language-Name: English\n"
13
+ "Preferred-Encodings: utf-8\n"
14
+ "Domain: volto\n"
15
+
16
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.18.0",
3
+ "version": "1.19.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",
@@ -4,7 +4,7 @@ import Tag from '@eeacms/volto-eea-design-system/ui/Tag/Tag';
4
4
 
5
5
  export const TokenWidget = ({ value, children, className }) =>
6
6
  value ? (
7
- <span className={cx(className, 'token', 'widget')}>
7
+ <div className={cx(className, 'token', 'widget', 'tags-content')}>
8
8
  {value.map((tag) => (
9
9
  <Tag
10
10
  href={`https://www.eea.europa.eu/en/advanced-search?q=${tag}`}
@@ -13,7 +13,7 @@ export const TokenWidget = ({ value, children, className }) =>
13
13
  {children ? children(tag) : tag}
14
14
  </Tag>
15
15
  ))}
16
- </span>
16
+ </div>
17
17
  ) : (
18
18
  ''
19
19
  );
@@ -2,18 +2,18 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import Tag from '@eeacms/volto-eea-design-system/ui/Tag/Tag';
4
4
 
5
- export const ThemesWidget = ({ value, children, className }) => {
5
+ export const TopicsWidget = ({ value, children, className }) => {
6
6
  return value ? (
7
- <span className={cx(className, 'token', 'widget')}>
7
+ <div className={cx(className, 'token', 'widget', 'tags-content')}>
8
8
  {value.map((tag) => (
9
9
  <Tag
10
- href={`https://www.eea.europa.eu/en/advanced-search?filters[0][field]=topic&filters[0][values][0]=${tag.title}&filters[0][type]=any&filters[1][field]=language&filters[1][type]=any&filters[1][values][0]=en&sort-field=issued.date&sort-direction=desc`}
10
+ href={`https://www.eea.europa.eu/en/advanced-search?filters[0][field]=topic&filters[0][values][0]=${tag.title}&filters[0][type]=any&filters[1][field]=language&filters[1][type]=any&filters[1][values][0]=en&filters[2][field]=issued.date&filters[2][values][0]=Last 5 years&filters[2][type]=any&sort-field=issued.date&sort-direction=desc`}
11
11
  key={tag.token}
12
12
  >
13
13
  {children ? children(tag.title) : tag.title}
14
14
  </Tag>
15
15
  ))}
16
- </span>
16
+ </div>
17
17
  ) : (
18
18
  ''
19
19
  );
package/src/index.js CHANGED
@@ -7,7 +7,7 @@ import CustomCSS from '@eeacms/volto-eea-website-theme/components/theme/CustomCS
7
7
  import NotFound from '@eeacms/volto-eea-website-theme/components/theme/NotFound/NotFound';
8
8
  import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground';
9
9
  import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
10
- import { ThemesWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/ThemesWidget';
10
+ import { TopicsWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TopicsWidget';
11
11
  import SubsiteClass from './components/theme/SubsiteClass';
12
12
  import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
13
13
  import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
@@ -83,7 +83,26 @@ const applyConfig = (config) => {
83
83
  };
84
84
  // Apply accordion block customization
85
85
  if (config.blocks.blocksConfig.accordion) {
86
- config.blocks.blocksConfig.accordion.semanticIcon = 'ri-arrow-down-s-line';
86
+ config.blocks.blocksConfig.accordion.titleIcons = {
87
+ closed: {
88
+ leftPosition: 'ri-arrow-down-s-line',
89
+ rightPosition: 'ri-arrow-down-s-line',
90
+ },
91
+ opened: {
92
+ leftPosition: 'ri-arrow-up-s-line',
93
+ rightPosition: 'ri-arrow-up-s-line',
94
+ },
95
+ unfiltered: {
96
+ leftPosition: 'ri-filter-3-line',
97
+ rightPosition: 'ri-filter-3-line',
98
+ },
99
+ filtered: {
100
+ leftPosition: 'ri-close-line',
101
+ rightPosition: 'ri-close-line',
102
+ },
103
+ iconComponent: 'SemanticIcon',
104
+ };
105
+
87
106
  config.blocks.blocksConfig.accordion.options = {};
88
107
  config.blocks.blocksConfig.accordion.defaults.theme = 'secondary';
89
108
  }
@@ -113,7 +132,7 @@ const applyConfig = (config) => {
113
132
  }
114
133
 
115
134
  // Custom Widgets
116
- config.widgets.views.id.taxonomy_themes = ThemesWidget;
135
+ config.widgets.views.id.topics = TopicsWidget;
117
136
  config.widgets.views.id.subjects = TokenWidget;
118
137
  config.widgets.views.widget.tags = TokenWidget;
119
138
 
@@ -227,6 +246,27 @@ const applyConfig = (config) => {
227
246
  },
228
247
  ];
229
248
 
249
+ // mega menu layout settings
250
+ config.settings.menuItemsLayouts = {
251
+ '/en/topics': {
252
+ menuItemChildrenListColumns: [1, 4],
253
+ menuItemColumns: [
254
+ 'at-a-glance three wide column',
255
+ 'topics-right-column nine wide column',
256
+ ],
257
+ hideChildrenFromNavigation: false,
258
+ },
259
+ '/en/countries': {
260
+ menuItemColumns: ['eight wide column', 'four wide column'],
261
+ menuItemChildrenListColumns: [5, 2],
262
+ appendExtraMenuItemsToLastColumn: true,
263
+ hideChildrenFromNavigation: false,
264
+ },
265
+ '/en/about': {
266
+ hideChildrenFromNavigation: false,
267
+ },
268
+ };
269
+
230
270
  // layout settings
231
271
  config = [installLayoutSettingsBlock].reduce(
232
272
  (acc, apply) => apply(acc),
package/src/slate.js CHANGED
@@ -17,6 +17,8 @@ import clearIcon from './icons/eraser.svg';
17
17
 
18
18
  const toggleBlockClassFormat = (editor, format) => {
19
19
  const levels = Array.from(Editor.levels(editor, editor.selection));
20
+ // TODO: someone fix this
21
+ if (levels.length < 2) return false;
20
22
  const [, [, path]] = levels;
21
23
  Transforms.setNodes(
22
24
  editor,
@@ -30,7 +32,9 @@ const toggleBlockClassFormat = (editor, format) => {
30
32
 
31
33
  const isBlockClassActive = (editor, format) => {
32
34
  if (!editor.selection) return false;
35
+ // TODO: someone fix this
33
36
  const levels = Array.from(Editor.levels(editor, editor.selection));
37
+ if (levels.length < 2) return false;
34
38
  const [, [node]] = levels;
35
39
  return node.styleName === format;
36
40
  };
@@ -1 +0,0 @@
1
- module.exports = require('@plone/volto/babel');