Skip to content

Commit dc2395b

Browse files
Merge branch 'trunk' into issue/WOOMOB-1338-jp-performance-remote-flag
2 parents 96ecac1 + 230c05c commit dc2395b

File tree

34 files changed

+4792
-527
lines changed

34 files changed

+4792
-527
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [*] Enhance the shipping label creation screen by making the selected hazardous box tappable [https://github.com/woocommerce/woocommerce-android/pull/14576]
88
- [*] Shipping Labels: Enhance selected package UI in the create shipping label flow [https://github.com/woocommerce/woocommerce-android/pull/14579]
99
- [***] Performance improvements for users logging in with WordPress.com accounts [https://github.com/woocommerce/woocommerce-android/pull/14610]
10+
- [*] Fix an issue where there is delay before displaying the continue button in Site Picker screen [https://github.com/woocommerce/woocommerce-android/pull/14611]
1011

1112
23.2
1213
-----

WooCommerce-Wear/src/main/java/com/woocommerce/android/wear/ui/stats/datasource/StatsRepository.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class StatsRepository @Inject constructor(
101101
result.granularity,
102102
result.quantity,
103103
result.date,
104-
result.isCustomField
105104
).let {
106105
Result.success(it.values.sum())
107106
}

WooCommerce/src/androidTest/assets/mocks/mappings/sites/rest_sites_161477129.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"view_stats": true
4848
},
4949
"jetpack": true,
50+
"jetpack_connection": true,
5051
"visible": true,
5152
"is_private": false,
5253
"options": {

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,22 @@ class AppInitializer @Inject constructor() : ApplicationLifecycleListener {
174174
*/
175175
private val updateSelectedSite: RateLimitedTask = object : RateLimitedTask(SECONDS_BETWEEN_SITE_UPDATE) {
176176
override fun run(): Boolean {
177-
selectedSite.getIfExists()?.let {
177+
selectedSite.getIfExists()?.let { site ->
178178
appCoroutineScope.launch {
179-
wooCommerceStore.fetchWooCommerceSite(it).model?.let {
179+
wooCommerceStore.fetchWooCommerceSite(site).model?.let {
180180
if (!it.hasWooCommerce && it.connectionType == ApplicationPasswords) {
181181
// The previously selected site doesn't have Woo anymore, take the user to the login screen
182182
WooLog.w(T.LOGIN, "Selected site no longer has WooCommerce")
183183

184184
selectedSite.reset()
185185
restartMainActivity()
186186
}
187+
if (it.connectionType != ApplicationPasswords && it.isApplicationPasswordsSupported) {
188+
analyticsTracker.track(AnalyticsEvent.JETPACK_SITE_ELIGIBLE_FOR_APP_PASSWORD_SUPPORT)
189+
}
187190
}
188-
wooCommerceStore.fetchSiteGeneralSettings(it)
189-
wooCommerceStore.fetchSiteProductSettings(it)
191+
wooCommerceStore.fetchSiteGeneralSettings(site)
192+
wooCommerceStore.fetchSiteProductSettings(site)
190193
}
191194
}
192195
return true

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ enum class AnalyticsEvent(override val siteless: Boolean = false) : IAnalyticsEv
212212
ORDERS_LIST_AUTOMATIC_TIMEOUT_RETRY,
213213
ORDERS_LIST_TOP_BANNER_TROUBLESHOOT_TAPPED,
214214
TEST_ORDER_START_TAPPED,
215-
ORDERS_LIST_APP_PASSWORDS_FAILURE,
216215

217216
FILTER_ORDERS_BY_STATUS_DIALOG_OPTION_SELECTED,
218217
ORDER_FILTER_LIST_CLEAR_MENU_BUTTON_TAPPED,
@@ -939,6 +938,10 @@ enum class AnalyticsEvent(override val siteless: Boolean = false) : IAnalyticsEv
939938
LOGIN_SITE_CREDENTIALS_APP_PASSWORD_LOGIN_EXIT_CONFIRMATION,
940939
LOGIN_SITE_CREDENTIALS_APP_PASSWORD_LOGIN_DISMISSED,
941940

941+
// Application passwords for Jetpack sites
942+
JETPACK_SITE_ELIGIBLE_FOR_APP_PASSWORD_SUPPORT,
943+
JETPACK_SITE_FLAGGED_UNSUPPORTED_FOR_APP_PASSWORDS,
944+
942945
// Free Trial
943946
FREE_TRIAL_UPGRADE_NOW_TAPPED,
944947
PLAN_UPGRADE_SUCCESS,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ class AnalyticsTracker private constructor(
250250
const val KEY_TIME_TAKEN = "time_taken"
251251
const val KEY_IS_EDITING = "is_editing"
252252
const val KEY_POS_ONBOARDING_STATE = "onboarding_state"
253+
const val KEY_API_ERROR_CODE = "api_error_code"
254+
const val KEY_HTTP_STATUS_CODE = "http_status_code"
253255

254256
const val KEY_SORT_ORDER = "order"
255257
const val VALUE_DEVICE_TYPE_REGULAR = "regular"

WooCommerce/src/main/kotlin/com/woocommerce/android/applicationpasswords/ApplicationPasswordsNotifier.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.asSharedFlow
1010
import org.wordpress.android.fluxc.model.SiteModel
1111
import org.wordpress.android.fluxc.network.rest.wpapi.WPAPINetworkError
1212
import org.wordpress.android.fluxc.network.rest.wpapi.applicationpasswords.ApplicationPasswordsListener
13+
import org.wordpress.android.fluxc.network.rest.wpapi.applicationpasswords.JetpackSiteFlaggedAsUnsupported
1314
import javax.inject.Inject
1415
import javax.inject.Singleton
1516

@@ -66,6 +67,18 @@ class ApplicationPasswordsNotifier @Inject constructor(
6667
)
6768
}
6869

70+
override fun onJetpackSiteFlaggedAsUnsupported(event: JetpackSiteFlaggedAsUnsupported) {
71+
analyticsTrackerWrapper.track(
72+
stat = AnalyticsEvent.JETPACK_SITE_FLAGGED_UNSUPPORTED_FOR_APP_PASSWORDS,
73+
properties = mapOf(
74+
AnalyticsTracker.KEY_FLOW to event.scenario.name.lowercase(),
75+
AnalyticsTracker.KEY_CAUSE to event.cause.name.lowercase(),
76+
AnalyticsTracker.KEY_API_ERROR_CODE to event.apiErrorCode,
77+
AnalyticsTracker.KEY_HTTP_STATUS_CODE to event.httpStatusCode,
78+
)
79+
)
80+
}
81+
6982
private fun trackGenerationFailure(
7083
cause: GenerationFailureCause,
7184
networkError: WPAPINetworkError,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class StatsRepository @Inject constructor(
154154
result.granularity,
155155
result.quantity,
156156
result.date,
157-
result.isCustomField
158157
)
159158
}
160159
Result.success(visitorStats)

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListViewModel.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,6 @@ class OrderListViewModel @Inject constructor(
614614
if (event.isError) {
615615
AnalyticsTracker.track(
616616
AnalyticsEvent.ORDER_LIST_LOAD_ERROR,
617-
properties = mapOf(
618-
"request_type" to event.networkingMode?.toTrackingValue()
619-
).filterNotNull(),
620617
errorType = event.error.type.name,
621618
errorContext = this::class.simpleName,
622619
errorDescription = event.error.message,
@@ -635,19 +632,6 @@ class OrderListViewModel @Inject constructor(
635632
"request_type" to event.networkingMode?.toTrackingValue()
636633
)
637634
)
638-
639-
if (event.networkingMode is WPAPINetworkingMode.JetpackTunnel &&
640-
(event.networkingMode as WPAPINetworkingMode.JetpackTunnel).isFallback
641-
) {
642-
val error = (event.networkingMode as WPAPINetworkingMode.JetpackTunnel).applicationPasswordsError
643-
AnalyticsTracker.track(
644-
AnalyticsEvent.ORDERS_LIST_APP_PASSWORDS_FAILURE,
645-
properties = mapOf(
646-
"network_error_code" to error?.volleyError?.networkResponse?.statusCode,
647-
"error_api_code" to error?.errorCode,
648-
)
649-
)
650-
}
651635
}
652636
}
653637
}

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/prefs/plugins/PluginsScreen.kt

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
package com.woocommerce.android.ui.prefs.plugins
22

33
import androidx.compose.animation.Crossfade
4-
import androidx.compose.animation.core.LinearEasing
5-
import androidx.compose.animation.core.RepeatMode
6-
import androidx.compose.animation.core.animateFloat
7-
import androidx.compose.animation.core.infiniteRepeatable
8-
import androidx.compose.animation.core.rememberInfiniteTransition
9-
import androidx.compose.animation.core.tween
104
import androidx.compose.foundation.background
115
import androidx.compose.foundation.clickable
126
import androidx.compose.foundation.layout.Arrangement
13-
import androidx.compose.foundation.layout.Box
147
import androidx.compose.foundation.layout.Column
158
import androidx.compose.foundation.layout.Row
169
import androidx.compose.foundation.layout.fillMaxSize
@@ -34,9 +27,6 @@ import androidx.compose.runtime.Composable
3427
import androidx.compose.runtime.livedata.observeAsState
3528
import androidx.compose.ui.Alignment
3629
import androidx.compose.ui.Modifier
37-
import androidx.compose.ui.geometry.Offset
38-
import androidx.compose.ui.graphics.Brush
39-
import androidx.compose.ui.graphics.Color
4030
import androidx.compose.ui.res.colorResource
4131
import androidx.compose.ui.res.dimensionResource
4232
import androidx.compose.ui.res.stringResource
@@ -45,6 +35,7 @@ import androidx.compose.ui.text.style.TextAlign
4535
import androidx.compose.ui.unit.dp
4636
import com.woocommerce.android.R
4737
import com.woocommerce.android.extensions.isNotNullOrEmpty
38+
import com.woocommerce.android.ui.compose.animations.SkeletonView
4839
import com.woocommerce.android.ui.compose.component.Toolbar
4940
import com.woocommerce.android.ui.compose.component.WCColoredButton
5041
import com.woocommerce.android.ui.compose.preview.LightDarkThemePreviews
@@ -199,32 +190,9 @@ private fun PluginItem(
199190

200191
@Composable
201192
fun ShimmerPluginsList() {
202-
val colors = listOf(
203-
Color.LightGray.copy(alpha = 0.9f),
204-
Color.LightGray.copy(alpha = 0.2f),
205-
Color.LightGray.copy(alpha = 0.9f)
206-
)
207-
208-
val transition = rememberInfiniteTransition(label = "")
209-
val animation = transition.animateFloat(
210-
initialValue = 0f,
211-
targetValue = 1000f,
212-
animationSpec = infiniteRepeatable(
213-
animation = tween(600, easing = LinearEasing, delayMillis = 500),
214-
repeatMode = RepeatMode.Restart
215-
),
216-
label = ""
217-
)
218-
219-
val brush = Brush.linearGradient(
220-
colors = colors,
221-
start = Offset(animation.value - 500f, animation.value - 500f),
222-
end = Offset(animation.value, animation.value)
223-
)
224-
225193
LazyColumn {
226194
items(10) {
227-
ShimmerPluginItem(brush = brush)
195+
ShimmerPluginItem()
228196

229197
if (it < 10) {
230198
Divider()
@@ -234,7 +202,7 @@ fun ShimmerPluginsList() {
234202
}
235203

236204
@Composable
237-
fun ShimmerPluginItem(brush: Brush) {
205+
fun ShimmerPluginItem() {
238206
Row(
239207
modifier = Modifier
240208
.fillMaxWidth()
@@ -245,16 +213,14 @@ fun ShimmerPluginItem(brush: Brush) {
245213
.weight(1f),
246214
verticalArrangement = Arrangement.spacedBy(8.dp)
247215
) {
248-
Box(
216+
SkeletonView(
249217
modifier = Modifier
250218
.fillMaxWidth()
251-
.background(brush)
252219
.height(18.dp)
253220
.width(200.dp)
254221
)
255-
Box(
222+
SkeletonView(
256223
modifier = Modifier
257-
.background(brush)
258224
.height(18.dp)
259225
.width(150.dp)
260226
)
@@ -265,17 +231,15 @@ fun ShimmerPluginItem(brush: Brush) {
265231
.width(100.dp),
266232
verticalArrangement = Arrangement.spacedBy(8.dp)
267233
) {
268-
Box(
234+
SkeletonView(
269235
modifier = Modifier
270236
.align(Alignment.End)
271-
.background(brush)
272237
.height(18.dp)
273238
.width(40.dp)
274239
)
275-
Box(
240+
SkeletonView(
276241
modifier = Modifier
277242
.align(Alignment.End)
278-
.background(brush)
279243
.height(16.dp)
280244
.width(70.dp)
281245
)

0 commit comments

Comments
 (0)