Skip to content

Commit

Permalink
Merge pull request #132 from eea/develop
Browse files Browse the repository at this point in the history
Release 1.14.0
  • Loading branch information
avoinea authored Apr 10, 2023
2 parents db7605f + 67435d6 commit 4b2bf2f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 31 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.14.0](https://github.com/eea/volto-eea-website-theme/compare/1.13.0...1.14.0) - 10 April 2023

#### :rocket: New Features

- 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)]
- feat(copyright): Add description with link to remix icon set [kreafox - [`fa025cc`](https://github.com/eea/volto-eea-website-theme/commit/fa025ccbd52f22be1294ec47c53b9b2ec70c5524)]

#### :bug: Bug Fixes

- fix(DRAFT): Consider parent on items with no review_state - refs #249741 [dobri1408 - [`042a3e3`](https://github.com/eea/volto-eea-website-theme/commit/042a3e3e08c31ef9eaf4e56ebf292010022ffbf1)]
- fix(columnsBlock): Available column background colors [Alin Voinea - [`f2f87ac`](https://github.com/eea/volto-eea-website-theme/commit/f2f87acec5ffed9e4b8eaa4c6977383ed54ca63e)]

#### :nail_care: Enhancements

- change(icons): set link for remix icon set to our docusaurus [David Ichim - [`df81a4f`](https://github.com/eea/volto-eea-website-theme/commit/df81a4f5f5954c7da228e1e5b2b409af9d82518d)]

#### :hammer_and_wrench: Others

- Release 1.14.0 [Alin Voinea - [`88e08e6`](https://github.com/eea/volto-eea-website-theme/commit/88e08e6b15ba536e7f7c06131f594a157a91daa7)]
### [1.13.0](https://github.com/eea/volto-eea-website-theme/compare/1.12.0...1.13.0) - 27 March 2023

#### :rocket: New Features
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-eea-website-theme",
"version": "1.13.0",
"version": "1.14.0",
"description": "@eeacms/volto-eea-website-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
12 changes: 12 additions & 0 deletions src/components/manage/Blocks/Title/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export default {
},
copyrightIcon: {
title: 'Icon',
description: (
<>
Ex. ri-copyright-line. See{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
>
Remix Icon set
</a>
</>
),
default: 'ri-copyright-line',
},
copyrightPosition: {
Expand Down
44 changes: 15 additions & 29 deletions src/components/theme/DraftBackground/DraftBackground.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,29 @@ import './draft.css';
import { BodyClass } from '@plone/volto/helpers';
import { withRouter } from 'react-router-dom';
import { compose } from 'redux';
import { runtimeConfig } from '@plone/volto/runtime_config';
import { flattenToAppURL } from '@plone/volto/helpers';

const removeTrailingSlash = (str) => {
return str.replace(/\/+$/, '');
};

/**
* The review_state and id don't change everytime the page is changed and because of that the draft background
* will apear on pages that shouldn't have it. The RAZZLE_DISABLE_DRAFT_WATERMARK varible from ENV file should have two possible values:
* "Hide-No-Workflow" and "Hide-All". If the variable is not present, it should follow the current logic(show the draft image everywhere),
* 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
* the draft image is not visible at all.
* For example, if the current page is /datatable (that has the draft background) and then we go to Content Types page,
* the review_state and id will be the same as the ones from /datatable, so the draft background will still be present. By checking
* if the pathname from (from withRouter) is different than the one from state.content.data and based on the varible from ENV,
* we decide if the draft backgound can be present or not.
* @param {Object} props
* @returns
*/
const DraftBackground = (props) => {
const draftClass = `wf-state-${props.review_state}`;
const razzleDraft =
runtimeConfig['RAZZLE_DISABLE_DRAFT_WATERMARK'] || 'default';
const isReviewableStateComponent =
props.review_state &&
props.contentId === removeTrailingSlash(props.pathname);

const draftOptions = {
'Hide-All': 'wf-state-published',
'Hide-No-Workflow': isReviewableStateComponent
? draftClass
: 'wf-state-published',
default: draftClass,
};
const checkIfNullOrUndefined = (value) => {
return value === undefined || value === null;
};

return <BodyClass className={draftOptions[razzleDraft]} />;
const DraftBackground = (props) => {
let draftClass = 'wf-state-is-draft';
if (
(checkIfNullOrUndefined(props?.review_state) &&
props?.content?.parent?.review_state === 'published') ||
props?.review_state === 'published' ||
(checkIfNullOrUndefined(props?.review_state) &&
Object.keys(props?.content?.parent || {}).length === 0)
) {
draftClass = '';
}
return draftClass ? <BodyClass className={draftClass} /> : '';
};

export default compose(
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/DraftBackground/draft.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.view-viewview:not(.wf-state-published) .content-area {
.view-viewview.wf-state-is-draft {
background-image: url('draft.png') !important;
}
12 changes: 12 additions & 0 deletions src/customizations/volto/components/manage/Blocks/Image/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ export function ImageSchema({ formData, intl }) {
},
copyrightIcon: {
title: 'Icon',
description: (
<>
Ex. ri-copyright-line. See{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
>
Remix Icon set
</a>
</>
),
default: 'ri-copyright-line',
},
copyrightPosition: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ export function LeadImageSchema({ formData, intl }) {
},
copyrightIcon: {
title: 'Icon',
description: (
<>
Ex. ri-copyright-line. See{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://eea.github.io/volto-eea-design-system/docs/webdev/Guidelines/iconography/#icon-set"
>
Remix Icon set
</a>
</>
),
default: 'ri-copyright-line',
},
copyrightPosition: {
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ const applyConfig = (config) => {
}
}

// Apply columns block customization
if (config.blocks.blocksConfig.columnsBlock) {
config.blocks.blocksConfig.columnsBlock.available_colors = eea.colors;
}

// Description block custom CSS
config.blocks.blocksConfig.description.className =
'documentDescription eea callout';
Expand Down

0 comments on commit 4b2bf2f

Please sign in to comment.