Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Jan 10, 2023

Part of #8558

Description

Why

After the user creates a store, they might want to choose a proper domain for their new store. The domain settings screen shows the domains of a WPCOM site, and allows the merchant to add a domain either using their domain credit or the checkout flow similar to the Jetpack app.

Networking layer changes

More technical details at the spike: pe5sF9-Ug-p2

This PR just contains the networking layer changes, since the JSON response files were pretty large. There are two endpoints required to show the domain settings UI:

  • DomainRemoteProtocol.loadDomains: this loads the site's domains, including the free staging domain
  • PaymentRemoteProtocol.loadSiteCurrentPlan: this loads the site's WPCOM plans, and returns the current plan to determine if the site has domain credit so that the user can pick a domain for free (available from certain WPCOM plans)
    • The WPCOMPlan field of WPComSitePlan was removed since it requires extra manual parsing due to the API response, and we're not using this field for the foreseeable future

Some manual decoding was required for both endpoints since the API response isn't straightforward, I added comments in the code.

Testing instructions

The changes aren't used in the Yosemite layer yet, they will be in the next PR. Just CI is sufficient.


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

@jaclync jaclync added the type: task An internally driven task. label Jan 10, 2023
@jaclync jaclync added this to the 11.9 milestone Jan 10, 2023
@wpmobilebot
Copy link
Collaborator

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 pr8600-d4330c3 on your iPhone

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

@selanthiraiyan selanthiraiyan self-assigned this Jan 10, 2023
@jaclync jaclync mentioned this pull request Jan 10, 2023
35 tasks
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.

LGTM 🚢

@jaclync jaclync merged commit e297611 into trunk Jan 10, 2023
@jaclync jaclync deleted the feat/8558-domain-settings-networking branch January 10, 2023 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants