From ef8b82323a0c108e58f73c180f5b4cb23ed04f0e Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Mon, 31 Oct 2022 15:41:23 +0200 Subject: [PATCH 1/5] test(cypress): Rename --- .../e2e/{01-block-basics.cy.js => 01-block-call-to-action.cy.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cypress/e2e/{01-block-basics.cy.js => 01-block-call-to-action.cy.js} (100%) diff --git a/cypress/e2e/01-block-basics.cy.js b/cypress/e2e/01-block-call-to-action.cy.js similarity index 100% rename from cypress/e2e/01-block-basics.cy.js rename to cypress/e2e/01-block-call-to-action.cy.js From 0e06348412feed9eeea6ae5d06ae59b8c21e4eff Mon Sep 17 00:00:00 2001 From: EEA Jenkins Date: Fri, 11 Nov 2022 12:27:58 +0200 Subject: [PATCH 2/5] Add Sonarqube tag using circularity-frontend addons list --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc40a09..49091b4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { environment { GIT_NAME = "volto-call-to-action-block" NAMESPACE = "@eeacms" - SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu" + SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu,circularity.eea.europa.eu" DEPENDENCIES = "" VOLTO = "alpha" } From bba7ea1ce39c4ff387c9ccb0dce3f10b3b678f59 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Tue, 15 Nov 2022 16:40:59 +0200 Subject: [PATCH 3/5] refactor(Styling): Use schemaEnhancer in favor of StyleWrapper --- README.md | 6 +++ package.json | 2 +- src/components/Schema.js | 80 +++++++++++++++++++++------------------- src/index.js | 3 +- 4 files changed, 51 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index d1f83eb..b594733 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ ![Call to Action](https://github.com/eea/volto-call-to-action-block/raw/develop/docs/call-to-action.gif) +## Upgrade + +### Upgrading to 2.x + +This version requires: `@plone/volto >= 16.0.0.alpha.46` (schemaEnhancer / addStyling). + ## Getting started ### Try volto-call-to-action-block with Docker diff --git a/package.json b/package.json index 46a75c3..00a4d06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-call-to-action-block", - "version": "1.0.0", + "version": "2.0.0", "description": "@eeacms/volto-call-to-action-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/components/Schema.js b/src/components/Schema.js index 2d14882..ecd1cf8 100644 --- a/src/components/Schema.js +++ b/src/components/Schema.js @@ -1,4 +1,5 @@ import { defineMessages } from 'react-intl'; +import { addStyling } from '@plone/volto/helpers'; const messages = defineMessages({ Type: { @@ -111,41 +112,46 @@ export const EditSchema = ({ intl }) => ({ required: [], }); -export const StylingSchema = ({ intl }) => ({ - title: intl.formatMessage(messages.Type), - block: 'callToAction', - fieldsets: [ - { - id: 'default', - title: 'Default', - fields: ['align', 'theme', 'inverted', 'icon', 'rightIcon'], - }, - ], - properties: { - align: { - title: intl.formatMessage(messages.Align), - widget: 'align', +export const StylingSchema = (props) => { + const { intl } = props; + const schema = addStyling(props); + schema.properties.styles.schema = { + title: intl.formatMessage(messages.Type), + block: 'callToAction', + fieldsets: [ + { + id: 'default', + title: 'Default', + fields: ['align', 'theme', 'inverted', 'icon', 'rightIcon'], + }, + ], + properties: { + align: { + title: intl.formatMessage(messages.Align), + widget: 'align', + }, + theme: { + title: intl.formatMessage(messages.Theme), + choices: [ + ['primary', intl.formatMessage(messages.ThemePrimary)], + ['secondary', intl.formatMessage(messages.ThemeSecondary)], + ['tertiary', intl.formatMessage(messages.ThemeTertiary)], + ['link', intl.formatMessage(messages.ThemeLink)], + ], + }, + inverted: { + title: intl.formatMessage(messages.Inverted), + type: 'boolean', + }, + icon: { + title: intl.formatMessage(messages.Icon), + }, + rightIcon: { + title: intl.formatMessage(messages.IconRight), + type: 'boolean', + }, }, - theme: { - title: intl.formatMessage(messages.Theme), - choices: [ - ['primary', intl.formatMessage(messages.ThemePrimary)], - ['secondary', intl.formatMessage(messages.ThemeSecondary)], - ['tertiary', intl.formatMessage(messages.ThemeTertiary)], - ['link', intl.formatMessage(messages.ThemeLink)], - ], - }, - inverted: { - title: intl.formatMessage(messages.Inverted), - type: 'boolean', - }, - icon: { - title: intl.formatMessage(messages.Icon), - }, - rightIcon: { - title: intl.formatMessage(messages.IconRight), - type: 'boolean', - }, - }, - required: [], -}); + required: [], + }; + return schema; +}; diff --git a/src/index.js b/src/index.js index c639d7c..f167686 100644 --- a/src/index.js +++ b/src/index.js @@ -14,11 +14,10 @@ const applyConfig = (config) => { view: View, edit: Edit, editSchema: EditSchema, - stylesSchema: StylingSchema, + schemaEnhancer: StylingSchema, restricted: false, mostUsed: false, sidebarTab: 1, - enableStyling: true, security: { addPermission: [], view: [], From 39e8df468509414924327917154f035235ec5798 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Wed, 16 Nov 2022 00:12:44 +0200 Subject: [PATCH 4/5] test(estlint): Fix .project.eslintrc.js --- .project.eslintrc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.project.eslintrc.js b/.project.eslintrc.js index cfefd89..765070f 100644 --- a/.project.eslintrc.js +++ b/.project.eslintrc.js @@ -1,7 +1,9 @@ const fs = require('fs'); const path = require('path'); -const projectRootPath = fs.realpathSync('./project'); // __dirname +const projectRootPath = fs.existsSync('./project') + ? fs.realpathSync('./project') + : fs.realpathSync('./../../../'); const packageJson = require(path.join(projectRootPath, 'package.json')); const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions; From 44b9bf5c0460c3cb9f2add9615a20dc32fd340b4 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Tue, 15 Nov 2022 22:26:57 +0000 Subject: [PATCH 5/5] Automated release 2.0.0 --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e09ac08..9298772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,17 @@ 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). -### [1.0.0](https://github.com/eea/volto-call-to-action-block/compare/0.2.4...1.0.0) - 28 October 2022 +### [2.0.0](https://github.com/eea/volto-call-to-action-block/compare/1.0.0...2.0.0) - 15 November 2022 + +#### :nail_care: Enhancements + +- refactor(Styling): Use schemaEnhancer in favor of StyleWrapper [Alin Voinea - [`bba7ea1`](https://github.com/eea/volto-call-to-action-block/commit/bba7ea1ce39c4ff387c9ccb0dce3f10b3b678f59)] + +#### :hammer_and_wrench: Others + +- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`39e8df4`](https://github.com/eea/volto-call-to-action-block/commit/39e8df468509414924327917154f035235ec5798)] +- test(cypress): Rename [Alin Voinea - [`ef8b823`](https://github.com/eea/volto-call-to-action-block/commit/ef8b82323a0c108e58f73c180f5b4cb23ed04f0e)] +## [1.0.0](https://github.com/eea/volto-call-to-action-block/compare/0.2.4...1.0.0) - 28 October 2022 #### :nail_care: Enhancements