Skip to content
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
4 changes: 0 additions & 4 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public enum FeatureFlag: Int, CaseIterable {
case pluginManagementOverhaul
case nativeJetpackConnection
case newsletterSubscribers
case dataViews

/// Returns a boolean indicating if the feature is enabled.
///
Expand Down Expand Up @@ -82,8 +81,6 @@ public enum FeatureFlag: Int, CaseIterable {
return BuildConfiguration.current == .debug
case .newsletterSubscribers:
return true
case .dataViews:
return BuildConfiguration.current == .debug
}
}

Expand Down Expand Up @@ -127,7 +124,6 @@ extension FeatureFlag {
case .readerGutenbergCommentComposer: "Gutenberg Comment Composer"
case .nativeJetpackConnection: "Native Jetpack Connection"
case .newsletterSubscribers: "Newsletter Subscribers"
case .dataViews: "Data Views"
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions WordPress/Classes/Utility/ContentCoordinator.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
import WordPressShared

protocol ContentCoordinator {
func displayReaderWithPostId(_ postID: NSNumber?, siteID: NSNumber?) throws
Expand Down Expand Up @@ -84,13 +85,16 @@ struct DefaultContentCoordinator: ContentCoordinator {

func displayBackupWithSiteID(_ siteID: NSNumber?) throws {
guard let siteID,
let blog = Blog.lookup(withID: siteID, in: mainContext),
let backupListViewController = BackupListViewController.withJPBannerForBlog(blog)
let blog = Blog.lookup(withID: siteID, in: mainContext)
else {
throw DisplayError.missingParameter
}

controller?.navigationController?.pushViewController(backupListViewController, animated: true)
let backupViewController = BackupsViewController(blog: blog)
backupViewController.navigationItem.largeTitleDisplayMode = .never
controller?.navigationController?.pushViewController(backupViewController, animated: true)

WPAnalytics.track(.backupListOpened)
}

func displayScanWithSiteID(_ siteID: NSNumber?) throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ class ActivityDetailViewController: UIViewController, StoryboardLoadable {
}

private func presentedFrom() -> String {
if presenter is JetpackActivityLogViewController {
if presenter is ActivityLogsViewController {
return "activity_log"
} else if presenter is BackupListViewController {
} else if presenter is BackupsViewController {
return "backup"
} else if presenter is DashboardActivityLogCardCell {
return "dashboard"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import SwiftUI
import WordPressUI
import WordPressKit

final class ActivityLogsViewController: UIHostingController<AnyView> {
final class ActivityLogsViewController: UIHostingController<ActivityLogsView> {
private let viewModel: ActivityLogsViewModel

init(blog: Blog, isBackupMode: Bool = false) {
self.viewModel = ActivityLogsViewModel(blog: blog, isBackupMode: isBackupMode)
super.init(rootView: AnyView(ActivityLogsView(viewModel: viewModel)))
self.title = isBackupMode ? Strings.backupsTitle : Strings.activityTitle
init(blog: Blog) {
self.viewModel = ActivityLogsViewModel(blog: blog)
super.init(rootView: ActivityLogsView(viewModel: viewModel))
self.title = Strings.title
}

required dynamic init?(coder aDecoder: NSCoder) {
Expand All @@ -18,6 +18,5 @@ final class ActivityLogsViewController: UIHostingController<AnyView> {
}

private enum Strings {
static let activityTitle = NSLocalizedString("activity.logs.title", value: "Activity", comment: "Title for the activity logs screen")
static let backupsTitle = NSLocalizedString("backups.title", value: "Backups", comment: "Title for the backups screen")
static let title = NSLocalizedString("activityLogs.title", value: "Activity", comment: "Title for the activity logs screen")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import UIKit
import SwiftUI
import WordPressUI
import WordPressKit

final class BackupsViewController: UIHostingController<BackupsView> {
private let viewModel: ActivityLogsViewModel

init(blog: Blog) {
self.viewModel = ActivityLogsViewModel(blog: blog, isBackupMode: true)
super.init(rootView: ActivityLogsView(viewModel: viewModel))
self.title = Strings.title
}

required dynamic init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

private enum Strings {
static let title = NSLocalizedString("backups.title", value: "Backups", comment: "Title for the backups screen")
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,7 @@ final class DashboardActivityLogCardCell: DashboardCollectionViewCell {
// MARK: - Navigation

private func showActivityLog(for blog: Blog, tapSource: String) {
let activityLogController: UIViewController

if FeatureFlag.dataViews.enabled {
activityLogController = ActivityLogsViewController(blog: blog)
} else if let jetpackController = JetpackActivityLogViewController(blog: blog) {
activityLogController = jetpackController
} else {
return
}

let activityLogController = ActivityLogsViewController(blog: blog)
presentingViewController?.navigationController?.pushViewController(activityLogController, animated: true)

WPAnalytics.track(.activityLogViewed, withProperties: [WPAppAnalyticsKeyTapSource: tapSource])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,7 @@ extension BlogDetailsViewController {
}

@objc public func showActivity() {
let controller: UIViewController

if FeatureFlag.dataViews.enabled {
controller = ActivityLogsViewController(blog: blog)
} else if let jetpackController = JetpackActivityLogViewController(blog: blog) {
controller = jetpackController
} else {
return wpAssertionFailure("failed to instantiate")
}

let controller = ActivityLogsViewController(blog: blog)
controller.navigationItem.largeTitleDisplayMode = .never
presentationDelegate?.presentBlogDetailsViewController(controller)

Expand All @@ -182,17 +173,8 @@ extension BlogDetailsViewController {
}

@objc public func showBackup() {
let controller: UIViewController

if FeatureFlag.dataViews.enabled {
controller = ActivityLogsViewController(blog: blog, isBackupMode: true)
controller.navigationItem.largeTitleDisplayMode = .never
} else {
guard let backupListVC = BackupListViewController.withJPBannerForBlog(blog) else {
return wpAssertionFailure("failed to instantiate")
}
controller = backupListVC
}
let controller = BackupsViewController(blog: blog)
controller.navigationItem.largeTitleDisplayMode = .never

presentationDelegate?.presentBlogDetailsViewController(controller)

Expand Down