@eeacms/volto-eea-website-theme 1.13.0 → 1.14.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,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.14.0](https://github.com/eea/volto-eea-website-theme/compare/1.13.0...1.14.0) - 10 April 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat(copyright): Add description with link to remix icon set #129 from eea/icon-description [ichim-david - [`73d905b`](https://github.com/eea/volto-eea-website-theme/commit/73d905b17a0d9979c91e51eda869805bd106b2f1)]
12
+ - feat(copyright): Add description with link to remix icon set [kreafox - [`fa025cc`](https://github.com/eea/volto-eea-website-theme/commit/fa025ccbd52f22be1294ec47c53b9b2ec70c5524)]
13
+
14
+ #### :bug: Bug Fixes
15
+
16
+ - fix(DRAFT): Consider parent on items with no review_state - refs #249741 [dobri1408 - [`042a3e3`](https://github.com/eea/volto-eea-website-theme/commit/042a3e3e08c31ef9eaf4e56ebf292010022ffbf1)]
17
+ - fix(columnsBlock): Available column background colors [Alin Voinea - [`f2f87ac`](https://github.com/eea/volto-eea-website-theme/commit/f2f87acec5ffed9e4b8eaa4c6977383ed54ca63e)]
18
+
19
+ #### :nail_care: Enhancements
20
+
21
+ - change(icons): set link for remix icon set to our docusaurus [David Ichim - [`df81a4f`](https://github.com/eea/volto-eea-website-theme/commit/df81a4f5f5954c7da228e1e5b2b409af9d82518d)]
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - Release 1.14.0 [Alin Voinea - [`88e08e6`](https://github.com/eea/volto-eea-website-theme/commit/88e08e6b15ba536e7f7c06131f594a157a91daa7)]
7
26
  ### [1.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023
8
27
 
9
28
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-website-theme",
3
- "version": "1.13.0",
3
+ "version": "1.14.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",
@@ -76,6 +76,18 @@ export default {
76
76
  },
77
77
  copyrightIcon: {
78
78
  title: 'Icon',
79
+ description: (
80
+ <>
81
+ Ex. ri-copyright-line. See{' '}
82
+ <a
83
+ target="_blank"
84
+ rel="noopener noreferrer"
85
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
86
+ >
87
+ Remix Icon set
88
+ </a>
89
+ </>
90
+ ),
79
91
  default: 'ri-copyright-line',
80
92
  },
81
93
  copyrightPosition: {
@@ -4,43 +4,29 @@ import './draft.css';
4
4
  import { BodyClass } from '@plone/volto/helpers';
5
5
  import { withRouter } from 'react-router-dom';
6
6
  import { compose } from 'redux';
7
- import { runtimeConfig } from '@plone/volto/runtime_config';
8
7
  import { flattenToAppURL } from '@plone/volto/helpers';
9
8
 
10
- const removeTrailingSlash = (str) => {
11
- return str.replace(/\/+$/, '');
12
- };
13
-
14
9
  /**
15
- * The review_state and id don't change everytime the page is changed and because of that the draft background
16
- * will apear on pages that shouldn't have it. The RAZZLE_DISABLE_DRAFT_WATERMARK varible from ENV file should have two possible values:
17
- * "Hide-No-Workflow" and "Hide-All". If the variable is not present, it should follow the current logic(show the draft image everywhere),
18
- * if the value is "Hide-No-Workflow", then the draft image is not shown on pages like login or controlpanel and if the value is "Hide-All", then
19
- * the draft image is not visible at all.
20
- * For example, if the current page is /datatable (that has the draft background) and then we go to Content Types page,
21
- * the review_state and id will be the same as the ones from /datatable, so the draft background will still be present. By checking
22
- * if the pathname from (from withRouter) is different than the one from state.content.data and based on the varible from ENV,
23
- * we decide if the draft backgound can be present or not.
24
10
  * @param {Object} props
25
11
  * @returns
26
12
  */
27
- const DraftBackground = (props) => {
28
- const draftClass = `wf-state-${props.review_state}`;
29
- const razzleDraft =
30
- runtimeConfig['RAZZLE_DISABLE_DRAFT_WATERMARK'] || 'default';
31
- const isReviewableStateComponent =
32
- props.review_state &&
33
- props.contentId === removeTrailingSlash(props.pathname);
34
13
 
35
- const draftOptions = {
36
- 'Hide-All': 'wf-state-published',
37
- 'Hide-No-Workflow': isReviewableStateComponent
38
- ? draftClass
39
- : 'wf-state-published',
40
- default: draftClass,
41
- };
14
+ const checkIfNullOrUndefined = (value) => {
15
+ return value === undefined || value === null;
16
+ };
42
17
 
43
- return <BodyClass className={draftOptions[razzleDraft]} />;
18
+ const DraftBackground = (props) => {
19
+ let draftClass = 'wf-state-is-draft';
20
+ if (
21
+ (checkIfNullOrUndefined(props?.review_state) &&
22
+ props?.content?.parent?.review_state === 'published') ||
23
+ props?.review_state === 'published' ||
24
+ (checkIfNullOrUndefined(props?.review_state) &&
25
+ Object.keys(props?.content?.parent || {}).length === 0)
26
+ ) {
27
+ draftClass = '';
28
+ }
29
+ return draftClass ? <BodyClass className={draftClass} /> : '';
44
30
  };
45
31
 
46
32
  export default compose(
@@ -1,3 +1,3 @@
1
- .view-viewview:not(.wf-state-published) .content-area {
1
+ .view-viewview.wf-state-is-draft {
2
2
  background-image: url('draft.png') !important;
3
3
  }
@@ -112,6 +112,18 @@ export function ImageSchema({ formData, intl }) {
112
112
  },
113
113
  copyrightIcon: {
114
114
  title: 'Icon',
115
+ description: (
116
+ <>
117
+ Ex. ri-copyright-line. See{' '}
118
+ <a
119
+ target="_blank"
120
+ rel="noopener noreferrer"
121
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
122
+ >
123
+ Remix Icon set
124
+ </a>
125
+ </>
126
+ ),
115
127
  default: 'ri-copyright-line',
116
128
  },
117
129
  copyrightPosition: {
@@ -91,6 +91,18 @@ export function LeadImageSchema({ formData, intl }) {
91
91
  },
92
92
  copyrightIcon: {
93
93
  title: 'Icon',
94
+ description: (
95
+ <>
96
+ Ex. ri-copyright-line. See{' '}
97
+ <a
98
+ target="_blank"
99
+ rel="noopener noreferrer"
100
+ href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
101
+ >
102
+ Remix Icon set
103
+ </a>
104
+ </>
105
+ ),
94
106
  default: 'ri-copyright-line',
95
107
  },
96
108
  copyrightPosition: {
package/src/index.js CHANGED
@@ -74,6 +74,11 @@ const applyConfig = (config) => {
74
74
  }
75
75
  }
76
76
 
77
+ // Apply columns block customization
78
+ if (config.blocks.blocksConfig.columnsBlock) {
79
+ config.blocks.blocksConfig.columnsBlock.available_colors = eea.colors;
80
+ }
81
+
77
82
  // Description block custom CSS
78
83
  config.blocks.blocksConfig.description.className =
79
84
  'documentDescription eea callout';