@eeacms/volto-accordion-block
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -7,6 +7,19 @@ ### Changelog | ||
#### [3.2.0](https://github.com/eea/volto-accordion-block/compare/3.1.0...3.2.0) | ||
- commented the use of duplicate useEffect [`f771fb8`](https://github.com/eea/volto-accordion-block/commit/f771fb8701ad58b6fcca785c7e4b042eec5e3b07) | ||
- Save data for empty accordion on mount [`f80e728`](https://github.com/eea/volto-accordion-block/commit/f80e728e91ebe16c7ee6966d4b89e8d0fc986fd0) | ||
- Replace group with accordion within class names [`8113731`](https://github.com/eea/volto-accordion-block/commit/8113731fbc770ec8b29346d9d2f97f0d067a6021) | ||
- Add support for onInsertBlock with BlockChooser [`0e37fb3`](https://github.com/eea/volto-accordion-block/commit/0e37fb3542be53806017d0611c9239e5cdf94193) | ||
- Revert "Add support for newId returned by onMutateBlock" [`e7d8824`](https://github.com/eea/volto-accordion-block/commit/e7d882455d4478ea8aec952b54b572ae4aca5458) | ||
- Add support for newId returned by onMutateBlock [`ffea93a`](https://github.com/eea/volto-accordion-block/commit/ffea93acae2e47c66ffff59d5e4cdc591e1b58b8) | ||
- [JENKINS] - Fix eslint [`426fdc6`](https://github.com/eea/volto-accordion-block/commit/426fdc6f77b21a65650b79e521e815670e080b5c) | ||
#### [3.1.0](https://github.com/eea/volto-accordion-block/compare/3.0.0...3.1.0) | ||
> 5 April 2021 | ||
- Align accordion style/settings/buttons to Volto Group block [`334ecb4`](https://github.com/eea/volto-accordion-block/commit/334ecb493379d16c7b4c0afef74580c38e897277) | ||
- Update docs [`475ec25`](https://github.com/eea/volto-accordion-block/commit/475ec251601941a2e0364563408d54fa6e88172a) | ||
- Release 3.1.0 [`ecf79dc`](https://github.com/eea/volto-accordion-block/commit/ecf79dc6f34346c26f11676765b4c3ba2d4dc427) | ||
- Add fixedLayout settings [`b874b69`](https://github.com/eea/volto-accordion-block/commit/b874b69c8a48e7e0002f2c68a1ab51d5abb5ff2d) | ||
@@ -13,0 +26,0 @@ |
{ | ||
"name": "@eeacms/volto-accordion-block", | ||
"version": "3.1.0", | ||
"description": "volto-accordion-block: Volto group block to add accordions", | ||
"version": "3.2.0", | ||
"description": "volto-accordion-block: Volto accordion block", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "author": "European Environment Agency: IDM2 A-Team", |
@@ -6,3 +6,3 @@ # volto-accordion-block | ||
[Volto](https://github.com/plone/volto) add-on to create group based accordions in blocks. | ||
[Volto](https://github.com/plone/volto) accordions block. | ||
@@ -9,0 +9,0 @@ ## Features |
@@ -77,3 +77,3 @@ import React from 'react'; | ||
placeholder="Enter Title" | ||
value={panel?.title} | ||
value={panel?.title || ''} | ||
onClick={(e) => { | ||
@@ -80,0 +80,0 @@ handleTitleClick(); |
@@ -17,2 +17,3 @@ import React, { useState } from 'react'; | ||
const Edit = (props) => { | ||
const [selectedBlock, setSelectedBlock] = useState({}); | ||
const { | ||
@@ -27,33 +28,44 @@ block, | ||
} = props; | ||
const metadata = props.metadata || props.properties; | ||
const properties = isEmpty(data?.data?.blocks) | ||
? emptyAccordion(3) | ||
: data.data; | ||
const [selectedBlock, setSelectedBlock] = useState({}); | ||
const metadata = props.metadata || props.properties; | ||
React.useEffect(() => { | ||
properties.blocks_layout.items.map((item) => { | ||
if (isEmpty(properties.blocks[item].blocks)) { | ||
return onChangeBlock(block, { | ||
...data, | ||
data: { | ||
...properties, | ||
blocks: { | ||
...properties.blocks, | ||
[item]: emptyBlocksForm(), | ||
}, | ||
}, | ||
}); | ||
} | ||
return undefined; | ||
}); | ||
}, [ | ||
onChangeBlock, | ||
properties, | ||
selectedBlock, | ||
block, | ||
data, | ||
properties.blocks, | ||
]); | ||
if (isEmpty(data?.data)) { | ||
onChangeBlock(block, { | ||
...data, | ||
data: { | ||
...properties, | ||
}, | ||
}); | ||
} | ||
/* eslint-disable-next-line */ | ||
}, []); | ||
// React.useEffect(() => { | ||
// properties.blocks_layout.items.map((item) => { | ||
// if (isEmpty(properties.blocks[item].blocks)) { | ||
// return onChangeBlock(block, { | ||
// ...data, | ||
// data: { | ||
// ...properties, | ||
// blocks: { | ||
// ...properties.blocks, | ||
// [item]: emptyBlocksForm(), | ||
// }, | ||
// }, | ||
// }); | ||
// } | ||
// return undefined; | ||
// }); | ||
// }, [ | ||
// onChangeBlock, | ||
// properties, | ||
// selectedBlock, | ||
// block, | ||
// data, | ||
// properties.blocks, | ||
// ]); | ||
const blockState = {}; | ||
@@ -60,0 +72,0 @@ const panelData = properties; |
@@ -75,3 +75,5 @@ import React from 'react'; | ||
onDeleteBlock, | ||
onInsertBlock, | ||
onMutateBlock, | ||
onSelectBlock, | ||
selected, | ||
@@ -115,3 +117,3 @@ } = blockProps; | ||
{...draginfo.dragHandleProps} | ||
className="drag handle wrapper-group-block" | ||
className="drag handle wrapper-accordion-block" | ||
> | ||
@@ -133,3 +135,3 @@ <Button icon basic title="Drag and drop"> | ||
}} | ||
className="group-block-add-button" | ||
className="accordion-block-add-button" | ||
> | ||
@@ -145,3 +147,3 @@ <Icon name={addSVG} className="" size="19px" /> | ||
onClick={() => onDeleteBlock(block)} | ||
className="delete-button-group-block" | ||
className="delete-button-accordion-block" | ||
aria-label={intl.formatMessage(messages.delete)} | ||
@@ -155,5 +157,9 @@ > | ||
onMutateBlock={(id, value) => { | ||
onMutateBlock(id, value); | ||
this.setState({ addNewBlockOpened: false }); | ||
onMutateBlock(id, value); | ||
}} | ||
onInsertBlock={(id, value) => { | ||
onSelectBlock(onInsertBlock(id, value)); | ||
this.setState({ addNewBlockOpened: false }); | ||
}} | ||
currentBlock={block} | ||
@@ -160,0 +166,0 @@ allowedBlocks={allowedBlocks} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79691
1485