@eeacms/volto-eea-website-theme 1.19.0 → 1.20.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,34 @@ 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.20.0](https://github.com/eea/volto-eea-website-theme/compare/1.19.0...1.20.0) - 29 August 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(tests): try fixing failing test on cypress [kreafox - [`6a3f261`](https://github.com/eea/volto-eea-website-theme/commit/6a3f261a1ff11245f40899cf8f75420077b993a6)]
12
+ - fix(tests): undo changes on BaseTag [kreafox - [`b74cbf2`](https://github.com/eea/volto-eea-website-theme/commit/b74cbf28276cddaa32cda6d7edceae0a6094b2ff)]
13
+ - fix(tests): comment BaseTag [kreafox - [`d1fd9d1`](https://github.com/eea/volto-eea-website-theme/commit/d1fd9d1d801c2a4de6e08aefd6f4f91076bb17f2)]
14
+
15
+ #### :house: Internal changes
16
+
17
+ - chore: remove volto-toc-block dependency - refs #256517 [dobri1408 - [`d465e45`](https://github.com/eea/volto-eea-website-theme/commit/d465e45f27416eef10a55edb85ecc75c6deaf774)]
18
+
19
+ #### :hammer_and_wrench: Others
20
+
21
+ - increase code covreage [Dobricean Ioan Dorian - [`4ff918e`](https://github.com/eea/volto-eea-website-theme/commit/4ff918edd9acb56dcbf466b759dbdd78b61b1218)]
22
+ - Release 1.20.0 [Alin Voinea - [`5fa90e1`](https://github.com/eea/volto-eea-website-theme/commit/5fa90e12d18db593400770fe48755cedda03a5e8)]
23
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`de90b72`](https://github.com/eea/volto-eea-website-theme/commit/de90b72fde94c2cf2245dfa49bd74cd9ea620f9f)]
24
+ - Cleanup [Tiberiu Ichim - [`248e953`](https://github.com/eea/volto-eea-website-theme/commit/248e9534364e550b8b0770f3f336c98e73cad434)]
25
+ - Maybe now [Tiberiu Ichim - [`361d026`](https://github.com/eea/volto-eea-website-theme/commit/361d0269c5f2ec5bad5e12727903a89aa3d1607d)]
26
+ - Protect against cypress [Tiberiu Ichim - [`64361fe`](https://github.com/eea/volto-eea-website-theme/commit/64361fefa5b2136c6b91b2f7e55ff56b5bc5bf15)]
27
+ - One more step [Tiberiu Ichim - [`858a7a3`](https://github.com/eea/volto-eea-website-theme/commit/858a7a317162316642722c30d867e9d0d04d79ea)]
28
+ - One more step [Tiberiu Ichim - [`6fd31d2`](https://github.com/eea/volto-eea-website-theme/commit/6fd31d2c17043d87acbaa786e0543d9ca1072aec)]
29
+ - Just Helmet [Tiberiu Ichim - [`56d38d9`](https://github.com/eea/volto-eea-website-theme/commit/56d38d929d50f06722e638f4fe9f46f8879b25a8)]
30
+ - Fix import [Tiberiu Ichim - [`14ecc8f`](https://github.com/eea/volto-eea-website-theme/commit/14ecc8fc41d5e35d4d16021cffc3eabe53a562c5)]
31
+ - Add client condition [Tiberiu Ichim - [`8c44a99`](https://github.com/eea/volto-eea-website-theme/commit/8c44a9962056a6e2864a57c324d60aab04928f8f)]
32
+ - Use Helmet again [Tiberiu Ichim - [`82aa4f3`](https://github.com/eea/volto-eea-website-theme/commit/82aa4f306f2a654bd9f2cc35de335eeaa35c6620)]
33
+ - Let's try this to make test pass [Tiberiu Ichim - [`327fdfb`](https://github.com/eea/volto-eea-website-theme/commit/327fdfbd2b730b19a4e8ea4907d5e4ae6018163a)]
34
+ - Refs #254325; add rss autodiscovery [Tiberiu Ichim - [`64d4df1`](https://github.com/eea/volto-eea-website-theme/commit/64d4df198880d9359dd6590fa000f71299971508)]
7
35
  ### [1.19.0](https://github.com/eea/volto-eea-website-theme/compare/1.18.1...1.19.0) - 17 August 2023
8
36
 
9
37
  #### :bug: Bug Fixes
package/README.md CHANGED
@@ -14,12 +14,11 @@
14
14
  [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-website-theme-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-website-theme-develop)
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
-
18
17
  EEA Website [Volto](https://github.com/plone/volto) Theme
19
18
 
20
19
  ## Demo
21
20
 
22
- - https://demo-www.eea.europa.eu
21
+ - https://www.eea.europa.eu
23
22
 
24
23
  ## Getting started
25
24
 
@@ -42,25 +41,25 @@ Go to http://localhost:3000
42
41
 
43
42
  1. Start Volto frontend
44
43
 
45
- * If you already have a volto project, just update `package.json`:
44
+ - If you already have a volto project, just update `package.json`:
46
45
 
47
- ```JSON
48
- "addons": [
49
- "@eeacms/volto-eea-website-theme"
50
- ],
46
+ ```JSON
47
+ "addons": [
48
+ "@eeacms/volto-eea-website-theme"
49
+ ],
51
50
 
52
- "dependencies": {
53
- "@eeacms/volto-eea-website-theme": "^1.0.0"
54
- }
55
- ```
51
+ "dependencies": {
52
+ "@eeacms/volto-eea-website-theme": "^1.0.0"
53
+ }
54
+ ```
56
55
 
57
- * If not, create one:
56
+ - If not, create one:
58
57
 
59
- ```
60
- npm install -g yo @plone/generator-volto
61
- yo @plone/volto my-volto-project --addon @eeacms/volto-eea-website-theme
62
- cd my-volto-project
63
- ```
58
+ ```
59
+ npm install -g yo @plone/generator-volto
60
+ yo @plone/volto my-volto-project --addon @eeacms/volto-eea-website-theme
61
+ cd my-volto-project
62
+ ```
64
63
 
65
64
  1. Install new add-ons and restart Volto:
66
65
 
@@ -81,6 +80,11 @@ See [RELEASE.md](https://github.com/eea/volto-eea-website-theme/blob/master/RELE
81
80
 
82
81
  See [DEVELOP.md](https://github.com/eea/volto-eea-website-theme/blob/master/DEVELOP.md).
83
82
 
83
+ ## Docusaurus and Storybook
84
+
85
+ See [Docusaurus](https://eea.github.io/).
86
+ See [Storybook](https://eea.github.io/eea-storybook/).
87
+
84
88
  ## Copyright and license
85
89
 
86
90
  The Initial Owner of the Original Code is European Environment Agency (EEA).
@@ -1,11 +1,12 @@
1
1
  version: "3"
2
2
  services:
3
3
  backend:
4
- image: plone/plone-backend:${PLONE_VERSION:-6}
4
+ image: eeacms/plone-backend
5
5
  ports:
6
6
  - "8080:8080"
7
7
  environment:
8
8
  SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
9
10
 
10
11
  frontend:
11
12
  build:
@@ -23,6 +24,9 @@ services:
23
24
  volumes:
24
25
  - ./:/app/src/addons/${ADDON_PATH}
25
26
  environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
26
30
  RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
27
31
  RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
28
32
  HOST: "0.0.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.19.0",
3
+ "version": "1.20.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",
@@ -16,6 +16,34 @@ const infoSchema = {
16
16
  required: [],
17
17
  };
18
18
 
19
+ const RSSLink = {
20
+ title: 'RSS Link',
21
+ fieldsets: [
22
+ {
23
+ id: 'default',
24
+ title: 'Default',
25
+ fields: ['title', 'feedType', 'href'],
26
+ },
27
+ ],
28
+ properties: {
29
+ title: {
30
+ title: 'Title',
31
+ },
32
+ feedType: {
33
+ title: 'Feed Type',
34
+ choices: [
35
+ ['rss2', 'RSS2'],
36
+ ['atom', 'ATOM'],
37
+ ],
38
+ default: 'rss2',
39
+ },
40
+ href: {
41
+ title: 'URL Path',
42
+ },
43
+ },
44
+ required: [],
45
+ };
46
+
19
47
  export default {
20
48
  title: 'Page header',
21
49
  fieldsets: [
@@ -33,7 +61,7 @@ export default {
33
61
  {
34
62
  id: 'actions',
35
63
  title: 'Actions',
36
- fields: ['hideShareButton', 'hideDownloadButton'],
64
+ fields: ['hideShareButton', 'hideDownloadButton', 'rssLinks'],
37
65
  },
38
66
  {
39
67
  id: 'copyright',
@@ -66,6 +94,11 @@ export default {
66
94
  title: 'Hide download button',
67
95
  type: 'boolean',
68
96
  },
97
+ rssLinks: {
98
+ title: 'RSS Links',
99
+ widget: 'object_list',
100
+ schema: RSSLink,
101
+ },
69
102
  info: {
70
103
  title: 'Extra info',
71
104
  widget: 'object_list',
@@ -1,4 +1,5 @@
1
1
  import React, { useCallback, useMemo, useRef } from 'react';
2
+ import { Helmet } from '@plone/volto/helpers';
2
3
  import { compose } from 'redux';
3
4
  import { connect } from 'react-redux';
4
5
  import { withRouter } from 'react-router';
@@ -41,6 +42,10 @@ const messages = defineMessages({
41
42
  id: 'Modified',
42
43
  defaultMessage: 'Modified',
43
44
  },
45
+ rssFeed: {
46
+ id: 'rssFeed',
47
+ defaultMessage: 'RSS Feed',
48
+ },
44
49
  });
45
50
 
46
51
  const friendlyId = (id) => {
@@ -74,6 +79,7 @@ const View = (props) => {
74
79
  copyright,
75
80
  copyrightIcon,
76
81
  copyrightPosition,
82
+ rssLinks,
77
83
  // contentType,
78
84
  } = props.data;
79
85
  const copyrightPrefix =
@@ -165,6 +171,31 @@ const View = (props) => {
165
171
  }}
166
172
  />
167
173
  )}
174
+ {rssLinks?.map((rssLink, index) => (
175
+ <>
176
+ <Helmet
177
+ link={[
178
+ {
179
+ rel: 'alternate',
180
+ title:
181
+ rssLink.title ?? intl.formatMessage(messages.rssFeed),
182
+ href: rssLink.href,
183
+ type:
184
+ rssLink.feedType === 'atom'
185
+ ? 'application/atom+xml'
186
+ : 'application/rss+xml',
187
+ },
188
+ ]}
189
+ />
190
+ <Banner.Action
191
+ icon="ri-rss-fill"
192
+ title={rssLink.title ?? intl.formatMessage(messages.rssFeed)}
193
+ className="rssfeed"
194
+ href={rssLink.href}
195
+ target="_blank"
196
+ />
197
+ </>
198
+ ))}
168
199
  </>
169
200
  }
170
201
  >
@@ -0,0 +1,11 @@
1
+ import { useSelector } from 'react-redux';
2
+ import { flattenToAppURL, Helmet } from '@plone/volto/helpers';
3
+
4
+ export default function BaseTag(props) {
5
+ const contentId = useSelector((store) => store?.content?.data?.['@id']);
6
+ const baseHref = contentId ? flattenToAppURL(contentId) : null;
7
+
8
+ return baseHref !== null ? (
9
+ <Helmet base={{ target: '_blank', href: `${baseHref}/` }} />
10
+ ) : null;
11
+ }
package/src/index.js CHANGED
@@ -1,21 +1,27 @@
1
- import * as eea from './config';
2
- import InpageNavigation from '@eeacms/volto-eea-design-system/ui/InpageNavigation/InpageNavigation';
3
- import installCustomTitle from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title';
4
- import installLayoutSettingsBlock from '@eeacms/volto-eea-website-theme/components/manage/Blocks/LayoutSettings';
5
- import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
1
+ import { Icon } from '@plone/volto/components';
2
+ import { getBlocks } from '@plone/volto/helpers';
6
3
  import CustomCSS from '@eeacms/volto-eea-website-theme/components/theme/CustomCSS/CustomCSS';
7
- import NotFound from '@eeacms/volto-eea-website-theme/components/theme/NotFound/NotFound';
8
4
  import DraftBackground from '@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground';
9
- import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
5
+ import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
6
+ import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
7
+ import InpageNavigation from '@eeacms/volto-eea-design-system/ui/InpageNavigation/InpageNavigation';
8
+ import NotFound from '@eeacms/volto-eea-website-theme/components/theme/NotFound/NotFound';
10
9
  import { TopicsWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TopicsWidget';
10
+ import { TokenWidget } from '@eeacms/volto-eea-website-theme/components/theme/Widgets/TokenWidget';
11
+
12
+ import { addStylingFieldsetSchemaEnhancer } from '@eeacms/volto-eea-website-theme/helpers/schema-utils';
13
+ import installCustomTitle from '@eeacms/volto-eea-website-theme/components/manage/Blocks/Title';
14
+ import installLayoutSettingsBlock from '@eeacms/volto-eea-website-theme/components/manage/Blocks/LayoutSettings';
15
+
16
+ import BaseTag from './components/theme/BaseTag';
11
17
  import SubsiteClass from './components/theme/SubsiteClass';
12
- import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
13
- import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
14
- import { Icon } from '@plone/volto/components';
15
18
  import contentBoxSVG from './icons/content-box.svg';
16
- import voltoCustomMiddleware from './middleware/voltoCustom';
17
- import okMiddleware from './middleware/ok';
19
+
18
20
  import installSlate from './slate';
21
+ import okMiddleware from './middleware/ok';
22
+ import voltoCustomMiddleware from './middleware/voltoCustom';
23
+
24
+ import * as eea from './config';
19
25
 
20
26
  const restrictedBlocks = [
21
27
  '__grid', // Grid/Teaser block (kitconcept)
@@ -120,6 +126,26 @@ const applyConfig = (config) => {
120
126
  // Apply columns block customization
121
127
  if (config.blocks.blocksConfig.columnsBlock) {
122
128
  config.blocks.blocksConfig.columnsBlock.available_colors = eea.colors;
129
+ config.blocks.blocksConfig.columnsBlock.tocEntries = (
130
+ block = {},
131
+ tocData,
132
+ ) => {
133
+ // integration with volto-block-toc
134
+ const headlines = tocData.levels || ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
135
+ let entries = [];
136
+ const sorted_column_blocks = getBlocks(block?.data || {});
137
+ sorted_column_blocks.forEach((column_block) => {
138
+ const sorted_blocks = getBlocks(column_block[1]);
139
+ sorted_blocks.forEach((block) => {
140
+ const { value, plaintext } = block[1];
141
+ const type = value?.[0]?.type;
142
+ if (headlines.includes(type)) {
143
+ entries.push([parseInt(type.slice(1)), plaintext, block[0]]);
144
+ }
145
+ });
146
+ });
147
+ return entries;
148
+ };
123
149
  }
124
150
 
125
151
  // Description block custom CSS
@@ -166,6 +192,10 @@ const applyConfig = (config) => {
166
192
  match: '',
167
193
  component: SubsiteClass,
168
194
  },
195
+ {
196
+ match: '',
197
+ component: BaseTag,
198
+ },
169
199
  ];
170
200
 
171
201
  config = installSlate(config);