Skip to content

Commit 97913ff

Browse files
committed
Merge branch 'trunk' into woomob-1648-woo-posapp-listings-add-a-tablet-to-the-ci-configuration-to
2 parents 5a6179e + b8da934 commit 97913ff

File tree

155 files changed

+6905
-2782
lines changed

Some content is hidden

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

155 files changed

+6905
-2782
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+
## 23.7
5+
Selling in-person just got faster! We've supercharged Woo POS with lightning-fast product search, instant barcode scanning, and near-instant loading. Your in-store experience is now smoother than ever.
6+
47
## 23.6
58
Did you give Woo POS a try? It’s now even better because you can view orders right inside it. What else? Interac refunds are smoother, filters and buttons got a fresh look, and tablet UI got better. Customer data quirks? Fixed. Selling in-person? Try out Woo Point Of Sale.
69

RELEASE-NOTES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
22
*** Use [*****] to indicate smoke tests of all critical flows should be run on the final APK before release (e.g. major library or targetSdk updates).
33
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
4+
5+
23.8
6+
-----
7+
- [Internal][Woo POS] Improve detection and handling of deleted products during checkout [https://github.com/woocommerce/woocommerce-android/pull/14981]
8+
49
23.7
510
-----
611
- [Internal][Woo POS] Survey for potential and current users of the POS delivered via local push notification. [https://github.com/woocommerce/woocommerce-android/pull/14751]
712
- [Internal] Handle BLUETOOTH_PEER_REMOVED_PAIRING_INFORMATION disconnect reason from Stripe SDK [https://github.com/woocommerce/woocommerce-android/pull/14886]
13+
- [**] Faster POS performance - search, barcode scanning, and loading are now nearly instant. [https://github.com/woocommerce/woocommerce-android/pull/14926]
814

915
23.6
1016
-----

WooCommerce-Wear/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,16 @@ static def loadPropertiesFromFile(inputFile) {
219219
}
220220
return properties
221221
}
222+
223+
dependencyAnalysis {
224+
issues {
225+
onUnusedDependencies {
226+
// This dependency is actually needed otherwise the app will crash with a runtime exception.
227+
exclude(libs.androidx.hilt.navigation.compose.get().module.toString())
228+
// This dependency is actually needed otherwise the app will crash with a runtime exception.
229+
exclude(libs.androidx.preference.ktx.get().module.toString())
230+
// This dependency is actually needed otherwise the app will crash with a runtime exception.
231+
exclude(libs.androidx.work.runtime.ktx.get().module.toString())
232+
}
233+
}
234+
}

WooCommerce/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ fladle {
2626
devices = [
2727
["model": "MediumPhone.arm", "version": "35"]
2828
]
29+
30+
additionalTestApks = [
31+
"- test: ${rootProject.projectDir}/libs/fluxc-plugin/build/outputs/apk/androidTest/debug/fluxc-plugin-debug-androidTest.apk".toString()
32+
]
2933
localResultsDir = "$rootDir/build/instrumented-tests"
3034

3135
useOrchestrator = true
@@ -514,4 +518,19 @@ def isLeakCanaryEnabled() {
514518
return developerProperties.get("enable_leak_canary") ?: true
515519
}
516520

521+
dependencyAnalysis {
522+
issues {
523+
onUnusedDependencies {
524+
// This dependency is actually needed otherwise UI tests will crash with a runtime exception.
525+
exclude(libs.apache.http.client.android.get().module.toString())
526+
// This dependency is actually needed otherwise it will cause the app to fail to build.
527+
exclude(libs.androidx.hilt.navigation.compose.get().module.toString())
528+
// This dependency is actually needed otherwise it will cause the app to fail to build.
529+
exclude(libs.androidx.work.runtime.ktx.get().module.toString())
530+
// This dependency is actually needed otherwise it will cause the app to fail to build.
531+
exclude(libs.google.protobuf.kotlinlite.get().module.toString())
532+
}
533+
}
534+
}
535+
517536
apply from: '../config/gradle/build_optimization.gradle'
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"request": {
3+
"method": "GET",
4+
"urlPathPattern": "/rest/v1.1/jetpack-blogs/161477129/rest-api/",
5+
"queryParameters": {
6+
"json": {
7+
"equalTo": "true"
8+
},
9+
"path": {
10+
"matches": "/wc-analytics/reports/products/(.*)"
11+
},
12+
"locale": {
13+
"matches": "(.*)"
14+
}
15+
}
16+
},
17+
"response": {
18+
"status": 200,
19+
"jsonBody": {
20+
"data": [
21+
{
22+
"product_id": 2129,
23+
"items_sold": 1,
24+
"net_revenue": 110.00,
25+
"orders_count": 1,
26+
"extended_info": {
27+
"name": "Akoya Pearl shades",
28+
"sku": "",
29+
"image": "https://i0.wp.com/automatticwidgets.wpcomstaging.com/wp-content/uploads/2020/01/Mask-Group-2.png",
30+
"permalink": "https://automatticwidgets.wpcomstaging.com/product/akoya-pearl-shades/"
31+
}
32+
},
33+
{
34+
"product_id": 2131,
35+
"items_sold": 1,
36+
"net_revenue": 100.00,
37+
"orders_count": 1,
38+
"extended_info": {
39+
"name": "Colorado shades",
40+
"sku": "",
41+
"image": "https://i0.wp.com/automatticwidgets.wpcomstaging.com/wp-content/uploads/2020/01/Mask-Group-4.png",
42+
"permalink": "https://automatticwidgets.wpcomstaging.com/product/colorado-shades/"
43+
}
44+
}
45+
]
46+
},
47+
"headers": {
48+
"Content-Type": "application/json",
49+
"Connection": "keep-alive"
50+
}
51+
}
52+
}

WooCommerce/src/main/kotlin/com/woocommerce/android/AppPrefs.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ object AppPrefs {
135135
BLAZE_CAMPAIGN_SELECTED_OBJECTIVE,
136136
BLAZE_CAMPAIGN_OBJECTIVE_SWITCH_CHECKED,
137137
IS_SITE_WPCOM_SUSPENDED,
138-
JETPACK_APP_PASSWORDS_ENABLED
138+
JETPACK_APP_PASSWORDS_ENABLED,
139+
WOO_POS_LOCAL_CATALOG_ENABLED
139140
}
140141

141142
/**
@@ -310,6 +311,10 @@ object AppPrefs {
310311
get() = getBoolean(DeletablePrefKey.JETPACK_APP_PASSWORDS_ENABLED, true)
311312
set(value) = setBoolean(DeletablePrefKey.JETPACK_APP_PASSWORDS_ENABLED, value)
312313

314+
var wooPosLocalCatalogEnabled: Boolean
315+
get() = getBoolean(DeletablePrefKey.WOO_POS_LOCAL_CATALOG_ENABLED, true)
316+
set(value) = setBoolean(DeletablePrefKey.WOO_POS_LOCAL_CATALOG_ENABLED, value)
317+
313318
var isWooPosSurveyNotificationCurrentUserShown: Boolean
314319
get() = getBoolean(UndeletablePrefKey.WOO_POS_SURVEY_NOTIFICATION_CURRENT_USER_SHOWN, false)
315320
set(value) = setBoolean(UndeletablePrefKey.WOO_POS_SURVEY_NOTIFICATION_CURRENT_USER_SHOWN, value)

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/BookingMapper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class BookingMapper @Inject constructor(
134134
BookingEntity.AttendanceStatus.Booked -> BookingAttendanceStatus.Booked
135135
BookingEntity.AttendanceStatus.CheckedIn -> BookingAttendanceStatus.CheckedIn
136136
BookingEntity.AttendanceStatus.NoShow -> BookingAttendanceStatus.NoShow
137+
BookingEntity.AttendanceStatus.Cancelled -> BookingAttendanceStatus.Cancelled
137138
is BookingEntity.AttendanceStatus.Unknown -> null
138139
}
139140

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/BookingsRepository.kt

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import kotlinx.coroutines.CoroutineScope
77
import kotlinx.coroutines.async
88
import kotlinx.coroutines.flow.Flow
99
import kotlinx.coroutines.flow.flowOf
10+
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingFilters
1011
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingUpdatePayload
11-
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingsFilterOption
1212
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingsOrderOption
1313
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingsStore
1414
import org.wordpress.android.fluxc.persistence.entity.BookingEntity
@@ -24,7 +24,7 @@ class BookingsRepository @Inject constructor(
2424
page: Int,
2525
perPage: Int,
2626
query: String? = null,
27-
filters: List<BookingsFilterOption> = emptyList(),
27+
filters: BookingFilters? = null,
2828
order: BookingsOrderOption
2929
): Result<FetchResult> {
3030
val result = bookingsStore.fetchBookings(
@@ -51,7 +51,7 @@ class BookingsRepository @Inject constructor(
5151

5252
fun observeBookings(
5353
limit: Int? = null,
54-
filters: List<BookingsFilterOption> = emptyList(),
54+
filters: BookingFilters? = null,
5555
order: BookingsOrderOption
5656
): Flow<List<Booking>> =
5757
bookingsStore.observeBookings(
@@ -61,6 +61,8 @@ class BookingsRepository @Inject constructor(
6161
order = order
6262
)
6363

64+
fun observeBookingsCount(): Flow<Long> = bookingsStore.observeBookingCount(site = selectedSite.get())
65+
6466
fun observeBooking(bookingId: Long): Flow<Booking?> =
6567
bookingsStore.observeBooking(
6668
site = selectedSite.get(),
@@ -88,6 +90,19 @@ class BookingsRepository @Inject constructor(
8890
}
8991
}
9092

93+
suspend fun fetchResources(): Result<Unit> {
94+
val result = bookingsStore.fetchResources(site = selectedSite.get())
95+
return if (result.isError) {
96+
Result.failure(WooException(result.error))
97+
} else {
98+
Result.success(Unit)
99+
}
100+
}
101+
102+
suspend fun getResource(
103+
resourceId: Long
104+
): BookingResource? = bookingsStore.getResource(site = selectedSite.get(), resourceId = resourceId)
105+
91106
suspend fun fetchResource(
92107
resourceId: Long
93108
): Result<Unit> {
@@ -113,6 +128,9 @@ class BookingsRepository @Inject constructor(
113128
}
114129
}
115130

131+
fun observeResources(): Flow<List<BookingResource>> =
132+
bookingsStore.observeResources(site = selectedSite.get())
133+
116134
suspend fun updateAttendanceStatus(
117135
bookingId: Long,
118136
attendanceStatus: BookingEntity.AttendanceStatus,

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingAppointmentDetails.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private fun AppointmentDetailsRow(
115115
.fillMaxWidth()
116116
.padding(horizontal = 16.dp, vertical = 12.dp)
117117
) {
118-
BookingDetailsLabel(label)
118+
BookingLabel(label)
119119
Box(Modifier.padding(start = 8.dp)) {
120120
value()
121121
}

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingAttendanceSection.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private fun AttendanceRow(
8282
.fillMaxWidth()
8383
.padding(horizontal = 16.dp, vertical = 12.dp)
8484
) {
85-
BookingDetailsLabel(label)
85+
BookingLabel(label)
8686
when (attendanceUpdateStatus) {
8787
AttendanceUpdateStatus.InProgress -> {
8888
SkeletonView(

0 commit comments

Comments
 (0)