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

Add remaining files to the shared codebase #24296

Merged
merged 1 commit into from
Mar 24, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,10 @@ final class SplitViewRootPresenter: RootViewPresenter {
case .addSite(let selection):
showAddSiteScreen(selection: selection)
case .domains:
#if IS_JETPACK
let domainsVC = AllDomainsListViewController()
let navigationVC = UINavigationController(rootViewController: domainsVC)
navigationVC.modalPresentationStyle = .formSheet
splitVC.present(navigationVC, animated: true)
#endif

#if IS_WORDPRESS
wpAssertionFailure("domains are not supported in wpios")
#endif
case .help:
let supportVC = SupportTableViewController()
let navigationVC = UINavigationController(rootViewController: supportVC)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SwiftUI
import BuildSettingsKit
import WordPressKit
import DesignSystem

Expand Down Expand Up @@ -274,7 +275,9 @@ final class SiteDomainsViewController: UIHostingController<SiteDomainsView> {
// MARK: - Setup

private func setupAllDomainsBarButtonItem() {
#if IS_JETPACK
guard BuildSettings.current.brand == .jetpack else {
return
}
guard domainManagementFeatureFlag.enabled() else {
return
}
Expand All @@ -287,6 +290,5 @@ final class SiteDomainsViewController: UIHostingController<SiteDomainsView> {
WPAnalytics.track(.domainsDashboardAllDomainsTapped)
}
self.navigationItem.rightBarButtonItem = .init(title: title, primaryAction: action)
#endif
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
import BuildSettingsKit
import WordPressShared
import AutomatticAbout

Expand Down Expand Up @@ -191,8 +192,7 @@ class MeViewController: UITableViewController {
ImmuTableSection(rows: [helpAndSupportIndicator]),
])

#if IS_JETPACK
if RemoteFeatureFlag.domainManagement.enabled() && loggedIn && !isSidebarModeEnabled {
if BuildSettings.current.brand == .jetpack, RemoteFeatureFlag.domainManagement.enabled() && loggedIn && !isSidebarModeEnabled {
sections.append(.init(rows: [
NavigationItemRow(
title: AllDomainsListViewController.Strings.title,
Expand All @@ -208,7 +208,6 @@ class MeViewController: UITableViewController {
])
)
}
#endif

sections.append(
ImmuTableSection(rows: [
Expand Down Expand Up @@ -363,9 +362,7 @@ class MeViewController: UITableViewController {
/// Selects the All Domains row and pushes the All Domains view controller
///
public func navigateToAllDomains() {
#if IS_JETPACK
navigateToTarget(for: AllDomainsListViewController.Strings.title)
#endif
}

/// Selects the App Settings row and pushes the App Settings view controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
import BuildSettingsKit
import SwiftUI
import Combine
import WordPressKit
Expand Down Expand Up @@ -126,43 +127,44 @@ struct SidebarView: View {

@ViewBuilder
private var more: some View {
#if IS_JETPACK
if AccountHelper.isDotcomAvailable() {
Label {
Text(Strings.notifications)
} icon: {
if notificationsButtonViewModel.counter > 0 {
Image(systemName: "bell.badge")
.foregroundStyle(.red, .primary)
} else {
Image(systemName: "bell")
}
switch BuildSettings.current.brand {
case .wordpress:
Button(action: { viewModel.navigate(.help) }) {
Label(Strings.help, systemImage: "questionmark.circle")
}
.accessibilityIdentifier("sidebar_notifications")
.tag(SidebarSelection.notifications)
.accessibilityIdentifier("sidebar_help")
case .jetpack:
if AccountHelper.isDotcomAvailable() {
Label {
Text(Strings.notifications)
} icon: {
if notificationsButtonViewModel.counter > 0 {
Image(systemName: "bell.badge")
.foregroundStyle(.red, .primary)
} else {
Image(systemName: "bell")
}
}
.accessibilityIdentifier("sidebar_notifications")
.tag(SidebarSelection.notifications)

Label(Strings.reader, systemImage: "eyeglasses")
.tag(SidebarSelection.reader)
.accessibilityIdentifier("sidebar_reader")
Label(Strings.reader, systemImage: "eyeglasses")
.tag(SidebarSelection.reader)
.accessibilityIdentifier("sidebar_reader")

if RemoteFeatureFlag.domainManagement.enabled() {
Button(action: { viewModel.navigate(.domains) }) {
Label(Strings.domains, systemImage: "network")
if RemoteFeatureFlag.domainManagement.enabled() {
Button(action: { viewModel.navigate(.domains) }) {
Label(Strings.domains, systemImage: "network")
}
.accessibilityIdentifier("sidebar_domains")
}
.accessibilityIdentifier("sidebar_domains")
}
}

Button(action: { viewModel.navigate(.help) }) {
Label(Strings.help, systemImage: "questionmark.circle")
}
.accessibilityIdentifier("sidebar_help")
#else
Button(action: { viewModel.navigate(.help) }) {
Label(Strings.help, systemImage: "questionmark.circle")
Button(action: { viewModel.navigate(.help) }) {
Label(Strings.help, systemImage: "questionmark.circle")
}
.accessibilityIdentifier("sidebar_help")
}
.accessibilityIdentifier("sidebar_help")
#endif
}
}

Expand Down
14 changes: 0 additions & 14 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2987,19 +2987,6 @@
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
24CE68AE2CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPress" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"ViewRelated/Me/All Domains/Coordinators/AllDomainsAddDomainCoordinator.swift",
"ViewRelated/Me/All Domains/View Models/AllDomainsListViewModel.swift",
"ViewRelated/Me/All Domains/View Models/AllDomainsListViewModel+Strings.swift",
"ViewRelated/Me/All Domains/Views/AllDomainsListActivityIndicatorTableViewCell.swift",
"ViewRelated/Me/All Domains/Views/AllDomainsListEmptyView.swift",
"ViewRelated/Me/All Domains/Views/AllDomainsListTableViewCell.swift",
"ViewRelated/Me/All Domains/Views/AllDomainsListViewController.swift",
);
target = 1D6058900D05DD3D006BFB54 /* WordPress */;
};
24CE68B42CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPressUITests" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Expand Down Expand Up @@ -3033,7 +3020,6 @@
24CE57C42CD3375200C7B37D /* Classes */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
24CE68AE2CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPress" target */,
24CE68B42CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPressUITests" target */,
24CE68B52CD3375300C7B37D /* Exceptions for "Classes" folder in "Jetpack" target */,
24CE68BB2CD3375300C7B37D /* Exceptions for "Classes" folder in "JetpackUITests" target */,
Expand Down