From 4a9a4beb9b643dfe5f045dddbeeb5f19a1f15141 Mon Sep 17 00:00:00 2001 From: andreiggr Date: Fri, 13 Jan 2023 02:27:15 +0200 Subject: [PATCH 1/6] color_picker widget for themes --- src/components/Schema.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/Schema.js b/src/components/Schema.js index ecd1cf8..dc9fc11 100644 --- a/src/components/Schema.js +++ b/src/components/Schema.js @@ -132,11 +132,21 @@ export const StylingSchema = (props) => { }, 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)], + widget: 'color_picker', + colors: [ + { name: 'primary', label: intl.formatMessage(messages.ThemePrimary) }, + { + name: 'secondary', + label: intl.formatMessage(messages.ThemeSecondary), + }, + { + name: 'tertiary', + label: intl.formatMessage(messages.ThemeTertiary), + }, + { + name: 'link', + label: intl.formatMessage(messages.ThemeLink), + }, ], }, inverted: { From 6fb5182897e7f5c29182f051eac4c4b948ac09f4 Mon Sep 17 00:00:00 2001 From: Andrei Grigore <44702393+andreiggr@users.noreply.github.com> Date: Thu, 26 Jan 2023 16:25:45 +0200 Subject: [PATCH 2/6] theme_picker widget --- package.json | 3 + src/components/Schema.js | 134 +++++++++++++++++++-------------------- 2 files changed, 67 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 04a0cde..b80e008 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "type": "git", "url": "git@github.com:eea/volto-call-to-action-block.git" }, + "dependencies": { + "@eeacms/volto-widget-theme-picker": "1.0.0" + }, "devDependencies": { "@cypress/code-coverage": "^3.10.0", "@plone/scripts": "*", diff --git a/src/components/Schema.js b/src/components/Schema.js index dc9fc11..7eeffff 100644 --- a/src/components/Schema.js +++ b/src/components/Schema.js @@ -1,89 +1,89 @@ -import { defineMessages } from 'react-intl'; -import { addStyling } from '@plone/volto/helpers'; +import { defineMessages } from "react-intl"; +import { addStyling } from "@plone/volto/helpers"; const messages = defineMessages({ Type: { - id: 'Call to Action', - defaultMessage: 'Call to Action', + id: "Call to Action", + defaultMessage: "Call to Action", }, Label: { - id: 'Label', - defaultMessage: 'Label', + id: "Label", + defaultMessage: "Label", }, Link: { - id: 'Link', - defaultMessage: 'Link', + id: "Link", + defaultMessage: "Link", }, Icon: { - id: 'Icon', - defaultMessage: 'Icon', + id: "Icon", + defaultMessage: "Icon", }, IconRight: { - id: 'Icon on the right', - defaultMessage: 'Icon on the right', + id: "Icon on the right", + defaultMessage: "Icon on the right", }, Align: { - id: 'Alignment', - defaultMessage: 'Alignment', + id: "Alignment", + defaultMessage: "Alignment", }, Theme: { - id: 'Theme', - defaultMessage: 'Theme', + id: "Theme", + defaultMessage: "Theme", }, ThemePrimary: { - id: 'Primary', - defaultMessage: 'Primary', + id: "Primary", + defaultMessage: "Primary", }, ThemeSecondary: { - id: 'Secondary', - defaultMessage: 'Secondary', + id: "Secondary", + defaultMessage: "Secondary", }, ThemeTertiary: { - id: 'Tertiary', - defaultMessage: 'Tertiary', + id: "Tertiary", + defaultMessage: "Tertiary", }, ThemeLink: { - id: 'Link', - defaultMessage: 'Link', + id: "Link", + defaultMessage: "Link", }, Inverted: { - id: 'Inverted', - defaultMessage: 'Inverted', + id: "Inverted", + defaultMessage: "Inverted", }, DefaultLabel: { - id: 'Click here', - defaultMessage: 'Click here', + id: "Click here", + defaultMessage: "Click here", }, Target: { - id: 'Target', - defaultMessage: 'Target', + id: "Target", + defaultMessage: "Target", }, TargetEmpty: { - id: 'Open in this window / frame', - defaultMessage: 'Open in this window / frame', + id: "Open in this window / frame", + defaultMessage: "Open in this window / frame", }, TargetBlank: { - id: 'Open in new window', - defaultMessage: 'Open in new window', + id: "Open in new window", + defaultMessage: "Open in new window", }, TargetParent: { - id: 'Open in parent window / frame', - defineMessages: 'Open in parent window / frame', + 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)', + 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', + block: "callToAction", fieldsets: [ { - id: 'default', - title: 'Default', - fields: ['text', 'href', 'target'], + id: "default", + title: "Default", + fields: ["text", "href", "target"], }, ], @@ -94,18 +94,18 @@ export const EditSchema = ({ intl }) => ({ }, href: { title: intl.formatMessage(messages.Link), - widget: 'object_browser', - mode: 'link', - selectedItemAttrs: ['Title', 'Description', 'hasPreviewImage'], + 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)], + ["_self", intl.formatMessage(messages.TargetEmpty)], + ["_blank", intl.formatMessage(messages.TargetBlank)], + ["_parent", intl.formatMessage(messages.TargetParent)], + ["_top", intl.formatMessage(messages.TargetTop)], ], }, }, @@ -117,48 +117,42 @@ export const StylingSchema = (props) => { const schema = addStyling(props); schema.properties.styles.schema = { title: intl.formatMessage(messages.Type), - block: 'callToAction', + block: "callToAction", fieldsets: [ { - id: 'default', - title: 'Default', - fields: ['align', 'theme', 'inverted', 'icon', 'rightIcon'], + id: "default", + title: "Default", + fields: ["align", "theme", "inverted", "icon", "rightIcon"], }, ], properties: { align: { title: intl.formatMessage(messages.Align), - widget: 'align', + widget: "align", }, theme: { title: intl.formatMessage(messages.Theme), - widget: 'color_picker', + widget: "theme_picker", colors: [ - { name: 'primary', label: intl.formatMessage(messages.ThemePrimary) }, - { - name: 'secondary', - label: intl.formatMessage(messages.ThemeSecondary), - }, - { - name: 'tertiary', - label: intl.formatMessage(messages.ThemeTertiary), - }, - { - name: 'link', - label: intl.formatMessage(messages.ThemeLink), - }, + ...(config.settings && config.settings.themeColors + ? config.settings.themeColors.map(({ value, title }) => ({ + name: value, + label: title, + })) + : []), + //and add extra ones here ], }, inverted: { title: intl.formatMessage(messages.Inverted), - type: 'boolean', + type: "boolean", }, icon: { title: intl.formatMessage(messages.Icon), }, rightIcon: { title: intl.formatMessage(messages.IconRight), - type: 'boolean', + type: "boolean", }, }, required: [], From 26664bc626c9e38626fdca516003a060b87191e0 Mon Sep 17 00:00:00 2001 From: Andrei Grigore <44702393+andreiggr@users.noreply.github.com> Date: Thu, 26 Jan 2023 16:47:07 +0200 Subject: [PATCH 3/6] config --- src/components/Schema.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Schema.js b/src/components/Schema.js index 7eeffff..8cf5619 100644 --- a/src/components/Schema.js +++ b/src/components/Schema.js @@ -1,5 +1,7 @@ import { defineMessages } from "react-intl"; import { addStyling } from "@plone/volto/helpers"; +import config from '@plone/volto/registry'; + const messages = defineMessages({ Type: { From f4e9488bd1a6a24526a8c1ae18d031ef7475ebcf Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 2 Feb 2023 22:39:14 +0200 Subject: [PATCH 4/6] lint fix --- package.json | 2 +- src/components/Schema.js | 115 +++++++++++++++++++-------------------- 2 files changed, 58 insertions(+), 59 deletions(-) diff --git a/package.json b/package.json index b80e008..bb8a359 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "git@github.com:eea/volto-call-to-action-block.git" }, "dependencies": { - "@eeacms/volto-widget-theme-picker": "1.0.0" + "@eeacms/volto-widget-theme-picker": "^1.0.1" }, "devDependencies": { "@cypress/code-coverage": "^3.10.0", diff --git a/src/components/Schema.js b/src/components/Schema.js index 8cf5619..46e8909 100644 --- a/src/components/Schema.js +++ b/src/components/Schema.js @@ -1,91 +1,90 @@ -import { defineMessages } from "react-intl"; -import { addStyling } from "@plone/volto/helpers"; +import { defineMessages } from 'react-intl'; +import { addStyling } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; - const messages = defineMessages({ Type: { - id: "Call to Action", - defaultMessage: "Call to Action", + id: 'Call to Action', + defaultMessage: 'Call to Action', }, Label: { - id: "Label", - defaultMessage: "Label", + id: 'Label', + defaultMessage: 'Label', }, Link: { - id: "Link", - defaultMessage: "Link", + id: 'Link', + defaultMessage: 'Link', }, Icon: { - id: "Icon", - defaultMessage: "Icon", + id: 'Icon', + defaultMessage: 'Icon', }, IconRight: { - id: "Icon on the right", - defaultMessage: "Icon on the right", + id: 'Icon on the right', + defaultMessage: 'Icon on the right', }, Align: { - id: "Alignment", - defaultMessage: "Alignment", + id: 'Alignment', + defaultMessage: 'Alignment', }, Theme: { - id: "Theme", - defaultMessage: "Theme", + id: 'Theme', + defaultMessage: 'Theme', }, ThemePrimary: { - id: "Primary", - defaultMessage: "Primary", + id: 'Primary', + defaultMessage: 'Primary', }, ThemeSecondary: { - id: "Secondary", - defaultMessage: "Secondary", + id: 'Secondary', + defaultMessage: 'Secondary', }, ThemeTertiary: { - id: "Tertiary", - defaultMessage: "Tertiary", + id: 'Tertiary', + defaultMessage: 'Tertiary', }, ThemeLink: { - id: "Link", - defaultMessage: "Link", + id: 'Link', + defaultMessage: 'Link', }, Inverted: { - id: "Inverted", - defaultMessage: "Inverted", + id: 'Inverted', + defaultMessage: 'Inverted', }, DefaultLabel: { - id: "Click here", - defaultMessage: "Click here", + id: 'Click here', + defaultMessage: 'Click here', }, Target: { - id: "Target", - defaultMessage: "Target", + id: 'Target', + defaultMessage: 'Target', }, TargetEmpty: { - id: "Open in this window / frame", - defaultMessage: "Open in this window / frame", + id: 'Open in this window / frame', + defaultMessage: 'Open in this window / frame', }, TargetBlank: { - id: "Open in new window", - defaultMessage: "Open in new window", + id: 'Open in new window', + defaultMessage: 'Open in new window', }, TargetParent: { - id: "Open in parent window / frame", - defineMessages: "Open in parent window / frame", + 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)", + 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", + block: 'callToAction', fieldsets: [ { - id: "default", - title: "Default", - fields: ["text", "href", "target"], + id: 'default', + title: 'Default', + fields: ['text', 'href', 'target'], }, ], @@ -96,18 +95,18 @@ export const EditSchema = ({ intl }) => ({ }, href: { title: intl.formatMessage(messages.Link), - widget: "object_browser", - mode: "link", - selectedItemAttrs: ["Title", "Description", "hasPreviewImage"], + 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)], + ['_self', intl.formatMessage(messages.TargetEmpty)], + ['_blank', intl.formatMessage(messages.TargetBlank)], + ['_parent', intl.formatMessage(messages.TargetParent)], + ['_top', intl.formatMessage(messages.TargetTop)], ], }, }, @@ -119,22 +118,22 @@ export const StylingSchema = (props) => { const schema = addStyling(props); schema.properties.styles.schema = { title: intl.formatMessage(messages.Type), - block: "callToAction", + block: 'callToAction', fieldsets: [ { - id: "default", - title: "Default", - fields: ["align", "theme", "inverted", "icon", "rightIcon"], + id: 'default', + title: 'Default', + fields: ['align', 'theme', 'inverted', 'icon', 'rightIcon'], }, ], properties: { align: { title: intl.formatMessage(messages.Align), - widget: "align", + widget: 'align', }, theme: { title: intl.formatMessage(messages.Theme), - widget: "theme_picker", + widget: 'theme_picker', colors: [ ...(config.settings && config.settings.themeColors ? config.settings.themeColors.map(({ value, title }) => ({ @@ -147,14 +146,14 @@ export const StylingSchema = (props) => { }, inverted: { title: intl.formatMessage(messages.Inverted), - type: "boolean", + type: 'boolean', }, icon: { title: intl.formatMessage(messages.Icon), }, rightIcon: { title: intl.formatMessage(messages.IconRight), - type: "boolean", + type: 'boolean', }, }, required: [], From 601512672ee37d9da39441a812bc8a8d59340b18 Mon Sep 17 00:00:00 2001 From: Alin Voinea Date: Tue, 7 Feb 2023 15:59:01 +0200 Subject: [PATCH 5/6] Release 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 035a890..840e5b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-call-to-action-block", - "version": "3.0.1", + "version": "4.0.0", "description": "@eeacms/volto-call-to-action-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From f5f09f1257c946a0f7b8dc6a9dba92e762e29d51 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:20:33 +0000 Subject: [PATCH 6/6] Automated release 4.0.0 --- CHANGELOG.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a38810..4eb9a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,26 +4,26 @@ 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). -### [3.0.1](https://github.com/eea/volto-call-to-action-block/compare/3.0.0...3.0.1) - 25 January 2023 +### [4.0.0](https://github.com/eea/volto-call-to-action-block/compare/3.0.1...4.0.0) - 7 February 2023 + +#### :nail_care: Enhancements + +- change(theme): color_picker widget for themes #8 from eea/color_pick_themes [ichim-david - [`4d1ed7e`](https://github.com/eea/volto-call-to-action-block/commit/4d1ed7eff65514211d49707dc91ce24915a16cc8)] #### :hammer_and_wrench: Others -- Fix flattenToAppURL [Alin Voinea - [`d80bbe7`](https://github.com/eea/volto-call-to-action-block/commit/d80bbe71711fca7ac61d468ce2516e1a2b8d09d8)] +- Release 4.0.0 [Alin Voinea - [`6015126`](https://github.com/eea/volto-call-to-action-block/commit/601512672ee37d9da39441a812bc8a8d59340b18)] +- lint fix [David Ichim - [`f4e9488`](https://github.com/eea/volto-call-to-action-block/commit/f4e9488bd1a6a24526a8c1ae18d031ef7475ebcf)] +- config [Andrei Grigore - [`26664bc`](https://github.com/eea/volto-call-to-action-block/commit/26664bc626c9e38626fdca516003a060b87191e0)] +- theme_picker widget [Andrei Grigore - [`6fb5182`](https://github.com/eea/volto-call-to-action-block/commit/6fb5182897e7f5c29182f051eac4c4b948ac09f4)] +- color_picker widget for themes [andreiggr - [`4a9a4be`](https://github.com/eea/volto-call-to-action-block/commit/4a9a4beb9b643dfe5f045dddbeeb5f19a1f15141)] +### [3.0.1](https://github.com/eea/volto-call-to-action-block/compare/3.0.0...3.0.1) - 25 January 2023 + ## [3.0.0](https://github.com/eea/volto-call-to-action-block/compare/2.0.0...3.0.0) - 25 January 2023 #### :hammer_and_wrench: Others -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`e46fb39`](https://github.com/eea/volto-call-to-action-block/commit/e46fb392ba15f9280e1a2d91b38e4acaa3105486)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`184e4d5`](https://github.com/eea/volto-call-to-action-block/commit/184e4d527764cbb754398b7c1975268c0eacdc86)] -- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`8ff40cc`](https://github.com/eea/volto-call-to-action-block/commit/8ff40cc8fb5087bd0f56fbc3e38a26f5d61d63fa)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`d1ba7b8`](https://github.com/eea/volto-call-to-action-block/commit/d1ba7b844f114305604e7f8c8b3158746dd59a7b)] -- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`4dea109`](https://github.com/eea/volto-call-to-action-block/commit/4dea10962560c760c2c44db27d3446a4268ded57)] -- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`fd6b7f3`](https://github.com/eea/volto-call-to-action-block/commit/fd6b7f31d28e05ed254a32bb213ad662e2635c96)] -- yarn 3 [Alin Voinea - [`8bfd09a`](https://github.com/eea/volto-call-to-action-block/commit/8bfd09a161d1d0b3174585c172a3804e56315dea)] -- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`440cd71`](https://github.com/eea/volto-call-to-action-block/commit/440cd71451fd5d5ef0316b5c74b61e66170444a7)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`e05f0dd`](https://github.com/eea/volto-call-to-action-block/commit/e05f0dd0cf782872b4105f3305c7f40ccb69cbb9)] -- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`6d44be8`](https://github.com/eea/volto-call-to-action-block/commit/6d44be88d8aabd57a8b74a3e16be7032dfda5eee)] -- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`4867cf3`](https://github.com/eea/volto-call-to-action-block/commit/4867cf362a91ea38bded8598d1937d33b35a12ab)] ## [2.0.0](https://github.com/eea/volto-call-to-action-block/compare/1.0.0...2.0.0) - 16 November 2022 #### :nail_care: Enhancements @@ -33,7 +33,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`39e8df4`](https://github.com/eea/volto-call-to-action-block/commit/39e8df468509414924327917154f035235ec5798)] -- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`0e06348`](https://github.com/eea/volto-call-to-action-block/commit/0e06348412feed9eeea6ae5d06ae59b8c21e4eff)] - 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 @@ -47,7 +46,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - test(cypress): Fix typo [Alin Voinea - [`f3cc342`](https://github.com/eea/volto-call-to-action-block/commit/f3cc3424ace81d26b296882b8484d6b6b12b0d28)] - Cleanup [Alin Voinea - [`2e63ef6`](https://github.com/eea/volto-call-to-action-block/commit/2e63ef665d3812d44b6a87bac6c7f657e40e2147)] - Update dependencies [Alin Voinea - [`cfb5062`](https://github.com/eea/volto-call-to-action-block/commit/cfb50627df9a9a15ebe67adc43dac97379c64efb)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`09c7c14`](https://github.com/eea/volto-call-to-action-block/commit/09c7c14265b0e63f054c3373530ba1dfbd39f4f7)] ### [0.2.4](https://github.com/eea/volto-call-to-action-block/compare/0.2.3...0.2.4) - 30 June 2022 ### [0.2.3](https://github.com/eea/volto-call-to-action-block/compare/0.2.2...0.2.3) - 30 June 2022 @@ -55,7 +53,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - Add tertiary theming option [Alin Voinea - [`c133291`](https://github.com/eea/volto-call-to-action-block/commit/c133291f17c7a8800271bafe96c008dae3b4ee79)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`720a9a6`](https://github.com/eea/volto-call-to-action-block/commit/720a9a62f1505906b5e6e0667272e07598a67972)] ### [0.2.2](https://github.com/eea/volto-call-to-action-block/compare/0.2.1...0.2.2) - 2 June 2022 ### [0.2.1](https://github.com/eea/volto-call-to-action-block/compare/0.2.0...0.2.1) - 2 June 2022 @@ -78,5 +75,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- yarn bootstrap [Alin Voinea - [`12f3e83`](https://github.com/eea/volto-call-to-action-block/commit/12f3e834d6d3e257cb9e7b6dde80dab783613a01)] - Initial commit [Alin Voinea - [`00f39c8`](https://github.com/eea/volto-call-to-action-block/commit/00f39c8a36327a821cc613a772bf228451a71e67)]