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

[SiOC - customer creation] Show collapsible customer card with header view #12650

Merged
merged 9 commits into from
May 6, 2024

Conversation

jaclync
Copy link
Contributor

@jaclync jaclync commented May 3, 2024

Part of #12623

Why

Now that the feature flag is set up and we have a reusable collapsible view component in the order form, we can start implementing the collapsible customer card under the feature flag.

How

  • As the padding is different from the product card, a new padding parameter was added to CollapsibleOrderFormCard for the customer card to pass a different value. Since the base collapsible view CollapsibleView already has some default padding (vertical 8px, horizontal 16px), this parameter is in addition to the default padding as noted in the comment
  • The new collapsible customer card is CollapsibleCustomerCard with the following subviews:
    • Header (always shown in both collapsed/expanded states) in a new view CollapsibleCustomerCardHeaderView:
      • In the collapsed state, customer email & address are shown when available
      • In the expanded state, just the email is shown
    • Expanded content (only shown in the expanded state):
      • In this PR, only an email text field is shown
      • Placeholder views for: create account toggle, address, CTA to remove customer
  • The order form customer section view OrderCustomerSection now shows the new customer card when:
    • The merchant taps on the CTA to add a customer
    • Customer details are available for the order
  • In order to pass the latest order's customer details to the customer section, EditableOrderViewModel now syncs the top-level OrderCustomerSectionViewModel for the customer section

Testing instructions

  • @jaclync makes sure the customer UX works the same as production when the feature flag is disabled

Prerequisite: the store has at least one order with customer details (email, address)

Existing customer details

  • Go to the orders tab
  • Tap on the order in the prerequisite
  • Tap Edit --> a customer card should be shown with the email and address in the collapsed state
  • Tap to expand the customer card --> the expanded content should show an email field with the customer email

No customer details

  • Go to the orders tab
  • Tap + to create an order
  • Tap Add Customer --> a customer card should be shown in the expanded state with an email text field
  • Enter some email --> the email in the header should should be synced (in a later subtask, the header will only be updated after the email text field loses focus)
  • Tap to collapse the customer card --> only the email should be shown in the header

Screenshots

Simulator.Screen.Recording.-.iPhone.15.-.2024-05-03.at.14.26.11.mp4

Existing customer details

collapsed expanded

No customer details

collapsed expanded

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@jaclync jaclync added status: feature-flagged Behind a feature flag. Milestone is not strongly held. feature: order creation All tasks related to creating an order labels May 3, 2024
@jaclync jaclync added this to the 18.6 milestone May 3, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 3, 2024

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr12650-5206386
Version18.5
Bundle IDcom.automattic.alpha.woocommerce
Commit5206386
App Center BuildWooCommerce - Prototype Builds #8947
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@jaclync jaclync merged commit 6fed1b4 into trunk May 6, 2024
24 checks passed
@jaclync jaclync deleted the feat/12623-customer-card-email branch May 6, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order creation All tasks related to creating an order status: feature-flagged Behind a feature flag. Milestone is not strongly held.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants