From 3ce82ee021f5e2f1653c6033198e6cb1b44cb157 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 14:57:06 +0100 Subject: [PATCH 01/11] implement inline text editor & typographicaly correct quotation marks --- src/components/View.jsx | 46 ++++++++++++++++++++++++++++++++++------ src/components/schema.js | 36 +++++++++++++++++++++++++------ src/index.js | 2 ++ src/theme/main.less | 29 +++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 13 deletions(-) diff --git a/src/components/View.jsx b/src/components/View.jsx index 37ab060..c483a92 100644 --- a/src/components/View.jsx +++ b/src/components/View.jsx @@ -2,29 +2,61 @@ import React from 'react'; import config from '@plone/volto/registry'; import { flattenToAppURL } from '@plone/volto/helpers'; import cx from 'classnames'; +import { DetachedTextBlockEditor } from '@plone/volto-slate/blocks/Text/DetachedTextBlockEditor'; const View = (props) => { - const { data } = props; + const { data, isEditMode } = props; + + const customSlateSettings = { + ...props, + slateSettings: { + ...config.settings.slate, + toolbarButtons: config.settings.slate.toolbarButtons.filter( + (index) => index - config.settings.slate.toolbarButtons, + ), + }, + }; + + const langMap = { + EN: { + startChar: '"', + endChar: '"', + }, + DE: { + startChar: '„', + endChar: '“', + }, + }; return (
- {config?.blocks?.blocksConfig?.quote.showImageField && - data?.image?.[0] && ( + {config.blocks?.blocksConfig?.quote?.showImageField && + data.image?.[0] && (
{data.image[0].title}
)}
-
{data.quote}
+ {!isEditMode ? ( +
+ {langMap[data.language].startChar} + {data.plaintext} + {langMap[data.language].endChar} +
+ ) : ( +
+ +
+ )}
{data.name} {data.additionalData && `, ${data.additionalData}`} diff --git a/src/components/schema.js b/src/components/schema.js index 5870945..4d59b01 100644 --- a/src/components/schema.js +++ b/src/components/schema.js @@ -2,6 +2,10 @@ import config from '@plone/volto/registry'; import { defineMessages } from 'react-intl'; const messages = defineMessages({ + language: { + id: 'Language', + defaultMessage: 'Language', + }, quote: { id: 'Quote', defaultMessage: 'Quote', @@ -25,6 +29,24 @@ const messages = defineMessages({ }); export const QuoteBlockSchema = ({ intl }) => { + const defaultLang = config.blocks?.blocksConfig?.quote?.defaultLang; + const allowed_languages = + config.blocks?.blocksConfig?.quote?.allowed_languages; + const DEFAULT_LANGUAGES = [ + ['EN', 'EN'], + ['DE', 'DE'], + ]; + + const filterDefaultLanguages = () => { + if (allowed_languages) { + return DEFAULT_LANGUAGES.filter((item) => + allowed_languages.includes(item[0]), + ); + } else { + return DEFAULT_LANGUAGES; + } + }; + return { title: intl.formatMessage(messages.quote), block: 'quote', @@ -32,9 +54,9 @@ export const QuoteBlockSchema = ({ intl }) => { { id: 'default', title: 'Default', - fields: config?.blocks?.blocksConfig?.quote.showImageField - ? ['quote', 'image', 'alignment'] - : ['quote'], + fields: config?.blocks?.blocksConfig?.quote?.showImageField + ? ['language', 'image', 'alignment'] + : ['language'], }, { id: 'person', @@ -43,9 +65,11 @@ export const QuoteBlockSchema = ({ intl }) => { }, ], properties: { - quote: { - title: intl.formatMessage(messages.quote), - widget: 'textarea', + language: { + title: intl.formatMessage(messages.language), + choices: filterDefaultLanguages(), + default: defaultLang, + noValueOption: false, }, image: { title: intl.formatMessage(messages.image), diff --git a/src/index.js b/src/index.js index 7097c5c..d846076 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,8 @@ const applyConfig = (config) => { // If an image is added and later on the image field get's disabled by setting 'showImageField' to 'false', // the image and alignment fields aswell as the image won't show any longer. showImageField: true, + defaultLang: 'EN', + allowedLanguages: ['EN', 'DE'], }; return config; diff --git a/src/theme/main.less b/src/theme/main.less index e69de29..6ce9f81 100644 --- a/src/theme/main.less +++ b/src/theme/main.less @@ -0,0 +1,29 @@ +.block-editor-quote :focus-visible { + outline: none; +} + +.block.quote blockquote { + &.DE .slate-editor p { + &::before { + content: '„'; + } + } + + &.DE .slate-editor p { + &::after { + content: '“'; + } + } + + &.EN .slate-editor p { + &::before { + content: '"'; + } + } + + &.EN .slate-editor p { + &::after { + content: '"'; + } + } +} From fce1418a6e486ac4d4c7e4f3c60201d19df8db94 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 14:57:23 +0100 Subject: [PATCH 02/11] update locales --- locales/de/LC_MESSAGES/volto.po | 5 +++++ locales/en/LC_MESSAGES/volto.po | 5 +++++ locales/volto.pot | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 96adf76..8c0b719 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "Ausrichtung" msgid "Image" msgstr "Bild" +#: components/schema +# defaultMessage: Language +msgid "Language" +msgstr "Sprache" + #: components/schema # defaultMessage: Name msgid "Name" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index edb4f49..674ce2d 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -26,6 +26,11 @@ msgstr "" msgid "Image" msgstr "" +#: components/schema +# defaultMessage: Language +msgid "Language" +msgstr "" + #: components/schema # defaultMessage: Name msgid "Name" diff --git a/locales/volto.pot b/locales/volto.pot index 39eaa0b..0bdcb69 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-01-08T10:14:30.347Z\n" +"POT-Creation-Date: 2024-01-26T12:40:48.423Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -28,6 +28,11 @@ msgstr "" msgid "Image" msgstr "" +#: components/schema +# defaultMessage: Language +msgid "Language" +msgstr "" + #: components/schema # defaultMessage: Name msgid "Name" From c741d6b417db614b8c0b50706e087064681a6d96 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 14:57:43 +0100 Subject: [PATCH 03/11] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 94ec588..4962778 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,24 @@ This option will enable an image and an alignment widget in the block settings, config.blocks.blocksConfig.quote.showImageField = true; ``` +#### `defaultLang` + +This option will set the default language in which the quotation marks should be shown. By default this option is set to `EN`. + +```js +config.blocks.blocksConfig.quote.defaultLang = 'EN'; +``` + +#### `allowedLanguages` + +This option will set the languages that are available to show the . By default this option is set to `['EN', 'DE']`. + +```js +config.blocks.blocksConfig.quote.allowedLanguages = ['EN', 'DE']; +``` + +Currently available languages: EN, DE + ## Credits Deutsches Zentrum für Luft- und Raumfahrt (DLR) From fa0cc325ea67deafc21fc58efdb7d889d6f0e8ff Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 14:57:54 +0100 Subject: [PATCH 04/11] news --- news/4.enhancement | 1 + news/5.enhancement | 1 + 2 files changed, 2 insertions(+) create mode 100644 news/4.enhancement create mode 100644 news/5.enhancement diff --git a/news/4.enhancement b/news/4.enhancement new file mode 100644 index 0000000..555aae9 --- /dev/null +++ b/news/4.enhancement @@ -0,0 +1 @@ +- implement inline text editor [@jonaspiterek] \ No newline at end of file diff --git a/news/5.enhancement b/news/5.enhancement new file mode 100644 index 0000000..7133043 --- /dev/null +++ b/news/5.enhancement @@ -0,0 +1 @@ +- implement language selector to display typographical correct quotation marks for different languages [@jonaspiterek] \ No newline at end of file From debaf8aff56c5697f407ddfaa28c389a530b1acd Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 15:56:52 +0100 Subject: [PATCH 05/11] fix test --- acceptance/cypress/tests/basic.cy.js | 90 ++++++++++++++-------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/acceptance/cypress/tests/basic.cy.js b/acceptance/cypress/tests/basic.cy.js index 1d381c7..0f127d9 100644 --- a/acceptance/cypress/tests/basic.cy.js +++ b/acceptance/cypress/tests/basic.cy.js @@ -1,76 +1,78 @@ -context("Basic Acceptance Tests", () => { - describe("Quote Block Tests", () => { +context('Basic Acceptance Tests', () => { + describe('Quote Block Tests', () => { beforeEach(() => { - cy.intercept("GET", `/**/*?expand*`).as("content"); - cy.intercept("GET", "/**/Document").as("schema"); + cy.intercept('GET', `/**/*?expand*`).as('content'); + cy.intercept('GET', '/**/Document').as('schema'); // given a logged in editor and a page in edit mode cy.autologin(); cy.createContent({ - contentType: "Image", - contentId: "my-image", - contentTitle: "My Image", + contentType: 'Image', + contentId: 'my-image', + contentTitle: 'My Image', }); - cy.visit("/"); - cy.wait("@content"); + cy.visit('/'); + cy.wait('@content'); }); - it("As editor I can add a page with a quote block", function () { + it('As editor I can add a page with a quote block', function () { // when I add a page with a quote block - cy.get("#toolbar-add").click(); - cy.get("#toolbar-add-document").click(); - cy.get(".documentFirstHeading") - .type("My Page") - .get(".documentFirstHeading") - .contains("My Page"); + cy.get('#toolbar-add').click(); + cy.get('#toolbar-add-document').click(); + cy.get('.documentFirstHeading') + .type('My Page') + .get('.documentFirstHeading') + .contains('My Page'); cy.get('[aria-multiline="false"] > p').click(); - cy.get(".text-slate-editor-inner > .ui > .icon").click(); + cy.get('.text-slate-editor-inner > .ui > .icon').click(); cy.get('[aria-label="Unfold Text blocks"]').click(); cy.get( '[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' ).click(); - cy.get("#field-quote").click(); - cy.get("#field-quote").type( - "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." - ); - cy.get("#field-name").click(); - cy.get("#field-name").type("Quotator"); - cy.get("#field-additionalData").click(); - cy.get("#field-additionalData").type("Position and/or Date"); + cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') + .click() + .type( + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' + ); + cy.get('#field-name').click(); + cy.get('#field-name').type('Quotator'); + cy.get('#field-additionalData').click(); + cy.get('#field-additionalData').type('Position and/or Date'); - cy.get("#toolbar-save").click(); + cy.get('#toolbar-save').click(); }); - it("As editor I can add an image to a quote block", function () { + it('As editor I can add an image to a quote block', function () { // when I add a page with a quote block with an image - cy.get("#toolbar-add").click(); - cy.get("#toolbar-add-document").click(); - cy.get(".documentFirstHeading") - .type("My Page") - .get(".documentFirstHeading") - .contains("My Page"); + cy.get('#toolbar-add').click(); + cy.get('#toolbar-add-document').click(); + cy.get('.documentFirstHeading') + .type('My Page') + .get('.documentFirstHeading') + .contains('My Page'); cy.get('[aria-multiline="false"] > p').click(); - cy.get(".text-slate-editor-inner > .ui > .icon").click(); + cy.get('.text-slate-editor-inner > .ui > .icon').click(); cy.get('[aria-label="Unfold Text blocks"]').click(); cy.get( '[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' ).click(); - cy.get("#field-quote").click(); - cy.get("#field-quote").type( - "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." - ); - cy.get("#field-name").click(); - cy.get("#field-name").type("Quotator"); - cy.get("#field-additionalData").click(); - cy.get("#field-additionalData").type("Position and/or Date"); + cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') + .click() + .type( + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' + ); + cy.get('#field-name').click(); + cy.get('#field-name').type('Quotator'); + cy.get('#field-additionalData').click(); + cy.get('#field-additionalData').type('Position and/or Date'); cy.get( - "#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon" + '#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon' ).click(); cy.get('[title="/my-image (Image)"]').dblclick(); - cy.get("#toolbar-save").click(); + cy.get('#toolbar-save').click(); }); }); }); From 6ebaa8d6afcd4c48670e99adb61b4338bbd61683 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Fri, 26 Jan 2024 15:59:39 +0100 Subject: [PATCH 06/11] fix news --- news/{4.enhancement => 4.feature} | 0 news/{5.enhancement => 5.feature} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename news/{4.enhancement => 4.feature} (100%) rename news/{5.enhancement => 5.feature} (100%) diff --git a/news/4.enhancement b/news/4.feature similarity index 100% rename from news/4.enhancement rename to news/4.feature diff --git a/news/5.enhancement b/news/5.feature similarity index 100% rename from news/5.enhancement rename to news/5.feature From 6ff0ccd2f087a6039fb1e3c43ca84777e6279d21 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Tue, 30 Jan 2024 11:12:29 +0100 Subject: [PATCH 07/11] refactor blockquote structure, add quotation mark switcher (language specific) & remove image alignment options --- src/components/View.jsx | 45 +++++++++++++++++----------------------- src/components/schema.js | 42 ++++++++++++++++++++----------------- src/theme/main.less | 24 ++++++++++----------- 3 files changed, 53 insertions(+), 58 deletions(-) diff --git a/src/components/View.jsx b/src/components/View.jsx index c483a92..934f2a3 100644 --- a/src/components/View.jsx +++ b/src/components/View.jsx @@ -3,6 +3,7 @@ import config from '@plone/volto/registry'; import { flattenToAppURL } from '@plone/volto/helpers'; import cx from 'classnames'; import { DetachedTextBlockEditor } from '@plone/volto-slate/blocks/Text/DetachedTextBlockEditor'; +import { TextBlockView } from '@plone/volto-slate/blocks/Text'; const View = (props) => { const { data, isEditMode } = props; @@ -17,23 +18,12 @@ const View = (props) => { }, }; - const langMap = { - EN: { - startChar: '"', - endChar: '"', - }, - DE: { - startChar: '„', - endChar: '“', - }, - }; - return (
{config.blocks?.blocksConfig?.quote?.showImageField && data.image?.[0] && ( -
+
{ />
)} -
+
{!isEditMode ? ( -
- {langMap[data.language].startChar} - {data.plaintext} - {langMap[data.language].endChar} -
+ ) : ( -
- -
+ )} -
- {data.name} - {data.additionalData && `, ${data.additionalData}`} -
-
+
+ {data.name} + {data.additional_information && data.cite ? ( + {`, ${data.additional_information}`} + ) : ( + data.additional_information && ( + {`, ${data.additional_information}`} + ) + )} +
+
); diff --git a/src/components/schema.js b/src/components/schema.js index 4d59b01..eab23b1 100644 --- a/src/components/schema.js +++ b/src/components/schema.js @@ -2,14 +2,14 @@ import config from '@plone/volto/registry'; import { defineMessages } from 'react-intl'; const messages = defineMessages({ - language: { - id: 'Language', - defaultMessage: 'Language', - }, quote: { id: 'Quote', defaultMessage: 'Quote', }, + language: { + id: 'Language', + defaultMessage: 'Language', + }, image: { id: 'Image', defaultMessage: 'Image', @@ -18,13 +18,18 @@ const messages = defineMessages({ id: 'Name', defaultMessage: 'Name', }, - additionalData: { - id: 'Additional data', - defaultMessage: 'Additional data', + additional_information: { + id: 'Additional information', + defaultMessage: 'Additional information', + }, + cite: { + id: 'Cite', + defaultMessage: 'Cite', }, - alignment: { - id: 'Alignment', - defineMessage: 'Alignment', + description: { + id: 'This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms.', + defaultMessage: + 'This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms.', }, }); @@ -55,13 +60,13 @@ export const QuoteBlockSchema = ({ intl }) => { id: 'default', title: 'Default', fields: config?.blocks?.blocksConfig?.quote?.showImageField - ? ['language', 'image', 'alignment'] + ? ['language', 'image'] : ['language'], }, { id: 'person', title: 'Person', - fields: ['name', 'additionalData'], + fields: ['name', 'additional_information', 'cite'], }, ], properties: { @@ -81,14 +86,13 @@ export const QuoteBlockSchema = ({ intl }) => { name: { title: intl.formatMessage(messages.name), }, - additionalData: { - title: intl.formatMessage(messages.additionalData), + additional_information: { + title: intl.formatMessage(messages.additional_information), }, - alignment: { - title: intl.formatMessage(messages.alignment), - widget: 'align', - actions: ['left', 'center', 'right'], - default: 'center', + cite: { + title: intl.formatMessage(messages.cite), + widget: 'url', + description: intl.formatMessage(messages.description), }, }, required: [], diff --git a/src/theme/main.less b/src/theme/main.less index 6ce9f81..7321c55 100644 --- a/src/theme/main.less +++ b/src/theme/main.less @@ -2,28 +2,26 @@ outline: none; } -.block.quote blockquote { - &.DE .slate-editor p { +.block-editor-quote blockquote div { + margin: 0em 0em 1em; +} + +.block.quote blockquote:not(.edit) { + &.EN p { &::before { - content: '„'; + content: '"'; } - } - - &.DE .slate-editor p { &::after { - content: '“'; + content: '"'; } } - &.EN .slate-editor p { + &.DE p { &::before { - content: '"'; + content: '„'; } - } - - &.EN .slate-editor p { &::after { - content: '"'; + content: '“'; } } } From f4ec6400ac36f5a1e8bbdd94d8bfb0e28e12109b Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Tue, 30 Jan 2024 11:12:45 +0100 Subject: [PATCH 08/11] update locales --- locales/de/LC_MESSAGES/volto.po | 15 ++++++++++----- locales/en/LC_MESSAGES/volto.po | 13 +++++++++---- locales/volto.pot | 15 ++++++++++----- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 8c0b719..f35464e 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -12,14 +12,14 @@ msgstr "" "Plural-Forms: \n" #: components/schema -# defaultMessage: Additional data -msgid "Additional data" +# defaultMessage: Additional information +msgid "Additional information" msgstr "Zusatzinformationen" #: components/schema -# defaultMessage: undefined -msgid "Alignment" -msgstr "Ausrichtung" +# defaultMessage: Cite +msgid "Cite" +msgstr "Zitiert" #: components/schema # defaultMessage: Image @@ -40,3 +40,8 @@ msgstr "Name" # defaultMessage: Quote msgid "Quote" msgstr "Zitat" + +#: components/schema +# defaultMessage: This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms. +msgid "This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms." +msgstr "Dieses Feld erwartet eine URL als Eingabe (optional). Wenn eine URL angegeben wird, beziehen sich die Zusatzinformationen auf diese URL, um Barrierefreiheit zu gewährleisten." diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 674ce2d..4c01fd8 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -12,13 +12,13 @@ msgstr "" "Plural-Forms: \n" #: components/schema -# defaultMessage: Additional data -msgid "Additional data" +# defaultMessage: Additional information +msgid "Additional information" msgstr "" #: components/schema -# defaultMessage: undefined -msgid "Alignment" +# defaultMessage: Cite +msgid "Cite" msgstr "" #: components/schema @@ -40,3 +40,8 @@ msgstr "" # defaultMessage: Quote msgid "Quote" msgstr "" + +#: components/schema +# defaultMessage: This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms. +msgid "This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms." +msgstr "" diff --git a/locales/volto.pot b/locales/volto.pot index 0bdcb69..3e3cc6b 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-01-26T12:40:48.423Z\n" +"POT-Creation-Date: 2024-01-30T09:51:05.697Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -14,13 +14,13 @@ msgstr "" "Domain: volto\n" #: components/schema -# defaultMessage: Additional data -msgid "Additional data" +# defaultMessage: Additional information +msgid "Additional information" msgstr "" #: components/schema -# defaultMessage: undefined -msgid "Alignment" +# defaultMessage: Cite +msgid "Cite" msgstr "" #: components/schema @@ -42,3 +42,8 @@ msgstr "" # defaultMessage: Quote msgid "Quote" msgstr "" + +#: components/schema +# defaultMessage: This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms. +msgid "This field expects an URL as input (optional). If an URL is provided the additional information will have a relation to this URL, this is due to accessibility norms." +msgstr "" From 774573c34853d3bd52faecb43589cce0783b9a36 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Tue, 30 Jan 2024 11:13:04 +0100 Subject: [PATCH 09/11] fix basic test --- acceptance/cypress/tests/basic.cy.js | 80 ++++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/acceptance/cypress/tests/basic.cy.js b/acceptance/cypress/tests/basic.cy.js index 0f127d9..b8515af 100644 --- a/acceptance/cypress/tests/basic.cy.js +++ b/acceptance/cypress/tests/basic.cy.js @@ -1,78 +1,78 @@ -context('Basic Acceptance Tests', () => { - describe('Quote Block Tests', () => { +context("Basic Acceptance Tests", () => { + describe("Quote Block Tests", () => { beforeEach(() => { - cy.intercept('GET', `/**/*?expand*`).as('content'); - cy.intercept('GET', '/**/Document').as('schema'); + cy.intercept("GET", `/**/*?expand*`).as("content"); + cy.intercept("GET", "/**/Document").as("schema"); // given a logged in editor and a page in edit mode cy.autologin(); cy.createContent({ - contentType: 'Image', - contentId: 'my-image', - contentTitle: 'My Image', + contentType: "Image", + contentId: "my-image", + contentTitle: "My Image", }); - cy.visit('/'); - cy.wait('@content'); + cy.visit("/"); + cy.wait("@content"); }); - it('As editor I can add a page with a quote block', function () { + it("As editor I can add a page with a quote block", function () { // when I add a page with a quote block - cy.get('#toolbar-add').click(); - cy.get('#toolbar-add-document').click(); - cy.get('.documentFirstHeading') - .type('My Page') - .get('.documentFirstHeading') - .contains('My Page'); + cy.get("#toolbar-add").click(); + cy.get("#toolbar-add-document").click(); + cy.get(".documentFirstHeading") + .type("My Page") + .get(".documentFirstHeading") + .contains("My Page"); cy.get('[aria-multiline="false"] > p').click(); - cy.get('.text-slate-editor-inner > .ui > .icon').click(); + cy.get(".text-slate-editor-inner > .ui > .icon").click(); cy.get('[aria-label="Unfold Text blocks"]').click(); cy.get( '[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' ).click(); - cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') + cy.get(".block-editor-quote .text-slate-editor-inner .slate-editor p") .click() .type( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." ); - cy.get('#field-name').click(); - cy.get('#field-name').type('Quotator'); - cy.get('#field-additionalData').click(); - cy.get('#field-additionalData').type('Position and/or Date'); + cy.get("#field-name").click(); + cy.get("#field-name").type("Quotator"); + cy.get("#field-additional_information").click(); + cy.get("#field-additional_information").type("Position and/or Date"); - cy.get('#toolbar-save').click(); + cy.get("#toolbar-save").click(); }); - it('As editor I can add an image to a quote block', function () { + it("As editor I can add an image to a quote block", function () { // when I add a page with a quote block with an image - cy.get('#toolbar-add').click(); - cy.get('#toolbar-add-document').click(); - cy.get('.documentFirstHeading') - .type('My Page') - .get('.documentFirstHeading') - .contains('My Page'); + cy.get("#toolbar-add").click(); + cy.get("#toolbar-add-document").click(); + cy.get(".documentFirstHeading") + .type("My Page") + .get(".documentFirstHeading") + .contains("My Page"); cy.get('[aria-multiline="false"] > p').click(); - cy.get('.text-slate-editor-inner > .ui > .icon').click(); + cy.get(".text-slate-editor-inner > .ui > .icon").click(); cy.get('[aria-label="Unfold Text blocks"]').click(); cy.get( '[style="transition: opacity 500ms ease 0ms;"] > :nth-child(3) > .ui' ).click(); - cy.get('.block-editor-quote .text-slate-editor-inner .slate-editor p') + cy.get(".block-editor-quote .text-slate-editor-inner .slate-editor p") .click() .type( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.' + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." ); - cy.get('#field-name').click(); - cy.get('#field-name').type('Quotator'); - cy.get('#field-additionalData').click(); - cy.get('#field-additionalData').type('Position and/or Date'); + cy.get("#field-name").click(); + cy.get("#field-name").type("Quotator"); + cy.get("#field-additional_information").click(); + cy.get("#field-additional_information").type("Position and/or Date"); cy.get( - '#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon' + "#blockform-fieldset-default > .segment > .text > .grid > .stretched > .eight > .objectbrowser-field > .ui > .icon" ).click(); cy.get('[title="/my-image (Image)"]').dblclick(); - cy.get('#toolbar-save').click(); + cy.get("#toolbar-save").click(); }); }); }); From 94218f7b867604e8d775ca661456bbf4500eb1a9 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Tue, 30 Jan 2024 11:41:40 +0100 Subject: [PATCH 10/11] make format --- src/theme/main.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/theme/main.less b/src/theme/main.less index 7321c55..4daaacf 100644 --- a/src/theme/main.less +++ b/src/theme/main.less @@ -11,6 +11,7 @@ &::before { content: '"'; } + &::after { content: '"'; } @@ -20,6 +21,7 @@ &::before { content: '„'; } + &::after { content: '“'; } From 2668df1d9d48add8a9509ec02b52903e92067790 Mon Sep 17 00:00:00 2001 From: jonaspiterek Date: Tue, 30 Jan 2024 14:00:49 +0100 Subject: [PATCH 11/11] footer change --- src/components/View.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/View.jsx b/src/components/View.jsx index 934f2a3..203cedf 100644 --- a/src/components/View.jsx +++ b/src/components/View.jsx @@ -45,12 +45,12 @@ const View = (props) => { )}