Conversation
…droid into issue/5801-simple-payments-link
…droid into issue/5801-simple-payments-link Conflicts: WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/simplepayments/TakePaymentFragment.kt WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/simplepayments/TakePaymentViewModel.kt
…droid into issue/5801-simple-payments-link
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
...rce/src/main/kotlin/com/woocommerce/android/ui/orders/simplepayments/TakePaymentViewModel.kt
Outdated
Show resolved
Hide resolved
|
You can test the changes on this Pull Request by downloading an installable build, or scanning this QR code: |
Codecov Report
@@ Coverage Diff @@
## trunk #6241 +/- ##
============================================
+ Coverage 0 24.45% +24.45%
- Complexity 0 2554 +2554
============================================
Files 0 787 +787
Lines 0 45250 +45250
Branches 0 5676 +5676
============================================
+ Hits 0 11066 +11066
- Misses 0 33161 +33161
- Partials 0 1023 +1023
Continue to review full report at Codecov.
|
…droid into issue/5801-simple-payments-link Conflicts: WooCommerce/src/main/kotlin/com/woocommerce/android/ui/inbox/domain/InboxRepository.kt build.gradle
|
Found 1 violations: The PR caused the following dependency changes:expand
-+--- org.wordpress:fluxc:trunk-91ee60846f10b9689cd1162ccffd26313b093fd0
-| +--- org.wordpress:wellsql:1.7.0
-| | \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
-| +--- org.wordpress.fluxc:fluxc-annotations:trunk-91ee60846f10b9689cd1162ccffd26313b093fd0
-| +--- org.greenrobot:eventbus:3.3.1 (*)
-| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
-| +--- com.android.volley:volley:1.1.1 -> 1.2.0
-| +--- androidx.paging:paging-runtime:2.1.2
-| | +--- androidx.paging:paging-common:2.1.2
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
-| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.0 (*)
-| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.4.0 (*)
-| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
-| +--- com.goterl:lazysodium-android:5.0.2
-| +--- net.java.dev.jna:jna:5.5.0
-| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
-| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
-| +--- androidx.appcompat:appcompat:1.0.2 -> 1.4.1 (*)
-| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
-| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.2.0
-| | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
-| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
-| | +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.10 (*)
-| +--- com.google.code.gson:gson:2.8.5 -> 2.8.9
-| +--- org.apache.commons:commons-text:1.1 -> 1.8 (*)
-| +--- androidx.room:room-runtime:2.4.2
-| | +--- androidx.room:room-common:2.4.2
-| | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
-| | +--- androidx.sqlite:sqlite-framework:2.2.0
-| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | | \--- androidx.sqlite:sqlite:2.2.0
-| | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0
-| | +--- androidx.sqlite:sqlite:2.2.0 (*)
-| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
-| | \--- androidx.annotation:annotation-experimental:1.1.0
-| +--- androidx.room:room-ktx:2.4.2
-| | +--- androidx.room:room-common:2.4.2 (*)
-| | +--- androidx.room:room-runtime:2.4.2 (*)
-| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
-| +--- com.google.dagger:dagger:2.29.1 -> 2.40.5
-| | \--- javax.inject:javax.inject:1
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
++--- org.wordpress:fluxc:trunk-884c546e3c2cdca6e743b3439082c42c5aa81b85
+| +--- org.wordpress:wellsql:1.7.0
+| | \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
+| +--- org.wordpress.fluxc:fluxc-annotations:trunk-884c546e3c2cdca6e743b3439082c42c5aa81b85
+| +--- org.greenrobot:eventbus:3.3.1 (*)
+| +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
+| +--- com.android.volley:volley:1.1.1 -> 1.2.0
+| +--- androidx.paging:paging-runtime:2.1.2
+| | +--- androidx.paging:paging-common:2.1.2
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | | \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
+| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.0 (*)
+| | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.4.0 (*)
+| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+| +--- com.goterl:lazysodium-android:5.0.2
+| +--- net.java.dev.jna:jna:5.5.0
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
+| +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
+| +--- androidx.appcompat:appcompat:1.0.2 -> 1.4.1 (*)
+| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+| +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.2.0
+| | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
+| +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
+| | +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.10 (*)
+| +--- com.google.code.gson:gson:2.8.5 -> 2.8.9
+| +--- org.apache.commons:commons-text:1.1 -> 1.8 (*)
+| +--- androidx.room:room-runtime:2.4.2
+| | +--- androidx.room:room-common:2.4.2
+| | | \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
+| | +--- androidx.sqlite:sqlite-framework:2.2.0
+| | | +--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | | \--- androidx.sqlite:sqlite:2.2.0
+| | | \--- androidx.annotation:annotation:1.0.0 -> 1.3.0
+| | +--- androidx.sqlite:sqlite:2.2.0 (*)
+| | +--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
+| | \--- androidx.annotation:annotation-experimental:1.1.0
+| +--- androidx.room:room-ktx:2.4.2
+| | +--- androidx.room:room-common:2.4.2 (*)
+| | +--- androidx.room:room-runtime:2.4.2 (*)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+| +--- com.google.dagger:dagger:2.29.1 -> 2.40.5
+| | \--- javax.inject:javax.inject:1
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
-\--- org.wordpress.fluxc.plugins:woocommerce:trunk-91ee60846f10b9689cd1162ccffd26313b093fd0
- +--- org.wordpress:wellsql:1.7.0 (*)
- +--- org.wordpress.fluxc:fluxc-annotations:trunk-91ee60846f10b9689cd1162ccffd26313b093fd0
- +--- androidx.room:room-ktx:2.4.2 (*)
- +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
- +--- org.wordpress:fluxc:trunk-91ee60846f10b9689cd1162ccffd26313b093fd0 (*)
- +--- org.apache.commons:commons-lang3:3.7 -> 3.9
- +--- com.google.code.gson:gson:2.8.0 -> 2.8.9
- +--- com.google.dagger:dagger:2.29.1 -> 2.40.5 (*)
- +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
- +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
- \--- androidx.room:room-runtime:2.4.2 (*)
+\--- org.wordpress.fluxc.plugins:woocommerce:trunk-884c546e3c2cdca6e743b3439082c42c5aa81b85
+ +--- org.wordpress:wellsql:1.7.0 (*)
+ +--- org.wordpress.fluxc:fluxc-annotations:trunk-884c546e3c2cdca6e743b3439082c42c5aa81b85
+ +--- androidx.room:room-ktx:2.4.2 (*)
+ +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
+ +--- org.wordpress:fluxc:trunk-884c546e3c2cdca6e743b3439082c42c5aa81b85 (*)
+ +--- org.apache.commons:commons-lang3:3.7 -> 3.9
+ +--- com.google.code.gson:gson:2.8.0 -> 2.8.9
+ +--- com.google.dagger:dagger:2.29.1 -> 2.40.5 (*)
+ +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
+ +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
+ \--- androidx.room:room-runtime:2.4.2 (*)
Please review and act accordingly
|
wzieba
left a comment
There was a problem hiding this comment.
👋 Works good but I think we can simplify things by removing ViewState, WDYT?
And I've noticed that navigating back from the share screen puts the user to the list of orders - maybe we should navigate back to "take payment options" instead?
Screen.Recording.2022-04-14.at.12.13.06.mov
| ) : ScopedViewModel(savedState) { | ||
| private val navArgs: TakePaymentFragmentArgs by savedState.navArgs() | ||
|
|
||
| val viewStateLiveData = LiveDataDelegate(savedState, ViewState()) |
There was a problem hiding this comment.
🔧 WDYT about not introducing observable ViewState and just take needed value from val order?
order is not a subject to change on this screen - when selected, we don't have to observe for any changes. Using order#paymentUrl directly in fragment's onCreateView will simplify this ViewModel.
| private val navArgs: TakePaymentFragmentArgs by savedState.navArgs() | ||
|
|
||
| val viewStateLiveData = LiveDataDelegate(savedState, ViewState()) | ||
| internal var viewState by viewStateLiveData |
There was a problem hiding this comment.
🔧 internal is not very useful here, probably private is the fit
| internal var viewState by viewStateLiveData | |
| private var viewState by viewStateLiveData |
…droid into issue/5801-simple-payments-link
Generated by 🚫 dangerJS |
|
@wzieba Thanks for the review! I've made the suggested changes, except for navigating back to the "take payment" screen when the user backs out of the share sheet. I initially had it only leave that fragment when So the choice was to either always return to the order list, or always return to "Take payment," and I opted for the former. |
|
I see, it works really strange also with e.g. Facebook Messenger 🤷 . After sharing I had to navigate back and the result was Looks good, CI is failing but only CircleCI and it's not related to this PR (p1649933536095639-slack-CC7L49W13).
|
wzieba
left a comment
There was a problem hiding this comment.
Thanks for adding improvements!
|
Oh I see that CircleCI is |
Closes #5801 - adds a "Share payment link" row to the simple payment flow to enable users to easily share the link to taking payment. Note that this requires WooCommerce 6.4 for testing since the
payment_urlfield wasn't available until that version.This means either using the WooCommerce beta tester plugin to install the latest 6.4 RC, or downloading the RC from here and uploading it manually.
To test:
payment-link.mp4