@eeacms/volto-eea-website-theme 2.0.0 → 2.0.2

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,7 +4,14 @@ 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
- ### [2.0.0](https://github.com/eea/volto-eea-website-theme/compare/1.34.0...2.0.0) - 10 May 2024
7
+ ### [2.0.2](https://github.com/eea/volto-eea-website-theme/compare/2.0.1...2.0.2) - 20 May 2024
8
+
9
+ ### [2.0.1](https://github.com/eea/volto-eea-website-theme/compare/2.0.0...2.0.1) - 15 May 2024
10
+
11
+ #### :hammer_and_wrench: Others
12
+
13
+ - modified param of dateIsInFuture to signal it's a string and not a date [David Ichim - [`e3243a0`](https://github.com/eea/volto-eea-website-theme/commit/e3243a075969a379462ba0b7889fe0d8b52af62a)]
14
+ ## [2.0.0](https://github.com/eea/volto-eea-website-theme/compare/1.34.0...2.0.0) - 13 May 2024
8
15
 
9
16
  #### :rocket: New Features
10
17
 
@@ -55,6 +62,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
55
62
 
56
63
  #### :hammer_and_wrench: Others
57
64
 
65
+ - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`adc6730`](https://github.com/eea/volto-eea-website-theme/commit/adc6730e21a37afb865b842182624401de6a29f5)]
58
66
  ### [1.33.1](https://github.com/eea/volto-eea-website-theme/compare/1.33.0...1.33.1) - 4 April 2024
59
67
 
60
68
  #### :bug: Bug Fixes
@@ -188,6 +196,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
188
196
 
189
197
  - bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)]
190
198
  - merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)]
199
+ - Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)]
200
+ - Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)]
191
201
  - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)]
192
202
  - fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
193
203
  - remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
@@ -282,6 +292,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
282
292
  - test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
283
293
  - test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
284
294
  - Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)]
295
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
296
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
297
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
298
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
299
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
285
300
  ### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
286
301
 
287
302
  #### :rocket: New Features
@@ -294,6 +309,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
294
309
 
295
310
  #### :house: Internal changes
296
311
 
312
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
297
313
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
298
314
  - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
299
315
 
@@ -479,6 +495,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
479
495
 
480
496
  #### :house: Internal changes
481
497
 
498
+ - chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
482
499
 
483
500
  #### :hammer_and_wrench: Others
484
501
 
@@ -634,6 +651,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
634
651
 
635
652
  #### :hammer_and_wrench: Others
636
653
 
654
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
637
655
  ### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
638
656
 
639
657
  #### :bug: Bug Fixes
@@ -780,6 +798,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
780
798
 
781
799
  - For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
782
800
  - Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
801
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
783
802
  ### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
784
803
 
785
804
  #### :hammer_and_wrench: Others
@@ -813,6 +832,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
813
832
 
814
833
  - Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
815
834
  - bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
835
+ - Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
816
836
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
817
837
  ### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
818
838
 
@@ -822,6 +842,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
822
842
 
823
843
  #### :hammer_and_wrench: Others
824
844
 
845
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
825
846
  - Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
826
847
  - Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
827
848
  ### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
@@ -832,6 +853,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
832
853
 
833
854
  #### :hammer_and_wrench: Others
834
855
 
856
+ - yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
835
857
  ### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
836
858
 
837
859
  #### :rocket: New Features
@@ -872,6 +894,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
872
894
  - Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
873
895
  - Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
874
896
  - fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
897
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
875
898
  ### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
876
899
 
877
900
  #### :nail_care: Enhancements
@@ -919,6 +942,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
919
942
 
920
943
  #### :hammer_and_wrench: Others
921
944
 
945
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
922
946
  ### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
923
947
 
924
948
  #### :hammer_and_wrench: Others
@@ -1186,6 +1210,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1186
1210
  - Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
1187
1211
  - Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
1188
1212
  - 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)]
1213
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
1189
1214
  - use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
1190
1215
  - Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
1191
1216
  - Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
@@ -1227,4 +1252,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1227
1252
 
1228
1253
  #### :hammer_and_wrench: Others
1229
1254
 
1255
+ - yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
1230
1256
  - 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": "2.0.0",
3
+ "version": "2.0.2",
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",
@@ -1,10 +1,8 @@
1
- import React from 'react';
1
+ import { BodyClass, flattenToAppURL } from '@plone/volto/helpers';
2
2
  import { connect } from 'react-redux';
3
- import './draft.css';
4
- import { BodyClass } from '@plone/volto/helpers';
5
3
  import { withRouter } from 'react-router-dom';
6
4
  import { compose } from 'redux';
7
- import { flattenToAppURL } from '@plone/volto/helpers';
5
+ import './draft.css';
8
6
 
