Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #54 from eea/develop
Browse files Browse the repository at this point in the history
Discodata connector support animations
  • Loading branch information
andreiggr committed Feb 16, 2022
2 parents 3c76737 + 321ecf3 commit afcec09
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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-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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const Edit = (props) => {
block={props.block}
/>
</SidebarPortal>
<View {...props} id={state.id} />
<View {...props} editMode id={state.id} />
</div>
);
};
Expand Down
13 changes: 9 additions & 4 deletions src/components/manage/Blocks/DiscodataConnectorBlock/v1/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
key={`land-data-for-${dataProviderKey}`}
Expand All @@ -17,6 +17,7 @@ const providerView = (dataProviderKey, dataProvider) => {
column={dataProvider.displayColumn}
textTemplate={dataProvider.textTemplate}
specifier={dataProvider.specifier}
animatedCounter={!editMode ? dataProvider.animatedCounter : ''}
placeholder="_"
/>
)}
Expand Down Expand Up @@ -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),
)}
</div>
);
Expand All @@ -136,7 +141,7 @@ const View = (props) => {
className={dataProvider.wrapperClassName}
key={`data-wrapper-${dataProviderKey}`}
>
{providerView(dataProviderKey, dataProvider)}
{providerView(dataProviderKey, dataProvider, props.editMode)}
</div>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const dataProviderSchemaExtender = (schema, child = {}, props) => {
{
id: 'properties',
title: 'Properties',
fields: ['measurmentUnit', 'additionalText', 'className'],
fields: [
'measurmentUnit',
'additionalText',
'className',
'animatedCounter',
],
},
...(child.hasDiscodataConnector
? [
Expand Down Expand Up @@ -90,6 +95,7 @@ const dataProviderSchema = {
'className',
'parent',
'wrapperClassName',
'animatedCounter',
],
},
],
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit afcec09

Please sign in to comment.