Skip to content

Commit

Permalink
Merge branch 'trunk' into 12633-woo-pos-determination-if-pos-availabl…
Browse files Browse the repository at this point in the history
…e-takes-more-time-than-it-should
  • Loading branch information
samiuelson authored Oct 14, 2024
2 parents 8583d9b + 5a9dbdd commit ef8b773
Show file tree
Hide file tree
Showing 38 changed files with 1,442 additions and 1,221 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!--
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
-->
## 20.7
In this update, we’ve improved the barcode scanner for more accurate readings and resolved issues with coupons unexpectedly disappearing during order creation. Merchants can now view and edit custom fields for products and orders directly in the app. We also fixed login errors and refined the "Tap to Pay" instructions for better clarity. Enjoy these enhancements and more!

## 20.6
We're excited to bring you new features in our WooCommerce app! Users can now set a password to protect products when signed in with site credentials, enhancing security for WooCommerce 8.1.0 and above. Also, promoting a Blaze product from the campaign detail will now trigger a smoother native flow. Enjoy the updates!

Expand Down
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
*** 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).
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
20.8
-----


20.7
-----
- [**] Improve barcode scanner reading accuracy [https://github.com/woocommerce/woocommerce-android/pull/12673]
Expand All @@ -11,6 +15,7 @@
- [*] Fixed incorrect instructions on "What is Tap to Pay" screen in the Payments section [https://github.com/woocommerce/woocommerce-android/pull/12709]
- [***] Merchants can now view and edit custom fields of their products and orders from the app [https://github.com/woocommerce/woocommerce-android/issues/12207]
- [*] Fix size of the whats new announcement dialog [https://github.com/woocommerce/woocommerce-android/pull/12692]
- [*] Enables Blaze survey [https://github.com/woocommerce/woocommerce-android/pull/12761]

20.6
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,7 @@ object AppUrls {

const val GOOGLE_ADMIN_DASHBOARD =
"admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"

const val BLAZE_CAMPAIGN_CREATION_SURVEY_URL_I1 =
"https://wordpressdotcom.survey.fm/blaze-on-woo-mobile-survey-sept-2024-i1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class AIRepository @Inject constructor(
feature = PRODUCT_CREATION_FEATURE,
format = ResponseFormat.JSON,
maxTokens = 4000 // Specify a higher limit for max_tokens to avoid truncated responses, see pe5sF9-2UY-p2
)
).map {
// OpenAI sometimes returns the JSON response wrapped in a code block Markdown syntax, we remove it
// see: https://community.openai.com/t/why-do-some-responses-message-content-start-with-json/573289
it.removePrefix("```json").removeSuffix("```")
}
}

suspend fun generateOrderThankYouNote(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ enum class AnalyticsEvent(override val siteless: Boolean = false) : IAnalyticsEv
BLAZE_CREATION_EDIT_INTEREST_SAVE_TAPPED,
BLAZE_CREATION_EDIT_LOCATION_SAVE_TAPPED,
BLAZE_CREATION_EDIT_DESTINATION_SAVE_TAPPED,
BLAZE_CAMPAIGN_CREATION_FEEDBACK,

// Hazmat Shipping Declaration
CONTAINS_HAZMAT_CHECKED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class BlazeRepository @Inject constructor(
)
},
isEndlessCampaign = campaignDetails.budget.isEndlessCampaign,
objectiveId = campaignDetails.objectiveId
objectiveId = if (FeatureFlag.OBJECTIVE_SECTION.isEnabled()) campaignDetails.objectiveId else null
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,50 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.woocommerce.android.R
import com.woocommerce.android.R.dimen
import com.woocommerce.android.R.drawable
import com.woocommerce.android.R.string
import com.woocommerce.android.ui.compose.component.BottomSheetHandle
import com.woocommerce.android.ui.compose.component.FeedbackRequest
import com.woocommerce.android.ui.compose.component.WCColoredButton
import com.woocommerce.android.ui.compose.preview.LightDarkThemePreviews

@Composable
fun BlazeCampaignSuccessBottomSheet(
onDoneTapped: () -> Unit,
onFeedbackTapped: (Boolean) -> Unit,
shouldShowFeedbackRequest: ShouldShowFeedbackRequest,
) {
var showFeedbackRequest by remember { mutableStateOf(false) }
LaunchedEffect(shouldShowFeedbackRequest) {
showFeedbackRequest = shouldShowFeedbackRequest()
}

BlazeCampaignSuccessBottomSheet(
onDoneTapped = onDoneTapped,
onFeedbackTapped = onFeedbackTapped,
showFeedbackRequest = showFeedbackRequest,
)
}

@Composable
fun BlazeCampaignSuccessBottomSheet(
onDoneTapped: () -> Unit,
onFeedbackTapped: (Boolean) -> Unit,
showFeedbackRequest: Boolean,
modifier: Modifier = Modifier
) {
Surface(
Expand Down Expand Up @@ -71,12 +98,24 @@ fun BlazeCampaignSuccessBottomSheet(
Text(text = stringResource(id = string.blaze_campaign_created_success_done_button))
}
Spacer(modifier = Modifier.height(16.dp))
if (showFeedbackRequest) {
FeedbackRequest(
onFeedbackReceived = onFeedbackTapped,
feedbackRequestText = R.string.blaze_campaign_created_success_feedback_request,
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(16.dp))
}
}
}
}

@LightDarkThemePreviews
@Composable
private fun BlazeCampaignSuccessBottomSheetPreview() {
BlazeCampaignSuccessBottomSheet(onDoneTapped = {})
BlazeCampaignSuccessBottomSheet(
onDoneTapped = {},
onFeedbackTapped = {},
showFeedbackRequest = true
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,43 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.woocommerce.android.AppUrls.BLAZE_CAMPAIGN_CREATION_SURVEY_URL_I1
import com.woocommerce.android.analytics.AnalyticsEvent
import com.woocommerce.android.analytics.AnalyticsTrackerWrapper
import com.woocommerce.android.ui.compose.composeView
import com.woocommerce.android.util.ChromeCustomTabUtils
import com.woocommerce.android.widgets.WCBottomSheetDialogFragment
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class BlazeCampaignSuccessBottomSheetFragment : WCBottomSheetDialogFragment() {
@Inject
lateinit var analyticsTracker: AnalyticsTrackerWrapper

@Inject
lateinit var shouldShowFeedbackRequest: ShouldShowFeedbackRequest

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
return composeView {
BlazeCampaignSuccessBottomSheet(::onDoneClicked)
BlazeCampaignSuccessBottomSheet(
::onDoneClicked,
::onFeedbackRequestTapped,
shouldShowFeedbackRequest
)
}
}

private fun onDoneClicked() {
dismiss()
}

private fun onFeedbackRequestTapped(isPositive: Boolean) {
analyticsTracker.track(
stat = AnalyticsEvent.BLAZE_CAMPAIGN_CREATION_FEEDBACK,
properties = mapOf("satisfied" to isPositive)
)
ChromeCustomTabUtils.launchUrl(requireContext(), BLAZE_CAMPAIGN_CREATION_SURVEY_URL_I1)
dismiss()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.woocommerce.android.ui.blaze.creation.success

import com.woocommerce.android.tools.SelectedSite
import org.wordpress.android.fluxc.store.blaze.BlazeCampaignsStore
import javax.inject.Inject

class ShouldShowFeedbackRequest @Inject constructor(
private val selectedSite: SelectedSite,
private val blazeCampaignsStore: BlazeCampaignsStore
) {
companion object {
private const val MINIMUM_CAMPAIGNS_FOR_FEEDBACK_REQUEST = 2
}

suspend operator fun invoke(): Boolean =
blazeCampaignsStore.getBlazeCampaigns(selectedSite.get()).size >= MINIMUM_CAMPAIGNS_FOR_FEEDBACK_REQUEST
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.woocommerce.android.ui.products.ai
package com.woocommerce.android.ui.compose.component

import androidx.annotation.StringRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand All @@ -20,8 +21,9 @@ import androidx.compose.ui.res.stringResource
import com.woocommerce.android.R

@Composable
fun AiFeedbackForm(
fun FeedbackRequest(
onFeedbackReceived: (Boolean) -> Unit,
@StringRes feedbackRequestText: Int,
modifier: Modifier = Modifier
) {
Row(
Expand All @@ -34,7 +36,7 @@ fun AiFeedbackForm(
.padding(dimensionResource(id = R.dimen.major_100))
) {
Text(
text = stringResource(id = R.string.ai_feedback_form_message),
text = stringResource(id = feedbackRequestText),
color = colorResource(id = R.color.color_on_surface_medium),
modifier = Modifier.weight(1f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ private fun CustomFieldsEditorScreen(
title = "Custom Field",
onNavigationButtonClick = onBackButtonClick,
actions = {
if (state.showDoneButton) {
WCTextButton(
onClick = onDoneClicked,
text = stringResource(R.string.done)
)
}
WCTextButton(
onClick = onDoneClicked,
text = stringResource(R.string.done),
enabled = state.enableDoneButton
)
WCOverflowMenu(
items = listOfNotNull(
R.string.custom_fields_editor_copy_key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class CustomFieldsEditorViewModel @Inject constructor(
val keyErrorMessage: UiString? = null,
val isCreatingNewItem: Boolean = false,
) {
val showDoneButton
val enableDoneButton
get() = customField.key.isNotEmpty() && hasChanges && keyErrorMessage == null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ private fun CustomFieldsScreen(
title = stringResource(id = R.string.custom_fields_list_title),
onNavigationButtonClick = onBackClick,
actions = {
if (state.hasChanges) {
WCTextButton(
text = stringResource(id = R.string.save),
onClick = onSaveClicked
)
}
WCTextButton(
text = stringResource(id = R.string.save),
onClick = onSaveClicked,
enabled = state.hasChanges
)
}
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import androidx.compose.ui.tooling.preview.Preview
import com.woocommerce.android.AppConstants.FADE_ANIMATION_DELAY_MS
import com.woocommerce.android.R
import com.woocommerce.android.ui.compose.animations.SkeletonView
import com.woocommerce.android.ui.compose.component.FeedbackRequest
import com.woocommerce.android.ui.compose.component.WCColoredButton
import com.woocommerce.android.ui.compose.component.WCOutlinedButton
import com.woocommerce.android.ui.compose.component.WCOutlinedTextField
Expand All @@ -45,7 +46,6 @@ import com.woocommerce.android.ui.products.ProductSharingViewModel.AIButtonState
import com.woocommerce.android.ui.products.ProductSharingViewModel.AIButtonState.Regenerate
import com.woocommerce.android.ui.products.ProductSharingViewModel.AIButtonState.WriteWithAI
import com.woocommerce.android.ui.products.ProductSharingViewModel.ProductSharingViewState
import com.woocommerce.android.ui.products.ai.AiFeedbackForm

@Composable
fun ProductSharingBottomSheet(viewModel: ProductSharingViewModel) {
Expand Down Expand Up @@ -109,7 +109,10 @@ fun ProductShareWithAI(
enter = fadeIn(animationSpec = tween(FADE_ANIMATION_DELAY_MS)),
exit = fadeOut(animationSpec = tween(FADE_ANIMATION_DELAY_MS))
) {
AiFeedbackForm(onDescriptionFeedbackReceived)
FeedbackRequest(
feedbackRequestText = R.string.ai_feedback_form_message,
onFeedbackReceived = onDescriptionFeedbackReceived
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ import androidx.compose.ui.window.DialogProperties
import com.woocommerce.android.R
import com.woocommerce.android.ui.compose.animations.SkeletonView
import com.woocommerce.android.ui.compose.autoMirror
import com.woocommerce.android.ui.compose.component.FeedbackRequest
import com.woocommerce.android.ui.compose.component.Toolbar
import com.woocommerce.android.ui.compose.component.WCOutlinedButton
import com.woocommerce.android.ui.compose.component.WCTextButton
import com.woocommerce.android.ui.compose.theme.WooThemeWithBackground
import com.woocommerce.android.ui.products.ai.AIProductModel
import com.woocommerce.android.ui.products.ai.AiFeedbackForm
import com.woocommerce.android.ui.products.ai.ProductPropertyCard
import com.woocommerce.android.ui.products.ai.components.FullScreenImageViewer
import com.woocommerce.android.ui.products.ai.components.ImageAction
Expand Down Expand Up @@ -283,8 +283,9 @@ private fun ProductPreviewContent(
.fillMaxWidth()
.padding(top = 16.dp)
) {
AiFeedbackForm(
onFeedbackReceived = onFeedbackReceived,
FeedbackRequest(
feedbackRequestText = R.string.ai_feedback_form_message,
onFeedbackReceived = onFeedbackReceived
)
}

Expand Down
9 changes: 8 additions & 1 deletion WooCommerce/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Translation-Revision-Date: 2024-09-23 18:54:03+0000
Translation-Revision-Date: 2024-10-01 09:54:10+0000
Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;
Generator: GlotPress/2.4.0-alpha
Language: ar
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="custom_fields_editor_html_toggle">HTML</string>
<string name="custom_fields_editor_text_toggle">النص</string>
<string name="custom_fields_editor_toggle_accessibility_description">التبديل بين النص ومحررات HTML</string>
<string name="custom_fields_list_top_banner_message">عند حفظ التغييرات إلى حقول مخصصة، سيتم تطبيقها على الفور.</string>
<string name="custom_fields_list_top_banner_title">عرض حقول مخصصة وتحريرها</string>
<string name="product_custom_fields_desc">عرض حقول مخصصة وتحريرها</string>
<string name="product_custom_fields">حقول مخصصة</string>
<string name="custom_fields_editor_copy_value">نسخ القيمة</string>
<string name="custom_fields_editor_copy_key">نسخ المفتاح</string>
<string name="blaze_campaign_product_photo_picker_photo_content_description">صورة المنتج</string>
Expand Down
Loading

0 comments on commit ef8b773

Please sign in to comment.