Skip to content

Commit

Permalink
Merge branch 'develop' into gutenberg/integrate_release_1.41.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Nov 14, 2020
2 parents 38aca87 + a76513c commit e4cf406
Show file tree
Hide file tree
Showing 169 changed files with 6,732 additions and 2,231 deletions.
26 changes: 21 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ commands:
name: Setup gradle.properties
command: cp gradle.properties-example gradle.properties && cp libs/utils/WordPressUtils/gradle.properties-example libs/utils/WordPressUtils/gradle.properties
update-gradle-memory:
parameters:
jvmargs:
type: string
default: "Xmx2048m"
steps:
- run:
name: Update memory setting
command: sed -i "s/org.gradle.jvmargs=.*/org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false /" gradle.properties
command: sed -i "s/org.gradle.jvmargs=.*/org.gradle.jvmargs=-<< parameters.jvmargs >> -XX:+HeapDumpOnOutOfMemoryError -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false /" gradle.properties
npm-install:
steps:
- restore_cache:
Expand Down Expand Up @@ -320,7 +324,8 @@ jobs:
- checkout-submodules
- android/restore-gradle-cache
- copy-gradle-properties
- update-gradle-memory
- update-gradle-memory:
jvmargs: "Xmx1024m"
- restore-gutenberg-bundle-cache
- run:
name: Ensure assets folder exists
Expand All @@ -331,7 +336,12 @@ jobs:
name: Build
environment:
SUPPRESS_GUTENBERG_MOBILE_JS_BUNDLE_BUILD: 1
command: ./gradlew WordPress:assembleVanillaDebug WordPress:assembleVanillaDebugAndroidTest --stacktrace
command: ./gradlew WordPress:assembleVanillaDebug --stacktrace
- run:
name: Build Tests
environment:
SUPPRESS_GUTENBERG_MOBILE_JS_BUNDLE_BUILD: 1
command: ./gradlew WordPress:assembleVanillaDebugAndroidTest --stacktrace
- run:
name: Decrypt credentials
command: openssl aes-256-cbc -md sha256 -d -in .circleci/.firebase.secrets.json.enc -out .circleci/.firebase.secrets.json -k "${FIREBASE_SECRETS_ENCRYPTION_KEY}"
Expand Down Expand Up @@ -368,7 +378,8 @@ jobs:
cache_key_prefix: v1-raw-screenshots
- android/restore-gradle-cache
- copy-gradle-properties
- update-gradle-memory
- update-gradle-memory:
jvmargs: "Xmx1024m"
- restore-gutenberg-bundle-cache
- run:
name: Ensure assets folder exists
Expand All @@ -385,7 +396,12 @@ jobs:
name: Build
environment:
SUPPRESS_GUTENBERG_MOBILE_JS_BUNDLE_BUILD: 1
command: ./gradlew WordPress:assembleVanillaDebug WordPress:assembleVanillaDebugAndroidTest --stacktrace
command: ./gradlew WordPress:assembleVanillaDebug --stacktrace
- run:
name: Build Tests
environment:
SUPPRESS_GUTENBERG_MOBILE_JS_BUNDLE_BUILD: 1
command: ./gradlew WordPress:assembleVanillaDebugAndroidTest --stacktrace
- run:
name: Decrypt credentials
command: openssl aes-256-cbc -md sha256 -d -in .circleci/.firebase.secrets.json.enc -out .circleci/.firebase.secrets.json -k "${FIREBASE_SECRETS_ENCRYPTION_KEY}"
Expand Down
4 changes: 4 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
-----
* [***] Block Editor: Faster editor start and overall operation. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2780]
* [*] Block Editor: Enable multiple upload support for Image block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2530]
* [*] Posts List: fixed bug that prevented showing the Featured Image of a post for pure self-hosted sites [https://github.com/wordpress-mobile/WordPress-Android/pull/13323]
* [**] Media picker: New media picker is now used in all the places where the user selects any kind of file (featured image, site icon, gravatar, in posts or media library) except stories [https://github.com/wordpress-mobile/WordPress-Android/pull/13368]
* [*] Reader: Fixes an infinite loading indicator on Discover tab in Reader.
* [*] My Site: Hide Activity Log, Themes and Plans for P2 sites.

16.1
-----
Expand Down
12 changes: 7 additions & 5 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ android {
if (project.hasProperty("versionName")) {
versionName project.property("versionName")
} else {
versionName "alpha-255"
versionName "alpha-257"
}
versionCode 950
versionCode 955
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion

Expand All @@ -76,7 +76,10 @@ android {
buildConfigField "boolean", "WP_STORIES_AVAILABLE", "true"
buildConfigField "boolean", "ANY_FILE_UPLOAD", "true"
buildConfigField "boolean", "CONSOLIDATED_MEDIA_PICKER", "false"
buildConfigField "boolean", "ACTIVITY_LOG_FILTERS", "false"
buildConfigField "boolean", "SCAN_AVAILABLE", "false"
buildConfigField "boolean", "ENABLE_FEATURE_CONFIGURATION", "true"
buildConfigField "boolean", "MY_SITE_IMPROVEMENTS", "false"
}

// Gutenberg's dependency - react-native-video is using
Expand All @@ -93,9 +96,9 @@ android {
dimension "buildType"
// Only set the release version if one isn't provided
if (!project.hasProperty("versionName")) {
versionName "16.1-rc-2"
versionName "16.1-rc-4"
}
versionCode 949
versionCode 954
buildConfigField "boolean", "ME_ACTIVITY_AVAILABLE", "false"
buildConfigField "boolean", "TENOR_AVAILABLE", "false"
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
Expand Down Expand Up @@ -242,7 +245,6 @@ dependencies {
implementation 'com.facebook.shimmer:shimmer:0.5.0'

implementation ("com.github.yalantis:ucrop:$uCropVersion") {
exclude group: 'com.squareup.okhttp3'
exclude group: 'androidx.core', module: 'core'
exclude group: 'androidx.constraintlayout', module: 'constraintlayout'
exclude group: 'androidx.appcompat', module: 'appcompat'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void enterImage() {
waitForElementToBeDisplayed(onView(withText("WordPress media")));
// wait for images to load before clicking
idleFor(2000);
onView(withIndex(withId(R.id.media_grid_item_image), 0)).perform(click());
onView(withIndex(withId(R.id.image_thumbnail), 0)).perform(click());

// Click the confirm button
clickOn(confirmButton);
Expand Down Expand Up @@ -107,7 +107,7 @@ public void addATag(String tag) {
public void setFeaturedImage() {
clickOn(onView(withId(R.id.post_add_featured_image_button)));
clickOn(onView(withId(R.id.icon_wpmedia)));
onView(withIndex(withId(R.id.media_grid_item_image), 0)).perform(click());
onView(withIndex(withId(R.id.image_thumbnail), 0)).perform(click());
}

public boolean publishPost() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class MockingInterceptor : Interceptor {
val request = chain.request()

// Redirect all WordPress.com API requests to local mock server
if (request.url().host() == "public-api.wordpress.com") {
val newUrl = request.url().newBuilder()
if (request.url.host == "public-api.wordpress.com") {
val newUrl = request.url.newBuilder()
.scheme("http")
.host("localhost")
.port(BaseTest.WIREMOCK_PORT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void manageMedia() {
clickOn(R.id.nav_sites);
clickOn(R.id.quick_action_media_button);

waitForElementToBeDisplayedWithoutFailure(R.id.media_grid_item_image);
waitForElementToBeDisplayedWithoutFailure(R.id.image_thumbnail);

takeScreenshot("5-share-from-anywhere");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,10 @@ private void dismissSignupSheet() {
return mDispatchingAndroidInjector;
}

@Override public void startOver() {
// Not used in WordPress app
}

@Override
public void showHelpFindingConnectedEmail() {
// Not used in WordPress app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class UnifiedLoginTracker
currentFlow = Flow.values().find { it.value == value }
}

fun setStep(step: Step) {
currentStep = step
}

fun setFlowAndStep(flow: Flow, step: Step) {
currentFlow = flow
currentStep = step
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,24 @@ public void trackSocialSignupConfirmationViewed() {
public void trackCreateAccountClick() {
mUnifiedLoginTracker.trackClick(Click.CREATE_ACCOUNT);
}

@Override public void emailPasswordFormScreenResumed() {
mUnifiedLoginTracker.setStep(Step.START);
}

@Override public void siteAddressFormScreenResumed() {
mUnifiedLoginTracker.setStep(Step.START);
}

@Override public void magicLinkRequestScreenResumed() {
mUnifiedLoginTracker.setStep(Step.START);
}

@Override public void magicLinkSentScreenResumed() {
mUnifiedLoginTracker.setStep(Step.MAGIC_LINK_REQUESTED);
}

@Override public void usernamePasswordScreenResumed() {
mUnifiedLoginTracker.setStep(Step.USERNAME_PASSWORD);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.wordpress.android.WordPress
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.posts.BasicFragmentDialog
import org.wordpress.android.ui.utils.UiHelpers
import org.wordpress.android.util.NetworkUtils
import org.wordpress.android.util.WPSwipeToRefreshHelper.buildSwipeToRefreshHelper
import org.wordpress.android.util.helpers.SwipeToRefreshHelper
Expand All @@ -29,6 +30,7 @@ import javax.inject.Inject

class ActivityLogListFragment : Fragment() {
@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
@Inject lateinit var uiHelpers: UiHelpers
private lateinit var viewModel: ActivityLogViewModel
private lateinit var swipeToRefreshHelper: SwipeToRefreshHelper

Expand Down Expand Up @@ -94,6 +96,10 @@ class ActivityLogListFragment : Fragment() {
refreshProgressBars(listStatus)
})

viewModel.dateRangePickerVisibility.observe(viewLifecycleOwner, Observer { visibility ->
uiHelpers.updateVisibility(date_range_picker, visibility)
})

viewModel.showItemDetail.observe(viewLifecycleOwner, Observer {
if (it is ActivityLogListItem.Event) {
ActivityLauncher.viewActivityLogDetailForResult(activity, viewModel.site, it.activityId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ import org.wordpress.android.util.QuickStartUtils.Companion.getNextUncompletedQu
import org.wordpress.android.util.QuickStartUtils.Companion.isQuickStartInProgress
import org.wordpress.android.util.QuickStartUtils.Companion.removeQuickStartFocusPoint
import org.wordpress.android.util.QuickStartUtils.Companion.stylizeQuickStartPrompt
import org.wordpress.android.util.ScanFeatureConfig
import org.wordpress.android.util.SiteUtils
import org.wordpress.android.util.ToastUtils
import org.wordpress.android.util.ToastUtils.Duration.SHORT
Expand All @@ -162,6 +163,7 @@ import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.util.image.ImageType.BLAVATAR
import org.wordpress.android.util.image.ImageType.USER
import org.wordpress.android.util.requestEmailValidation
import org.wordpress.android.util.setVisible
import org.wordpress.android.widgets.WPDialogSnackbar
import org.wordpress.android.widgets.WPSnackbar
import java.io.File
Expand Down Expand Up @@ -197,6 +199,8 @@ class MySiteFragment : Fragment(),
@Inject lateinit var mediaPickerLauncher: MediaPickerLauncher
@Inject lateinit var storiesMediaPickerResultHandler: StoriesMediaPickerResultHandler
@Inject lateinit var consolidatedMediaPickerFeatureConfig: ConsolidatedMediaPickerFeatureConfig
@Inject lateinit var scanFeatureConfig: ScanFeatureConfig

val selectedSite: SiteModel?
get() {
return (activity as? WPMainActivity)?.selectedSite
Expand Down Expand Up @@ -232,11 +236,13 @@ class MySiteFragment : Fragment(),
// Site details may have changed (e.g. via Settings and returning to this Fragment) so update the UI
refreshSelectedSiteDetails(selectedSite)
selectedSite?.let { site ->
updateScanMenuVisibility()

val isNotAdmin = !site.hasCapabilityManageOptions
val isSelfHostedWithoutJetpack = !SiteUtils.isAccessedViaWPComRest(
site
) && !site.isJetpackConnected
if (isNotAdmin || isSelfHostedWithoutJetpack) {
if (isNotAdmin || isSelfHostedWithoutJetpack || site.isWpForTeamsSite) {
row_activity_log.visibility = View.GONE
} else {
row_activity_log.visibility = View.VISIBLE
Expand All @@ -251,6 +257,10 @@ class MySiteFragment : Fragment(),
showQuickStartNoticeIfNecessary()
}

private fun updateScanMenuVisibility() {
row_scan.setVisible(scanFeatureConfig.isEnabled())
}

private fun showQuickStartNoticeIfNecessary() {
if (!isQuickStartInProgress(quickStartStore) || !AppPrefs.isQuickStartNoticeRequired()) {
return
Expand Down Expand Up @@ -774,12 +784,7 @@ class MySiteFragment : Fragment(),
isDomainCreditAvailable = false
}
RequestCodes.PHOTO_PICKER -> if (resultCode == Activity.RESULT_OK && data != null) {
if (consolidatedMediaPickerFeatureConfig.isEnabled() ||
!storiesMediaPickerResultHandler.handleMediaPickerResultForStories(
data,
activity,
selectedSite
)) {
if (!storiesMediaPickerResultHandler.handleMediaPickerResultForStories(data, activity, selectedSite)) {
if (data.hasExtra(MediaPickerConstants.EXTRA_MEDIA_ID)) {
val mediaId = data.getLongExtra(MediaPickerConstants.EXTRA_MEDIA_ID, 0).toInt()
showSiteIconProgressBar(true)
Expand Down Expand Up @@ -1014,7 +1019,7 @@ class MySiteFragment : Fragment(),

// Hide the Plan item if the Plans feature is not available for this blog
val planShortName = site.planShortName
if (!TextUtils.isEmpty(planShortName) && site.hasCapabilityManageOptions) {
if (!TextUtils.isEmpty(planShortName) && site.hasCapabilityManageOptions && !site.isWpForTeamsSite) {
if (site.isWPCom || site.isAutomatedTransfer) {
my_site_current_plan_text_view.text = planShortName
row_plan.visibility = View.VISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
import org.wordpress.android.util.analytics.AnalyticsUtils;
import org.wordpress.android.util.analytics.service.InstallationReferrerServiceStarter;
import org.wordpress.android.util.config.ModalLayoutPickerFeatureConfig;
import org.wordpress.android.util.config.MySiteImprovementsFeatureConfig;
import org.wordpress.android.viewmodel.main.WPMainActivityViewModel;
import org.wordpress.android.viewmodel.mlp.ModalLayoutPickerViewModel;
import org.wordpress.android.widgets.AppRatingDialog;
Expand Down Expand Up @@ -210,6 +211,7 @@ public class WPMainActivity extends LocaleAwareActivity implements
@Inject ModalLayoutPickerFeatureConfig mModalLayoutPickerFeatureConfig;
@Inject ReaderTracker mReaderTracker;
@Inject MediaPickerLauncher mMediaPickerLauncher;
@Inject MySiteImprovementsFeatureConfig mMySiteImprovementsFeatureConfig;

/*
* fragments implement this if their contents can be scrolled, called when user
Expand Down Expand Up @@ -237,7 +239,7 @@ public void onCreate(Bundle savedInstanceState) {

mBottomNav = findViewById(R.id.bottom_navigation);

mBottomNav.init(getSupportFragmentManager(), this);
mBottomNav.init(getSupportFragmentManager(), this, mMySiteImprovementsFeatureConfig.isEnabled());

mConnectionBar = findViewById(R.id.connection_bar);
mConnectionBar.setOnClickListener(v -> {
Expand Down Expand Up @@ -1085,6 +1087,7 @@ public void onClick(View v) {
case RequestCodes.STORIES_PHOTO_PICKER:
case RequestCodes.PHOTO_PICKER:
Fragment fragment = mBottomNav.getActiveFragment();
// TODO move this logic directly to the fragment
if (fragment instanceof MySiteFragment) {
fragment.onActivityResult(requestCode, resultCode, data);
}
Expand Down Expand Up @@ -1146,6 +1149,8 @@ private MySiteFragment getMySiteFragment() {
if (fragment instanceof MySiteFragment) {
return (MySiteFragment) fragment;
}

// TODO consider the new my site fragment
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.wordpress.android.ui.main.WPMainActivity.OnScrollToTopListener
import org.wordpress.android.ui.main.WPMainNavigationView.PageType.MY_SITE
import org.wordpress.android.ui.main.WPMainNavigationView.PageType.NOTIFS
import org.wordpress.android.ui.main.WPMainNavigationView.PageType.READER
import org.wordpress.android.ui.mysite.ImprovedMySiteFragment
import org.wordpress.android.ui.notifications.NotificationsListFragment
import org.wordpress.android.ui.prefs.AppPrefs
import org.wordpress.android.ui.reader.ReaderFragment
Expand Down Expand Up @@ -67,11 +68,11 @@ class WPMainNavigationView @JvmOverloads constructor(
fun onNewPostButtonClicked()
}

fun init(fm: FragmentManager, listener: OnPageListener) {
fun init(fm: FragmentManager, listener: OnPageListener, showNewMySiteFragment: Boolean) {
fragmentManager = fm
pageListener = listener

navAdapter = NavAdapter()
navAdapter = NavAdapter(showNewMySiteFragment)
assignNavigationListeners(true)
disableShiftMode()

Expand Down Expand Up @@ -278,10 +279,14 @@ class WPMainNavigationView @JvmOverloads constructor(
return position in 0 until numPages()
}

private inner class NavAdapter {
private inner class NavAdapter(val showNewMySiteFragment: Boolean) {
private fun createFragment(pageType: PageType): Fragment {
val fragment = when (pageType) {
MY_SITE -> MySiteFragment.newInstance()
MY_SITE -> if (showNewMySiteFragment) {
ImprovedMySiteFragment.newInstance()
} else {
MySiteFragment.newInstance()
}
READER -> ReaderFragment()
NOTIFS -> NotificationsListFragment.newInstance()
}
Expand Down
Loading

0 comments on commit e4cf406

Please sign in to comment.