Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Tabel block to use block.json metadata #14863

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Apr 8, 2019

Description

Partially implements #13693:

  • Refactors Table block to define name, category and attributes in block.json
  • Moves all fields defined on the client like transforms or save to their own files

How has this been tested?

Ensure that File block still works as before.

@gziolo gziolo added [Type] Task Issues or PRs that have been broken down into an individual action to take [Block] Table Affects the Table Block [Feature] Block Directory Related to the Block Directory, a repository of block plugins labels Apr 8, 2019
@gziolo gziolo self-assigned this Apr 8, 2019
},
};

function getTableSectionAttributeSchema( section ) {
Copy link
Member Author

Choose a reason for hiding this comment

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

JSON format doesn't allow using functions so it had to be duplicated 3 times.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I did not notice any regression during my tests. It is unfortunate that we need to have some duplication because of having nor variables we can reuse in a JSON file but I guess there is not much we can do about it without adding complexity to the block.json solution.

@gziolo gziolo merged commit 838ab79 into master Apr 9, 2019
@gziolo gziolo deleted the update/table-block-json branch April 9, 2019 04:25
@gziolo gziolo added this to the 5.5 (Gutenberg) milestone Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Feature] Block Directory Related to the Block Directory, a repository of block plugins [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants