-
Notifications
You must be signed in to change notification settings - Fork 117
[Woo POS] UI: Reader connection presentation flow with simulated happy path #12740
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
Conversation
|
* trunk: (22 commits) Update button image to use “plus circle” symbol make property constant (again!) make property constant remove unused PlusButtonView remove whitespace Refactor plus button to use reusable view and style Don't throw error if coupon reports are empty. Require time range to fetch most active coupons. Make start date and end data non optional for fetching active coupons. Fix vstack width when cart view is empty Update components background colors Update product card colors Update remove button and quantity badge Update ProductFactory util address merge conflict Remove CartProduct from cart Extract views to own files. Add previews Add communication between product list and cart Create ProductCardView, PlusButtonView, QuantityBadgeView Action in coupon store to fetch most active coupons. ... # Conflicts: # WooCommercePOS/WooCommercePOS.xcodeproj/project.pbxproj
Looks ok, I will check again once CI is green, if that is ok. |
Sure, CI is green now. I'm not sure why the iPad UI tests failed to run at all, but all the PR changes are in the POS framework and aren't supposed to affect the app behavior. |
@@ -5,7 +5,7 @@ public struct PointOfSaleEntryPointView: View { | |||
// Temporary. DI proper product models once we have a data layer | |||
private let viewModel: PointOfSaleDashboardViewModel = { | |||
let products = ProductFactory.makeFakeProducts() | |||
let viewModel = PointOfSaleDashboardViewModel(products: products) | |||
let viewModel = PointOfSaleDashboardViewModel(products: products, cardReaderConnectionViewModel: .init(state: .scanningForReader(cancel: {}))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 While simplified at this point, I like that we have some sort of init state which should help with testability if we want to start a flow in a specific stage, something we should think about implementing in the final designs
Looks good to me as well 👍 |
@iamgabrielma @bozidarsevo When the PR looks okay, could you stamp it to enable merge? 😄 I'm preparing a PR #12747 that moves all the POS files including the ones in this PR to the main app. |
Simulated flow for #12711
Why
Before having a concrete design, we can start working on the card reader connection flow with a mocked state machine. In a WIP PR #12723, I worked on extracting the UI logic from
CardReaderConnectionController
so that we can reuse the state machine logic while the UI/UX differs from the existing app. From that WIP work, we know a list of UI states and we can build the reader connection flow based on that list.How
All of the changes in this PR are in the POS framework (noted as
pos
).After reviewing the code for the UI states in
CardReaderConnectionController
, I concluded them into the following smaller list combining a few similar states and defined a new UI stateCardReaderConnectionUIState
inpos
:CardReaderConnectionController
Then, each UI state corresponds to a new SwiftUI view that follows the latest design when available.
To integrate with the POS dashboard,
CardReaderConnectionView
and its view model were created and shown in a sheet when the user taps on the "Reader not connected" CTA in the navigation bar.To simulate the happy path for searching & connecting to a reader,
CardReaderConnectionViewModel. checkReaderConnection
is called on view'sonAppear
to mock the UI state transition.Testing instructions
Point of Sale
menu itemReader not connected
in the navigation bar --> the searching view should be shown first, then after 2 seconds, a list of 1 reader should be shownConnect
--> the connecting view should be shown first, then after 2 seconds, the connected view is shownScreenshots
Simulator.Screen.Recording.-.iPad.Air.5th.generation.-.2024-05-15.at.16.42.05.mp4
RELEASE-NOTES.txt
if necessary.