Skip to content

Commit 763ea79

Browse files
Merge remote-tracking branch 'origin/trunk' into issue/WOOMOB-1389_customer_bug
2 parents bf65b00 + 501dbce commit 763ea79

File tree

44 files changed

+796
-437
lines changed

Some content is hidden

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

44 files changed

+796
-437
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ updates:
3636
- dependency-name: "com.fasterxml.jackson.core:jackson-databind"
3737
- dependency-name: "com.jayway.jsonpath:json-path"
3838
- dependency-name: "commons-fileupload:commons-fileupload"
39+
- dependency-name: "org.wordpress:wellsql"
40+
- dependency-name: "org.wordpress.wellsql:wellsql-processor"

RELEASE-NOTES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
- [Internal] Update In-Person Payments setup flow to use Authenticated WebView [https://github.com/woocommerce/woocommerce-android/pull/14827]
88
- [*] Improved the Filters button colors on the Orders and Products screens [https://github.com/woocommerce/woocommerce-android/pull/14832]
99
- [*] Fixed an issue with inconsistent data on the Customers screen [https://github.com/woocommerce/woocommerce-android/pull/14839]
10+
- [*] Fixed an issue when images for the card reader flows were not shown on tablets [https://github.com/woocommerce/woocommerce-android/pull/14849]
11+
- [*] Fixed an issue where the count of the filters applied to the orders was not updated correctly [https://github.com/woocommerce/woocommerce-android/pull/14844]
1012

1113
23.5
1214
-----
1315
- [Internal][Wear] Remove unused dependencies and optimize dependency scopes [https://github.com/woocommerce/woocommerce-android/pull/14710]
1416
- [Internal] Remove unused dependencies and optimize dependency scopes [https://github.com/woocommerce/woocommerce-android/pull/14710]
17+
- [Internal][Wear] Override Horologist’s transitive protolayout-expression dependency to fix known issues [https://github.com/woocommerce/woocommerce-android/pull/14797]
1518
- [*] Fix a rare crash in order refund flow [https://github.com/woocommerce/woocommerce-android/pull/14742]
1619
- [*] Fix customer name display when filtering orders from order details [https://github.com/woocommerce/woocommerce-android/pull/14761]
1720
- [*] Fixed a rare media upload error [https://github.com/woocommerce/woocommerce-android/pull/14813]

WooCommerce-Wear/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ dependencies {
191191
exclude group: 'com.android.support', module: 'support-annotations'
192192
exclude group: 'com.android.support', module: 'support-core-utils'
193193
}
194+
195+
constraints {
196+
implementation(libs.androidx.wear.protolayout.expression) {
197+
because("Horologist 0.7.15 uses Wear ProtoLayout 1.0.0-beta01, which has known issues.")
198+
}
199+
}
194200
}
195201

196202
android.buildTypes.all { buildType ->

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

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@ import android.content.res.Configuration
44
import androidx.compose.foundation.background
55
import androidx.compose.foundation.layout.Arrangement
66
import androidx.compose.foundation.layout.Column
7-
import androidx.compose.foundation.layout.FlowRow
87
import androidx.compose.foundation.layout.Row
8+
import androidx.compose.foundation.layout.Spacer
99
import androidx.compose.foundation.layout.fillMaxWidth
10+
import androidx.compose.foundation.layout.height
1011
import androidx.compose.foundation.layout.padding
12+
import androidx.compose.foundation.layout.size
1113
import androidx.compose.material3.MaterialTheme
1214
import androidx.compose.material3.Text
1315
import androidx.compose.runtime.Composable
14-
import androidx.compose.ui.Alignment
1516
import androidx.compose.ui.Modifier
1617
import androidx.compose.ui.res.stringResource
1718
import androidx.compose.ui.text.font.FontWeight
1819
import androidx.compose.ui.tooling.preview.Preview
1920
import androidx.compose.ui.unit.dp
20-
import androidx.compose.ui.unit.sp
2121
import com.woocommerce.android.R
2222
import com.woocommerce.android.ui.bookings.details.AttendanceUpdateStatus
23+
import com.woocommerce.android.ui.compose.animations.SkeletonView
2324
import com.woocommerce.android.ui.compose.theme.WooThemeWithBackground
2425

2526
@Composable
@@ -28,34 +29,29 @@ fun BookingSummary(
2829
modifier: Modifier = Modifier,
2930
) {
3031
Column(
31-
horizontalAlignment = Alignment.Start,
3232
modifier = modifier
3333
.background(color = MaterialTheme.colorScheme.surfaceContainer)
34-
.padding(16.dp)
34+
.padding(16.dp),
35+
verticalArrangement = Arrangement.spacedBy(2.dp),
3536
) {
3637
Text(
3738
text = model.date,
3839
color = MaterialTheme.colorScheme.onSurface,
3940
style = MaterialTheme.typography.bodyLarge.copy(fontWeight = FontWeight.Medium),
4041
)
41-
FlowRow(
42-
modifier = Modifier.padding(top = 2.dp),
43-
) {
44-
Text(
45-
text = "${model.name}",
46-
color = MaterialTheme.colorScheme.onSurfaceVariant,
47-
style = MaterialTheme.typography.labelMedium.copy(fontSize = 13.sp),
48-
)
49-
Text(
50-
text = model.customerName ?: stringResource(R.string.orderdetail_customer_name_default),
51-
color = MaterialTheme.colorScheme.onSurfaceVariant,
52-
style = MaterialTheme.typography.labelMedium.copy(fontSize = 13.sp),
53-
)
54-
}
42+
Text(
43+
text = model.name,
44+
color = MaterialTheme.colorScheme.onSurfaceVariant,
45+
style = MaterialTheme.typography.bodyLarge,
46+
)
47+
Text(
48+
text = model.customerName ?: stringResource(R.string.orderdetail_customer_name_default),
49+
color = MaterialTheme.colorScheme.onSurfaceVariant,
50+
style = MaterialTheme.typography.bodyLarge,
51+
)
5552
Row(
5653
horizontalArrangement = Arrangement.spacedBy(8.dp),
57-
modifier = Modifier
58-
.padding(top = 8.dp)
54+
modifier = Modifier.padding(top = 6.dp)
5955
) {
6056
model.attendanceStatus?.let {
6157
BookingAttendanceStatusTag(
@@ -70,6 +66,23 @@ fun BookingSummary(
7066
}
7167
}
7268

69+
@Composable
70+
fun BookingSummaryLoading() {
71+
Column(
72+
modifier = Modifier
73+
.fillMaxWidth()
74+
.background(MaterialTheme.colorScheme.surfaceContainer)
75+
.padding(16.dp),
76+
verticalArrangement = Arrangement.spacedBy(2.dp)
77+
) {
78+
SkeletonView(Modifier.size(173.dp, 18.dp))
79+
SkeletonView(Modifier.size(131.dp, 18.dp))
80+
SkeletonView(Modifier.size(161.dp, 18.dp))
81+
Spacer(Modifier.height(6.dp))
82+
SkeletonView(Modifier.size(138.dp, 22.dp))
83+
}
84+
}
85+
7386
data class BookingSummaryModel(
7487
val date: String,
7588
val name: String,

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.height
1212
import androidx.compose.foundation.layout.padding
13-
import androidx.compose.foundation.layout.size
1413
import androidx.compose.foundation.layout.width
1514
import androidx.compose.foundation.rememberScrollState
1615
import androidx.compose.foundation.verticalScroll
@@ -41,6 +40,7 @@ import com.woocommerce.android.ui.bookings.compose.BookingPaymentSection
4140
import com.woocommerce.android.ui.bookings.compose.BookingStaffMemberStatus
4241
import com.woocommerce.android.ui.bookings.compose.BookingStatus
4342
import com.woocommerce.android.ui.bookings.compose.BookingSummary
43+
import com.woocommerce.android.ui.bookings.compose.BookingSummaryLoading
4444
import com.woocommerce.android.ui.bookings.compose.BookingSummaryModel
4545
import com.woocommerce.android.ui.compose.Render
4646
import com.woocommerce.android.ui.compose.animations.SkeletonView
@@ -178,18 +178,7 @@ private fun BookingDetailsContent(
178178
@Composable
179179
private fun BookingDetailsLoading() {
180180
Column {
181-
Column(
182-
modifier = Modifier
183-
.fillMaxWidth()
184-
.background(MaterialTheme.colorScheme.surfaceContainer)
185-
.padding(16.dp)
186-
) {
187-
SkeletonView(Modifier.size(200.dp, 20.dp))
188-
Spacer(Modifier.height(4.dp))
189-
SkeletonView(Modifier.size(250.dp, 15.dp))
190-
Spacer(Modifier.height(8.dp))
191-
SkeletonView(Modifier.size(150.dp, 25.dp))
192-
}
181+
BookingSummaryLoading()
193182
Spacer(Modifier.height(40.dp))
194183
Column(
195184
modifier = Modifier

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

Lines changed: 80 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package com.woocommerce.android.ui.bookings.filter
22

33
import androidx.activity.compose.BackHandler
4-
import androidx.compose.animation.AnimatedContent
5-
import androidx.compose.animation.ContentTransform
4+
import androidx.compose.animation.EnterTransition
5+
import androidx.compose.animation.ExitTransition
66
import androidx.compose.animation.core.tween
77
import androidx.compose.animation.fadeIn
88
import androidx.compose.animation.fadeOut
99
import androidx.compose.animation.slideInHorizontally
1010
import androidx.compose.animation.slideOutHorizontally
11-
import androidx.compose.animation.togetherWith
1211
import androidx.compose.foundation.background
1312
import androidx.compose.foundation.layout.Column
1413
import androidx.compose.foundation.layout.fillMaxSize
@@ -19,11 +18,15 @@ import androidx.compose.material3.MaterialTheme
1918
import androidx.compose.material3.Scaffold
2019
import androidx.compose.material3.Text
2120
import androidx.compose.runtime.Composable
21+
import androidx.compose.runtime.LaunchedEffect
2222
import androidx.compose.ui.Modifier
2323
import androidx.compose.ui.graphics.vector.ImageVector
2424
import androidx.compose.ui.res.stringResource
2525
import androidx.compose.ui.res.vectorResource
2626
import androidx.compose.ui.unit.dp
27+
import androidx.navigation.compose.NavHost
28+
import androidx.navigation.compose.composable
29+
import androidx.navigation.compose.rememberNavController
2730
import com.woocommerce.android.R
2831
import com.woocommerce.android.ui.compose.component.Toolbar
2932
import com.woocommerce.android.ui.compose.component.WCColoredButton
@@ -32,10 +35,6 @@ import com.woocommerce.android.ui.compose.theme.WooThemeWithBackground
3235

3336
@Composable
3437
fun BookingFilterListScreen(state: BookingFilterListUiState) {
35-
BackHandler {
36-
state.onClose()
37-
}
38-
3938
Scaffold(
4039
topBar = {
4140
Column {
@@ -66,62 +65,94 @@ fun BookingFilterListScreen(state: BookingFilterListUiState) {
6665
},
6766
containerColor = MaterialTheme.colorScheme.surface,
6867
) { innerPadding ->
69-
AnimatedContent(
70-
targetState = state.currentPage,
71-
transitionSpec = {
72-
if (targetState is BookingFilterPage.List) {
73-
slideOut()
74-
} else {
75-
slideIn()
76-
}
77-
},
78-
label = "BookingFiltersAnimatedContent",
68+
FiltersNavHost(
69+
state = state,
7970
modifier = Modifier
8071
.fillMaxSize()
8172
.padding(innerPadding)
82-
) { page ->
83-
when (page) {
84-
is BookingFilterPage.List -> {
85-
BookingFilterRootPage(state.items)
86-
}
73+
)
8774

88-
BookingFilterPage.AttendanceStatus,
89-
BookingFilterPage.BookingType,
90-
BookingFilterPage.Customer,
91-
BookingFilterPage.Location,
92-
BookingFilterPage.PaymentStatus,
93-
BookingFilterPage.ServiceEvent,
94-
BookingFilterPage.TeamMember,
95-
is BookingFilterPage.DateTime -> {
96-
DateTimeFilterPicker()
97-
}
75+
// The navigation is driven by the state, so we handle back navigation by calling onClose
76+
// We need to ensure that this called after NavHost to make sure we receive back events
77+
BackHandler {
78+
state.onClose()
79+
}
80+
}
81+
}
82+
83+
@Composable
84+
private fun FiltersNavHost(
85+
state: BookingFilterListUiState,
86+
modifier: Modifier
87+
) {
88+
val navController = rememberNavController()
89+
90+
LaunchedEffect(state.currentPage) {
91+
if (state.currentPage != BookingFilterPage.List) {
92+
navController.navigate(state.currentPage.route) {
93+
popUpTo(BookingFilterPage.List.route)
9894
}
95+
} else {
96+
navController.popBackStack(BookingFilterPage.List.route, false)
97+
}
98+
}
99+
100+
NavHost(
101+
navController = navController,
102+
startDestination = BookingFilterPage.List.route,
103+
enterTransition = { slideIn(popNavigation = true) },
104+
exitTransition = { slideOut(popNavigation = true) },
105+
popEnterTransition = { slideIn(popNavigation = false) },
106+
popExitTransition = { slideOut(popNavigation = false) },
107+
modifier = modifier
108+
) {
109+
composable(BookingFilterPage.List.route) {
110+
BookingFilterRootPage(state.items)
111+
}
112+
composable(BookingFilterPage.DateTime.route) {
113+
DateTimeFilterPicker()
114+
}
115+
composable(BookingFilterPage.TeamMember.route) {
116+
TODO()
117+
}
118+
composable(BookingFilterPage.AttendanceStatus.route) {
119+
TODO()
120+
}
121+
composable(BookingFilterPage.PaymentStatus.route) {
122+
TODO()
123+
}
124+
composable(BookingFilterPage.BookingType.route) {
125+
TODO()
126+
}
127+
composable(BookingFilterPage.Customer.route) {
128+
TODO()
129+
}
130+
composable(BookingFilterPage.ServiceEvent.route) {
131+
TODO()
132+
}
133+
composable(BookingFilterPage.Location.route) {
134+
TODO()
99135
}
100136
}
101137
}
102138

103-
private const val TRANSITION_DURATION = 250
139+
private val BookingFilterPage.route: String
140+
get() = name
104141

105-
private fun slideIn(duration: Int = TRANSITION_DURATION): ContentTransform {
106-
return (
107-
slideInHorizontally(animationSpec = tween(durationMillis = duration)) { fullWidth -> fullWidth } +
108-
fadeIn(animationSpec = tween(durationMillis = duration))
109-
) togetherWith (
110-
slideOutHorizontally(animationSpec = tween(durationMillis = duration)) { fullWidth -> -fullWidth } +
111-
fadeOut(animationSpec = tween(durationMillis = duration))
112-
)
142+
private fun slideIn(popNavigation: Boolean): EnterTransition {
143+
return slideInHorizontally(animationSpec = tween(durationMillis = TRANSITION_DURATION)) { fullWidth ->
144+
if (popNavigation) fullWidth else -fullWidth
145+
} + fadeIn(animationSpec = tween(durationMillis = TRANSITION_DURATION))
113146
}
114147

115-
private fun slideOut(duration: Int = TRANSITION_DURATION): ContentTransform {
116-
return (
117-
slideInHorizontally(animationSpec = tween(durationMillis = duration)) { fullWidth -> -fullWidth } +
118-
fadeIn(animationSpec = tween(durationMillis = duration))
119-
) togetherWith (
120-
slideOutHorizontally(animationSpec = tween(durationMillis = duration)) { fullWidth -> fullWidth } +
121-
fadeOut(animationSpec = tween(durationMillis = duration))
122-
)
148+
private fun slideOut(popNavigation: Boolean): ExitTransition {
149+
return slideOutHorizontally(animationSpec = tween(durationMillis = TRANSITION_DURATION)) { fullWidth ->
150+
if (popNavigation) -fullWidth else fullWidth
151+
} + fadeOut(animationSpec = tween(durationMillis = TRANSITION_DURATION))
123152
}
124153

154+
private const val TRANSITION_DURATION = 250
155+
125156
@LightDarkThemePreviews
126157
@Composable
127158
private fun BookingFilterListScreenPreview() {

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import com.woocommerce.android.R
66
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingFilters
77
import org.wordpress.android.fluxc.network.rest.wpcom.wc.bookings.BookingsFilterOption
88

9-
sealed interface BookingFilterPage {
10-
data object List : BookingFilterPage
11-
data object DateTime : BookingFilterPage
12-
data object TeamMember : BookingFilterPage
13-
data object AttendanceStatus : BookingFilterPage
14-
data object PaymentStatus : BookingFilterPage
15-
data object BookingType : BookingFilterPage
16-
data object Customer : BookingFilterPage
17-
data object ServiceEvent : BookingFilterPage
18-
data object Location : BookingFilterPage
9+
enum class BookingFilterPage {
10+
List,
11+
DateTime,
12+
TeamMember,
13+
AttendanceStatus,
14+
PaymentStatus,
15+
BookingType,
16+
Customer,
17+
ServiceEvent,
18+
Location,
1919
}
2020

2121
data class BookingFilterListUiState(
@@ -37,7 +37,7 @@ data class BookingFilterListUiState(
3737

3838
@DrawableRes
3939
val navigationIcon: Int = when (currentPage) {
40-
is BookingFilterPage.List -> R.drawable.ic_gridicons_cross_24dp
40+
BookingFilterPage.List -> R.drawable.ic_gridicons_cross_24dp
4141
else -> R.drawable.ic_back_24dp
4242
}
4343

0 commit comments

Comments
 (0)