From 4082ff8383c189e78113ed595fc4a6f7b3671793 Mon Sep 17 00:00:00 2001 From: Andrei Grigore Date: Mon, 14 Feb 2022 16:58:10 +0200 Subject: [PATCH 1/2] Discodata connector support animations --- .../Blocks/DiscodataConnectorBlock/v1/Edit.jsx | 2 +- .../Blocks/DiscodataConnectorBlock/v1/View.jsx | 13 +++++++++---- .../Blocks/DiscodataConnectorBlock/v1/schema.js | 13 ++++++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/Edit.jsx b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/Edit.jsx index d0b04df..dcbb589 100644 --- a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/Edit.jsx +++ b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/Edit.jsx @@ -72,7 +72,7 @@ const Edit = (props) => { block={props.block} /> - + ); }; diff --git a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/View.jsx b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/View.jsx index bb82ae5..e615bde 100644 --- a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/View.jsx +++ b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/View.jsx @@ -4,7 +4,7 @@ import { connectToMultipleProviders } from '@eeacms/volto-datablocks/hocs'; import { DataConnectedValue } from '@eeacms/volto-datablocks/Utils'; import { Sources } from '@eeacms/volto-datablocks/Utils'; -const providerView = (dataProviderKey, dataProvider) => { +const providerView = (dataProviderKey, dataProvider, editMode) => { return (
{ column={dataProvider.displayColumn} textTemplate={dataProvider.textTemplate} specifier={dataProvider.specifier} + animatedCounter={!editMode ? dataProvider.animatedCounter : ''} placeholder="_" /> )} @@ -122,11 +123,15 @@ const View = (props) => { className={dataProvider.wrapperClassName} key={`data-wrapper-${dataProviderKey}`} > - {providerView(dataProviderKey, dataProvider)} + {providerView( + dataProviderKey, + dataProvider, + props.editMode, + )} {Object.entries( dataProvider.children, ).map(([cildrenKey, children]) => - providerView(cildrenKey, children), + providerView(cildrenKey, children, props.editMode), )}
); @@ -136,7 +141,7 @@ const View = (props) => { className={dataProvider.wrapperClassName} key={`data-wrapper-${dataProviderKey}`} > - {providerView(dataProviderKey, dataProvider)} + {providerView(dataProviderKey, dataProvider, props.editMode)} ); }, diff --git a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/schema.js b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/schema.js index cb983b2..3bf6195 100644 --- a/src/components/manage/Blocks/DiscodataConnectorBlock/v1/schema.js +++ b/src/components/manage/Blocks/DiscodataConnectorBlock/v1/schema.js @@ -20,7 +20,12 @@ const dataProviderSchemaExtender = (schema, child = {}, props) => { { id: 'properties', title: 'Properties', - fields: ['measurmentUnit', 'additionalText', 'className'], + fields: [ + 'measurmentUnit', + 'additionalText', + 'className', + 'animatedCounter', + ], }, ...(child.hasDiscodataConnector ? [ @@ -90,6 +95,7 @@ const dataProviderSchema = { 'className', 'parent', 'wrapperClassName', + 'animatedCounter', ], }, ], @@ -147,6 +153,11 @@ const dataProviderSchema = { type: 'text', title: 'Additional text', }, + animatedCounter: { + type: 'boolean', + title: 'Animated Counter', + description: 'Apply counter animation to a number', + }, className: { type: 'select', From 321ecf326cd775a2930fa7752dfc9934979065cb Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:46:02 +0000 Subject: [PATCH 2/2] Automated release 0.2.1 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f73a7e9..d43add7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ 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). +#### [0.2.1](https://github.com/eea/volto-forests-theme/compare/0.2.0...0.2.1) + +- Discodata connector support animations [`4082ff8`](https://github.com/eea/volto-forests-theme/commit/4082ff8383c189e78113ed595fc4a6f7b3671793) + #### [0.2.0](https://github.com/eea/volto-forests-theme/compare/0.2.0-beta.0...0.2.0) +> 4 February 2022 + +- Added compatibility with volto-datablocks@3.x [`#53`](https://github.com/eea/volto-forests-theme/pull/53) - Develop [`#51`](https://github.com/eea/volto-forests-theme/pull/51) #### [0.2.0-beta.0](https://github.com/eea/volto-forests-theme/compare/0.1.37...0.2.0-beta.0) diff --git a/package.json b/package.json index f6b79e7..2f3dff7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-forests-theme", - "version": "0.2.0", + "version": "0.2.1", "description": "@eeacms/volto-forests-theme: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team",