Skip to content

Commit

Permalink
Merge pull request #1752 from wordpress-mobile/release/1.20.0
Browse files Browse the repository at this point in the history
Release v1.20.0
  • Loading branch information
Tug authored Jan 10, 2020
2 parents 3ee93dd + 13c9a41 commit aaa43ff
Show file tree
Hide file tree
Showing 20 changed files with 1,891 additions and 1,834 deletions.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Fixes #

To test:

Update release notes:
PR submission checklist:

- [ ] If there are user facing changes, I have added an item to `RELEASE-NOTES.txt`.
- [ ] I have considered adding unit tests where possible.
- [ ] I have considered if this change warrants user-facing release notes and have added them to `RELEASE-NOTES.txt` if necessary.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Note that the OS platform used by the maintainers is macOS but the tools and set

* Clone the project and submodules:
```
$ git clone --recurse-submodules https://github.com/wordpress-mobile/gutenberg-mobile.git
git clone --recurse-submodules https://github.com/wordpress-mobile/gutenberg-mobile.git
```

* Or if you already have the project cloned, initialize and update the submodules:
```
$ git submodule init
$ git submodule update
git submodule init
git submodule update
```

## Set up
Expand Down Expand Up @@ -95,7 +95,7 @@ When you first open the project in Visual Studio, you will be prompted to instal

One of the extensions we are using is the [React Native Tools](https://marketplace.visualstudio.com/items?itemName=vsmobile.vscode-react-native). This allows you to run the packager from VSCode or launch the application on iOS or Android. It also adds some debug configurations so you can set breakpoints and debug the application directly from VSCode. Take a look at the [extension documentation](https://marketplace.visualstudio.com/items?itemName=vsmobile.vscode-react-native) for more details.

## Test
## Unit Tests

Use the following command to run the test suite:

Expand All @@ -113,7 +113,7 @@ yarn test:debug

Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "Remote Target" section). While testing/developing, feel free to springle `debugger` statements anywhere in the code that you'd like the debugger to break.

## Writing and Running Tests
## Writing and Running Unit Tests

This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/app/App.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

Expand Down
7 changes: 7 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.20.0
------
* Fix bug where image placeholders would sometimes not be shown
* Fix crash on undo
* Style fixes on the navigation UI
* [iOS] Fix focus issue

