-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable site creation for WP users with no sites #22415
Changes from 8 commits
61f0f31
75e8418
8ebc238
da3ced6
272ac13
760e5b7
151d3c4
5fce8cf
2d9c826
1914910
5cff94e
3d1bb4e
3dd9716
cf69359
49c4920
e0f7f63
fed4475
d6ee40c
ffe97ce
56c1015
6ee4ae9
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 |
---|---|---|
|
@@ -229,7 +229,7 @@ final class SiteAssemblyWizardContent: UIViewController { | |
|
||
if configuration.dismissalActionHandler == nil { | ||
configuration.dismissalActionHandler = { [weak self] in | ||
guard let self = self else { | ||
guard let self else { | ||
return | ||
} | ||
self.dismissTapped() | ||
|
@@ -255,6 +255,10 @@ final class SiteAssemblyWizardContent: UIViewController { | |
|
||
self.errorStateViewController = errorStateViewController | ||
} | ||
|
||
private func shouldPresentJetpackFeaturesRemovalOverlay() -> Bool { | ||
AppConfiguration.isWordPress && Blog.count(in: ContextManager.sharedInstance().mainContext) == 1 | ||
} | ||
} | ||
|
||
// MARK: ErrorStateViewController support | ||
|
@@ -309,6 +313,20 @@ extension SiteAssemblyWizardContent: NUXButtonViewControllerDelegate { | |
guard let self = self else { | ||
return | ||
} | ||
if AppConfiguration.isWordPress && Blog.count(in: ContextManager.sharedInstance().mainContext) == 1 { | ||
let viewModel = JetpackFullscreenOverlayGeneralViewModel( | ||
phase: .four, | ||
source: .phaseFourOverlay, | ||
blog: blog, | ||
coordinator: JetpackDefaultOverlayCoordinator() | ||
) | ||
let overlayViewController = JetpackFullscreenOverlayViewController(with: viewModel) | ||
let navigationViewController = UINavigationController(rootViewController: overlayViewController) | ||
JetpackFeaturesRemovalCoordinator.presentOverlay( | ||
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. I don't think there's a need to manually trigger an overlay. |
||
navigationViewController: navigationViewController, | ||
in: RootViewCoordinator.sharedPresenter.rootViewController | ||
) | ||
} | ||
let completedSteps: [QuickStartTour] = self.siteCreator.hasSiteTitle ? [QuickStartSiteTitleTour(blog: blog)] : [] | ||
self.showQuickStartPrompt(for: blog, completedSteps: completedSteps) | ||
} | ||
|
@@ -319,6 +337,11 @@ extension SiteAssemblyWizardContent: NUXButtonViewControllerDelegate { | |
return | ||
} | ||
|
||
// Disable the prompt for WordPress when the blog has no domains. | ||
guard AppConfiguration.isJetpack || isDashboardEnabled(for: blog) else { | ||
return | ||
} | ||
|
||
let rootViewController = RootViewCoordinator.sharedPresenter.rootViewController | ||
let quickstartPrompt = QuickStartPromptViewController(blog: blog) | ||
quickstartPrompt.onDismiss = { blog, showQuickStart in | ||
|
@@ -328,4 +351,8 @@ extension SiteAssemblyWizardContent: NUXButtonViewControllerDelegate { | |
} | ||
rootViewController.present(quickstartPrompt, animated: true) | ||
} | ||
|
||
private func isDashboardEnabled(for blog: Blog) -> Bool { | ||
return JetpackFeaturesRemovalCoordinator.jetpackFeaturesEnabled() && blog.isAccessibleThroughWPCom() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ final class SiteCreationWizardLauncher { | |||||
}() | ||||||
|
||||||
let steps: [SiteCreationStep] = { | ||||||
if RemoteFeatureFlag.plansInSiteCreation.enabled() { | ||||||
if RemoteFeatureFlag.plansInSiteCreation.enabled() && !AppConfiguration.isWordPress { | ||||||
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. [Nit] I think this is more readable:
Suggested change
|
||||||
return [ | ||||||
.intent, | ||||||
.design, | ||||||
|
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.
I guess this should be removed?