-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into gutenberg/try-local-post
# Conflicts: # Modules/Package.swift # WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved
- Loading branch information
Showing
44 changed files
with
412 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,12 @@ on: | |
jobs: | ||
dangermattic: | ||
if: ${{ (github.event.pull_request.draft == false) }} | ||
uses: Automattic/dangermattic/.github/workflows/[email protected].0 | ||
uses: Automattic/dangermattic/.github/workflows/[email protected].2 | ||
with: | ||
org-slug: "automattic" | ||
pipeline-slug: "wordpress-ios" | ||
retry-step-key: "danger" | ||
build-commit-sha: "${{ github.event.pull_request.head.sha }}" | ||
org-slug: automattic | ||
pipeline-slug: wordpress-ios | ||
retry-step-key: danger | ||
build-commit-sha: ${{ github.event.pull_request.head.sha }} | ||
cancel-running-github-jobs: false | ||
secrets: | ||
buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
WordPress/Classes/System/SplitViewRootPresenter+Notifications.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
class NotificationsSplitViewContent: SplitViewDisplayable { | ||
let supplementary: UINavigationController | ||
let notificationsViewController: NotificationsViewController | ||
var secondary: UINavigationController | ||
|
||
init() { | ||
notificationsViewController = UIStoryboard(name: "Notifications", bundle: nil).instantiateInitialViewController() as! NotificationsViewController | ||
supplementary = UINavigationController(rootViewController: notificationsViewController) | ||
secondary = UINavigationController() | ||
|
||
notificationsViewController.isSidebarModeEnabled = true | ||
} | ||
|
||
func displayed(in splitVC: UISplitViewController) { | ||
// Do nothing | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
WordPress/Classes/System/SplitViewRootPresenter+Reader.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
class ReaderSplitViewContent: SplitViewDisplayable { | ||
let sidebar: ReaderSidebarViewController | ||
let supplementary: UINavigationController | ||
var secondary: UINavigationController | ||
|
||
init() { | ||
secondary = UINavigationController() | ||
let viewModel = ReaderSidebarViewModel() | ||
sidebar = ReaderSidebarViewController(viewModel: viewModel) | ||
sidebar.navigationItem.largeTitleDisplayMode = .automatic | ||
supplementary = UINavigationController(rootViewController: sidebar) | ||
supplementary .navigationBar.prefersLargeTitles = true | ||
} | ||
|
||
func displayed(in splitVC: UISplitViewController) { | ||
if secondary.viewControllers.isEmpty { | ||
sidebar.showInitialSelection() | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
WordPress/Classes/System/SplitViewRootPresenter+Site.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
class SiteSplitViewContent: SiteMenuViewControllerDelegate, SplitViewDisplayable { | ||
let siteMenu: SiteMenuViewController | ||
let supplementary: UINavigationController | ||
var secondary: UINavigationController | ||
|
||
var blog: Blog { | ||
siteMenu.blog | ||
} | ||
|
||
init(blog: Blog) { | ||
siteMenu = SiteMenuViewController(blog: blog) | ||
supplementary = UINavigationController(rootViewController: siteMenu) | ||
secondary = UINavigationController() | ||
siteMenu.delegate = self | ||
} | ||
|
||
func displayed(in splitVC: UISplitViewController) { | ||
RecentSitesService().touch(blog: blog) | ||
|
||
// TODO: (wpsidebar) Refactor this (initial .secondary vc managed based on the VC presentation) | ||
_ = siteMenu.view | ||
} | ||
|
||
func siteMenuViewController(_ siteMenuViewController: SiteMenuViewController, showDetailsViewController viewController: UIViewController) { | ||
guard siteMenu === siteMenuViewController, let splitVC = siteMenuViewController.splitViewController else { return } | ||
|
||
if viewController is UINavigationController || | ||
viewController is UISplitViewController { | ||
splitVC.setViewController(viewController, for: .secondary) | ||
} else { | ||
// Reset previous navigation or split stack | ||
let navigationVC = UINavigationController(rootViewController: viewController) | ||
splitVC.setViewController(navigationVC, for: .secondary) | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
WordPress/Classes/System/SplitViewRootPresenter+Welcome.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Foundation | ||
import UIKit | ||
import SwiftUI | ||
|
||
class WelcomeSplitViewContent: SplitViewDisplayable { | ||
let supplementary: UINavigationController | ||
var secondary: UINavigationController | ||
|
||
init(addSite: @escaping (AddSiteMenuViewModel.Selection) -> Void) { | ||
supplementary = UINavigationController(rootViewController: UnifiedPrologueViewController()) | ||
|
||
let addSiteViewModel = AddSiteMenuViewModel(context: .shared, onSelection: addSite) | ||
let noSitesViewModel = NoSitesViewModel(appUIType: JetpackFeaturesRemovalCoordinator.currentAppUIType, account: nil) | ||
let noSiteView = NoSitesView(addSiteViewModel: addSiteViewModel, viewModel: noSitesViewModel) | ||
let noSitesVC = UIHostingController(rootView: noSiteView) | ||
noSitesVC.view.backgroundColor = .systemBackground | ||
secondary = UINavigationController(rootViewController: noSitesVC) | ||
|
||
supplementary.isNavigationBarHidden = true | ||
} | ||
|
||
func displayed(in splitVC: UISplitViewController) { | ||
// Do nothing | ||
} | ||
} |
Oops, something went wrong.