-
Notifications
You must be signed in to change notification settings - Fork 86
Studio: Make sure that Publish site button navigates to WP.com #2264
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { DEFAULT_CUSTOM_DOMAIN_SUFFIX } from 'common/constants'; | ||
|
|
||
| export function generateCheckoutUrl( selectedSite?: SiteDetails ): string { | ||
| const url = new URL( | ||
| 'https://wordpress.com/setup/new-hosted-site?ref=studio§ion=studio-sync&showDomainStep' | ||
|
Comment on lines
+3
to
+5
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @katinthehatsite, can we pass the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will adress these comments in a follow up PR 👍
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adressed in #2283 |
||
| ); | ||
|
|
||
| if ( ! selectedSite ) { | ||
| return url.toString(); | ||
| } | ||
|
|
||
| const suggestedName = selectedSite.customDomain | ||
| ? selectedSite.customDomain.replace( DEFAULT_CUSTOM_DOMAIN_SUFFIX, '' ) | ||
| : selectedSite.name; | ||
|
|
||
| url.searchParams.set( 'studioSiteId', String( selectedSite.id ) ); | ||
| url.searchParams.set( 'new', suggestedName ); | ||
|
|
||
| return url.toString(); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.