Skip to content

Commit

Permalink
chore(SLB-297 SLB-296): update the quote text from text to quote
Browse files Browse the repository at this point in the history
  • Loading branch information
chindris committed Apr 16, 2024
1 parent d0e0b95 commit d8d41f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
],
Expand Down
10 changes: 5 additions & 5 deletions packages/drupal/gutenberg_blocks/src/blocks/quote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ registerBlockType(`custom/quote`, {
icon: 'format-quote',
category: 'text',
attributes: {
text: {
quote: {
type: 'string',
},
author: {
Expand All @@ -37,16 +37,16 @@ registerBlockType(`custom/quote`, {
return (
<blockquote>
<RichText
identifier="text"
value={props.attributes.text}
identifier="quote"
value={props.attributes.quote}
allowedFormats={['core/bold']}
// @ts-ignore
disableLineBreaks={false}
placeholder={__('Quote')}
keepPlaceholderOnFocus={false}
onChange={(text) => {
onChange={(quote) => {
props.setAttributes({
text: cleanUpText(text, ['strong']),
quote: cleanUpText(quote, ['strong']),
});
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/fragments/PageContent/BlockQuote.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fragment BlockQuote on BlockQuote {
text
quote
author
role
image {
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8d41f3

Please sign in to comment.