Skip to content

Commit

Permalink
Merge pull request #26 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Jun 7, 2024
2 parents 591971b + 8fb7e31 commit 6ee2e0a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ 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).

### [2.0.0](https://github.com/eea/volto-description-block/compare/1.2.4...2.0.0) - 22 April 2024
### [2.0.1](https://github.com/eea/volto-description-block/compare/2.0.0...2.0.1) - 7 June 2024

#### :bug: Bug Fixes

- fix: Make description block not loose position - refs #270726 [dobri1408 - [`14da4d6`](https://github.com/eea/volto-description-block/commit/14da4d67d927b5c66ea7695d420ddd4309daa4cd)]

## [2.0.0](https://github.com/eea/volto-description-block/compare/1.2.4...2.0.0) - 22 April 2024

#### :rocket: New Features

Expand All @@ -13,9 +19,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

- chore: [JENKINS] Refactor automated testing [valentinab25 - [`35cc7c4`](https://github.com/eea/volto-description-block/commit/35cc7c4e8633267e2add99da8c76dab801c63697)]

#### :hammer_and_wrench: Others

- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`58f5d05`](https://github.com/eea/volto-description-block/commit/58f5d05b1a4d89a7875db7091598a93cb57e25b6)]
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`97c091c`](https://github.com/eea/volto-description-block/commit/97c091c0bf1b55ba6d0579521136ec1c222604db)]
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`4b5b675`](https://github.com/eea/volto-description-block/commit/4b5b675dec027e4ebba416ad6423196bd864cbe5)]
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`d8b1ec2`](https://github.com/eea/volto-description-block/commit/d8b1ec20c366e647ec1045ec7d6fdc8505b33cea)]
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`303dad6`](https://github.com/eea/volto-description-block/commit/303dad6b5cd7fc243a2484ffeec3087a3685a0c2)]
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`fe0bac4`](https://github.com/eea/volto-description-block/commit/fe0bac48142361ff092f28d8c72979c4b88bca13)]
- test: [JENKINS] Improve cypress time [valentinab25 - [`7cb360d`](https://github.com/eea/volto-description-block/commit/7cb360dac6b78d5d2db24f93db8c29eae56227cc)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0989032`](https://github.com/eea/volto-description-block/commit/0989032fbbcd3a7a217ab8a8bab1deef8b147014)]
### [1.2.4](https://github.com/eea/volto-description-block/compare/1.2.3...1.2.4) - 22 October 2023

### [1.2.3](https://github.com/eea/volto-description-block/compare/1.2.2...1.2.3) - 17 October 2023
Expand Down Expand Up @@ -56,12 +71,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`5ba7497`](https://github.com/eea/volto-description-block/commit/5ba74971be907f1a30c5af14bef816f4ec4d3888)]
- i18n: Add en [Alin Voinea - [`26ecbde`](https://github.com/eea/volto-description-block/commit/26ecbde5fe4fe6d0a7709a8bf39602f034036364)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`4e8d2b2`](https://github.com/eea/volto-description-block/commit/4e8d2b2ca65248f2e9e924f00fe89eb9c8ccb513)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3e0fdaa`](https://github.com/eea/volto-description-block/commit/3e0fdaab9a13e56dae4fe437d598e8a41c928335)]
### [1.1.3](https://github.com/eea/volto-description-block/compare/1.1.2...1.1.3) - 24 July 2023

### [1.1.2](https://github.com/eea/volto-description-block/compare/1.1.1...1.1.2) - 12 June 2023

#### :house: Internal changes

- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`5a4d802`](https://github.com/eea/volto-description-block/commit/5a4d80276c4b9474484236e371eec034d49d3381)]

#### :hammer_and_wrench: Others

Expand All @@ -73,16 +90,30 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`8aa5ced`](https://github.com/eea/volto-description-block/commit/8aa5ced5f4a21326059d86e1bd9c608b672569f1)]
### [1.1.0](https://github.com/eea/volto-description-block/compare/1.0.1...1.1.0) - 27 March 2023

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`cae3333`](https://github.com/eea/volto-description-block/commit/cae3333ea521533d15b05401a831425751e5dc15)]
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`0e6b85a`](https://github.com/eea/volto-description-block/commit/0e6b85af26f7a68b737650fe43cb59ab9304a888)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`5b9f67a`](https://github.com/eea/volto-description-block/commit/5b9f67a41812aa0cd126ede14fd13b3cbd4f84ab)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`7095b4a`](https://github.com/eea/volto-description-block/commit/7095b4a17ba4ec6c5650cd6233dac8420accd1a8)]
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`a58e1db`](https://github.com/eea/volto-description-block/commit/a58e1db4c880028780cda54a386a06d72bf89877)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`39d9f06`](https://github.com/eea/volto-description-block/commit/39d9f06e028c5006cf29e62984647e4fa8d4fc80)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`9058cd4`](https://github.com/eea/volto-description-block/commit/9058cd46e1922e46ce13038c0d9dbe4b39fa4354)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`da35440`](https://github.com/eea/volto-description-block/commit/da35440d53b6fbaf9462f2950791a473b674b67a)]
- yarn 3 [Alin Voinea - [`0c02df5`](https://github.com/eea/volto-description-block/commit/0c02df5f5c1a26656018d68927aa437ce37df8c3)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`aed1921`](https://github.com/eea/volto-description-block/commit/aed1921e2e0493afd2a7e8fe37428643069f9487)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0ca677e`](https://github.com/eea/volto-description-block/commit/0ca677e3732f5f7dba50dae8d60d43e95c7ecfb1)]
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`d829698`](https://github.com/eea/volto-description-block/commit/d82969855addee8478a43f1440b0dba003f5f9c2)]
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`9b5d631`](https://github.com/eea/volto-description-block/commit/9b5d6310df3a32d8b29085eb843e727a5a19ceb7)]
### [1.0.1](https://github.com/eea/volto-description-block/compare/1.0.0...1.0.1) - 16 November 2022

#### :hammer_and_wrench: Others

- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`18e06c3`](https://github.com/eea/volto-description-block/commit/18e06c387847079ba8dee0ac5c059e8bba7671e7)]
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`629f0f6`](https://github.com/eea/volto-description-block/commit/629f0f6867bc7b69f571eea5d61df57473c1f1c4)]
## [1.0.0](https://github.com/eea/volto-description-block/compare/0.3.1...1.0.0) - 28 October 2022

#### :nail_care: Enhancements
Expand All @@ -95,6 +126,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- test(scripts): Move scripts to Makefile [Alin Voinea - [`10b4eae`](https://github.com/eea/volto-description-block/commit/10b4eaec24009403b4100a29550d536c4e08d9a2)]
- test(cypress): Cypress 10 / Razzle 4 [Alin Voinea - [`36429b4`](https://github.com/eea/volto-description-block/commit/36429b4656333472038fd245623736042e9cc2ae)]
- Cleanup [Alin Voinea - [`5247e9c`](https://github.com/eea/volto-description-block/commit/5247e9cca2751495c91a52ce8cd0a3992a399df1)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`82652e5`](https://github.com/eea/volto-description-block/commit/82652e51b86f31d9a10e75c6986d3b44182b4931)]
### [0.3.1](https://github.com/eea/volto-description-block/compare/0.3.0...0.3.1) - 30 June 2022

### [0.3.0](https://github.com/eea/volto-description-block/compare/0.2.0...0.3.0) - 24 May 2022
Expand All @@ -104,6 +136,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Release 0.3.0 [Alin Voinea - [`39df766`](https://github.com/eea/volto-description-block/commit/39df76639343b340bb8369342728a35a0a7260f7)]
- Update docs with demo gif [Alin Voinea - [`2b18328`](https://github.com/eea/volto-description-block/commit/2b183280ea637d53c1b20e933972d41bab0f08c8)]
- Remove callout install; Default className to documentDescription; Enabled by default [Alin Voinea - [`64ae975`](https://github.com/eea/volto-description-block/commit/64ae975fdfe05f3e87788d09735282b756be1559)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`032ff16`](https://github.com/eea/volto-description-block/commit/032ff162b8c89c951840f6ae020480e4ae68272c)]
### [0.2.0](https://github.com/eea/volto-description-block/compare/0.1.3...0.2.0) - 19 May 2022

### [0.1.3](https://github.com/eea/volto-description-block/compare/0.1.2...0.1.3) - 17 May 2022
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-description-block",
"version": "2.0.0",
"version": "2.0.1",
"description": "@eeacms/volto-description-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand All @@ -24,7 +24,8 @@
"dotenv": "^16.3.2",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"md5": "^2.3.0"
"md5": "^2.3.0",
"cypress": "13.1.0"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json}": [
Expand Down
23 changes: 3 additions & 20 deletions src/DescriptionBlock/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module volto-slate/blocks/Description/DescriptionBlockEdit
*/

import React, { useCallback, useMemo } from 'react';
import React, { useCallback } from 'react';
import { connect } from 'react-redux';
import { defineMessages, useIntl } from 'react-intl';
import config from '@plone/volto/registry';
Expand Down Expand Up @@ -35,13 +35,8 @@ export const DescriptionBlockEdit = (props) => {
data,
} = props;
const intl = useIntl();

const value = data?.value || config.settings.slate.defaultValue();
const text = metadata?.['description'] || properties?.['description'] || '';
const blockText = data?.value || config.settings.slate.defaultValue();
const plainBlockText = useMemo(
() => serializeNodesToText(blockText),
[blockText],
);

const withBlockProperties = useCallback(
(editor) => {
Expand All @@ -65,18 +60,6 @@ export const DescriptionBlockEdit = (props) => {
[block, data, text, onChangeField, onChangeBlock],
);

const value = useMemo(() => {
if (plainBlockText !== text) {
return [
{
type: 'p',
children: [{ text }],
},
];
}
return blockText;
}, [text, blockText, plainBlockText]);

const handleFocus = useCallback(() => {
if (!selected) {
onSelectBlock(block);
Expand All @@ -97,9 +80,9 @@ export const DescriptionBlockEdit = (props) => {
properties={properties}
extensions={slate.textblockExtensions}
renderExtensions={[withBlockProperties]}
value={value}
onChange={handleChange}
block={block}
value={value}
onFocus={handleFocus}
onKeyDown={handleKey}
selected={selected}
Expand Down

0 comments on commit 6ee2e0a

Please sign in to comment.