Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/12597 custom fields banner #12601

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

hichamboushaba
Copy link
Member

Closes: #12597

Description

This PR adds a banner to the custom fields list screen to show a message that would help explaining how the saving works for them, in contrast to how it works in the other parts of the Product Details.
For more information on why we need this and how we reached this decision please check this discussion p1725968896022239/1725948493.332539-slack-C03L1NF1EA3

Steps to reproduce

  1. Ensure an order has at least one custom field.
  2. Open the order in the app.
  3. Tap on View Custom Fields.

Testing information

  1. Confirm the top banner is shown.
  2. Confirm it can be dismissed.

The tests that have been performed

The above.

Images/gif


  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

Comment on lines +53 to +61
private val appPrefs: AppPrefsWrapper = mock {
val bannerDismissed = MutableStateFlow(false)
on { observePrefs() }.thenReturn(bannerDismissed.map { Unit })
on { isCustomFieldsTopBannerDismissed } doAnswer { bannerDismissed.value }
on { isCustomFieldsTopBannerDismissed = any() }.then { invocation ->
bannerDismissed.update { invocation.arguments[0] as Boolean }
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works more like a fake than a mock, and allows for a more thorough testing (we can simulate the dismiss properly).

@hichamboushaba hichamboushaba added type: enhancement A request for an enhancement. feature: order details Related to order details. feature: product details Related to adding or editing products, includes product settings. labels Sep 12, 2024
@hichamboushaba hichamboushaba marked this pull request as ready for review September 12, 2024 15:45
@dangermattic
Copy link
Collaborator

1 Error
🚫 PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 12, 2024

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitbb72363
Direct Downloadwoocommerce-wear-prototype-build-pr12601-bb72363.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 12, 2024

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitbb72363
Direct Downloadwoocommerce-prototype-build-pr12601-bb72363.apk

@hichamboushaba hichamboushaba requested review from JorgeMucientes and irfano and removed request for JorgeMucientes September 19, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order details Related to order details. feature: product details Related to adding or editing products, includes product settings. type: enhancement A request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom Fields] Add a banner to explain when custom fields are saved
3 participants