Skip to content

Commit d5f0085

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into feature/18375-prompts-core-data
2 parents e459de2 + c8fdf66 commit d5f0085

File tree

73 files changed

+3722
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3722
-71
lines changed

Gemfile.lock

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
GIT
2+
remote: git@github.com:wordpress-mobile/release-toolkit
3+
revision: 329effd14e4176817d28ff5b97f35ea84a19c69e
4+
branch: trunk
5+
specs:
6+
fastlane-plugin-wpmreleasetoolkit (4.1.0)
7+
activesupport (~> 5)
8+
bigdecimal (~> 1.4)
9+
buildkit (~> 1.5)
10+
chroma (= 0.2.0)
11+
diffy (~> 3.3)
12+
git (~> 1.3)
13+
jsonlint (~> 0.3)
14+
nokogiri (~> 1.11)
15+
octokit (~> 4.18)
16+
parallel (~> 1.14)
17+
progress_bar (~> 1.3)
18+
rake (>= 12.3, < 14.0)
19+
rake-compiler (~> 1.0)
20+
121
GEM
222
remote: https://rubygems.org/
323
specs:
@@ -163,20 +183,6 @@ GEM
163183
xcpretty-travis-formatter (>= 0.0.3)
164184
fastlane-plugin-appcenter (1.11.1)
165185
fastlane-plugin-sentry (1.11.0)
166-
fastlane-plugin-wpmreleasetoolkit (4.1.0)
167-
activesupport (~> 5)
168-
bigdecimal (~> 1.4)
169-
buildkit (~> 1.5)
170-
chroma (= 0.2.0)
171-
diffy (~> 3.3)
172-
git (~> 1.3)
173-
jsonlint (~> 0.3)
174-
nokogiri (~> 1.11)
175-
octokit (~> 4.18)
176-
parallel (~> 1.14)
177-
progress_bar (~> 1.3)
178-
rake (>= 12.3, < 14.0)
179-
rake-compiler (~> 1.0)
180186
ffi (1.15.4)
181187
fourflusher (2.3.1)
182188
fuzzy_match (2.0.4)
@@ -245,7 +251,7 @@ GEM
245251
nap (1.1.0)
246252
naturally (2.2.1)
247253
netrc (0.11.0)
248-
nokogiri (1.13.4)
254+
nokogiri (1.13.6)
249255
mini_portile2 (~> 2.8.0)
250256
racc (~> 1.4)
251257
octokit (4.22.0)
@@ -334,7 +340,7 @@ DEPENDENCIES
334340
fastlane (~> 2.174)
335341
fastlane-plugin-appcenter (~> 1.8)
336342
fastlane-plugin-sentry
337-
fastlane-plugin-wpmreleasetoolkit (~> 4.1)
343+
fastlane-plugin-wpmreleasetoolkit!
338344
octokit (~> 4.0)
339345
rake
340346
rmagick (~> 3.2.0)

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def wordpress_ui
4747
end
4848

4949
def wordpress_kit
50-
pod 'WordPressKit', '~> 4.52.0-beta'
50+
pod 'WordPressKit', '~> 4.52.0-beta.4'
5151
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => ''
5252
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
5353
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => ''

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ PODS:
487487
- WordPressKit (~> 4.18-beta)
488488
- WordPressShared (~> 1.12-beta)
489489
- WordPressUI (~> 1.7-beta)
490-
- WordPressKit (4.52.0-beta.3):
490+
- WordPressKit (4.52.0-beta.4):
491491
- Alamofire (~> 4.8.0)
492492
- CocoaLumberjack (~> 3.4)
493493
- NSObject-SafeExpectations (= 0.0.4)
@@ -591,7 +591,7 @@ DEPENDENCIES:
591591
- SVProgressHUD (= 2.2.5)
592592
- WordPress-Editor-iOS (~> 1.19.8)
593593
- WordPressAuthenticator (~> 2.0.0)
594-
- WordPressKit (~> 4.52.0-beta)
594+
- WordPressKit (~> 4.52.0-beta.4)
595595
- WordPressMocks (~> 0.0.15)
596596
- WordPressShared (~> 1.17.1)
597597
- WordPressUI (~> 1.12.5)
@@ -853,7 +853,7 @@ SPEC CHECKSUMS:
853853
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
854854
WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345
855855
WordPressAuthenticator: 5163f732e4e529781f931f158f54b1a1545bc536
856-
WordPressKit: 0defd60331a0b66f09e8892179582814cecb9fdc
856+
WordPressKit: 450022923efc0108b12ea9ce7a346e51f58bfe15
857857
WordPressMocks: 6b52b0764d9939408151367dd9c6e8a910877f4d
858858
WordPressShared: 0c4bc5e25765732fcf5d07f28c81970ab28493fb
859859
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
@@ -869,6 +869,6 @@ SPEC CHECKSUMS:
869869
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
870870
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37
871871

872-
PODFILE CHECKSUM: f114ad2ae700db1d36f4ea61c36386723da3e644
872+
PODFILE CHECKSUM: 24bc8372e70618119eac614105c8ee8d21a93c77
873873

874874
COCOAPODS: 1.11.2

WordPress/Classes/Stores/StatsStore+Cache.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ extension StatsStoreCacheable {
1414
extension StatsInsightsStore: StatsStoreCacheable {
1515
func containsCachedData(for type: InsightType) -> Bool {
1616
switch type {
17+
case .viewsVisitors:
18+
return true
1719
case .latestPostSummary:
1820
return state.lastPostInsight != nil
1921
case .allTimeStats, .growAudience:

WordPress/Classes/Utility/AccountHelper.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ import Foundation
8484

8585
service.removeDefaultWordPressComAccount()
8686

87+
// Delete saved dashboard states
88+
BlogDashboardState.resetAllStates()
89+
8790
// Delete local notification on logout
8891
PushNotificationsManager.shared.deletePendingLocalNotifications()
8992

@@ -94,8 +97,6 @@ import Foundation
9497
StatsDataHelper.clearWidgetsData()
9598

9699
// Delete donated user activities (e.g., for Siri Shortcuts)
97-
if #available(iOS 12.0, *) {
98-
NSUserActivity.deleteAllSavedUserActivities {}
99-
}
100+
NSUserActivity.deleteAllSavedUserActivities {}
100101
}
101102
}

WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import Foundation
109109
case statsReaderDiscoverNudgeTapped
110110
case statsReaderDiscoverNudgeDismissed
111111
case statsReaderDiscoverNudgeCompleted
112+
case statsLineChartTapped
112113

113114
// Stats - Insights
114115
case statsCustomizeInsightsShown
@@ -541,6 +542,8 @@ import Foundation
541542
return "stats_reader_discover_nudge_dismissed"
542543
case .statsReaderDiscoverNudgeCompleted:
543544
return "stats_reader_discover_nudge_completed"
545+
case .statsLineChartTapped:
546+
return "stats_line_chart_tapped"
544547

545548
// Stats - Insights
546549
case .statsCustomizeInsightsShown:

WordPress/Classes/Utility/App Configuration/AppConfiguration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Foundation
1212
@objc static let allowSiteCreation: Bool = true
1313
@objc static let allowSignUp: Bool = true
1414
@objc static let allowsCustomAppIcons: Bool = true
15+
@objc static let allowsDomainRegistration: Bool = false
1516
@objc static let showsReader: Bool = true
1617
@objc static let showsCreateButton: Bool = true
1718
@objc static let showAddSelfHostedSiteButton: Bool = true

WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
6464
case .weeklyRoundupBGProcessingTask:
6565
return true
6666
case .domains:
67-
return false
67+
// Note: when used to control access to the domains feature, you should also check whether
68+
// the current AppConfiguration and blog support domains.
69+
// See BlogDetailsViewController.shouldShowDomainRegistration for an example.
70+
return true
6871
case .timeZoneSuggester:
6972
return true
7073
case .aboutScreen:

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Posts/DashboardPostsListCardCell.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class DashboardPostsListCardCell: UICollectionViewCell, Reusable {
5656

5757
override func prepareForReuse() {
5858
super.prepareForReuse()
59+
tableView.dataSource = nil
5960
viewModel?.stopObserving()
6061
}
6162

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Posts/PostsCardViewModel.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protocol PostsCardView: AnyObject {
88
func removeIfNeeded()
99
}
1010

11-
enum PostsListSection {
11+
enum PostsListSection: CaseIterable {
1212
case posts
1313
case error
1414
case loading
@@ -40,7 +40,7 @@ class PostsCardViewModel: NSObject {
4040
didSet {
4141
if oldValue != currentState {
4242
forceReloadSnapshot()
43-
trackCardDisaplyedIfNeeded()
43+
trackCardDisplayedIfNeeded()
4444
}
4545
}
4646
}
@@ -259,7 +259,7 @@ private extension PostsCardViewModel {
259259
return false
260260
}
261261

262-
func trackCardDisaplyedIfNeeded() {
262+
func trackCardDisplayedIfNeeded() {
263263
switch currentState {
264264
case .posts:
265265
BlogDashboardAnalytics.shared.track(.dashboardCardShown, properties: ["type": "post", "sub_type": status.rawValue])
@@ -336,12 +336,12 @@ extension PostsCardViewModel: NSFetchedResultsControllerDelegate {
336336

337337
private func createSnapshot(currentSnapshot: Snapshot, postsSnapshot: PostsSnapshot) -> Snapshot {
338338
var snapshot = Snapshot()
339+
snapshot.appendSections(PostsListSection.allCases)
339340
switch currentState {
340341
case .posts:
341342
var adjustedPostsSnapshot = postsSnapshot
342343
adjustedPostsSnapshot.deleteItems(adjustedPostsSnapshot.itemIdentifiers.enumerated().filter { $0.offset > fetchedResultsController.fetchRequest.fetchLimit - 1 }.map { $0.element })
343344
let postItems: [PostsListItem] = adjustedPostsSnapshot.itemIdentifiers.map { .post($0) }
344-
snapshot.appendSections([.posts])
345345
snapshot.appendItems(postItems, toSection: .posts)
346346

347347
let reloadIdentifiers: [PostsListItem] = snapshot.itemIdentifiers.compactMap { item in
@@ -358,21 +358,18 @@ extension PostsCardViewModel: NSFetchedResultsControllerDelegate {
358358
snapshot.reloadItems(reloadIdentifiers)
359359

360360
case .error:
361-
snapshot.appendSections([.error])
362361
snapshot.appendItems([.error], toSection: .error)
363362

364363
case .loading:
365364
let items: [PostsListItem] = (0..<Constants.numberOfPosts).map { .ghost($0) }
366-
snapshot.appendSections([.loading])
367365
snapshot.appendItems(items, toSection: .loading)
368366
}
369367
return snapshot
370368
}
371369

372370
private func applySnapshot(_ snapshot: Snapshot, to dataSource: DataSource) {
373-
let shouldAnimate = view?.tableView.numberOfSections != 0 && view?.tableView.numberOfRows(inSection: 0) != 0
374371
dataSource.defaultRowAnimation = .fade
375-
dataSource.apply(snapshot, animatingDifferences: shouldAnimate, completion: nil)
372+
dataSource.apply(snapshot, animatingDifferences: true, completion: nil)
376373
view?.tableView.allowsSelection = currentState == .posts
377374
}
378375
}

0 commit comments

Comments
 (0)