generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eea/develop
Release
- Loading branch information
Showing
12 changed files
with
412 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
# Changelog | ||
### Changelog | ||
|
||
## 0.1.0 | ||
All notable changes to this project will be documented in this file. Dates are displayed in UTC. | ||
|
||
- Initial release | ||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). | ||
|
||
#### [0.2.0](https://github.com/eea/volto-call-to-action-block/compare/0.1.0...0.2.0) | ||
|
||
- Release 0.2.0 [`ae6c18d`](https://github.com/eea/volto-call-to-action-block/commit/ae6c18d84f502829f254ac62d0792040a9854418) | ||
- Add cypress basic tests [`fd5b04b`](https://github.com/eea/volto-call-to-action-block/commit/fd5b04b43cfcd01e6ddd32b7c16e5db4a8cadb22) | ||
- Cleanup: style defaults [`f682eca`](https://github.com/eea/volto-call-to-action-block/commit/f682eca484fe3aab0ab7ab774115df6548290f41) | ||
- Update docs [`7f8d80b`](https://github.com/eea/volto-call-to-action-block/commit/7f8d80bb7b18ec989ab47dbf2f62fc966a022e50) | ||
- i18n [`63b55e1`](https://github.com/eea/volto-call-to-action-block/commit/63b55e17d2136f01d4c7e6bb8d9886d751d0cbc4) | ||
- Fix style [`6a35058`](https://github.com/eea/volto-call-to-action-block/commit/6a35058703fd5b67401562ed1f1c3fc4f855b61b) | ||
- Add labeled icon and some cleanup [`88a331f`](https://github.com/eea/volto-call-to-action-block/commit/88a331ffb1d8814c2e2b4abfd09b7e69e2895014) | ||
- i18n [`0f965c0`](https://github.com/eea/volto-call-to-action-block/commit/0f965c0d8f16b1e8354c60631463f2d57c40fe23) | ||
- Cleanup and use enableStyling / custom stylesSchema: [`1453f98`](https://github.com/eea/volto-call-to-action-block/commit/1453f98109626760271cdbff519ef9f831345ce9) | ||
- Add button [`8e1a17f`](https://github.com/eea/volto-call-to-action-block/commit/8e1a17f2f622e501348697b1d80216d1219c3c4e) | ||
|
||
#### 0.1.0 | ||
|
||
> 31 May 2022 | ||
- Initial commit [`00f39c8`](https://github.com/eea/volto-call-to-action-block/commit/00f39c8a36327a821cc613a772bf228451a71e67) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Plone\n" | ||
"POT-Creation-Date: 2022-05-31T18:04:15.692Z\n" | ||
"Last-Translator: Plone i18n <[email protected]>\n" | ||
"Language-Team: Plone i18n <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=utf-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=1; plural=0;\n" | ||
"Language-Code: en\n" | ||
"Language-Name: English\n" | ||
"Preferred-Encodings: utf-8\n" | ||
"Domain: volto\n" | ||
|
||
#: components/Schema | ||
# defaultMessage: Alignment | ||
msgid "Alignment" | ||
msgstr "" | ||
|
||
#: components/Edit | ||
#: components/Schema | ||
# defaultMessage: Call to Action | ||
msgid "Call to Action" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Click here | ||
msgid "Click here" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Icon | ||
msgid "Icon" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Icon on the right | ||
msgid "Icon on the right" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Inverted | ||
msgid "Inverted" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Link | ||
msgid "Link" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Open in new window | ||
msgid "Open in new window" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: undefined | ||
msgid "Open in parent window / frame" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Open in this window / frame | ||
msgid "Open in this window / frame" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Open in top frame (replaces all frames) | ||
msgid "Open in top frame (replaces all frames)" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Primary | ||
msgid "Primary" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Secondary | ||
msgid "Secondary" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Target | ||
msgid "Target" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Text | ||
msgid "Text" | ||
msgstr "" | ||
|
||
#: components/Schema | ||
# defaultMessage: Theme | ||
msgid "Theme" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@eeacms/volto-call-to-action-block", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "@eeacms/volto-call-to-action-block: Volto add-on", | ||
"main": "src/index.js", | ||
"author": "European Environment Agency: IDM2 A-Team", | ||
|
@@ -16,10 +16,9 @@ | |
"type": "git", | ||
"url": "[email protected]:eea/volto-call-to-action-block.git" | ||
}, | ||
"dependencies": { | ||
"@plone/scripts": "*" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@plone/scripts": "*", | ||
"@cypress/code-coverage": "^3.9.5", | ||
"babel-plugin-transform-class-properties": "^6.24.1" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { SidebarPortal, BlockDataForm } from '@plone/volto/components'; | ||
import { defineMessages } from 'react-intl'; | ||
import { EditSchema } from './Schema'; | ||
import View from './View'; | ||
|
||
const messages = defineMessages({ | ||
Type: { | ||
id: 'Call to Action', | ||
defaultMessage: 'Call to Action', | ||
}, | ||
}); | ||
|
||
const Edit = (props) => { | ||
const { data, block, onChangeBlock, selected, intl } = props; | ||
const schema = EditSchema({ intl }); | ||
return ( | ||
<> | ||
<View {...props} isEditMode /> | ||
<SidebarPortal selected={selected}> | ||
<BlockDataForm | ||
schema={schema} | ||
title={intl.formatMessage(messages.Type)} | ||
onChangeField={(id, value) => { | ||
onChangeBlock(block, { | ||
...data, | ||
[id]: value, | ||
}); | ||
}} | ||
formData={data} | ||
fieldIndex={data.index} | ||
block={block} | ||
/> | ||
</SidebarPortal> | ||
</> | ||
); | ||
}; | ||
|
||
export default Edit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
import { defineMessages } from 'react-intl'; | ||
|
||
const messages = defineMessages({ | ||
Type: { | ||
id: 'Call to Action', | ||
defaultMessage: 'Call to Action', | ||
}, | ||
Label: { | ||
id: 'Label', | ||
defaultMessage: 'Label', | ||
}, | ||
Link: { | ||
id: 'Link', | ||
defaultMessage: 'Link', | ||
}, | ||
Icon: { | ||
id: 'Icon', | ||
defaultMessage: 'Icon', | ||
}, | ||
IconRight: { | ||
id: 'Icon on the right', | ||
defaultMessage: 'Icon on the right', | ||
}, | ||
Align: { | ||
id: 'Alignment', | ||
defaultMessage: 'Alignment', | ||
}, | ||
Theme: { | ||
id: 'Theme', | ||
defaultMessage: 'Theme', | ||
}, | ||
ThemePrimary: { | ||
id: 'Primary', | ||
defaultMessage: 'Primary', | ||
}, | ||
ThemeSecondary: { | ||
id: 'Secondary', | ||
defaultMessage: 'Secondary', | ||
}, | ||
ThemeLink: { | ||
id: 'Link', | ||
defaultMessage: 'Link', | ||
}, | ||
Inverted: { | ||
id: 'Inverted', | ||
defaultMessage: 'Inverted', | ||
}, | ||
DefaultLabel: { | ||
id: 'Click here', | ||
defaultMessage: 'Click here', | ||
}, | ||
Target: { | ||
id: 'Target', | ||
defaultMessage: 'Target', | ||
}, | ||
TargetEmpty: { | ||
id: 'Open in this window / frame', | ||
defaultMessage: 'Open in this window / frame', | ||
}, | ||
TargetBlank: { | ||
id: 'Open in new window', | ||
defaultMessage: 'Open in new window', | ||
}, | ||
TargetParent: { | ||
id: 'Open in parent window / frame', | ||
defineMessages: 'Open in parent window / frame', | ||
}, | ||
TargetTop: { | ||
id: 'Open in top frame (replaces all frames)', | ||
defaultMessage: 'Open in top frame (replaces all frames)', | ||
}, | ||
}); | ||
|
||
export const EditSchema = ({ intl }) => ({ | ||
title: intl.formatMessage(messages.Type), | ||
block: 'callToAction', | ||
fieldsets: [ | ||
{ | ||
id: 'default', | ||
title: 'Default', | ||
fields: ['text', 'href', 'target'], | ||
}, | ||
], | ||
|
||
properties: { | ||
text: { | ||
title: intl.formatMessage(messages.Label), | ||
default: intl.formatMessage(messages.DefaultLabel), | ||
}, | ||
href: { | ||
title: intl.formatMessage(messages.Link), | ||
widget: 'object_browser', | ||
mode: 'link', | ||
selectedItemAttrs: ['Title', 'Description', 'hasPreviewImage'], | ||
allowExternals: true, | ||
}, | ||
target: { | ||
title: intl.formatMessage(messages.Target), | ||
choices: [ | ||
['_self', intl.formatMessage(messages.TargetEmpty)], | ||
['_blank', intl.formatMessage(messages.TargetBlank)], | ||
['_parent', intl.formatMessage(messages.TargetParent)], | ||
['_top', intl.formatMessage(messages.TargetTop)], | ||
], | ||
}, | ||
}, | ||
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', | ||
}, | ||
theme: { | ||
title: intl.formatMessage(messages.Theme), | ||
choices: [ | ||
['primary', intl.formatMessage(messages.ThemePrimary)], | ||
['secondary', intl.formatMessage(messages.ThemeSecondary)], | ||
['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: [], | ||
}); |
Oops, something went wrong.