Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into issue/1992-RangeCo…
Browse files Browse the repository at this point in the history
…ntrol
  • Loading branch information
chipsnyder committed Apr 15, 2020
2 parents 17a9298 + 0246cb6 commit d41c5ff
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 17 deletions.
38 changes: 38 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/release_pull_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Release for Gutenberg Mobile v1.XX.Y

## Related PRs

- Gutenberg: https://github.com/WordPress/gutenberg/pull/
- WPAndroid: https://github.com/wordpress-mobile/WordPress-Android/pull/
- WPiOS: https://github.com/wordpress-mobile/WordPress-iOS/pull/

- Aztec-iOS: https://github.com/wordpress-mobile/AztecEditor-iOS/pull/
- Aztec-Android: https://github.com/wordpress-mobile/AztecEditor-Android/pull

## Extra PRs that Landed After the Release Was Cut

- [ ] PR 1
- [ ] PR 2

## Changes
<!-- To determine the changes you can check the RELEASE-NOTES.txt file and cross check with the list of commits that are part of the PR -->

- Change 1
- Change 2

## Test plan

- Use the main WP apps to test the changes above.
- Check WPAndroid and WPiOS PRs if there are specific tests to run.
- Smoke test the main WP apps for [general writing flow](https://github.com/wordpress-mobile/test-cases/tree/master/test-cases/gutenberg/writing-flow).

## Release Submission Checklist

- [ ] Release number was bumped
- [ ] Aztec dependencies are pointing to a stable release
- iOS: 'grep WordPressAztec-iOS RNTAztecView.podspec'
- Android: 'grep aztecVersion react-native-aztec/android/build.gradle'
- [ ] Gutenberg 'Podfile' and 'Podfile.lock' inside './ios/' are updated to the release number
- [ ] Bundle package of the release is updated
- [ ] Check if `RELEASE-NOTES.txt` is updated with all the changes that made it to the release

6 changes: 6 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.26.0
------
* [iOS] Disable ripple effect in all BottomSheet's controls.
* [Android] Disable ripple effect for Slider control
* New block: Columns

1.25.0
------
* New block: Cover
Expand Down
27 changes: 18 additions & 9 deletions __device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,33 @@ export default class EditorPage {

// Click on block of choice
const blockButton = await this.findBlockButton( blockName );
await blockButton.click();
if ( isAndroid() ) {
await blockButton.click();
} else {
await this.driver.execute( 'mobile: tap', { element: blockButton, x: 10, y: 10 } );
}
}

// Attempts to find the given block button in the block inserter control.
async findBlockButton( blockName: string ) {
// If running on iOS returns the result of the look up as no scrolling is necessary for offscreen items.
if ( ! isAndroid() ) {
if ( isAndroid() ) {
// Checks if the Block Button is available, and if not will scroll to the second half of the available buttons.
while ( ! await this.driver.hasElementByAccessibilityId( blockName ) ) {
await this.driver.pressKeycode( 20 ); // Press the Down arrow to force a scroll.
}

return await this.driver.elementByAccessibilityId( blockName );
}

// Checks if the Block Button is available, and if not will scroll to the second half of the available buttons.
if ( ! await this.driver.hasElementByAccessibilityId( blockName ) ) {
for ( let step = 0; step < 5; step++ ) {
await this.driver.pressKeycode( 20 ); // Press the Down arrow to force a scroll.
}
const blockButton = await this.driver.elementByAccessibilityId( blockName );
const size = await this.driver.getWindowSize();
const height = size.height - 5;

while ( ! await blockButton.isDisplayed() ) {
await this.driver.execute( 'mobile: dragFromToForDuration', { fromX: 50, fromY: height, toX: 50, toY: height - 450, duration: 0.5 } );
}

return await this.driver.elementByAccessibilityId( blockName );
return blockButton;
}

async clickToolBarButton( buttonName: string ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package org.wordpress.mobile.WPAndroidGlue;

import android.text.TextUtils;

import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnAuthHeaderRequestedListener;

import java.io.IOException;
import java.util.Map;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class OkHttpHeaderInterceptor implements Interceptor {
private static final String AUTHORIZATION_HEADER_KEY = "Authorization";

private OnAuthHeaderRequestedListener mOnAuthHeaderRequestedListener;

void setOnAuthHeaderRequestedListener(OnAuthHeaderRequestedListener onAuthHeaderRequestedListener) {
Expand All @@ -23,10 +20,13 @@ void setOnAuthHeaderRequestedListener(OnAuthHeaderRequestedListener onAuthHeader
public Response intercept(Chain chain) throws IOException {
Request.Builder builder = chain.request().newBuilder();

String authHeader = mOnAuthHeaderRequestedListener != null
Map<String, String> authHeaders = mOnAuthHeaderRequestedListener != null
? mOnAuthHeaderRequestedListener.onAuthHeaderRequested(chain.request().url().toString()) : null;
if (!TextUtils.isEmpty(authHeader)) {
builder.addHeader(AUTHORIZATION_HEADER_KEY, authHeader);

if (authHeaders != null) {
for (Map.Entry<String, String> entry : authHeaders.entrySet()) {
builder.addHeader(entry.getKey(), entry.getValue());
}
}

return chain.proceed(builder.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public interface OnEditorMountListener {
}

public interface OnAuthHeaderRequestedListener {
String onAuthHeaderRequested(String url);
Map<String, String> onAuthHeaderRequested(String url);
}

public interface OnEditorAutosaveListener {
Expand Down

0 comments on commit d41c5ff

Please sign in to comment.