Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Nov 9, 2022

Part of #8045

Description

Domain selection is the first step that I'm implementing for store creation, because profiler questions might be skipped due to API availability (we'll likely have them ready by the end of November and we're okay with skipping profiler questions in M2). This PR includes barebone UI using the existing components like SearchHeader and List, with many design improvements needed as a later subtask to match the latest design since the PR is already big. The empty and loading state design is still TBD and will be implemented in a future subtask.

Major changes include:

  • Added a feature flag storeCreationM2 and show the domain selector as the first step of store creation when the feature flag is enabled in StoreCreationCoordinator
  • Created two SwiftUI views: DomainSelectorView and DomainRowView with their own view model
    • DomainSelectorHostingController was added as the UIKit wrapper for DomainSelectorView
    • In DomainSelectorViewModel, it loads domain suggestions from the API and updates the observable domains

Testing instructions

  • Log in to the app if needed
  • Go to the Menu tab
  • Tap Switch store
  • Tap + Add a store
  • Tap Create a new store in the action sheet --> the store picker should be dismissed, then the domain selector should be shown with a very basic UI
  • Enter some text to the field --> some domain suggestions should be loaded, and the search query should be highlighted in the domain attributed string
  • Select a domain --> the substring that doesn't match the search query should be bold

  • @jaclync tests the store creation flow when the feature is disabled

Screenshots

one-word query two-word query two-word query - light mode
Simulator Screen Shot - iPhone 14 - 2022-11-09 at 16 59 10 Simulator Screen Shot - iPhone 14 - 2022-11-09 at 16 59 32 Simulator Screen Shot - iPhone 14 - 2022-11-09 at 16 59 41

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

@jaclync jaclync added type: enhancement A request for an enhancement. status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels Nov 9, 2022
@jaclync jaclync added this to the 11.2 milestone Nov 9, 2022
@peril-woocommerce
Copy link

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 9, 2022

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8065-15e1319 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@selanthiraiyan selanthiraiyan self-assigned this Nov 9, 2022
Copy link
Contributor

@selanthiraiyan selanthiraiyan left a comment

Choose a reason for hiding this comment

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

It works as described.

LGTM 🚢


// MARK: - Presentation in different states for store creation M2

func test_AuthenticatedWebViewController_is_presented_when_navigationController_is_presenting_another_view() throws {
Copy link
Contributor

@selanthiraiyan selanthiraiyan Nov 9, 2022

Choose a reason for hiding this comment

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

Nit: I think these test methods should NOT have AuthenticatedWebViewController in their name. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Updated in 15e1319

import Yosemite
@testable import WooCommerce

final class DomainSelectorViewModelTests: XCTestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice tests. 🎉

@jaclync jaclync enabled auto-merge November 10, 2022 02:08
@jaclync jaclync mentioned this pull request Nov 10, 2022
18 tasks
@jaclync jaclync merged commit fa0a8cd into trunk Nov 10, 2022
@jaclync jaclync deleted the feat/8045-domain-selector branch November 10, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants