Skip to content

Commit

Permalink
Release 6.0.0 #45 from eea/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Apr 5, 2024
2 parents 387eb5e + 1ca2926 commit a0120da
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 185 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,41 @@ 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).

### [6.0.0](https://github.com/eea/volto-hero-block/compare/5.5.0...6.0.0) - 4 April 2024

#### :boom: Breaking Change

- breaking(hero): Use BlocksForm instead of SlateEditor to render more slates block #44 from eea/multiline-bug [ichim-david - [`57953c5`](https://github.com/eea/volto-hero-block/commit/57953c5f27a1831fbb3ff581900b1b8d1b20cb1e)]
- breaking(tests): Updated Hero.test.jsx.snap snapshots after removal of inner div wrapper [David Ichim - [`7cf73ef`](https://github.com/eea/volto-hero-block/commit/7cf73ef3c4cd0b01dc238a1f6a51a1866dd56aa0)]

#### :nail_care: Enhancements

- change(hero): Use EditBlockWrapper from Volto core [David Ichim - [`360d2d7`](https://github.com/eea/volto-hero-block/commit/360d2d7e0f0240dd089839cc2ec62a691bcf41e2)]

#### :hammer_and_wrench: Others

- Fix onClick event in Hero block to select the block in Edit mode [David Ichim - [`1f38992`](https://github.com/eea/volto-hero-block/commit/1f389922d05a5a04cf11d023229aca156873f4b9)]
- Add ts-jest package to package.json [David Ichim - [`7c82b62`](https://github.com/eea/volto-hero-block/commit/7c82b626985bfdabcf10db6da159c13fa86b27e2)]
- bump package version to a major 6.0.0 to indicate breaking changes [David Ichim - [`472b675`](https://github.com/eea/volto-hero-block/commit/472b675fcc037c5ac31ceed52f60aa13998fa896)]
- fix crash of page after removal of a slate block and saving edit page [David Ichim - [`a917cdc`](https://github.com/eea/volto-hero-block/commit/a917cdccec827594b10ceced3c1588cac2308b43)]
- fix intial value slate [dobri1408 - [`c70bb80`](https://github.com/eea/volto-hero-block/commit/c70bb80a8c60a710cba02d7afbe069ad1b2e4fa2)]
- Update Jest configuration to avoid ts error and removed onClick from Hero block view component [David Ichim - [`448dbb4`](https://github.com/eea/volto-hero-block/commit/448dbb4882b0fa3d0a128a7a5241b3fa8148d955)]
- switch to block sidebar when clicking on the hero block in edit [David Ichim - [`1797077`](https://github.com/eea/volto-hero-block/commit/1797077bcbe9001e24c382d4e534b150683acb9c)]
- fix eslint [dobri1408 - [`7b0a66c`](https://github.com/eea/volto-hero-block/commit/7b0a66cfb0157787b69ae9c80326b9d9e7a06227)]
- fix eslint [dobri1408 - [`163af98`](https://github.com/eea/volto-hero-block/commit/163af98415a702361c044531e8f13e8e034972ef)]
- fix eslint comments [dobri1408 - [`0fff8b0`](https://github.com/eea/volto-hero-block/commit/0fff8b07f4375cf8809fe3575ea6bf913aec0c0c)]
- fix eslint [dobri1408 - [`d560dcb`](https://github.com/eea/volto-hero-block/commit/d560dcb580755767d43d7848f182b420552c1894)]
- improve the quality [dobri1408 - [`d6bf215`](https://github.com/eea/volto-hero-block/commit/d6bf21563f6e1e423f1c730f5e5409cfc724c240)]
- Update Edit.jsx [dobri1408 - [`2c31ecd`](https://github.com/eea/volto-hero-block/commit/2c31ecd5fd896e5f0a43f4a689dbb60a36c39431)]
- fix cypress test [dobri1408 - [`c24f627`](https://github.com/eea/volto-hero-block/commit/c24f627de259623cf27cdcde703667d4e510ce8b)]
- fix unit tests [dobri1408 - [`ad6e98f`](https://github.com/eea/volto-hero-block/commit/ad6e98fe433f815a692139d5a06f669c485422ad)]
- fix unit tests [dobri1408 - [`7c007a6`](https://github.com/eea/volto-hero-block/commit/7c007a63c4a14a9230a4e59a3877e9494a241656)]
- trigger tests [dobri1408 - [`0f51440`](https://github.com/eea/volto-hero-block/commit/0f514401ccd93e90053009427735acc9d8ef4ef7)]
- mock react-router-dom [dobri1408 - [`f6a33ab`](https://github.com/eea/volto-hero-block/commit/f6a33ab4142fe25f890d186f09162d3c6ea8c68d)]
- fix eslint [dobri1408 - [`89483de`](https://github.com/eea/volto-hero-block/commit/89483dee93c172e14b8a89e71bd112a27d3d5a90)]
- fi problems with the bacward compatibility [dobri1408 - [`5915149`](https://github.com/eea/volto-hero-block/commit/59151498b7601f2e1de959916cee504b702c9cb1)]
- use blockform and renderblocks [dobri1408 - [`61994d0`](https://github.com/eea/volto-hero-block/commit/61994d0044e212e89dbec1ac25f13a56b42f8f82)]
- fix multiline hero bug [dobri1408 - [`25b26d5`](https://github.com/eea/volto-hero-block/commit/25b26d562121b59ff5120ea8caefaab014885889)]
### [5.5.0](https://github.com/eea/volto-hero-block/compare/5.4.6...5.5.0) - 19 February 2024

#### :house: Internal changes
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -98,15 +98,15 @@ test-update: ## Update jest tests snapshots

.PHONY: stylelint
stylelint: ## Stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
$(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}'

.PHONY: stylelint-overrides
stylelint-overrides:
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'

.PHONY: stylelint-fix
stylelint-fix: ## Fix stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix

.PHONY: prettier
Expand Down
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,16 @@ Enhanced Hero Block [Volto](https://github.com/plone/volto) add-on

This version requires: `@plone/volto >= 16.0.0.alpha.46` (schemaEnhancer / addStyling).

### Upgrading to 6.x

Starting with version `6.0.0` we have the following breaking changes from version `5.x.x`:

1. Removed inner `div` that was used to add `quoted-wrapper` class.
This `class` is now added on the main `div` alongside the other `block` options.
2. Block is using `BlocksForm` to add more than one `Slate` blocks.
This is useful in case you have to add some sub titles or extra paragraphs inside the `Hero block`. The default `Slate` tag is still `h2` but you can change it using the rich text options toolbar.


## Getting started

### Try volto-hero-block with Docker
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/01-hero-block-basics.cy.js
Expand Up @@ -19,9 +19,6 @@ describe('Blocks Tests', () => {
'hero',
);
cy.get('.button.hero').click({ force: true });
cy.get('.hero-block-text div[role="textbox"]')
.click()
.type('My Hero Block');

cy.get(
'.inline.field.textarea.field-wrapper-buttonLabel textarea#field-buttonLabel',
Expand All @@ -37,6 +34,10 @@ describe('Blocks Tests', () => {
.eq(0)
.click();

cy.get('.hero-block-text div[role="textbox"]')
.click()
.type('My Hero Block');

// Save
cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
Expand Down
20 changes: 12 additions & 8 deletions cypress/e2e/02-dexterity-controlpanel-layout.cy.js
Expand Up @@ -35,6 +35,7 @@ describe('ControlPanel: Dexterity Content-Types Layout', () => {
cy.get('.blocks-chooser .title').contains('Common').click();
cy.get('.content.active.common .button.hero')
.contains('Hero')

.click({ force: true });

cy.get('#toolbar-save').click();
Expand All @@ -48,17 +49,16 @@ describe('ControlPanel: Dexterity Content-Types Layout', () => {
cy.get('button[class="add"]').click();
cy.get('#toolbar-add-book').click();
cy.get('.block.title').contains('Book title');
cy.get('.block.hero div[role="presentation"]').click();

// Add text and button
cy.get('.hero-block-text div[role="textbox"]')
.click()
.type('My hero block');
cy.get('label[for="field-fullWidth"]').click();
cy.get('label[for="field-fullHeight"]').click();
cy.get('.block.hero div[role="presentation"]').first().click();
cy.get('.formtabs.menu').children().first().next().click();

cy.get('label[for="field-quoted"]').click();
cy.get('label[for="field-spaced"]').click();
cy.get('.field-wrapper-buttonLabel #field-buttonLabel').click().type('Label')
cy.get('.field-wrapper-buttonLabel #field-buttonLabel')
.click()
.type('Label');
cy.get('#field-buttonLabel').click().type('my button');
cy.get('.inline.field.field-attached-image .ui.input')
.click()
Expand All @@ -67,6 +67,10 @@ describe('ControlPanel: Dexterity Content-Types Layout', () => {
'.inline.field.field-attached-image .ui.buttons .primary.button',
).click();

cy.get('.hero-block-text div[role="textbox"]')
.click()
.type('My hero block');

// Change book title
cy.clearSlateTitle();
cy.getSlateTitle().type('My First Book');
Expand All @@ -78,6 +82,6 @@ describe('ControlPanel: Dexterity Content-Types Layout', () => {
cy.get('.hero-block-meta .button').contains('my button');
cy.get('.hero-block-image-wrapper');
cy.get('.eea.hero-block.spaced.inverted.full-height');
cy.get('.hero-block-meta.text-left .button').contains('Label')
cy.get('.hero-block-meta.text-left .button').contains('Label');
});
});
5 changes: 3 additions & 2 deletions jest-addon.config.js
@@ -1,4 +1,4 @@
require('dotenv').config({ path: __dirname + '/.env' })
require('dotenv').config({ path: __dirname + '/.env' });

module.exports = {
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
Expand Down Expand Up @@ -28,6 +28,7 @@ module.exports = {
],
transform: {
'^.+\\.js(x)?$': 'babel-jest',
'^.+\\.ts(x)?$': 'ts-jest',
'^.+\\.(png)$': 'jest-file',
'^.+\\.(jpg)$': 'jest-file',
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
Expand All @@ -45,4 +46,4 @@ module.exports = {
'<rootDir>/node_modules/@eeacms/volto-hero-block/jest.setup.js',
],
}),
}
};
3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-hero-block",
"version": "5.5.0",
"version": "6.0.0",
"description": "@eeacms/volto-hero-block: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down Expand Up @@ -29,6 +29,7 @@
"babel-plugin-transform-class-properties": "^6.24.1",
"dotenv": "^16.3.2",
"husky": "^8.0.3",
"ts-jest": "^26.4.2",
"lint-staged": "^14.0.1",
"md5": "^2.3.0"
},
Expand Down

0 comments on commit a0120da

Please sign in to comment.