Skip to content

Commit

Permalink
Merge pull request #10308 from wordpress-mobile/merge/13.0-into-master
Browse files Browse the repository at this point in the history
Merge 13.0 into master
  • Loading branch information
jkmassel authored Jul 31, 2019
2 parents 33a1cbd + 44b33e2 commit 68721ec
Show file tree
Hide file tree
Showing 611 changed files with 6,400 additions and 3,916 deletions.
1 change: 1 addition & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_WITHOUT: "screenshots"
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
type: instrumentation
apk-path: WordPress/build/outputs/apk/vanilla/debug/WordPress-vanilla-debug.apk
test-apk-path: WordPress/build/outputs/apk/androidTest/vanilla/debug/WordPress-vanilla-debug-androidTest.apk
test-targets: package org.wordpress.android.e2e
test-targets: notPackage org.wordpress.android.ui.screenshots
device: model=Nexus5X,version=26,locale=en,orientation=portrait
project: api-project-108380595987
timeout: 10m
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org" do
gem 'fastlane', "2.126"
gem 'fastlane', "2.127.2"
gem 'nokogiri'
end

Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/wordpress-mobile/release-toolkit
revision: d5ad0466ab9f72161cd55916577cf52ee386f9cf
tag: 0.5.0
revision: c555066402074a527a9853932790da8198eb7f21
tag: 0.6.0
specs:
fastlane-plugin-wpmreleasetoolkit (0.5.0)
fastlane-plugin-wpmreleasetoolkit (0.6.0)
diffy (~> 3.3)
git (~> 1.3)
jsonlint
Expand All @@ -13,7 +13,6 @@ GIT
progress_bar (~> 1.3)
rake (~> 12.3)
rake-compiler (~> 1.0)
rmagick (~> 3.0)

