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

Update edit-save documentation #13578

Merged
merged 12 commits into from
Feb 4, 2019
Merged

Update edit-save documentation #13578

merged 12 commits into from
Feb 4, 2019

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Jan 29, 2019

Description

  • Add ES5 code samples for edit() documentation
  • Add links to additional information around attributes
  • Update save documentation with additional examples

View branch documentation.

Fixes #4070

How has this been tested?

Confirm example code works as explained.

Types of changes

Documentation.

@mkaz mkaz added [Type] Developer Documentation Documentation for developers [Status] In Progress Tracking issues with work in progress labels Jan 29, 2019
@mkaz mkaz self-assigned this Jan 29, 2019
@mkaz mkaz removed the [Status] In Progress Tracking issues with work in progress label Jan 29, 2019
@gziolo gziolo added this to the Documentation & Handbook milestone Jan 31, 2019
Copy link
Contributor

@chrisvanpatten chrisvanpatten left a comment

Choose a reason for hiding this comment

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

Might be worthwhile to get more eyes on this, but overall it seemed good to me!

edit( { attributes, className } ) {
return <div className={ className }>{ attributes.content }</div>;
}
```
{% end %}

### isSelected

The isSelected property is an object that communicates whether the block is currently selected.
Copy link
Member

Choose a reason for hiding this comment

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

I thought isSelected was a boolean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't a boolean an object too :-)

Copy link
Member

Choose a reason for hiding this comment

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

It's 0s and 1s as well! The more specific, the better.

@oandregal
Copy link
Member

Leaving a general comment here instead of commenting line by line. I saw some inconsistencies in how we declare edit and save through this text. How about using:

ES5:

edit: function( props ) {
...
},

ESNext:

edit: ( props ) => {
...
},

@chrisvanpatten chrisvanpatten dismissed their stale review February 1, 2019 14:41

Changes were addressed

@chrisvanpatten
Copy link
Contributor

(Dismissed my own review; if someone else approves I don't want my stale review to block a merge!)

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

Left a couple of comments that I'd like us to address. Other than that this is good to go.

This improves things a lot! 🌟

@mkaz mkaz merged commit 609a42c into master Feb 4, 2019
@mkaz mkaz deleted the docs/4070/save branch February 4, 2019 17:41
daniloercoli added a commit that referenced this pull request Feb 5, 2019
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg: (22 commits)
  Make the modal title styling consistent (#13669)
  Disable navigation block for text mode. (#12185)
  Fix: Linting problem in modal example code (#13671)
  Add myself as a code owner to the annotations (#13672)
  Add more reviewers to CODEOWNERS.md file (#13667)
  Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576)
  Workflow: Add repository CODEOWNERS file (#13604)
  Add a mobile minimum size for form fields (#13639)
  Update edit-save documentation  (#13578)
  Alt image setting (#13631)
  Fix: Allow years lower than 1970 in DateTime component. (#13602)
  Using addQueryArgs to generate Manage All Reusable Blocks link (#13653)
  Bump plugin version to 5.0.0-rc.1 (#13652)
  Update lodash to 4.17.10 (#13651)
  Refreshed PR (#9469)
  Set default values of the width and height input fields according to the actual image dimensions (#7687)
  12647 fix css color picker (#12747)
  Remove "we" from messages (#13644)
  Fix: Font size picker max width on mobile (#13264)
  Fix/issue 12501 menu item aria label
  ...
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Update edit examples with ES5 code

* Add extra explanation and links to attributes and block tutorial

* Add two examples for attributes, edit, save

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Remove spaces.

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Make function defns consistent across ES5/ESNext

* Add clone example for ES5

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Simplify ES5 example, props @nosolosw
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Update edit examples with ES5 code

* Add extra explanation and links to attributes and block tutorial

* Add two examples for attributes, edit, save

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Remove spaces.

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Make function defns consistent across ES5/ESNext

* Add clone example for ES5

* Update docs/designers-developers/developers/block-api/block-edit-save.md

Co-Authored-By: mkaz <marcus@mkaz.com>

* Simplify ES5 example, props @nosolosw
This was referenced Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants