Skip to content

Commit 961c0d8

Browse files
authored
Add domains to the WP build (#24296)
1 parent 36408b0 commit 961c0d8

File tree

5 files changed

+37
-57
lines changed

5 files changed

+37
-57
lines changed

WordPress/Classes/System/Root View/SplitViewRootPresenter.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,10 @@ final class SplitViewRootPresenter: RootViewPresenter {
135135
case .addSite(let selection):
136136
showAddSiteScreen(selection: selection)
137137
case .domains:
138-
#if IS_JETPACK
139138
let domainsVC = AllDomainsListViewController()
140139
let navigationVC = UINavigationController(rootViewController: domainsVC)
141140
navigationVC.modalPresentationStyle = .formSheet
142141
splitVC.present(navigationVC, animated: true)
143-
#endif
144-
145-
#if IS_WORDPRESS
146-
wpAssertionFailure("domains are not supported in wpios")
147-
#endif
148142
case .help:
149143
let supportVC = SupportTableViewController()
150144
let navigationVC = UINavigationController(rootViewController: supportVC)

WordPress/Classes/ViewRelated/Domains/Views/SiteDomainsView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import SwiftUI
2+
import BuildSettingsKit
23
import WordPressKit
34
import DesignSystem
45

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

276277
private func setupAllDomainsBarButtonItem() {
277-
#if IS_JETPACK
278+
guard BuildSettings.current.brand == .jetpack else {
279+
return
280+
}
278281
guard domainManagementFeatureFlag.enabled() else {
279282
return
280283
}
@@ -287,6 +290,5 @@ final class SiteDomainsViewController: UIHostingController<SiteDomainsView> {
287290
WPAnalytics.track(.domainsDashboardAllDomainsTapped)
288291
}
289292
self.navigationItem.rightBarButtonItem = .init(title: title, primaryAction: action)
290-
#endif
291293
}
292294
}

WordPress/Classes/ViewRelated/Me/Me Main/MeViewController.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ class MeViewController: UITableViewController {
192192
ImmuTableSection(rows: [helpAndSupportIndicator]),
193193
])
194194

195-
#if IS_JETPACK
196-
if RemoteFeatureFlag.domainManagement.enabled() && loggedIn && !isSidebarModeEnabled {
195+
if BuildSettings.current.brand == .jetpack, RemoteFeatureFlag.domainManagement.enabled() && loggedIn && !isSidebarModeEnabled {
197196
sections.append(.init(rows: [
198197
NavigationItemRow(
199198
title: AllDomainsListViewController.Strings.title,
@@ -209,7 +208,6 @@ class MeViewController: UITableViewController {
209208
])
210209
)
211210
}
212-
#endif
213211

214212
sections.append(
215213
ImmuTableSection(rows: [
@@ -364,9 +362,7 @@ class MeViewController: UITableViewController {
364362
/// Selects the All Domains row and pushes the All Domains view controller
365363
///
366364
public func navigateToAllDomains() {
367-
#if IS_JETPACK
368365
navigateToTarget(for: AllDomainsListViewController.Strings.title)
369-
#endif
370366
}
371367

372368
/// Selects the App Settings row and pushes the App Settings view controller

WordPress/Classes/ViewRelated/System/Sidebar/SidebarViewController.swift

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import UIKit
2+
import BuildSettingsKit
23
import SwiftUI
34
import Combine
45
import WordPressKit
@@ -126,43 +127,44 @@ struct SidebarView: View {
126127

127128
@ViewBuilder
128129
private var more: some View {
129-
#if IS_JETPACK
130-
if AccountHelper.isDotcomAvailable() {
131-
Label {
132-
Text(Strings.notifications)
133-
} icon: {
134-
if notificationsButtonViewModel.counter > 0 {
135-
Image(systemName: "bell.badge")
136-
.foregroundStyle(.red, .primary)
137-
} else {
138-
Image(systemName: "bell")
139-
}
130+
switch BuildSettings.current.brand {
131+
case .wordpress:
132+
Button(action: { viewModel.navigate(.help) }) {
133+
Label(Strings.help, systemImage: "questionmark.circle")
140134
}
141-
.accessibilityIdentifier("sidebar_notifications")
142-
.tag(SidebarSelection.notifications)
135+
.accessibilityIdentifier("sidebar_help")
136+
case .jetpack:
137+
if AccountHelper.isDotcomAvailable() {
138+
Label {
139+
Text(Strings.notifications)
140+
} icon: {
141+
if notificationsButtonViewModel.counter > 0 {
142+
Image(systemName: "bell.badge")
143+
.foregroundStyle(.red, .primary)
144+
} else {
145+
Image(systemName: "bell")
146+
}
147+
}
148+
.accessibilityIdentifier("sidebar_notifications")
149+
.tag(SidebarSelection.notifications)
143150

144-
Label(Strings.reader, systemImage: "eyeglasses")
145-
.tag(SidebarSelection.reader)
146-
.accessibilityIdentifier("sidebar_reader")
151+
Label(Strings.reader, systemImage: "eyeglasses")
152+
.tag(SidebarSelection.reader)
153+
.accessibilityIdentifier("sidebar_reader")
147154

148-
if RemoteFeatureFlag.domainManagement.enabled() {
149-
Button(action: { viewModel.navigate(.domains) }) {
150-
Label(Strings.domains, systemImage: "network")
155+
if RemoteFeatureFlag.domainManagement.enabled() {
156+
Button(action: { viewModel.navigate(.domains) }) {
157+
Label(Strings.domains, systemImage: "network")
158+
}
159+
.accessibilityIdentifier("sidebar_domains")
151160
}
152-
.accessibilityIdentifier("sidebar_domains")
153161
}
154-
}
155162

156-
Button(action: { viewModel.navigate(.help) }) {
157-
Label(Strings.help, systemImage: "questionmark.circle")
158-
}
159-
.accessibilityIdentifier("sidebar_help")
160-
#else
161-
Button(action: { viewModel.navigate(.help) }) {
162-
Label(Strings.help, systemImage: "questionmark.circle")
163+
Button(action: { viewModel.navigate(.help) }) {
164+
Label(Strings.help, systemImage: "questionmark.circle")
165+
}
166+
.accessibilityIdentifier("sidebar_help")
163167
}
164-
.accessibilityIdentifier("sidebar_help")
165-
#endif
166168
}
167169
}
168170

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,19 +2876,6 @@
28762876
/* End PBXFileReference section */
28772877

28782878
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
2879-
24CE68AE2CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPress" target */ = {
2880-
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
2881-
membershipExceptions = (
2882-
"ViewRelated/Me/All Domains/Coordinators/AllDomainsAddDomainCoordinator.swift",
2883-
"ViewRelated/Me/All Domains/View Models/AllDomainsListViewModel.swift",
2884-
"ViewRelated/Me/All Domains/View Models/AllDomainsListViewModel+Strings.swift",
2885-
"ViewRelated/Me/All Domains/Views/AllDomainsListActivityIndicatorTableViewCell.swift",
2886-
"ViewRelated/Me/All Domains/Views/AllDomainsListEmptyView.swift",
2887-
"ViewRelated/Me/All Domains/Views/AllDomainsListTableViewCell.swift",
2888-
"ViewRelated/Me/All Domains/Views/AllDomainsListViewController.swift",
2889-
);
2890-
target = 1D6058900D05DD3D006BFB54 /* WordPress */;
2891-
};
28922879
24CE68B42CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPressUITests" target */ = {
28932880
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
28942881
membershipExceptions = (
@@ -2921,7 +2908,6 @@
29212908
24CE57C42CD3375200C7B37D /* Classes */ = {
29222909
isa = PBXFileSystemSynchronizedRootGroup;
29232910
exceptions = (
2924-
24CE68AE2CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPress" target */,
29252911
24CE68B42CD3375300C7B37D /* Exceptions for "Classes" folder in "WordPressUITests" target */,
29262912
24CE68B52CD3375300C7B37D /* Exceptions for "Classes" folder in "Jetpack" target */,
29272913
24CE68BB2CD3375300C7B37D /* Exceptions for "Classes" folder in "JetpackUITests" target */,

0 commit comments

Comments
 (0)