Skip to content

Commit 9557832

Browse files
author
Alejo
committed
Merge remote-tracking branch 'origin/trunk' into issue/10666-see-report-hub
2 parents 126ac22 + b3bc3e9 commit 9557832

File tree

90 files changed

+2165
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2165
-1001
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!--
22
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
33
-->
4+
## 17.2
5+
This version includes optimizations for speed and reliability. We are committed to continuously improving the app, making managing your online store more efficient and hassle-free.
6+
47
## 17.1
58
This release focuses on bug fixes and improvements to help you get your business started. Keep your feedback rolling in; it helps us figure out what to work on next.
69

RELEASE-NOTES.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
2+
3+
17.3
4+
-----
5+
6+
7+
17.3
8+
-----
9+
- [*] [Internal] Enhanced user experience in shipping label creation with automatic scrolling to the first invalid field upon form submission failure [https://github.com/woocommerce/woocommerce-android/pull/10657]
10+
17.2
11+
-----
12+
- [**] [Available for users with WooCommerce version of 8.7+, which is not released yet] Every order have a receipt now. The receipts can be shared via many apps installed on the phone [https://github.com/woocommerce/woocommerce-android/pull/10650]
13+
214
17.1
315
-----
416
- [*] [Internal] Fixed crash when going to background from the order creation screen [https://github.com/woocommerce/woocommerce-android/pull/10600]

WooCommerce/metadata/PlayStoreStrings.pot

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ msgstr ""
1111
"Project-Id-Version: Release Notes & Play Store Descriptions\n"
1212

1313
#. translators: Release notes for this version to be displayed in the Play Store. Limit to 500 characters including spaces and commas!
14-
msgctxt "release_note_171"
14+
msgctxt "release_note_172"
1515
msgid ""
16-
"17.1:\n"
17-
"This release focuses on bug fixes and improvements to help you get your business started. Keep your feedback rolling in; it helps us figure out what to work on next.\n"
16+
"17.2:\n"
17+
"This version includes optimizations for speed and reliability. We are committed to continuously improving the app, making managing your online store more efficient and hassle-free.\n"
1818
msgstr ""
1919

20-
msgctxt "release_note_170"
20+
msgctxt "release_note_171"
2121
msgid ""
22-
"17.0:\n"
23-
"Get ready for a smoother experience with our latest update! We've ironed out the pesky bug that kept gift cards from showing up in the 'totals' section during order creation and editing. Managing your sales with our WooCommerce app is now more seamless than ever. Update now and enjoy the hassle-free enhancements!\n"
22+
"17.1:\n"
23+
"This release focuses on bug fixes and improvements to help you get your business started. Keep your feedback rolling in; it helps us figure out what to work on next.\n"
2424
msgstr ""
2525

2626
#. translators: Short description of the app to be displayed in the Play Store. Limit to 80 characters including spaces and commas!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This release focuses on bug fixes and improvements to help you get your business started. Keep your feedback rolling in; it helps us figure out what to work on next.
1+
This version includes optimizations for speed and reliability. We are committed to continuously improving the app, making managing your online store more efficient and hassle-free.

WooCommerce/src/main/kotlin/com/woocommerce/android/analytics/AnalyticsEvent.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ enum class AnalyticsEvent(val siteless: Boolean = false) {
456456
RECEIPT_PRINT_CANCELED,
457457
RECEIPT_PRINT_SUCCESS,
458458
RECEIPT_VIEW_TAPPED,
459+
RECEIPT_URL_FETCHING_FAILS,
459460

460461
// -- Top-level navigation
461462
MAIN_MENU_SETTINGS_TAPPED,

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/appwidgets/stats/GetWidgetStats.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class GetWidgetStats @Inject constructor(
3535
// If siteModel is null, exit the function with WidgetStatsFailure
3636
siteModel == null -> WidgetStatsResult.WidgetStatsFailure("No site selected")
3737
else -> {
38-
// Fetch stats, always force to refresh data
3938
val areVisitorStatsSupported = siteModel.connectionType == SiteConnectionType.Jetpack
4039

40+
// Fetch stats, always force to refresh data.
4141
val fetchedStats = statsRepository.fetchStats(
4242
granularity = granularity,
4343
forced = true,
@@ -47,7 +47,7 @@ class GetWidgetStats @Inject constructor(
4747
if (fetchedStats.isError) {
4848
WidgetStatsResult.WidgetStatsFailure(fetchedStats.error.message)
4949
} else {
50-
WidgetStatsResult.WidgetStats(fetchedStats.model!!, areVisitorStatsSupported)
50+
WidgetStatsResult.WidgetStats(fetchedStats.model!!)
5151
}
5252
}
5353
}
@@ -62,15 +62,13 @@ class GetWidgetStats @Inject constructor(
6262
data class WidgetStats(
6363
private val revenueModel: WCRevenueStatsModel?,
6464
private val visitorsMap: Map<String, Int>?,
65-
val currencyCode: String,
66-
val areVisitorStatsSupported: Boolean
65+
val currencyCode: String
6766
) : WidgetStatsResult() {
6867
constructor(
6968
stats: StatsRepository.SiteStats,
70-
areVisitorStatsSupported: Boolean
71-
) : this(stats.revenue, stats.visitors, stats.currencyCode, areVisitorStatsSupported)
69+
) : this(stats.revenue, stats.visitors, stats.currencyCode)
7270

73-
val visitorsTotal: Int
71+
val visitorsTotal: Int?
7472
val ordersTotal: Int
7573
val revenueGross: Double
7674

@@ -82,7 +80,7 @@ class GetWidgetStats @Inject constructor(
8280
orderCount = total.ordersCount ?: 0
8381
}
8482

85-
visitorsTotal = visitorsMap?.values?.sum() ?: 0
83+
visitorsTotal = visitorsMap?.values?.sum()
8684
ordersTotal = orderCount
8785
revenueGross = grossRevenue
8886
}

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/appwidgets/stats/today/TodayStatsWidgetUIHelper.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ class TodayStatsWidgetUIHelper @Inject constructor(
6767

6868
remoteViews.setTextViewText(R.id.widget_revenue_value, revenue)
6969
remoteViews.setTextViewText(R.id.widget_orders_value, stats.ordersTotal.toString())
70-
remoteViews.setTextViewText(R.id.widget_visitors_value, stats.visitorsTotal.toString())
71-
70+
stats.visitorsTotal?.let {
71+
remoteViews.setTextViewText(R.id.widget_visitors_value, it.toString())
72+
}
7273
remoteViews.setViewVisibility(R.id.widget_revenue_value, View.VISIBLE)
7374
remoteViews.setViewVisibility(R.id.widget_revenue_skeleton, View.INVISIBLE)
7475

@@ -80,11 +81,11 @@ class TodayStatsWidgetUIHelper @Inject constructor(
8081

8182
remoteViews.setViewVisibility(
8283
R.id.widget_visitors_title,
83-
if (stats.areVisitorStatsSupported) View.VISIBLE else View.GONE
84+
if (stats.visitorsTotal != null) View.VISIBLE else View.GONE
8485
)
8586
remoteViews.setViewVisibility(
8687
R.id.widget_visitors_value,
87-
if (stats.areVisitorStatsSupported) View.VISIBLE else View.GONE
88+
if (stats.visitorsTotal != null) View.VISIBLE else View.GONE
8889
)
8990

9091
remoteViews.setTextViewText(

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/mystore/data/StatsRepository.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ class StatsRepository @Inject constructor(
285285
}
286286
}
287287

288+
/**
289+
* This function will return the site stats optional including visitor stats.
290+
* Even if the includeVisitorStats flag is set to true, errors fetching visitor
291+
* will be handled as null and only errors fetching the revenue stats will be processed.
292+
*/
288293
suspend fun fetchStats(
289294
granularity: StatsGranularity,
290295
forced: Boolean,
@@ -314,7 +319,10 @@ class StatsRepository @Inject constructor(
314319
val revenueStats = fetchRevenueStats.await()
315320
val siteCurrencyCode = wooCommerceStore.getSiteSettings(site)?.currencyCode.orEmpty()
316321

317-
return@coroutineScope if (visitorStats.isError || revenueStats.isError) {
322+
// If there was an error fetching the visitor stats chances are that is because
323+
// jetpack is not properly configure to return stats. So we take into account
324+
// only revenue stats to return process the error response.
325+
return@coroutineScope if (revenueStats.isError) {
318326
val error = WooError(
319327
type = WooErrorType.GENERIC_ERROR,
320328
original = BaseRequest.GenericErrorType.UNKNOWN,

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailTracker.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import com.woocommerce.android.analytics.AnalyticsEvent
44
import com.woocommerce.android.analytics.AnalyticsTracker
55
import com.woocommerce.android.analytics.AnalyticsTrackerWrapper
66
import com.woocommerce.android.model.Order
7+
import com.woocommerce.android.ui.payments.tracking.PaymentsFlowTracker
78
import org.wordpress.android.fluxc.store.WCOrderStore
89
import javax.inject.Inject
910

1011
class OrderDetailTracker @Inject constructor(
11-
private val trackerWrapper: AnalyticsTrackerWrapper
12+
private val trackerWrapper: AnalyticsTrackerWrapper,
13+
private val paymentsFlowTracker: PaymentsFlowTracker,
1214
) {
1315
fun trackCustomFieldsTapped() {
1416
trackerWrapper.track(AnalyticsEvent.ORDER_VIEW_CUSTOM_FIELDS_TAPPED)
@@ -24,9 +26,8 @@ class OrderDetailTracker @Inject constructor(
2426
)
2527
}
2628

27-
fun trackReceiptViewTapped(orderId: Long, orderStatus: Order.Status) {
28-
trackerWrapper.track(
29-
AnalyticsEvent.RECEIPT_VIEW_TAPPED,
29+
suspend fun trackReceiptViewTapped(orderId: Long, orderStatus: Order.Status) {
30+
paymentsFlowTracker.trackReceiptViewTapped(
3031
mapOf(
3132
AnalyticsTracker.KEY_ORDER_ID to orderId,
3233
AnalyticsTracker.KEY_STATUS to orderStatus

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/details/OrderDetailViewModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ class OrderDetailViewModel @Inject constructor(
369369
if (receiptResult.isSuccess) {
370370
triggerEvent(PreviewReceipt(order.billingAddress.email, receiptResult.getOrThrow(), order.id))
371371
} else {
372+
paymentsFlowTracker.trackReceiptUrlFetchingFails(
373+
errorDescription = receiptResult.exceptionOrNull()?.message ?: "Unknown error",
374+
)
372375
triggerEvent(ShowSnackbar(string.receipt_fetching_error))
373376
}
374377
}

0 commit comments

Comments
 (0)