Skip to content

Commit

Permalink
Merge pull request #7 from eea/develop
Browse files Browse the repository at this point in the history
BREAKING: Use schemaEnhancer in favor of StyleWrapper
  • Loading branch information
avoinea authored Nov 16, 2022
2 parents a095cad + 44b9bf5 commit 186ee6f
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 43 deletions.
4 changes: 3 additions & 1 deletion .project.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
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-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",
Expand Down
80 changes: 43 additions & 37 deletions src/components/Schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineMessages } from 'react-intl';
import { addStyling } from '@plone/volto/helpers';

const messages = defineMessages({
Type: {
Expand Down Expand Up @@ -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;
};
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down

0 comments on commit 186ee6f

Please sign in to comment.