Skip to content

Commit

Permalink
Release 1.18.0 #154 from eea/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david authored Jun 20, 2023
2 parents 52f1f78 + 5119b7b commit 9e47abb
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 23 deletions.
34 changes: 24 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,36 @@ 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.18.0](https://github.com/eea/volto-eea-website-theme/compare/1.17.2...1.18.0) - 20 June 2023

#### :rocket: New Features

- feat: ThemesWidget update advanced-search link - refs #145772 [Alin Voinea - [`036f471`](https://github.com/eea/volto-eea-website-theme/commit/036f4711ace0985e2b542c64a1cbe28fd97911bd)]
- feat: Add ThemeasWidget for taxonomy_themes and fix tags link - refs #145772 [Alin Voinea - [`903de63`](https://github.com/eea/volto-eea-website-theme/commit/903de638be2e2b2a9c550200706271fc72f09e36)]

#### :bug: Bug Fixes

- fix: clearformat only selection [nileshgulia1 - [`e8aab36`](https://github.com/eea/volto-eea-website-theme/commit/e8aab36c0c86e2a2a01ca53673a89c596949a4b1)]
- fix(slate): backport feature from volto-slate that sets classes on style options [David Ichim - [`5ed97f3`](https://github.com/eea/volto-eea-website-theme/commit/5ed97f34a4714dcbaa11296ca64d043a24464d3e)]

#### :nail_care: Enhancements

- change(footer): removed fallback to empty array for footer actions #153 from eea/footer_actions [ichim-david - [`8fb9c08`](https://github.com/eea/volto-eea-website-theme/commit/8fb9c082a7fac14e31c7e568cc85cb7095b0524d)]

#### :hammer_and_wrench: Others

- Refs #254132 - Bump to 1.18.0. [GhitaB - [`51f483b`](https://github.com/eea/volto-eea-website-theme/commit/51f483b3dba6cff13471fc512d372b577991f6f4)]
- Refs #254132 - Do not initialize actions with []. Make sure actions in footerOpts are used if set. [GhitaB - [`8c0afb5`](https://github.com/eea/volto-eea-website-theme/commit/8c0afb539b0c96928545bc9a6974a189c9e886b8)]
- test: Fix sonarqube - Convert the conditional to a boolean to avoid leaked value [Alin Voinea - [`195eb19`](https://github.com/eea/volto-eea-website-theme/commit/195eb19b8aa40a95bca6aafc7720bdc6b8e02340)]
### [1.17.2](https://github.com/eea/volto-eea-website-theme/compare/1.17.1...1.17.2) - 14 June 2023

#### :rocket: New Features

- feat: config nextcloud subtitles languages - refs #253430 [dobri1408 - [`1fc72df`](https://github.com/eea/volto-eea-website-theme/commit/1fc72df37adbb9f9c03f4adb6ad800d7e603ed90)]

#### :hammer_and_wrench: Others

- Release #150 from eea/develop [ichim-david - [`52f1f78`](https://github.com/eea/volto-eea-website-theme/commit/52f1f782a1d815c6df5be1aabe34f67715637d0f)]
### [1.17.1](https://github.com/eea/volto-eea-website-theme/compare/1.17.0...1.17.1) - 12 June 2023

#### :nail_care: Enhancements
Expand Down Expand Up @@ -62,7 +86,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]

#### :hammer_and_wrench: Others

Expand Down Expand Up @@ -218,7 +241,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023

#### :bug: Bug Fixes
Expand Down Expand Up @@ -365,7 +387,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023

#### :hammer_and_wrench: Others
Expand Down Expand Up @@ -399,7 +420,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022

Expand All @@ -409,7 +429,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
Expand All @@ -420,7 +439,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022

#### :rocket: New Features
Expand Down Expand Up @@ -461,7 +479,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022

#### :nail_care: Enhancements
Expand Down Expand Up @@ -509,7 +526,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022

#### :hammer_and_wrench: Others
Expand Down Expand Up @@ -777,7 +793,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
- 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)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
Expand Down Expand Up @@ -819,5 +834,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
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.17.2",
"version": "1.18.0",
"description": "@eeacms/volto-eea-website-theme: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
20 changes: 20 additions & 0 deletions src/components/theme/Widgets/ThemesWidget.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import cx from 'classnames';
import Tag from '@eeacms/volto-eea-design-system/ui/Tag/Tag';

export const ThemesWidget = ({ value, children, className }) => {
return value ? (
<span className={cx(className, 'token', 'widget')}>
{value.map((tag) => (
<Tag
href={`https://www.eea.europa.eu/en/advanced-search?filters[0][field]=topic&filters[0][values][0]=${tag.title}&filters[0][type]=any&filters[1][field]=language&filters[1][type]=any&filters[1][values][0]=en&sort-field=issued.date&sort-direction=desc`}
key={tag.token}
>
{children ? children(tag.title) : tag.title}
</Tag>
))}
</span>
) : (
''
);
};
5 changes: 4 additions & 1 deletion src/components/theme/Widgets/TokenWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export const TokenWidget = ({ value, children, className }) =>
value ? (
<span className={cx(className, 'token', 'widget')}>
{value.map((tag) => (
<Tag href={`http://search.apps.eea.europa.eu/?q=${tag}`} key={tag}>
<Tag
href={`https://www.eea.europa.eu/en/advanced-search?q=${tag}`}
key={tag}
>
{children ? children(tag) : tag}
</Tag>
))}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This customization fixes bugs with styleMenu not highlighting selected styles in some scenarios. This should be removed after https://github.com/plone/volto/pull/4852
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import React from 'react';
import { useSlate } from 'slate-react';
import { Dropdown } from 'semantic-ui-react';
import { useIntl, defineMessages } from 'react-intl';
import cx from 'classnames';
import { omit } from 'lodash';
import { isBlockStyleActive, isInlineStyleActive, toggleStyle } from './utils';
import config from '@plone/volto/registry';
import { ToolbarButton } from '@plone/volto-slate/editor/ui';
import paintSVG from '@plone/volto/icons/paint.svg';

const messages = defineMessages({
inlineStyle: {
id: 'Inline Style',
defaultMessage: 'Inline Style',
},
paragraphStyle: {
id: 'Paragraph Style',
defaultMessage: 'Paragraph Style',
},
additionalStyles: {
id: 'Additional Styles',
defaultMessage: 'Additional Styles',
},
});

const StyleMenuButton = ({ icon, active, ...props }) => (
<ToolbarButton {...props} icon={icon} active={active} />
);

const MenuOpts = ({ editor, toSelect, option, type }) => {
const isActive = toSelect.includes(option);
return (
<Dropdown.Item
as="span"
active={isActive}
className={cx(`${type}-${option.value}`, { active: isActive })}
{...omit(option, ['isBlock'])}
data-isblock={option.isBlock}
onClick={(event, selItem) => {
toggleStyle(editor, {
cssClass: selItem.value,
isBlock: selItem.isBlock,
});
}}
/>
);
};

const StylingsButton = (props) => {
const editor = useSlate();
const intl = useIntl();

// Converting the settings to a format that is required by dropdowns.
const inlineOpts = [
...config.settings.slate.styleMenu.inlineStyles.map((def) => {
return {
value: def.cssClass,
text: def.label,
icon: def.icon,
isBlock: false,
};
}),
];
const blockOpts = [
...config.settings.slate.styleMenu.blockStyles.map((def) => {
return {
value: def.cssClass,
text: def.label,
icon: def.icon,
isBlock: true,
};
}),
];

// Calculating the initial selection.
const toSelect = [];
// block styles
for (const val of blockOpts) {
const ia = isBlockStyleActive(editor, val.value);
if (ia) {
toSelect.push(val);
}
}
// inline styles
for (const val of inlineOpts) {
const ia = isInlineStyleActive(editor, val.value);
if (ia) {
toSelect.push(val);
}
}

const menuItemProps = {
toSelect,
editor,
};
const showMenu = inlineOpts.length || blockOpts.length;
return showMenu ? (
<Dropdown
id="style-menu"
pointing="top left"
multiple
value={toSelect}
disabled={config.settings.slate.styleMenu.disabled ?? false}
additionLabel={intl.formatMessage(messages.additionalStyles)}
trigger={
<StyleMenuButton
title={intl.formatMessage(messages.additionalStyles)}
icon={paintSVG}
active={toSelect.length > 0}
/>
}
>
<Dropdown.Menu>
{inlineOpts.length ? (
<>
<Dropdown.Header
content={intl.formatMessage(messages.inlineStyle)}
/>
{inlineOpts.map((option, index) => (
<MenuOpts
{...menuItemProps}
type="inline-style"
option={option}
key={index}
/>
))}
</>
) : (
''
)}

{blockOpts.length ? (
<>
<Dropdown.Header
content={intl.formatMessage(messages.paragraphStyle)}
/>
{blockOpts.map((option, index) => (
<MenuOpts
{...menuItemProps}
type="block-style"
option={option}
key={index}
/>
))}
</>
) : (
''
)}
</Dropdown.Menu>
</Dropdown>
) : (
''
);
};

export default StylingsButton;
Loading

0 comments on commit 9e47abb

Please sign in to comment.