9
7
  /**
10
8
  * Removes any trailing slashes from the given string.
@@ -16,6 +14,18 @@ const removeTrailingSlash = (str) => {
16
14
  return str.replace(/\/+$/, '');
17
15
  };
18
16
 
17
+ /**
18
+ * Checks if a given date is in the future.
19
+ *
20
+ * @param {string} date - The date to check.
21
+ * @returns {boolean} `true` if the date is in the future, `false` otherwise.
22
+ */
23
+ const dateIsInFuture = (date) => {
24
+ return (
25
+ date && date !== 'None' && new Date(date).getTime() > new Date().getTime()
26
+ );
27
+ };
28
+
19
29
  /**
20
30
  * Checks if the current content is published.
21
31
  *
@@ -38,34 +48,32 @@ export const checkIfPublished = (props) => {
38
48
  // set draft image if effective date is set and is in the future
39
49
  // regardless of review_state
40
50
  const effectiveDate = props?.content?.effective;
41
- if (
42
- effectiveDate &&
43
- effectiveDate !== 'None' &&
44
- new Date(effectiveDate).getTime() > new Date().getTime()
45
- ) {
51
+ if (dateIsInFuture(effectiveDate)) {
46
52
  return false;
47
53
  }
48
54
 
55
+ const reviewState = props?.review_state;
56
+
49
57
  //case 1 : review_state published
50
- if (props?.review_state === 'published') return true;
58
+ if (reviewState === 'published') return true;
51
59
 
52
60
  //case 2: review_state null, but parent is published eg:Image in published folder
53
- if (
54
- !props?.review_state &&
55
- props?.content?.parent?.review_state === 'published'
56
- )
61
+ // is marked as published, or not published if the effective date of parent
62
+ // is in the future
63
+ const parent = props?.content?.parent;
64
+ const parentReviewState = parent?.review_state;
65
+ if (!reviewState && parentReviewState === 'published') {
66
+ if (dateIsInFuture(parent?.effective)) {
67
+ return false;
68
+ }
57
69
  return true;
70
+ }
58
71
 
59
72
  //case 3: review_state null, but there is no parent eg: PloneSite
60
- if (
61
- !props?.review_state &&
62
- Object.keys(props?.content?.parent || {}).length === 0
63
- )
64
- return true;
73
+ if (!reviewState && Object.keys(parent || {}).length === 0) return true;
65
74
 
66
75
  //case 4: review_state null, and review state of parent is null, eg: Image in PloneSite
67
- if (!props?.review_state && !props?.content?.parent?.review_state)
68
- return true;
76
+ if (!reviewState && !parentReviewState) return true;
69
77
  return false;
70
78
  };
71
79
 
@@ -87,10 +87,10 @@ class SlateEditor extends Component {
87
87
  const uid = uuid(); // used to namespace the editor's plugins
88
88
 
89
89
  this.slateSettings = props.slateSettings || config.settings.slate;
90
-
91
- this.initialValue = cloneDeep(
92
- this.props.value || this.slateSettings.defaultValue(),
93
- );
90
+ this.initialValue =
91
+ this.props.value && this.props.value.length > 0
92
+ ? cloneDeep(this.props.value)
93
+ : this.slateSettings.defaultValue();
94
94
 
95
95
  this.state = {
96
96
  editor: this.createEditor(uid),
@@ -182,8 +182,11 @@ class SlateEditor extends Component {
182
182
  this.props.value &&
183
183
  !isEqual(this.props.value, this.state.internalValue)
184
184
  ) {
185
- const newValue = cloneDeep(this.props.value);
186
185
  const { editor } = this.state;
186
+ const newValue =
187
+ this.props.value && this.props.value.length > 0
188
+ ? cloneDeep(this.props.value)
189
+ : this.slateSettings.defaultValue();
187
190
 
188
191
  resetNodes(editor, { nodes: newValue });
189
192
 
@@ -209,7 +212,6 @@ class SlateEditor extends Component {
209
212
 
210
213
  if (!prevProps.selected && this.props.selected) {
211
214
  // if the SlateEditor becomes selected from unselected
212
-
213
215
  if (window.getSelection().type === 'None') {
214
216
  // TODO: why is this condition checked?
215
217
  Transforms.select(
@@ -217,7 +219,6 @@ class SlateEditor extends Component {
217
219
  Editor.range(this.state.editor, Editor.start(this.state.editor, [])),
218
220
  );
219
221
  }
220
-
221
222
  ReactEditor.focus(this.state.editor);
222
223
  }
223
224
 
@@ -331,7 +332,9 @@ class SlateEditor extends Component {
331
332
  this.props.onBlur && this.props.onBlur();
332
333
  return null;
333
334
  }}
334
- onClick={this.props.onClick}
335
+ onClick={(e) => {
336
+ return this.props.onClick && this.props.onClick(e);
337
+ }}
335
338
  onSelect={(e) => {
336
339
  if (!selected && this.props.onFocus) {
337
340
  // we can't overwrite the onFocus of Editable, as the onFocus