GEM
remote: https://rubygems.org/
Expand All @@ -32,11 +31,11 @@ GEM
declarative-option (0.1.0)
diffy (3.3.0)
digest-crc (0.4.1)
domain_name (0.5.20180417)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.4)
emoji_regex (1.0.1)
excon (0.64.0)
excon (0.65.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
Expand All @@ -45,7 +44,7 @@ GEM
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.126.0)
fastlane (2.127.2)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand All @@ -65,7 +64,7 @@ GEM
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (~> 2.1.0)
mini_magick (~> 4.5.1)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
Expand Down Expand Up @@ -121,7 +120,7 @@ GEM
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mini_magick (4.5.1)
mini_magick (4.9.5)
mini_portile2 (2.4.0)
multi_json (1.13.1)
multi_xml (0.6.0)
Expand All @@ -132,7 +131,7 @@ GEM
mini_portile2 (~> 2.4.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
oj (3.7.12)
oj (3.8.0)
optimist (3.0.0)
options (2.3.2)
os (1.0.1)
Expand Down Expand Up @@ -179,7 +178,7 @@ GEM
unf_ext (0.0.7.6)
unicode-display_width (1.6.0)
word_wrap (1.0.0)
xcodeproj (1.10.0)
xcodeproj (1.11.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -194,9 +193,10 @@ PLATFORMS
ruby

DEPENDENCIES
fastlane (= 2.126)!
fastlane (= 2.127.2)!
fastlane-plugin-wpmreleasetoolkit!
nokogiri!
rmagick (~> 3.2.0)

BUNDLED WITH
1.17.3
9 changes: 9 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
13.1
-----

13.0
-----
* Block editor: Auto-enabled upon first open of a block post, unless opted out in v12.9.
* Block editor: You can now enable and disable the block editor on a per-site basis.
* Improve accessibility in the Stats
* Block editor: Adding a block from the post title now shows the add block here indicator.
* Block editor: Deselect post title any time a block is added
* Block editor: Fix loss of center alignment in image captions

12.9
-----
Expand Down
18 changes: 10 additions & 8 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'se.bjurr.violations.violation-comments-to-github-gradle-plugin'
apply plugin: 'kotlin-allopen'

allOpen {
// allows mocking for classes w/o directly opening them for release builds
annotation 'org.wordpress.android.testing.OpenClassAnnotation'
}

android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true

Expand All @@ -43,17 +49,13 @@ android {

defaultConfig {
applicationId "org.wordpress.android"
versionName "alpha-180"
versionCode 754
versionName "alpha-183"
versionCode 762
minSdkVersion 21
targetSdkVersion 28

multiDexEnabled true

ndk {
abiFilters 'armeabi-v7a', 'x86'
}

vectorDrawables.useSupportLibrary = true
testInstrumentationRunner 'org.wordpress.android.WordPressTestRunner'

Expand All @@ -72,8 +74,8 @@ android {
productFlavors {
vanilla { // used for release and beta
dimension "buildType"
versionName "12.9-rc-1"
versionCode 753
versionName "13.0-rc-1"
versionCode 761
}

zalpha { // alpha version - enable experimental features
Expand Down
8 changes: 5 additions & 3 deletions WordPress/metadata/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Customers with unclaimed domain credits can register domains in the app.
* You can expand the Comment Editor to Full Screen for more space while editing.
* The Block editor has a few improvements: Video blocks are available, and a some issues that led to content loss when using unsupported blocks have been resolved.
* Fixes a crash that could happen when viewing help from the login screen
* Allow setting which editor to use on a per-site basis
* Improves accessibility in stats
* Makes it easier to log in by validating the URL to your site more quickly.
* Some minor tweaks to the colour scheme
45 changes: 45 additions & 0 deletions WordPress/src/androidTest/java/org/wordpress/android/e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## UI tests Overview

WordPress for Android has UI acceptance tests for critical user flows through the app, such as login,
signup, and publishing. The tests use mocked network requests with [WireMock](http://wiremock.org/),
defined in [WordPressMocks](https://github.com/wordpress-mobile/WordPressMocks).

## Running the tests

**Note that due to the mock server setup, tests cannot be run on physical devices right now.**


1. Follow the [build instructions](https://github.com/wordpress-mobile/WordPress-Android#build-instructions)
(steps 1-7) to clone, build and run the project in Android Studio.
2. Run the tests in `org.wordpress.android.e2e`

There's no additional steps needed to make the tests run against the mock server -- that's configured by default.

## Adding a new test?

Great! When adding a new UI test, consider:

* Whether you need to test a user flow (to accomplish a task or goal) or a specific feature (e.g. boundary testing).
* What screens/pages are being tested (defined in `pages/`).
* What user flows are being used (defined in `flows/`).
* Any specific UI components being interacted with?(defined in `components/`).
* What network requests are made during the test (defined in `libs/mocks/WordPressMocks`)).

It's preferred to focus UI tests on entire user flows, and group tests with related flows or goals in the same test file.

When you add a new test, you may need to add new screens, methods, and flows. When writing these I encourage you to check
`support/WPSupportUtils.java` for additional code to reuse to automate the task. Our tests are also used to generate screenshots
and a lot of useful helper functions are made available through that auxillary file. Wherever possible, avoid the use
of a string to select a UI element on the screen; the use of other identifiers such as id or content description is preferable
and should be used where possible, even if that means adding it to a UI element that might be missing the appropriate field.
This ensures tests can be run regardless of the device language.

## Adding or updating network mocks

When you add a test (or when the app changes), the request definitions for WireMock need to be updated. You can read WireMock’s documentation [here](http://wiremock.org/docs/).

If you are unsure what network requests need to be mocked for a test, an easy way to find out is to run the app through [Charles Proxy](https://www.charlesproxy.com/) and observe the required requests.

`WordPressMocks` is included as a library in `WordPress-Android` and are located in `libs/mocks/WordPressMocks/`, you can update
your local mock files and make changes here. Additionally a pull request updating the mocks
here should have an accompanying pull request to the `WordPressMocks` repo so that the mocks can be shared across the platforms.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void enterImage() {
// Accept alert for media access
clickOn(onView(withText("LEAVE OFF")).inRoot(isDialog()));
}

waitForElementToBeDisplayed(publishButton);
}

public void openSettings() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.wordpress.android.testing
/**
* This annotation allows us to open some classes in debug build only for mocking purposes while they are final in
* release builds.
*/
@Target(AnnotationTarget.ANNOTATION_CLASS)
annotation class OpenClassAnnotation
/**
* Annotate a class with [OpenForTesting] if you want it to be extendable in debug builds.
*/
@OpenClassAnnotation
@Target(AnnotationTarget.CLASS)
annotation class OpenForTesting
11 changes: 10 additions & 1 deletion WordPress/src/main/java/org/wordpress/android/WordPress.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
import org.wordpress.android.ui.stats.datasets.StatsDatabaseHelper;
import org.wordpress.android.ui.stats.datasets.StatsTable;
import org.wordpress.android.ui.stats.refresh.lists.widget.WidgetUpdater.StatsWidgetUpdaters;
import org.wordpress.android.ui.uploads.UploadStarter;
import org.wordpress.android.ui.uploads.UploadService;
import org.wordpress.android.ui.uploads.UploadStarter;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.AppLog.AppLogListener;
import org.wordpress.android.util.AppLog.LogLevel;
Expand All @@ -94,6 +94,7 @@
import org.wordpress.android.util.ProfilingUtils;
import org.wordpress.android.util.QuickStartUtils;
import org.wordpress.android.util.RateLimitedTask;
import org.wordpress.android.util.SiteUtils;
import org.wordpress.android.util.UploadWorker;
import org.wordpress.android.util.UploadWorkerKt;
import org.wordpress.android.util.VolleyUtils;
Expand Down Expand Up @@ -185,6 +186,11 @@ protected boolean run() {
SiteModel selectedSite = mSiteStore.getSiteByLocalId(siteLocalId);
if (selectedSite != null) {
mDispatcher.dispatch(SiteActionBuilder.newFetchSiteAction(selectedSite));
// Reload editor details from the remote backend
if (!AppPrefs.isDefaultAppWideEditorPreferenceSet()) {
// Check if the migration from app-wide to per-site setting has already happened - v12.9->13.0
mDispatcher.dispatch(SiteActionBuilder.newFetchSiteEditorsAction(selectedSite));
}
}
return true;
}
Expand Down Expand Up @@ -873,6 +879,9 @@ public void onAppComesFromBackground() {
}
sDeleteExpiredStats.runIfNotLimited();

// Let's migrate the old editor preference if available in AppPrefs to the remote backend
SiteUtils.migrateAppWideMobileEditorPreferenceToRemote(mContext, mDispatcher, mSiteStore);

if (mFirstActivityResumed) {
deferredInit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import org.wordpress.android.util.StringUtils;

public class PublicizeService {
public static final String FACEBOOK_SERVICE_ID = "facebook";

private String mId;
private String mLabel;
private String mDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ private NotificationCompat.Builder getNotificationBuilder(Context context, Strin
return new NotificationCompat.Builder(context,
context.getString(R.string.notification_channel_normal_id))
.setSmallIcon(R.drawable.ic_my_sites_white_24dp)
.setColor(context.getResources().getColor(R.color.primary_500))
.setColor(context.getResources().getColor(R.color.primary_50))
.setContentTitle(title)
.setContentText(message)
.setTicker(message)
Expand Down Expand Up @@ -711,7 +711,7 @@ private void showGroupNotificationForBuilder(Context context, NotificationCompat
context.getString(R.string.notification_channel_normal_id))
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
.setSmallIcon(R.drawable.ic_my_sites_white_24dp)
.setColor(context.getResources().getColor(R.color.primary_500))
.setColor(context.getResources().getColor(R.color.primary_50))
.setGroup(NOTIFICATION_GROUP_KEY)
.setGroupSummary(true)
.setAutoCancel(true)
Expand Down Expand Up @@ -987,7 +987,7 @@ private void handlePushAuth(Context context, Bundle data) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context,
context.getString(R.string.notification_channel_important_id))
.setSmallIcon(R.drawable.ic_my_sites_white_24dp)
.setColor(context.getResources().getColor(R.color.primary_500))
.setColor(context.getResources().getColor(R.color.primary_50))
.setContentTitle(title)
.setContentText(message)
.setAutoCancel(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void showMessageToUserWithBuilder(NotificationCompat.Builder build
public static NotificationCompat.Builder getBuilder(Context context, String channelId) {
return new NotificationCompat.Builder(context, channelId)
.setSmallIcon(R.drawable.ic_my_sites_white_24dp)
.setColor(context.getResources().getColor(R.color.primary_500))
.setColor(context.getResources().getColor(R.color.primary_50))
.setContentTitle(context.getString(R.string.app_name))
.setAutoCancel(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
StringEscapeUtils.unescapeHtml4(blogNames[position]));
blogUsername.setText(
StringEscapeUtils.unescapeHtml4(username));
blavatar.setErrorImageResId(R.drawable.bg_rectangle_neutral_100_globe_32dp);
blavatar.setErrorImageResId(R.drawable.bg_rectangle_neutral_10_globe_32dp);
blavatar.setImageUrl(blavatars[position], mImageLoader);

return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public void onClick(View view) {
if (!mAction.isEmpty()) {
Menu menu = toolbar.getMenu();
mMenuAction = menu.add(0, ID_ACTION, 0, this.mAction);
mMenuAction.setIcon(R.drawable.ic_send_accent_neutral_300_24dp);
mMenuAction.setIcon(R.drawable.ic_send_accent_neutral_30_24dp);
mMenuAction.setEnabled(false);
mMenuAction.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
mMenuAction.setOnMenuItemClickListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sealed class JetpackRemoteInstallViewState(
R.string.install_jetpack,
R.string.install_jetpack_message,
icon = R.drawable.ic_plans_white_24dp,
iconTint = R.color.jetpack,
iconTint = R.color.jetpack_green_50,
buttonResource = R.string.install_jetpack_continue,
onClick = onClick
)
Expand All @@ -34,7 +34,7 @@ sealed class JetpackRemoteInstallViewState(
R.string.installing_jetpack,
R.string.installing_jetpack_message,
icon = R.drawable.ic_plans_white_24dp,
iconTint = R.color.jetpack,
iconTint = R.color.jetpack_green_50,
progressBarVisible = true
)

Expand All @@ -44,7 +44,7 @@ sealed class JetpackRemoteInstallViewState(
R.string.jetpack_installed_message,
icon = R.drawable.ic_plans_white_24dp,
buttonResource = R.string.install_jetpack_continue,
iconTint = R.color.jetpack,
iconTint = R.color.jetpack_green_50,
onClick = onClick
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ public void run() {
if (mRecyclerView.computeVerticalScrollRange() > mRecyclerView.getHeight()) {
mBottomButtonsShadow.setVisibility(View.VISIBLE);
mBottomButtonsContainer.setBackgroundResource(android.R.color.white);
mShareMediaBtn.setTextColor(getResources().getColor(R.color.primary_500));
mShareMediaBtn.setTextColor(getResources().getColor(R.color.primary_50));
ViewUtils.setButtonBackgroundColor(getContext(), mShareMediaBtn,
R.style.WordPress_Button_Grey,
R.attr.colorButtonNormal);
} else {
mBottomButtonsShadow.setVisibility(View.GONE);
mBottomButtonsContainer.setBackground(null);
mShareMediaBtn.setTextColor(getResources().getColor(R.color.neutral_700));
mShareMediaBtn.setTextColor(getResources().getColor(R.color.neutral_70));
ViewUtils.setButtonBackgroundColor(getContext(), mShareMediaBtn,
R.style.WordPress_Button,
R.attr.colorButtonNormal);
Expand Down
Loading

0 comments on commit 68721ec

Please sign in to comment.