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

Quick Start: Display modal after login if default section is Home #18721

Merged
merged 4 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
20.0
-----
* [*] Quick Start: The "Get to know the WordPress app" card has a fresh new look [#18688]
* [*] [internal] Quick Start: Fixed an issue where the Quick Start modal was not displayed after login if the user's default tab is Home. [#18721]
* [*] Quick Start: The Next Steps modal has a fresh new look [#18711]

19.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ final class BlogDashboardViewController: UIViewController {
let element = info[QuickStartTourGuide.notificationElementKey] as? QuickStartTourElement {

switch element {
case .setupQuickStart, .removeQuickStart:
case .setupQuickStart:
self.loadCardsFromCache()
self.displayQuickStart()
case .updateQuickStart:
self.loadCardsFromCache()
case .stats, .mediaScreen:
if self.embeddedInScrollView {
Expand Down Expand Up @@ -273,6 +276,18 @@ extension BlogDashboardViewController {
private func shouldShowQuickStartChecklist() -> Bool {
return DashboardCard.quickStart.shouldShow(for: blog)
}

private func displayQuickStart() {
let currentCollections = QuickStartFactory.collections(for: blog)
guard let collectionToShow = currentCollections.first else {
return
}
let checklist = QuickStartChecklistViewController(blog: blog, collection: collectionToShow)
let navigationViewController = UINavigationController(rootViewController: checklist)
present(navigationViewController, animated: true)

QuickStartTourGuide.shared.visited(.checklist)
}
}

extension BlogDashboardViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef NS_ENUM(NSInteger, QuickStartTourElement) {
QuickStartTourElementSiteMenu = 21,
QuickStartTourElementNotifications = 22,
QuickStartTourElementSetupQuickStart = 23,
QuickStartTourElementRemoveQuickStart = 24,
QuickStartTourElementUpdateQuickStart = 24,
QuickStartTourElementMediaScreen = 25,
QuickStartTourElementMediaUpload = 26,
};
Expand Down
12 changes: 5 additions & 7 deletions WordPress/Classes/ViewRelated/Blog/QuickStartTourGuide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ open class QuickStartTourGuide: NSObject {

NotificationCenter.default.post(name: .QuickStartTourElementChangedNotification, object: self)
WPAnalytics.trackQuickStartEvent(.quickStartStarted, blog: blog)

refreshQuickStart()
NotificationCenter.default.post(name: .QuickStartTourElementChangedNotification,
object: self,
userInfo: [QuickStartTourGuide.notificationElementKey: QuickStartTourElement.setupQuickStart])
}

func setupWithDelay(for blog: Blog, type: QuickStartType, withCompletedSteps steps: [QuickStartTour] = []) {
Expand All @@ -74,10 +75,7 @@ open class QuickStartTourGuide: NSObject {
blog.quickStartType = .undefined
endCurrentTour()
NotificationCenter.default.post(name: .QuickStartTourElementChangedNotification, object: self)

NotificationCenter.default.post(name: .QuickStartTourElementChangedNotification,
object: self,
userInfo: [QuickStartTourGuide.notificationElementKey: QuickStartTourElement.removeQuickStart])
refreshQuickStart()
}

@objc static func quickStartEnabled(for blog: Blog) -> Bool {
Expand Down Expand Up @@ -183,7 +181,7 @@ open class QuickStartTourGuide: NSObject {
func refreshQuickStart() {
NotificationCenter.default.post(name: .QuickStartTourElementChangedNotification,
object: self,
userInfo: [QuickStartTourGuide.notificationElementKey: QuickStartTourElement.setupQuickStart])
userInfo: [QuickStartTourGuide.notificationElementKey: QuickStartTourElement.updateQuickStart])
}

private func addSiteMenuWayPointIfNeeded(for tour: QuickStartTour) -> QuickStartTour {
Expand Down