-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Jetpack REST connection log into wp.com #22115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Added shell for JetpackConnectionViewModel * Added shell for JetpackConnectionScreen * Fleshed out JetpackConnectionScreen * Minor tweaks * Added canInitiateJetpackConnection * Updated comment * Renamed const * Removed wpApiClient * Added activity shell * Added activity to manifest * Handle close * Pass states rather than the view model * Pass states rather than the view model,p2 * Dummy code to simulate login * Dummy code to simulate login, p2 * Added done button * Animate Done button, added Failed status * Use light MaterialTheme.colorScheme.error color background for failed steps * Animate changes to ConnectionStepItem * Added startNextStep * Added startNextStep, p2 * Added startNextStep, p3 * Fixed UI testing * Fixed UI testing, p2 * Changed color for completed and in-progress cards * Changed color for completed and in-progress cards again * Removed elevation and changed card to column * First pass at Retry * Second pass at Retry * Third pass at Retry * Added error states * Combined states * Fixed Detekt errors * Replaced hard-coded hex color values * Minor formatting changes * Minor formatting changes, p2 * Minor formatting changes, p3 * Updated preview to use JetpackConnectionScreen * Simplified ConnectionStepItem * Moved Screen to ScreenWithTopAppBarM3 * Added modifier * Changed two icons * Fix the done/retry button to the bottom * Removed the heading and changed the screen title * Increase elevation of in-progress step, remove elevation animation * First pass at confirming cancellation * Second pass at confirming cancellation * Fixed detekt warnings * Fixed detekt warnings * Changed fun name * Fixed isActive check * Use ErrorEvent instead of a string * Fixed new Detekt warnings * Renamed variable * Retry starts at the failed step * Moved getNextStep to its own fun * Simplified retrying from step * Added optional message to ErrorType * Updated wp.com error message * Moved color constants to color resources * Use existing color resources for in-progress step * Don't use !! for selected site * Replaced throwing exception with error() to resolve Detekt warning * Simplified JetpackConnectionViewModel * Simplified JetpackConnectionScreen * Simplified JetpackConnectionActivity
* Rely on isUsingSelfHostedRestApi to determine whether we can use the new JP REST connection * Removed starting the flow from the main activity * Launch the new flow from stats if available * Simplified canInitiateJetpackConnection * Renamed feature to Experimental Jetpack *REST* Connection to avoid confusion with existing web-based flow * Fixed Detekt line length warnings * Add "Simulated" to screen title to make it clear there's nothing happening * Renamed experimental key
…-Android into feature/jp-rest-connect-wpcom Conflicts: WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionActivity.kt WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionScreen.kt WordPress/src/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt WordPress/src/main/res/values/strings.xml
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the first step of the Jetpack REST connection flow by adding WordPress.com login functionality. It introduces a new login mode specifically for the Jetpack REST connection process and updates the UI to handle login flow completion.
Key changes:
- Adds
JETPACK_REST_CONNECT
login mode to support the new flow - Implements WordPress.com login step in the connection process
- Updates error handling to distinguish between login and connection failures
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
LoginMode.java | Adds new JETPACK_REST_CONNECT enum value for the login mode |
strings.xml | Splits generic connection error into specific login and connection error messages |
JetpackRestConnectionViewModel.kt | Implements WordPress.com login step with proper state management and error handling |
JetpackRestConnectionScreen.kt | Updates UI to show error messages instead of status text when failures occur |
JetpackRestConnectionActivity.kt | Handles login activity result and integrates with the connection flow |
LoginActivity.java | Adds support for the new login mode with appropriate result handling |
ActivityLauncher.java | Provides utility method to launch WordPress.com login for Jetpack REST connection |
...c/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt
Outdated
Show resolved
Hide resolved
...c/main/java/org/wordpress/android/ui/jetpackrestconnection/JetpackRestConnectionViewModel.kt
Show resolved
Hide resolved
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22115-efc81fb | |
Commit | efc81fb | |
Direct Download | wordpress-prototype-build-pr22115-efc81fb.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22115-efc81fb | |
Commit | efc81fb | |
Direct Download | jetpack-prototype-build-pr22115-efc81fb.apk |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #22115 +/- ##
=======================================
Coverage 39.43% 39.43%
=======================================
Files 2149 2149
Lines 101872 101872
Branches 15604 15604
=======================================
Hits 40177 40177
Misses 58126 58126
Partials 3569 3569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
private var _isWaitingForWPComLogin = false | ||
val isWaitingForWPComLogin: Boolean | ||
get() = _isWaitingForWPComLogin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ How come using a getter form an internal variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that! I'm assuming that change was made by Claude and I somehow missed it. Resolved in efc81fb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works as expected!
|
This PR provides the first step of the Jetpack REST connection flow, which is to log into WordPress.com.
To test
Keep in mind that the remaining steps are simulated at this point.