@eeacms/volto-eea-website-theme 1.11.2 → 1.12.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,12 +4,51 @@ 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.12.0](https://github.com/eea/volto-eea-website-theme/compare/1.11.3...1.12.0) - 24 March 2023
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - change(banner): modified title of share buttons [David Ichim - [`c6dcbb5`](https://github.com/eea/volto-eea-website-theme/commit/c6dcbb534d26155d82d8a2729c454fbe3e2b312b)]
12
+ - change(banner): use custom-made Popup for better accessibility [David Ichim - [`955abf1`](https://github.com/eea/volto-eea-website-theme/commit/955abf1c525841577b7cc737871e9640c64a10dc)]
13
+ - change(banner): removed title parameter from MetadataField [David Ichim - [`aff3b6a`](https://github.com/eea/volto-eea-website-theme/commit/aff3b6a8302be165c6bce5cc20d3da734c81fc87)]
14
+
15
+ #### :hammer_and_wrench: Others
16
+
17
+ - Release 1.12.0 [Alin Voinea - [`4f77af8`](https://github.com/eea/volto-eea-website-theme/commit/4f77af895d6ba9952fa54b1928bbb9f56543765d)]
18
+ - (feat):Page Header Banner accessibility #119 from eea/banner-accesibility [ichim-david - [`3102129`](https://github.com/eea/volto-eea-website-theme/commit/3102129fe6e1416c566522d7da90fd1f118726d5)]
19
+ - delete id [Dobricean Ioan Dorian - [`500727f`](https://github.com/eea/volto-eea-website-theme/commit/500727f87b93dc2c1498c1ed1861d93e464532f4)]
20
+ - final version [Dobricean Ioan Dorian - [`f26adf4`](https://github.com/eea/volto-eea-website-theme/commit/f26adf4fb584a1f7f31a177852bfbde1a15ebd4f)]
21
+ - popup accesibility [Dobricean Ioan Dorian - [`14961bd`](https://github.com/eea/volto-eea-website-theme/commit/14961bdf6bdfcd2a83c53f8fbca83671833217f7)]
22
+ ### [1.11.3](https://github.com/eea/volto-eea-website-theme/compare/1.11.2...1.11.3) - 24 March 2023
23
+
24
+ #### :rocket: New Features
25
+
26
+ - feat: add 'with-title-block' class to body [Miu Razvan - [`6fdf40f`](https://github.com/eea/volto-eea-website-theme/commit/6fdf40f603559a99ceca2ad9066d86b42ab09d5d)]
27
+
28
+ #### :nail_care: Enhancements
29
+
30
+ - change(header): Remove customization moved to volto-eea-design-system [Krisztina Elekes - [`9276965`](https://github.com/eea/volto-eea-website-theme/commit/92769656f56caeaf32fcdf4ae6d623698c07f386)]
31
+ - change(colors): update the design system colour palette defined in package config #123 from eea/update-color-palette [ichim-david - [`ba3b729`](https://github.com/eea/volto-eea-website-theme/commit/ba3b729d90e44fff6cd27e7b45239ef802008dbb)]
32
+ - refactor(colors): update colors according to latest [ITML - [`f256205`](https://github.com/eea/volto-eea-website-theme/commit/f256205b2b93019c1c18c421381a94e5abc1065b)]
33
+ - change(theme): removed outdated browser info from core Volto [David Ichim - [`6d6fa03`](https://github.com/eea/volto-eea-website-theme/commit/6d6fa036c9ef85dbc5d6416a4f34635da0784778)]
34
+
35
+ #### :house: Internal changes
36
+
37
+ - chore(Form): Update Form shadow to Volto 16.17.1 #122 from eea/form-customization-to-volto-16-17-1 [ichim-david - [`5815668`](https://github.com/eea/volto-eea-website-theme/commit/5815668000c4ff5e7236f7dc12999b04840eb849)]
38
+ - chore(Form): Update Form shadow to Volto 16.17.1 [Alin Voinea - [`36d5f2c`](https://github.com/eea/volto-eea-website-theme/commit/36d5f2c18df8173701a769d7ad8991a36bf771ee)]
39
+
40
+ #### :hammer_and_wrench: Others
41
+
42
+ - lint fix [David Ichim - [`97057a8`](https://github.com/eea/volto-eea-website-theme/commit/97057a811bacd63b352cdf08e7c0a20e199feed6)]
7
43
  ### [1.11.2](https://github.com/eea/volto-eea-website-theme/compare/1.11.1...1.11.2) - 15 March 2023
8
44
 
9
45
  #### :bug: Bug Fixes
10
46
 
11
47
  - fix(imageBlock): re-add sizeWidget classes [nileshgulia1 - [`de4673b`](https://github.com/eea/volto-eea-website-theme/commit/de4673b1efe3e0559e4bcde9fe15a014fac5a6da)]
12
48
 
49
+ #### :hammer_and_wrench: Others
50
+
51
+ - Merge pull request #121 from eea/develop [Nilesh - [`1ce20da`](https://github.com/eea/volto-eea-website-theme/commit/1ce20da3c52678cbbe38cea1de8aa7f878b0d8f3)]
13
52
  ### [1.11.1](https://github.com/eea/volto-eea-website-theme/compare/1.11.0...1.11.1) - 14 March 2023
14
53
 
15
54
  #### :nail_care: Enhancements
@@ -68,7 +107,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
68
107
 
69
108
  #### :hammer_and_wrench: Others
70
109
 
71
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
72
110
  ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
73
111
 
74
112
  #### :bug: Bug Fixes
@@ -215,7 +253,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
215
253
 
216
254
  - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
217
255
  - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
218
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
219
256
  ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
220
257
 
221
258
  #### :hammer_and_wrench: Others
@@ -249,7 +286,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
249
286
 
250
287
  - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
251
288
  - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
252
- - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
253
289
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
254
290
  ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
255
291
 
@@ -259,7 +295,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
259
295
 
260
296
  #### :hammer_and_wrench: Others
261
297
 
262
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
263
298
  - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
264
299
  - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
265
300
  ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
@@ -268,9 +303,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
268
303
 
269
304
  - feat(Footer): Bring back footer contacts extra actions - refs #151856 [Alin Voinea - [`6c19413`](https://github.com/eea/volto-eea-website-theme/commit/6c194139420c9fd847692d180db1c1593e2483de)]
270
305
 
271
- #### :hammer_and_wrench: Others
272
-
273
- - yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
274
306
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
275
307
 
276
308
  #### :rocket: New Features
@@ -311,7 +343,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
311
343
  - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
312
344
  - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
313
345
  - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
314
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
315
346
  ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
316
347
 
317
348
  #### :nail_care: Enhancements
@@ -359,7 +390,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
359
390
 
360
391
  #### :hammer_and_wrench: Others
361
392
 
362
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
363
393
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
364
394
 
365
395
  #### :hammer_and_wrench: Others
@@ -627,7 +657,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
627
657
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
628
658
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
629
659
  - 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)]
630
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
631
660
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
632
661
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
633
662
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -669,5 +698,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
669
698
 
670
699
  #### :hammer_and_wrench: Others
671
700
 
672
- - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
673
701
  - Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.11.2",
3
+ "version": "1.12.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",
@@ -10,6 +10,7 @@ import { Editor, createEditor, Transforms, Node, Range } from 'slate';
10
10
  import { ReactEditor, Editable, Slate, withReact } from 'slate-react';
11
11
  import config from '@plone/volto/registry';
12
12
  import { SidebarPortal } from '@plone/volto/components';
13
+ import { BodyClass } from '@plone/volto/helpers';
13
14
  import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
14
15
  import BannerView from '@eeacms/volto-eea-website-theme/components/theme/Banner/View';
15
16
  import schema from './schema';
@@ -163,6 +164,7 @@ export const TitleBlockEdit = (props) => {
163
164
 
164
165
  return (
165
166
  <React.Fragment>
167
+ <BodyClass className="with-title-block" />
166
168
  <BannerView
167
169
  {...props}
168
170
  banner={{
@@ -6,6 +6,7 @@
6
6
  import React from 'react';
7
7
  import { Portal } from 'react-portal';
8
8
  import PropTypes from 'prop-types';
9
+ import { BodyClass } from '@plone/volto/helpers';
9
10
 
10
11
  import BannerView from '@eeacms/volto-eea-website-theme/components/theme/Banner/View';
11
12
 
@@ -26,9 +27,12 @@ function IsomorphicPortal({ children }) {
26
27
  * @extends Component
27
28
  */
28
29
  const View = (props) => (
29
- <IsomorphicPortal>
30
- <BannerView {...props} />
31
- </IsomorphicPortal>
30
+ <React.Fragment>
31
+ <BodyClass className="with-title-block" />
32
+ <IsomorphicPortal>
33
+ <BannerView {...props} />
34
+ </IsomorphicPortal>
35
+ </React.Fragment>
32
36
  );
33
37
 
34
38
  /**
@@ -1,11 +1,12 @@
1
- import React, { useCallback, useMemo } from 'react';
1
+ import React, { useCallback, useMemo, useRef } from 'react';
2
2
  import { compose } from 'redux';
3
3
  import { connect } from 'react-redux';
4
4
  import { withRouter } from 'react-router';
5
5
  import { defineMessages, injectIntl } from 'react-intl';
6
6
  import { startCase } from 'lodash';
7
7
  import qs from 'querystring';
8
- import { Popup, Icon } from 'semantic-ui-react';
8
+ import { Icon } from 'semantic-ui-react';
9
+ import Popup from '@eeacms/volto-eea-design-system/ui/Popup/Popup';
9
10
  import { flattenToAppURL } from '@plone/volto/helpers';
10
11
  import Banner from '@eeacms/volto-eea-design-system/ui/Banner/Banner';
11
12
  import {
@@ -33,26 +34,14 @@ const messages = defineMessages({
33
34
  id: 'Created',
34
35
  defaultMessage: 'Created',
35
36
  },
36
- created_on: {
37
- id: 'Created on',
38
- defaultMessage: 'Created on',
39
- },
40
37
  published: {
41
38
  id: 'Published',
42
39
  defaultMessage: 'Published',
43
40
  },
44
- published_on: {
45
- id: 'Published on',
46
- defaultMessage: 'Published on',
47
- },
48
41
  modified: {
49
42
  id: 'Modified',
50
43
  defaultMessage: 'Modified',
51
44
  },
52
- modified_on: {
53
- id: 'Modified on',
54
- defaultMessage: 'Modified on',
55
- },
56
45
  });
57
46
 
58
47
  const friendlyId = (id) => {
@@ -74,6 +63,7 @@ const Title = ({ config = {}, properties }) => {
74
63
  const View = (props) => {
75
64
  const { banner = {}, intl, location, types = [] } = props;
76
65
  const metadata = props.metadata || props.properties;
66
+ const popupRef = useRef(null);
77
67
  const {
78
68
  info = [],
79
69
  hideContentType,
@@ -134,44 +124,50 @@ const View = (props) => {
134
124
  actions={
135
125
  <>
136
126
  {!hideShareButton && (
137
- <Popup
138
- className="share-popup"
139
- content={() => (
140
- <>
141
- <p>{intl.formatMessage(messages.share_to)}</p>
142
- <div className="actions">
143
- <Banner.Action
144
- icon="ri-facebook-fill"
145
- onClick={() => {
146
- sharePage(metadata['@id'], 'facebook');
147
- }}
148
- />
149
- <Banner.Action
150
- icon="ri-twitter-fill"
151
- onClick={() => {
152
- sharePage(metadata['@id'], 'twitter');
153
- }}
154
- />
155
- <Banner.Action
156
- icon="ri-linkedin-fill"
157
- onClick={() => {
158
- sharePage(metadata['@id'], 'linkedin');
159
- }}
160
- />
161
- </div>
162
- </>
163
- )}
164
- position="bottom center"
165
- size="small"
166
- trigger={
167
- <Banner.Action
168
- icon="ri-share-fill"
169
- title={intl.formatMessage(messages.share)}
170
- className="share"
171
- onClick={() => {}}
172
- />
173
- }
174
- />
127
+ <>
128
+ <Popup
129
+ className={'share-popup'}
130
+ trigger={
131
+ <Banner.Action
132
+ icon="ri-share-fill"
133
+ title={intl.formatMessage(messages.share)}
134
+ className="share"
135
+ onClick={() => {}}
136
+ />
137
+ }
138
+ content={
139
+ <>
140
+ <p>{intl.formatMessage(messages.share_to)}</p>
141
+ <div className="actions" ref={popupRef}>
142
+ <Banner.Action
143
+ icon="ri-facebook-fill"
144
+ title={'Share page to Facebook'}
145
+ titleClass={'hiddenStructure'}
146
+ onClick={() => {
147
+ sharePage(metadata['@id'], 'facebook');
148
+ }}
149
+ />
150
+ <Banner.Action
151
+ icon="ri-twitter-fill"
152
+ title={'Share page to Twitter'}
153
+ titleClass={'hiddenStructure'}
154
+ onClick={() => {
155
+ sharePage(metadata['@id'], 'twitter');
156
+ }}
157
+ />
158
+ <Banner.Action
159
+ icon="ri-linkedin-fill"
160
+ title={'Share page to Linkedin'}
161
+ titleClass={'hiddenStructure'}
162
+ onClick={() => {
163
+ sharePage(metadata['@id'], 'linkedin');
164
+ }}
165
+ />
166
+ </div>
167
+ </>
168
+ }
169
+ />
170
+ </>
175
171
  )}
176
172
  {!hideDownloadButton && (
177
173
  <Banner.Action
@@ -197,19 +193,16 @@ const View = (props) => {
197
193
  type="date"
198
194
  label={intl.formatMessage(messages.created)}
199
195
  value={creationDate}
200
- title={`${intl.formatMessage(messages.created_on)} {}`}
201
196
  />
202
197
  <Banner.MetadataField
203
198
  type="date"
204
199
  label={intl.formatMessage(messages.published)}
205
200
  value={publishingDate}
206
- title={`${intl.formatMessage(messages.published_on)} {}`}
207
201
  />
208
202
  <Banner.MetadataField
209
203
  type="date"
210
204
  label={intl.formatMessage(messages.modified)}
211
205
  value={modificationDate}
212
- title={`${intl.formatMessage(messages.modified_on)} {}`}
213
206
  />
214
207
  {info.map((item, index) => (
215
208
  <Banner.MetadataField
package/src/config.js CHANGED
@@ -289,10 +289,10 @@ export const colors = [
289
289
  '#007B6C',
290
290
  '#005248',
291
291
  '#007B6C',
292
- '#00A390',
293
- '#00CCB4',
294
- '#00F5D8',
295
- '#85FFF1',
292
+ '#289588',
293
+ '#50B0A4',
294
+ '#78CAC0',
295
+ '#A0E5DC',
296
296
  '#C8FFF8',
297
297
  // Secondary & shades
298
298
  '#004B7F',
@@ -308,13 +308,13 @@ export const colors = [
308
308
  '#3D5265',
309
309
  '#4C677F',
310
310
  '#6989A5',
311
- '#8EA6C2',
311
+ '#87A7C3',
312
312
  '#ACCAE5',
313
313
  '#DAE8F4',
314
314
  // Black & White shades
315
315
  '#000000',
316
316
  '#323232',
317
- '#67696b',
317
+ '#747678',
318
318
  '#BCBEC0',
319
319
  '#E6E7E8',
320
320
  '#F9F9F9',
@@ -180,10 +180,11 @@ class Form extends Component {
180
180
  formData.hasOwnProperty(blocksLayoutFieldname) &&
181
181
  formData[blocksLayoutFieldname].items.length > 0
182
182
  ) {
183
- selectedBlock = formData[blocksLayoutFieldname].items[0];
184
-
185
- if (config.blocks?.initialBlocksFocus?.[this.props.type]) {
186
- //Default selected is not the first block, but the one from config.
183
+ if (config.blocks?.initialBlocksFocus === null) {
184
+ selectedBlock = null;
185
+ } else if (this.props.type in config.blocks?.initialBlocksFocus) {
186
+ // Default selected is not the first block, but the one from config.
187
+ // TODO Select first block and not an arbitrary one.
187
188
  Object.keys(formData[blocksFieldname]).forEach((b_key) => {
188
189
  if (
189
190
  formData[blocksFieldname][b_key]['@type'] ===
@@ -192,8 +193,11 @@ class Form extends Component {
192
193
  selectedBlock = b_key;
193
194
  }
194
195
  });
196
+ } else {
197
+ selectedBlock = formData[blocksLayoutFieldname].items[0];
195
198
  }
196
199
  }
200
+
197
201
  this.state = {
198
202
  formData,
199
203
  initialFormData: cloneDeep(formData),
@@ -254,7 +258,11 @@ class Form extends Component {
254
258
  * Tab selection is done only by setting activeIndex in state
255
259
  */
256
260
  onTabChange(e, { activeIndex }) {
257
- this.setState({ activeIndex });
261
+ const defaultFocus = this.props.schema.fieldsets[activeIndex].fields[0];
262
+ this.setState({
263
+ activeIndex,
264
+ ...(defaultFocus ? { inFocus: { [defaultFocus]: true } } : {}),
265
+ });
258
266
  }
259
267
 
260
268
  /**
@@ -641,7 +649,7 @@ class Form extends Component {
641
649
  error={keys(this.state.errors).length > 0}
642
650
  className={settings.verticalFormTabs ? 'vertical-form' : ''}
643
651
  >
644
- <fieldset className="invisible" disabled={!this.props.editable}>
652
+ <fieldset className="invisible">
645
653
  <Segment.Group raised>
646
654
  {schema && schema.fieldsets.length > 1 && (
647
655
  <>
@@ -678,10 +686,11 @@ class Form extends Component {
678
686
  ...map(item.fields, (field, index) => (
679
687
  <Field
680
688
  {...schema.properties[field]}
689
+ isDisabled={!this.props.editable}
681
690
  id={field}
682
691
  formData={this.state.formData}
683
692
  fieldSet={item.title.toLowerCase()}
684
- focus={index === 0}
693
+ focus={this.state.inFocus[field]}
685
694
  value={this.state.formData?.[field]}
686
695
  required={schema.required.indexOf(field) !== -1}
687
696
  onChange={this.onChangeField}
@@ -60,6 +60,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
60
60
 
61
61
  const { eea } = config.settings;
62
62
  const headerOpts = eea.headerOpts || {};
63
+ const headerSearchBox = eea.headerSearchBox || [];
63
64
  const { logo, logoWhite } = headerOpts || {};
64
65
  const width = useSelector((state) => state.screen?.width);
65
66
  const dispatch = useDispatch();
@@ -199,6 +200,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
199
200
  </Header.TopHeader>
200
201
  <Header.Main
201
202
  pathname={pathname}
203
+ headerSearchBox={headerSearchBox}
202
204
  inverted={isHomePageInverse ? true : false}
203
205
  transparency={isHomePageInverse ? true : false}
204
206
  logo={
@@ -0,0 +1,5 @@
1
+ const OutdatedBrowser = () => {
2
+ return null;
3
+ };
4
+
5
+ export default OutdatedBrowser;
@@ -1,131 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import { Container, Input, List } from 'semantic-ui-react';
3
- import { withRouter, Link } from 'react-router-dom';
4
- import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
- import config from '@plone/volto/registry';
6
-
7
- const getRandomItems = (arr, max) => {
8
- return (
9
- arr?.slice(0, max).map(function () {
10
- return this.splice(Math.floor(Math.random() * this.length), 1)[0];
11
- }, arr.slice()) || []
12
- );
13
- };
14
-
15
- function HeaderSearchPopUp({
16
- history,
17
- location,
18
- onClose,
19
- searchInputRef,
20
- triggerRefs = [],
21
- }) {
22
- const nodeRef = React.useRef();
23
- const { eea } = config.settings;
24
- const defaultView = eea.headerSearchBox.filter((v) => v.isDefault);
25
- const localView = eea.headerSearchBox.filter((v) =>
26
- location.pathname.includes(v.path),
27
- );
28
- const activeView = localView.length > 0 ? localView[0] : defaultView[0];
29
- const {
30
- path,
31
- placeholder,
32
- buttonTitle,
33
- description,
34
- searchSuggestions,
35
- } = activeView;
36
- const { suggestionsTitle, suggestions, maxToShow } = searchSuggestions || {};
37
-
38
- const [text, setText] = React.useState('');
39
- const [visibleSuggestions, setVisibileSuggestions] = React.useState(
40
- getRandomItems(suggestions, maxToShow),
41
- );
42
-
43
- useEffect(() => {
44
- setVisibileSuggestions(getRandomItems(suggestions, maxToShow));
45
- }, [maxToShow, suggestions]);
46
-
47
- useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
48
-
49
- const onChangeText = (event, { value }) => {
50
- setText(value);
51
- event.preventDefault();
52
- };
53
-
54
- const onSubmit = (event) => {
55
- history.push(`${path}?q=${text}`);
56
-
57
- if (window?.searchContext?.resetSearch) {
58
- window.searchContext.resetSearch({ searchTerm: text });
59
- }
60
-
61
- onClose();
62
- event.preventDefault();
63
- };
64
-
65
- const onClickHandler = (suggestion) => {
66
- if (window?.searchContext?.resetSearch) {
67
- window.searchContext.resetSearch({ searchTerm: suggestion });
68
- }
69
-
70
- onClose();
71
- };
72
-
73
- return (
74
- <div id="search-box" ref={nodeRef}>
75
- <div className="wrapper">
76
- <Container>
77
- <form method="get" onSubmit={onSubmit}>
78
- <Input
79
- ref={searchInputRef}
80
- className="search"
81
- onChange={onChangeText}
82
- icon={{
83
- className: 'ri-search-line',
84
- link: true,
85
- onClick: onSubmit,
86
- }}
87
- placeholder={placeholder}
88
- fluid
89
- />
90
- </form>
91
- {searchSuggestions && suggestions.length > 0 && (
92
- <div className="search-suggestions">
93
- {suggestionsTitle && <h4>{suggestionsTitle}</h4>}
94
-
95
- <List>
96
- {visibleSuggestions.map((item, i) => {
97
- return (
98
- <List.Item key={i}>
99
- <Link
100
- to={`${path}?q=${item}`}
101
- onClick={() => onClickHandler(item)}
102
- >
103
- {item}
104
- </Link>
105
- </List.Item>
106
- );
107
- })}
108
- </List>
109
- </div>
110
- )}
111
- </Container>
112
- {buttonTitle && (
113
- <div className="advanced-search">
114
- <Container>
115
- <div>{description}</div>
116
- <a
117
- href={defaultView[0].path}
118
- className="ui button white inverted"
119
- title="Advanced search"
120
- >
121
- {buttonTitle}
122
- </a>
123
- </Container>
124
- </div>
125
- )}
126
- </div>
127
- </div>
128
- );
129
- }
130
-
131
- export default withRouter(HeaderSearchPopUp);