Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Feature/blockquote update #127

Merged
merged 10 commits into from
Feb 13, 2019
Merged

Feature/blockquote update #127

merged 10 commits into from
Feb 13, 2019

Conversation

con322
Copy link
Contributor

@con322 con322 commented Jan 25, 2019

Proposed Changes

  • Ability to add background colour and/or image on blockquote component

@con322 con322 requested review from jaymcp and ampersarnie January 25, 2019 16:23
@con322 con322 changed the base branch from master to develop January 25, 2019 17:08
Copy link
Member

@jaymcp jaymcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you've updated the save() method, existing blockquotes will break if the old save method isn't moved to a deprecated property. This takes the form:

deprecated: [{
  attributes: {
    // old attributes
  },
  save({ attributes }) {
    // old save method
  },
}],

Since you've only appended to the original attributes without changing any existing ones, it may be worth defining the original attributes as an object outside of the block registration. That way, you can use it straight in the deprecation, and use lodash's assign to compose the new attributes onto this for the updated block registration definition.

@jaymcp jaymcp added this to the v1.1.0 milestone Jan 29, 2019
jaymcp
jaymcp previously requested changes Feb 4, 2019
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
@con322 con322 dismissed jaymcp’s stale review February 4, 2019 16:14

changes have been made

@con322 con322 requested a review from jaymcp February 4, 2019 16:14
jaymcp
jaymcp previously requested changes Feb 5, 2019
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
src/scripts/blocks/blockquote/index.js Outdated Show resolved Hide resolved
@@ -29,29 +55,26 @@ registerBlockType('benenson/quote', {
supports: {
className: false,
},
attributes: {
align: {
attributes: assign({}, oldAttributes, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in my original review—apologies—but it looks like the attribute citation has been replaced with subText. Whilst I understand the reasoning behind why this has been done, because you're not removing it from the attribute list, it's still being declared as a valid attribute.
So, I'd recommend using Lodash's omit method to remove the citation attribute from the new block attribute definitions, in addition to what you have here.
Syntax is: omit(object, 'path') or omit(object, ['path1', 'path2']), or see the docs, if you're unfamiliar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subText is a new attribute, citation still exists within new and old save method at least if am reading the code correctly.

Let me know if am wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you're right, sorry. I misread the changes because I only looked at them in GitHub and not in the source itself.

@con322 con322 dismissed jaymcp’s stale review February 11, 2019 16:32

code changes

@con322 con322 requested a review from jaymcp February 11, 2019 16:32
Copy link
Member

@jaymcp jaymcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jaymcp jaymcp merged commit 75beaec into develop Feb 13, 2019
@jaymcp jaymcp deleted the feature/blockquote-update branch February 13, 2019 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants