From d8d41f3a55859b7f08f58ab3f9c1bf5ea9b5d96f Mon Sep 17 00:00:00 2001 From: Vasile Chindris Date: Tue, 16 Apr 2024 20:26:22 +0300 Subject: [PATCH] chore(SLB-297 SLB-296): update the quote text from text to quote --- .../Validation/GutenbergValidator/QuoteValidator.php | 2 +- packages/drupal/gutenberg_blocks/src/blocks/quote.tsx | 10 +++++----- .../schema/src/fragments/PageContent/BlockQuote.gql | 2 +- packages/schema/src/schema.graphql | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/QuoteValidator.php b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/QuoteValidator.php index 1f9f9d9c9..53df53041 100644 --- a/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/QuoteValidator.php +++ b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/QuoteValidator.php @@ -26,7 +26,7 @@ public function applies(array $block): bool { */ public function validatedFields($block = []): array { return [ - 'text' => [ + 'quote' => [ 'field_label' => $this->t('Quote text'), 'rules' => ['required'], ], diff --git a/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx b/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx index f42c3f82d..1aea31b6a 100644 --- a/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx +++ b/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx @@ -19,7 +19,7 @@ registerBlockType(`custom/quote`, { icon: 'format-quote', category: 'text', attributes: { - text: { + quote: { type: 'string', }, author: { @@ -37,16 +37,16 @@ registerBlockType(`custom/quote`, { return (
{ + onChange={(quote) => { props.setAttributes({ - text: cleanUpText(text, ['strong']), + quote: cleanUpText(quote, ['strong']), }); }} /> diff --git a/packages/schema/src/fragments/PageContent/BlockQuote.gql b/packages/schema/src/fragments/PageContent/BlockQuote.gql index b50478e0a..785efb620 100644 --- a/packages/schema/src/fragments/PageContent/BlockQuote.gql +++ b/packages/schema/src/fragments/PageContent/BlockQuote.gql @@ -1,5 +1,5 @@ fragment BlockQuote on BlockQuote { - text + quote author role image { diff --git a/packages/schema/src/schema.graphql b/packages/schema/src/schema.graphql index e379509fb..43bff39d9 100644 --- a/packages/schema/src/schema.graphql +++ b/packages/schema/src/schema.graphql @@ -246,7 +246,7 @@ type BlockCta @type(id: "custom/cta") { } type BlockQuote @type(id: "custom/quote") { - text: Markup @resolveEditorBlockAttribute(key: "text") + quote: Markup @resolveEditorBlockAttribute(key: "quote") author: String @resolveEditorBlockAttribute(key: "author") role: String @resolveEditorBlockAttribute(key: "role") image: MediaImage @resolveEditorBlockMedia