Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/WordPress/gutenberg into …
Browse files Browse the repository at this point in the history
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg:
  Try alternate list item jump fix. (#12941)
  Mobile bottom sheet component (#13612)
  Remove unintentional right-margin on last odd-item. (#12199)
  Introduce left and right float alignment options to latest posts block (#8814)
  Fix Google Docs table paste (#13543)
  Increase bottom padding on gallery image caption (#13623)
  Fix the editor save keyboard shortcut not working in code editor view (#13159)
  Plugin: Deprecate gutenberg_add_admin_body_class (#13572)
  Rnmobile/upload media failed state (#13615)
  Make clickOnMoreMenuItem not dependent on aria labels (#13166)
  Add: className prop support to server side render. (#13568)
  Fix: Categories Block: hierarchical Dropdown (#13567)
  Docs: Add clarification about git workflow (#13534)
  Plugin: Remove `user_can_richedit` filtering (#13608)
  eslint-plugin: Add rule `no-unused-vars-before-return` (#12828)
  Image settings button (#13597)
  Fixed wording for the color picker saturation (#13479)

# Conflicts:
#	packages/block-library/src/image/edit.native.js
  • Loading branch information
daniloercoli committed Feb 1, 2019
2 parents 624b473 + 532ed5f commit 10ad47d
Show file tree
Hide file tree
Showing 51 changed files with 1,030 additions and 366 deletions.
44 changes: 44 additions & 0 deletions docs/contributors/git-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Git Workflow

## Keeping Your Branch Up To Date

When many different people are working on a project simultaneously, pull requests can go stale quickly. A "stale" pull request is one that is no longer up to date with the main line of development, and it needs to be updated before it can be merged into the project.

There are two ways to do this: merging and rebasing. In Gutenberg, the recommendation is to rebase. Rebasing means rewriting your changes as if they're happening on top of the main line of development. This ensures the commit history is always clean and linear. Rebasing can be performed as many times as needed while you're working on a pull request. **Do share your work early on** by opening a pull request and keeping your history rebase as you progress.

The main line of development is known as the `master` branch. If you have a pull-request branch that cannot be merged into `master` due to a conflict (this can happen for long-running pull requests), then in the course of rebasing you'll have to manually resolve any conflicts in your local copy. Learn more in [section _Perform a rebase_](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request#perform-a-rebase) of _How to Rebase a Pull Request_.

Once you have resolved any conflicts locally you can update the pull request with `git push --force-with-lease`. Using the `--force-with-lease` parameter is important to guarantee that you don't accidentally overwrite someone else's work.

To sum it up, you need to fetch any new changes in the repository, rebase your branch on top of `master`, and push the result back to the repository. These are the corresponding commands:

```sh
git fetch
git rebase master
git push --force-with-lease your-branch-name
```

## Keeping Your Fork Up To Date

Working on pull request starts with forking the Gutenberg repository, your separate working copy. Which can easily go out of sync as new pull requests are merged into the main repository. Here your working repository is a `fork` and the main Gutenberg repository is `upstream`. When working on new pull request you should always update your fork before you do `git checkout -b my-new-branch` to work on a feature or fix.

To sync your fork you need to fetch the upstream changes and merge them into your fork. These are the corresponding commands:

``` sh
git fetch upstream
git checkout master
git merge upstream/master
```

This will update you local copy to update your fork on github push your changes

```
git push
```

The above commands will update your `master` branch from _upstream_. To update any other branch replace `master` with the respective branch name.


## References
- https://git-scm.com/book/en/v2
- https://help.github.com/categories/collaborating-with-issues-and-pull-requests/
2 changes: 1 addition & 1 deletion docs/contributors/repository-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ When reviewing issues, here are some steps you can perform:

Gutenberg follows a feature branch pull request workflow for all code and documentation changes. At a high-level, the process looks like this:


1. Check out a new feature branch locally.
2. Make your changes, testing thoroughly.
3. Commit your changes when you’re happy with them, and push the branch.
Expand Down Expand Up @@ -127,6 +126,7 @@ A pull request can generally be merged once it is:
- Vetted against all potential edge cases.
- Changelog entries were properly added.
- Reviewed by someone other than the original author.
- [Rebased](/docs/contributors/git-workflow.md#keeping-your-branch-up-to-date) onto the latest version of the master branch.

The final pull request merge decision is made by the **@wordpress/gutenberg-core** team.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa
- The PHP function `gutenberg_collect_meta_box_data` has been removed. Use [`register_and_do_post_meta_boxes`](https://developer.wordpress.org/reference/functions/register_and_do_post_meta_boxes/) instead.
- `window._wpLoadGutenbergEditor` has been removed. Use `window._wpLoadBlockEditor` instead. Note: This is a private API, not intended for public use. It may be removed in the future.
- The PHP function `gutenberg_get_script_polyfill` has been removed. Use [`wp_get_script_polyfill`](https://developer.wordpress.org/reference/functions/wp_get_script_polyfill/) instead.
- The PHP function `gutenberg_add_admin_body_class` has been removed. Use the `.block-editor-page` class selector in your stylesheets if you need to scope styles to the block editor screen.

## 4.5.0
- `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed.
Expand Down
18 changes: 12 additions & 6 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,24 @@
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/coding-guidelines.md",
"parent": "develop"
},
{
"title": "Block Grammar",
"slug": "grammar",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/grammar.md",
"parent": "develop"
},
{
"title": "Testing Overview",
"slug": "testing-overview",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/testing-overview.md",
"parent": "develop"
},
{
"title": "Git Workflow",
"slug": "git-workflow",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/git-workflow.md",
"parent": "develop"
},
{
"title": "Block Grammar",
"slug": "grammar",
"markdown_source": "https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/contributors/grammar.md",
"parent": "develop"
},
{
"title": "Scripts",
"slug": "scripts",
Expand Down
3 changes: 2 additions & 1 deletion docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
]},
{"docs/contributors/develop.md": [
{"docs/contributors/coding-guidelines.md": []},
{"docs/contributors/grammar.md": []},
{"docs/contributors/testing-overview.md": []},
{"docs/contributors/git-workflow.md": []},
{"docs/contributors/grammar.md": []},
{"docs/contributors/scripts.md": []},
{"docs/contributors/release.md": []}
]},
Expand Down
12 changes: 4 additions & 8 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ function gutenberg_init( $return, $post ) {

add_action( 'admin_enqueue_scripts', 'gutenberg_editor_scripts_and_styles' );
add_filter( 'screen_options_show_screen', '__return_false' );
add_filter( 'admin_body_class', 'gutenberg_add_admin_body_class' );

/*
* Remove the emoji script as it is incompatible with both React and any
Expand Down Expand Up @@ -299,18 +298,15 @@ function gutenberg_replace_default_add_new_button() {
* Adds the block-editor-page class to the body tag on the Gutenberg page.
*
* @since 1.5.0
* @deprecated 5.0.0
*
* @param string $classes Space separated string of classes being added to the body tag.
* @return string The $classes string, with block-editor-page appended.
*/
function gutenberg_add_admin_body_class( $classes ) {
// gutenberg-editor-page is left for backward compatibility.
if ( current_theme_supports( 'editor-styles' ) && current_theme_supports( 'dark-editor-style' ) ) {
return "$classes block-editor-page gutenberg-editor-page is-fullscreen-mode wp-embed-responsive is-dark-theme";
} else {
// Default to is-fullscreen-mode to avoid jumps in the UI.
return "$classes block-editor-page gutenberg-editor-page is-fullscreen-mode wp-embed-responsive";
}
_deprecated_function( __FUNCTION__, '5.0.0' );

return $classes;
}

/**
Expand Down
9 changes: 1 addition & 8 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -893,13 +893,6 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'after'
);

// Ignore Classic Editor's `rich_editing` user option, aka "Disable visual
// editor". Forcing this to be true guarantees that TinyMCE and its plugins
// are available in Gutenberg. Fixes
// https://github.com/WordPress/gutenberg/issues/5667.
$user_can_richedit = user_can_richedit();
add_filter( 'user_can_richedit', '__return_true' );

wp_enqueue_script( 'wp-edit-post' );
wp_enqueue_script( 'wp-format-library' );
wp_enqueue_style( 'wp-format-library' );
Expand Down Expand Up @@ -1134,7 +1127,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'allowedMimeTypes' => get_allowed_mime_types(),
'styles' => $styles,
'imageSizes' => gutenberg_get_available_image_sizes(),
'richEditingEnabled' => $user_can_richedit,
'richEditingEnabled' => user_can_richedit(),

// Ideally, we'd remove this and rely on a REST API endpoint.
'postLock' => $lock_details,
Expand Down
Loading

0 comments on commit 10ad47d

Please sign in to comment.