1.19.0
------
* Add support for changing Settings in List Block.
Expand Down
4 changes: 2 additions & 2 deletions __device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export default class EditorPage {

const parentId = `${ blockName } Block. Row ${ position }.`;
const parentLocator = `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ parentId }")]`;
let removeBlockLocator = `${ parentLocator }/following-sibling::*`;
removeBlockLocator += isAndroid() ? '' : '//*';
let removeBlockLocator = `${ parentLocator }`;
removeBlockLocator += isAndroid() ? '//*' : '//XCUIElementTypeButton';
let removeButtonIdentifier = `Remove block at row ${ position }`;

if ( isAndroid() ) {
Expand Down
16 changes: 12 additions & 4 deletions bin/po2android.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ const indent = ' ';
* @return {string} Escaped string to be copied into the XML <string></string> node
*/
function escapeResourceXML( unsafeXMLValue ) {
// Let's first replace XML special characters that JSON.stringify does not escape: <, > and &
// Then let's use JSON.stringify to handle pre and post spaces as well as escaping ", \, \t and \n
return JSON.stringify( unsafeXMLValue.replace( /[<>&]/g, function( character ) {
// See: https://tekeye.uk/android/examples/android-string-resources-gotchas
// Let's replace XML special characters <, >, &, ", ', \, \t and \n
// Note that this does not support android:textstyle attributes (<b></b>...)
return unsafeXMLValue.replace( /(\r?\n|\r|\t|<|>|&|'|"|\\)/gm, function( character ) {
switch ( character ) {
case '<': return '&lt;';
case '>': return '&gt;';
case '&': return '&amp;';
case '\'': return '\\\'';
case '"': return '\\\"';
case '\r':
case '\n':
case '\r\n': return '\\n';
case '\t': return '\\t';
case '\\': return '\\\\';
}
} ) );
} );
}

/**
Expand Down
1,727 changes: 871 additions & 856 deletions bundle/android/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/App.js.map

Large diffs are not rendered by default.

167 changes: 84 additions & 83 deletions bundle/android/strings.xml

Large diffs are not rendered by default.

1,741 changes: 878 additions & 863 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bundle/ios/GutenbergNativeTranslations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
private func dummy() {
_ = NSLocalizedString("'%s' isn't yet supported on WordPress for Android", comment: "translators: %s: Name of the block")
_ = NSLocalizedString("'%s' isn't yet supported on WordPress for iOS", comment: "")
_ = NSLocalizedString("%1$s. Current value is %2$s", comment: "translators: accessibility text. Inform about current value. %1$s: Control label %2$s: Current value.")
_ = NSLocalizedString("%s Block", comment: "translators: accessibility text. %s: block name.")
_ = NSLocalizedString("%s block. Empty", comment: "translators: accessibility text for the media block empty state. %s: media type")
_ = NSLocalizedString("%s block. This block has invalid content", comment: "translators: accessibility text for blocks with invalid content. %d: localized block title")
Expand Down Expand Up @@ -66,7 +67,7 @@ private func dummy() {
_ = NSLocalizedString("Problem opening the video", comment: "")
_ = NSLocalizedString("Remove annotations", comment: "")
_ = NSLocalizedString("Remove block at row %s", comment: "translators: accessibility text. %s: current block position (number).")
_ = NSLocalizedString("RESET", comment: "")
_ = NSLocalizedString("Remove Image", comment: "")
_ = NSLocalizedString("Reset Block", comment: "")
_ = NSLocalizedString("Row %d.", comment: "")
_ = NSLocalizedString("Show section", comment: "translators: Checkbox toggle label")
Expand All @@ -81,6 +82,5 @@ private func dummy() {
_ = NSLocalizedString("Title:", comment: "")
_ = NSLocalizedString("Translate", comment: "")
_ = NSLocalizedString("Ungroup", comment: "")
_ = NSLocalizedString("Unsupported", comment: "")
_ = NSLocalizedString("We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.", comment: "")
_ = NSLocalizedString("WordPress Media Library", comment: "")
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 706 files
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg-mobile",
"version": "1.19.1",
"version": "1.20.0",
"private": true,
"config": {
"jsfiles": "./*.js src/*.js src/**/*.js src/**/**/*.js",
Expand Down Expand Up @@ -85,7 +85,9 @@
"pregenstrings": "test -f gutenberg.pot || yarn makepot:gutenberg",
"genstrings": "yarn genstrings:android && yarn genstrings:ios",
"genstrings:android": "yarn makepot:android && ./bin/po2android.js gutenberg-android.pot bundle/android/strings.xml",
"genstrings:android:check": "xmllint --noout bundle/android/strings.xml",
"genstrings:ios": "yarn makepot:ios && ./bin/po2swift.js gutenberg-ios.pot bundle/ios/GutenbergNativeTranslations.swift",
"postgenstrings:android": "yarn genstrings:android:check",
"android": "react-native run-android",
"prewpandroid": "rm -Rf $TMPDIR/gbmobile-wpandroidfakernroot && mkdir $TMPDIR/gbmobile-wpandroidfakernroot && ln -s $(cd \"$(dirname \"../../../\")\"; pwd) $TMPDIR/gbmobile-wpandroidfakernroot/android",
"wpandroid": "yarn android --root $TMPDIR/gbmobile-wpandroidfakernroot --variant wasabiDebug --appIdSuffix beta --appFolder WordPress --main-activity=ui.WPLaunchActivity",
Expand Down Expand Up @@ -139,7 +141,7 @@
"dependencies": {
"@babel/runtime": "^7.3.1",
"@react-native-community/cli": "^1.5.2",
"@react-native-community/slider": "git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4",
"@react-native-community/slider": "git+https://github.com/wordpress-mobile/react-native-slider.git#f5d8685ffa389c78a8713162b1e2821067ad214f",
"classnames": "^2.2.5",
"dom-react": "^2.2.1",
"domutils": "^1.7.0",
Expand All @@ -166,8 +168,8 @@
"react-native-modal": "^6.5.0",
"react-native-recyclerview-list": "git+https://github.com/wordpress-mobile/react-native-recyclerview-list.git#eadaa2f62d2f488d4dc80f9148e52b62047297ab",
"react-native-safe-area": "^0.5.0",
"react-native-svg": "git+https://github.com/wordpress-mobile/react-native-svg.git#f16e9adae71c6cf3158f2356cf95fff5c2075e0f",
"react-native-video": "git+https://github.com/wordpress-mobile/react-native-video.git#3a0e2fa6fc6bf1fe1a54adb2dbf94545b28c2bc4",
"react-native-svg": "git+https://github.com/wordpress-mobile/react-native-svg.git#d466eb06a38e6f553f08666f0ca784d47fd6f724",
"react-native-video": "git+https://github.com/wordpress-mobile/react-native-video.git#ad64098edc4ce1cd0ad783cb1843df634d997fdb",
"react-redux": "^5.0.7",
"redux": "^3.7.2",
"redux-multi": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ extension RCTAztecView: UITextViewDelegate {
}

func textViewDidEndEditing(_ textView: UITextView) {
onBlur?([:])
let text = packForRN(cleanHTML(), withName: "text")
onBlur?(text)
}
}
2 changes: 1 addition & 1 deletion react-native-aztec/src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class AztecView extends React.Component {

_onPress = (event) => {
if ( ! this.isFocused() ) {
this.focus(event); // Call to move the focus in RN way (TextInputState)
this.focus(); // Call to move the focus in RN way (TextInputState)
this._onFocus(event); // Check if there are listeners set on the focus event
}
}
Expand Down
3 changes: 2 additions & 1 deletion sass-transformer-inside-gb.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function findVariant( name, extensions, includePaths ) {
// try to find the file iterating through the extensions, in order.
const foundExtention = extensions.find( ( extension ) => {
const fname = includePath + '/' + name + extension;
return fs.existsSync( fname );
const partialfname = includePath + '/_' + name + extension;
return fs.existsSync( fname ) || fs.existsSync( partialfname );
} );

if ( foundExtention ) {
Expand Down
3 changes: 2 additions & 1 deletion sass-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function findVariant( name, extensions, includePaths ) {
// try to find the file iterating through the extensions, in order.
const foundExtention = extensions.find( ( extension ) => {
const fname = includePath + '/' + name + extension;
return fs.existsSync( fname );
const partialfname = includePath + '/_' + name + extension;
return fs.existsSync( fname ) || fs.existsSync( partialfname );
} );

if ( foundExtention ) {
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class RootComponent extends React.Component {

render() {
const { initialHtmlModeEnabled } = this.props;
const settings = {
__experimentalEnablePageTemplates: !! __DEV__,
};
let initialData = this.props.initialData;
let initialTitle = this.props.initialTitle;
let postType = this.props.postType;
Expand All @@ -80,6 +83,7 @@ export class RootComponent extends React.Component {
initialHtmlModeEnabled={ initialHtmlModeEnabled }
initialTitle={ initialTitle }
postType={ postType }
settings={ settings }
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions symlinked-packages/@wordpress/keyboard-shortcuts
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1913,9 +1913,9 @@
xcode "^2.0.0"
xmldoc "^0.4.0"

"@react-native-community/slider@git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4":
"@react-native-community/slider@git+https://github.com/wordpress-mobile/react-native-slider.git#f5d8685ffa389c78a8713162b1e2821067ad214f":
version "2.0.7"
resolved "git+https://github.com/wordpress-mobile/react-native-slider.git#e20f268e61327321a5bbd66afc5238388d65f2a4"
resolved "git+https://github.com/wordpress-mobile/react-native-slider.git#f5d8685ffa389c78a8713162b1e2821067ad214f"

"@tannin/compile@^1.0.3":
version "1.0.3"
Expand Down Expand Up @@ -11012,13 +11012,13 @@ react-native-sass-transformer@^1.1.1:
css-to-react-native-transform "^1.8.1"
semver "^5.6.0"

"react-native-svg@git+https://github.com/wordpress-mobile/react-native-svg.git#f16e9adae71c6cf3158f2356cf95fff5c2075e0f":
"react-native-svg@git+https://github.com/wordpress-mobile/react-native-svg.git#d466eb06a38e6f553f08666f0ca784d47fd6f724":
version "9.3.3-gb"
resolved "git+https://github.com/wordpress-mobile/react-native-svg.git#f16e9adae71c6cf3158f2356cf95fff5c2075e0f"
resolved "git+https://github.com/wordpress-mobile/react-native-svg.git#d466eb06a38e6f553f08666f0ca784d47fd6f724"

"react-native-video@git+https://github.com/wordpress-mobile/react-native-video.git#3a0e2fa6fc6bf1fe1a54adb2dbf94545b28c2bc4":
"react-native-video@git+https://github.com/wordpress-mobile/react-native-video.git#ad64098edc4ce1cd0ad783cb1843df634d997fdb":
version "4.4.1"
resolved "git+https://github.com/wordpress-mobile/react-native-video.git#3a0e2fa6fc6bf1fe1a54adb2dbf94545b28c2bc4"
resolved "git+https://github.com/wordpress-mobile/react-native-video.git#ad64098edc4ce1cd0ad783cb1843df634d997fdb"
dependencies:
keymirror "^0.1.1"
prop-types "^15.5.10"
Expand Down

0 comments on commit aaa43ff

Please sign in to comment.