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
15 changes: 6 additions & 9 deletions WordPress/Classes/ViewRelated/Stats/Helpers/StatSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,21 @@

static var allInsights: [StatSection] {
if FeatureFlag.statsNewInsights.enabled {
return [StatSection.insightsViewsVisitors,
.insightsLatestPostSummary,
.insightsAllTime,
return [.insightsViewsVisitors,
.insightsLikesTotals,
.insightsCommentsTotals,
.insightsFollowerTotals,
.insightsMostPopularTime,
.insightsTagsAndCategories,
.insightsLatestPostSummary,
.insightsAllTime,
.insightsAnnualSiteStats,
.insightsCommentsAuthors,
.insightsCommentsPosts,
.insightsFollowersWordPress,
.insightsFollowersEmail,
.insightsTodaysStats,
.insightsPostingActivity,
.insightsTagsAndCategories,
.insightsFollowersEmail,
.insightsPublicize]
} else {
return [StatSection.insightsLatestPostSummary,
return [.insightsLatestPostSummary,
.insightsAllTime,
.insightsFollowerTotals,
.insightsMostPopularTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InsightsManagementViewController: UITableViewController {
}

private var insightsInactive: [StatSection] {
InsightsManagementViewController.allInsights.filter({ !self.insightsShown.contains($0) })
StatSection.allInsights.filter({ !self.insightsShown.contains($0) })
}

private var hasChanges: Bool {
Expand Down Expand Up @@ -388,22 +388,6 @@ private extension InsightsManagementViewController {
action: nil)
}

private static let allInsights: [StatSection] = [
.insightsViewsVisitors,
.insightsLikesTotals,
.insightsCommentsTotals,
.insightsFollowerTotals,
.insightsMostPopularTime,
.insightsLatestPostSummary,
.insightsAllTime,
.insightsAnnualSiteStats,
.insightsTodaysStats,
.insightsPostingActivity,
.insightsTagsAndCategories,
.insightsFollowersEmail,
.insightsPublicize
]

// MARK: - Insights Categories

enum InsightsCategories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SiteStatsInsightsTableViewController: SiteStatsBaseTableViewController, St
private var insightsToShow: [InsightType] {
get {
SiteStatsInformation.sharedInstance.getCurrentSiteInsights()
.filter(StatSection.allInsights.compactMap(\.insightType).contains)
}

set {
Expand Down