Skip to content

Commit

Permalink
Merge branch 'feature/manage_insights_readonly' into issue/9464-manag…
Browse files Browse the repository at this point in the history
…e-insights

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsFragment.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsViewModel.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/BaseListUseCase.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/StatsListViewModel.kt
#	WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/utils/ItemPopupMenuHandler.kt
  • Loading branch information
0nko committed Apr 18, 2019
2 parents 8785957 + 6bcdc96 commit 4979eaa
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public class Login2FaFragment extends LoginBaseFormFragment<LoginListener> imple

private WPLoginInputRow m2FaInput;

private @StringRes int mInProgressMessageId;
private static final @StringRes int DEFAULT_PROGRESS_MESSAGE_ID = R.string.logging_in;
private @StringRes int mInProgressMessageId = DEFAULT_PROGRESS_MESSAGE_ID;

ArrayList<Integer> mOldSitesIDs;

private Button mSecondaryButton;
Expand Down Expand Up @@ -241,7 +243,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
// retrieve mInProgressMessageId before super.onActivityCreated() so the string will be available to the
// progress bar helper if in progress
if (savedInstanceState != null) {
mInProgressMessageId = savedInstanceState.getInt(KEY_IN_PROGRESS_MESSAGE_ID, 0);
mInProgressMessageId = savedInstanceState.getInt(KEY_IN_PROGRESS_MESSAGE_ID, DEFAULT_PROGRESS_MESSAGE_ID);
mOldSitesIDs = savedInstanceState.getIntegerArrayList(KEY_OLD_SITES_IDS);
} else {
mAnalyticsListener.trackTwoFactorFormViewed();
Expand Down Expand Up @@ -370,7 +372,7 @@ private void show2FaError(String message) {
@Override
protected void endProgress() {
super.endProgress();
mInProgressMessageId = 0;
mInProgressMessageId = DEFAULT_PROGRESS_MESSAGE_ID;
}

private void handleAuthError(AuthenticationErrorType error, String errorMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class LoginEmailFragment extends LoginBaseFormFragment<LoginListener> imp
public static final String TAG = "login_email_fragment_tag";
public static final int MAX_EMAIL_LENGTH = 100;

private ArrayList<Integer> mOldSitesIDs;
private ArrayList<Integer> mOldSitesIDs = new ArrayList<>();
private GoogleApiClient mGoogleApiClient;
private String mGoogleEmail;
private String mRequestedEmail;
Expand Down Expand Up @@ -445,6 +445,11 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

if (requestCode == EMAIL_CREDENTIALS_REQUEST_CODE) {
if (mEmailInput == null) {
// Activity result received before the fragments onCreateView(), disregard result.
return;
}

if (resultCode == RESULT_OK) {
Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);
mEmailInput.getEditText().setText(credential.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Patterns;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
Expand Down Expand Up @@ -146,12 +147,19 @@ protected void discover() {
return;
}

if (TextUtils.isEmpty(mSiteAddressInput.getEditText().getText())) {
String cleanedSiteAddress = getCleanedSiteAddress();

if (TextUtils.isEmpty(cleanedSiteAddress)) {
showError(R.string.login_empty_site_url);
return;
}

mRequestedSiteAddress = getCleanedSiteAddress();
if (!Patterns.WEB_URL.matcher(cleanedSiteAddress).matches()) {
showError(R.string.login_invalid_site_url);
return;
}

mRequestedSiteAddress = cleanedSiteAddress;

String cleanedXmlrpcSuffix = UrlUtils.removeXmlrpcSuffix(mRequestedSiteAddress);
mDispatcher.dispatch(SiteActionBuilder.newFetchWpcomSiteByUrlAction(cleanedXmlrpcSuffix));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_height="@dimen/magic_link_sent_illustration_sz"
android:scaleType="centerInside"
android:contentDescription="@null"
app:srcCompat="@drawable/img_illustration_email_alert_120dp"/>
app:srcCompat="@drawable/login_email_alert"/>

<TextView
android:id="@+id/label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:layout_height="@dimen/magic_link_sent_illustration_sz"
android:layout_width="@dimen/magic_link_sent_illustration_sz"
android:scaleType="centerInside"
app:srcCompat="@drawable/img_illustration_email_alert_120dp" >
app:srcCompat="@drawable/login_email_alert" >
</ImageView>

<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:scaleType="centerInside"
android:layout_marginTop="@dimen/margin_extra_extra_large"
android:contentDescription="@null"
app:srcCompat="@drawable/img_illustration_email_alert_120dp"/>
app:srcCompat="@drawable/login_email_alert"/>

<TextView
android:id="@+id/label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_height="@dimen/magic_link_sent_illustration_sz"
android:layout_width="@dimen/magic_link_sent_illustration_sz"
android:scaleType="centerInside"
app:srcCompat="@drawable/img_illustration_email_alert_120dp" >
app:srcCompat="@drawable/login_email_alert" >
</ImageView>

<TextView
Expand Down
4 changes: 2 additions & 2 deletions vendored/WordPressLoginFlow/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<string name="login_log_in_for_deeplink">Log in to WordPress.com to access the post.</string>
<string name="login_log_in_for_share_intent">Log in to WordPress.com to share the content.</string>
<string name="login_empty_site_url">Please enter a site address</string>
<string name="login_invalid_site_url">The site address you entered is invalid. Please re-enter it.</string>
<string name="login_empty_username">Please enter a username</string>
<string name="login_empty_password">Please enter a password</string>
<string name="login_empty_2fa">Please enter a verification code</string>
Expand Down Expand Up @@ -89,8 +90,7 @@
<string name="logging_in">Logging in</string>
<string name="forgot_password">Lost your password?</string>
<string name="error_generic">An error occurred</string>
<string name="no_site_error">Couldn\'t connect to the WordPress site. There is no valid WordPress site at this
address. Check the site address (URL) you entered.</string>
<string name="no_site_error">The site at this address is not a WordPress site. For us to connect to it, the site must use WordPress.</string>
<string name="invalid_site_url_message">Check that the site URL entered is valid</string>
<string name="xmlrpc_missing_method_error">Couldn\'t connect. Required XML-RPC methods are missing on the server.</string>
<string name="xmlrpc_post_blocked_error">Couldn\'t connect. Your host is blocking POST requests, and the app needs
Expand Down

0 comments on commit 4979eaa

Please sign in to comment.