Skip to content

Commit 1e1e8a0

Browse files
committed
Merge branch 'trunk' into feature/land-in-the-editor
2 parents ecff147 + 50a0c89 commit 1e1e8a0

169 files changed

Lines changed: 4908 additions & 2020 deletions

File tree

Some content is hidden

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

Podfile

Lines changed: 4 additions & 4 deletions
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.46.0-beta'
50+
pod 'WordPressKit', '~> 4.47.0-beta.1'
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 => ''
@@ -202,23 +202,23 @@ abstract_target 'Apps' do
202202

203203
# Production
204204

205-
pod 'Automattic-Tracks-iOS', '~> 0.9.1'
205+
pod 'Automattic-Tracks-iOS', '~> 0.11.0'
206206
# While in PR
207207
# pod 'Automattic-Tracks-iOS', :git => 'https://github.com/Automattic/Automattic-Tracks-iOS.git', :branch => ''
208208
# Local Development
209209
#pod 'Automattic-Tracks-iOS', :path => '~/Projects/Automattic-Tracks-iOS'
210210

211211
pod 'NSURL+IDN', '~> 0.4'
212212

213-
pod 'WPMediaPicker', '~> 1.8.2-beta.2'
213+
pod 'WPMediaPicker', '~> 1.8.2'
214214
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :tag => '1.7.0'
215215
## while PR is in review:
216216
# pod 'WPMediaPicker', :git => 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', :branch => ''
217217
# pod 'WPMediaPicker', :path => '../MediaPicker-iOS'
218218

219219
pod 'Gridicons', '~> 1.1.0'
220220

221-
pod 'WordPressAuthenticator', '~> 1.43.0-beta.2'
221+
pod 'WordPressAuthenticator', '~> 1.43.0'
222222
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
223223
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
224224
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'

Podfile.lock

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ PODS:
2020
- AppCenter/Core
2121
- AppCenter/Distribute (4.3.0):
2222
- AppCenter/Core
23-
- Automattic-Tracks-iOS (0.9.1):
24-
- CocoaLumberjack (~> 3)
25-
- Reachability (~> 3)
23+
- Automattic-Tracks-iOS (0.11.0):
2624
- Sentry (~> 6)
2725
- Sodium (>= 0.9.1)
28-
- UIDeviceIdentifier (~> 1)
26+
- UIDeviceIdentifier (~> 2.0)
2927
- boost (1.76.0)
3028
- BVLinearGradient (2.5.6-wp-2):
3129
- React-Core
@@ -450,11 +448,11 @@ PODS:
450448
- Sodium (0.9.1)
451449
- Starscream (3.0.6)
452450
- SVProgressHUD (2.2.5)
453-
- UIDeviceIdentifier (1.7.1)
451+
- UIDeviceIdentifier (2.0.0)
454452
- WordPress-Aztec-iOS (1.19.7)
455453
- WordPress-Editor-iOS (1.19.7):
456454
- WordPress-Aztec-iOS (= 1.19.7)
457-
- WordPressAuthenticator (1.43.0-beta.2):
455+
- WordPressAuthenticator (1.43.0):
458456
- Alamofire (~> 4.8)
459457
- CocoaLumberjack (~> 3.5)
460458
- GoogleSignIn (~> 6.0.1)
@@ -465,19 +463,19 @@ PODS:
465463
- WordPressKit (~> 4.18-beta)
466464
- WordPressShared (~> 1.12-beta)
467465
- WordPressUI (~> 1.7-beta)
468-
- WordPressKit (4.46.0-beta.2):
466+
- WordPressKit (4.47.0-beta.1):
469467
- Alamofire (~> 4.8.0)
470468
- CocoaLumberjack (~> 3.4)
471469
- NSObject-SafeExpectations (= 0.0.4)
472-
- UIDeviceIdentifier (~> 1.4)
470+
- UIDeviceIdentifier (~> 2.0)
473471
- WordPressShared (~> 1.15-beta)
474472
- wpxmlrpc (~> 0.9)
475473
- WordPressMocks (0.0.15)
476474
- WordPressShared (1.17.0):
477475
- CocoaLumberjack (~> 3.4)
478476
- FormatterKit/TimeIntervalFormatter (~> 1.8)
479477
- WordPressUI (1.12.3)
480-
- WPMediaPicker (1.8.2-beta.2)
478+
- WPMediaPicker (1.8.2)
481479
- wpxmlrpc (0.9.0)
482480
- Yoga (1.14.0)
483481
- ZendeskCommonUISDK (6.1.1)
@@ -502,7 +500,7 @@ DEPENDENCIES:
502500
- AMScrollingNavbar (= 5.6.0)
503501
- AppCenter (~> 4.1)
504502
- AppCenter/Distribute (~> 4.1)
505-
- Automattic-Tracks-iOS (~> 0.9.1)
503+
- Automattic-Tracks-iOS (~> 0.11.0)
506504
- boost (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.70.0/third-party-podspecs/boost.podspec.json`)
507505
- BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.70.0/third-party-podspecs/BVLinearGradient.podspec.json`)
508506
- Charts (~> 3.2.2)
@@ -568,20 +566,19 @@ DEPENDENCIES:
568566
- Starscream (= 3.0.6)
569567
- SVProgressHUD (= 2.2.5)
570568
- WordPress-Editor-iOS (~> 1.19.7)
571-
- WordPressAuthenticator (~> 1.43.0-beta.2)
572-
- WordPressKit (~> 4.46.0-beta)
569+
- WordPressAuthenticator (~> 1.43.0)
570+
- WordPressKit (~> 4.47.0-beta.1)
573571
- WordPressMocks (~> 0.0.15)
574572
- WordPressShared (from `https://github.com/wordpress-mobile/WordPress-iOS-Shared.git`, branch `add/landing-in-the-editor-analytics`)
575573
- WordPressUI (~> 1.12.3)
576-
- WPMediaPicker (~> 1.8.2-beta.2)
574+
- WPMediaPicker (~> 1.8.2)
577575
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.70.0/third-party-podspecs/Yoga.podspec.json`)
578576
- ZendeskSupportSDK (= 5.3.0)
579577
- ZIPFoundation (~> 0.9.8)
580578

581579
SPEC REPOS:
582580
https://github.com/wordpress-mobile/cocoapods-specs.git:
583581
- WordPressAuthenticator
584-
- WordPressKit
585582
trunk:
586583
- Alamofire
587584
- AlamofireImage
@@ -620,6 +617,7 @@ SPEC REPOS:
620617
- UIDeviceIdentifier
621618
- WordPress-Aztec-iOS
622619
- WordPress-Editor-iOS
620+
- WordPressKit
623621
- WordPressMocks
624622
- WordPressUI
625623
- WPMediaPicker
@@ -760,7 +758,7 @@ SPEC CHECKSUMS:
760758
AMScrollingNavbar: cf0ec5a5ee659d76ba2509f630bf14fba7e16dc3
761759
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7
762760
AppCenter: 883369ab78427b0561c688158d689dfe1f993ea9
763-
Automattic-Tracks-iOS: f5a6188ad8d00680748111466beabb0aea11f856
761+
Automattic-Tracks-iOS: 061303f897938044f11a9d97d5f8d6426ee7ff56
764762
boost: 32a63928ef0a5bf8b60f6b930c8864113fa28779
765763
BVLinearGradient: 9373b32b8f749c00fe59e3482b45091eeacec08b
766764
Charts: f69cf0518b6d1d62608ca504248f1bbe0b6ae77e
@@ -834,15 +832,15 @@ SPEC CHECKSUMS:
834832
Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da
835833
Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5
836834
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
837-
UIDeviceIdentifier: d0fee204f467dacf8808b7ac14ce43affeb271a5
835+
UIDeviceIdentifier: af4e11e25a2ea670078e2bd677bb0e8144f9f063
838836
WordPress-Aztec-iOS: 144f124148079084860368dfd27cb96e0952853e
839837
WordPress-Editor-iOS: 20551d5a5e51f29832064f08faaaae8e1da7e1e2
840-
WordPressAuthenticator: 0b3423546d92a976e3ce627d2e5a0350716b1f5b
841-
WordPressKit: e623ffb39b2b9d7730a9be63e26fa77929e6e43b
838+
WordPressAuthenticator: e4a43745a647e4dc4b35d21b1353bc4f07f9f3c9
839+
WordPressKit: 375f54b3b27bf37f8fc5ed444afd0507fe48a2c7
842840
WordPressMocks: 6b52b0764d9939408151367dd9c6e8a910877f4d
843841
WordPressShared: a4b0308a6345d4dda20c8f7ad9317df4246b4a00
844842
WordPressUI: 45591178e843ecb82e65e868ec766148befe9f9f
845-
WPMediaPicker: 95682a64d24d2a1de4e140e7da68da79030f8173
843+
WPMediaPicker: a34b708a7b995a0889bd5098e3b79f4a50a7a9bd
846844
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
847845
Yoga: 2ca978c40e0fd6d7f54bcb1602bc0cbbc79454a7
848846
ZendeskCommonUISDK: 5808802951ad2bb424f0bed4259dc3c0ce9b52ec
@@ -854,6 +852,6 @@ SPEC CHECKSUMS:
854852
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
855853
ZIPFoundation: e27423c004a5a1410c15933407747374e7c6cb6e
856854

857-
PODFILE CHECKSUM: b74fbc9c25b2eafda1e4b0193bf384595e08d28d
855+
PODFILE CHECKSUM: 95884cf06a6a160e63286eeba4b2134e42e81615
858856

859857
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
19.2
2+
-----
3+
* [**] Some of the screens of the app has a new, fresh and more modern visual, including the initial one: My Site. [#17812]
4+
5+
16
19.1
27
-----
38
* [*] Signup: Fixed bug where username selection screen could be pushed twice. [#17624]
@@ -12,11 +17,8 @@
1217
* [**] Block editor: Fix content justification attribute in Buttons block [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4451]
1318
* [*] Block editor: Hide help button from Unsupported Block Editor. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4352]
1419
* [*] Block editor: Add contrast checker to text-based blocks [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4357]
15-
* [*] Block editor: Fix missing Featured Image translations [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4464]
1620
* [*] Block editor: Fix missing translations of color settings [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4479]
17-
* [*] Block editor: Fix cut-off setting labels by properly wrapping the text [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4475]
1821
* [*] Block editor: Highlight text: fix applying formatting for non-selected text [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4471]
19-
* [**] Block editor: Fix Android handling of Hebrew and Indonesian translations [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4397]
2022
* [***] Self-hosted sites: Fixed a crash when saving media and no Internet connection was available. [#17759]
2123
* [*] Publicize: Fixed an issue where a successful login was not automatically detected when connecting a Facebook account to Publicize. [#17803]
2224

@@ -30,6 +32,7 @@
3032
* [*] Block editor: Add missing translations of unsupported block editor modal [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4410]
3133
* [**] Time zone suggester: we have a new time zone selection screen that suggests the time zone based on the device, and improves search. [#17699]
3234
* [*] Added the "Share WordPress with a friend" row back to the Me screen. [#17748]
35+
* [***] Updated default app icon. [#17793]
3336

3437
18.9
3538
-----

WordPress/Classes/Services/NotificationActionsService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ private extension NotificationActionsService {
268268

269269
let notificationID = block.parent.notificationIdentifier
270270
DDLogInfo("Invalidating Cache and Force Sync'ing Notification with ID: \(notificationID)")
271-
mediator.invalidateCacheForNotification(with: notificationID)
271+
mediator.invalidateCacheForNotification(notificationID)
272272
mediator.syncNote(with: notificationID)
273273
}
274274
}

WordPress/Classes/Services/NotificationSyncMediator.swift

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,19 @@ class NotificationSyncMediator {
159159
/// - completion: Callback to be executed on completion.
160160
///
161161
func markAsRead(_ notification: Notification, completion: ((Error?)-> Void)? = nil) {
162-
mark(notification, asRead: true, completion: completion)
162+
mark([notification], asRead: true, completion: completion)
163+
}
164+
165+
/// Marks an array of notifications as Read.
166+
///
167+
/// - Note: This method should only be used on the main thread.
168+
///
169+
/// - Parameters:
170+
/// - notifications: Notifications that were marked as read.
171+
/// - completion: Callback to be executed on completion.
172+
///
173+
func markAsRead(_ notifications: [Notification], completion: ((Error?)-> Void)? = nil) {
174+
mark(notifications, asRead: true, completion: completion)
163175
}
164176

165177
/// Marks a Notification as Unead.
@@ -171,17 +183,19 @@ class NotificationSyncMediator {
171183
/// - completion: Callback to be executed on completion.
172184
///
173185
func markAsUnread(_ notification: Notification, completion: ((Error?)-> Void)? = nil) {
174-
mark(notification, asRead: false, completion: completion)
186+
mark([notification], asRead: false, completion: completion)
175187
}
176188

177-
private func mark(_ notification: Notification, asRead read: Bool = true, completion: ((Error?)-> Void)? = nil) {
189+
private func mark(_ notifications: [Notification], asRead read: Bool = true, completion: ((Error?)-> Void)? = nil) {
178190
assert(Thread.isMainThread)
179191

180-
let noteID = notification.notificationId
181-
remote.updateReadStatus(noteID, read: read) { error in
192+
let noteIDs = notifications.map {
193+
$0.notificationId
194+
}
195+
196+
remote.updateReadStatusForNotifications(noteIDs, read: read) { error in
182197
if let error = error {
183-
let readState = read ? "read" : "unread"
184-
DDLogError("Error marking note as \(readState): \(error)")
198+
DDLogError("Error marking notifications as \(Self.readState(for: read)): \(error)")
185199
// Ideally, we'd want to revert to the previous status if this
186200
// fails, but if the note is visible, the UI layer will keep
187201
// trying to mark this note and fail.
@@ -191,13 +205,24 @@ class NotificationSyncMediator {
191205
// next successful sync.
192206
//
193207
// https://github.com/wordpress-mobile/WordPress-iOS/issues/7216
194-
NotificationSyncMediator()?.invalidateCacheForNotification(with: noteID)
208+
NotificationSyncMediator()?.invalidateCacheForNotifications(noteIDs)
195209
}
196210

197211
completion?(error)
198212
}
199213

200-
updateReadStatus(read, forNoteWithObjectID: notification.objectID)
214+
let objectIDs = notifications.map {
215+
$0.objectID
216+
}
217+
218+
updateReadStatus(
219+
read,
220+
forNotesWithObjectIDs: objectIDs
221+
)
222+
}
223+
224+
private static func readState(for read: Bool) -> String {
225+
read ? "read" : "unread"
201226
}
202227

203228
/// Invalidates the cache for a notification, marks it as read and syncs it.
@@ -207,7 +232,7 @@ class NotificationSyncMediator {
207232
/// - completion: Callback to be executed on completion.
208233
///
209234
func markAsReadAndSync(_ noteID: String, completion: ((Error?) -> Void)? = nil) {
210-
invalidateCacheForNotification(with: noteID)
235+
invalidateCacheForNotification(noteID)
211236
remote.updateReadStatus(noteID, read: true) { error in
212237
if let error = error {
213238
DDLogError("Error marking note as read: \(error)")
@@ -256,16 +281,20 @@ class NotificationSyncMediator {
256281

257282
/// Invalidates the local cache for the notification with the specified ID.
258283
///
259-
func invalidateCacheForNotification(with noteID: String) {
284+
func invalidateCacheForNotification(_ noteID: String) {
285+
invalidateCacheForNotifications([noteID])
286+
}
287+
288+
/// Invalidates the local cache for all the notifications with specified ID's in the array.
289+
///
290+
func invalidateCacheForNotifications(_ noteIDs: [String]) {
260291
let derivedContext = type(of: self).sharedDerivedContext(with: contextManager)
261-
let predicate = NSPredicate(format: "(notificationId == %@)", noteID)
262292

263293
derivedContext.perform {
264-
guard let notification = derivedContext.firstObject(ofType: Notification.self, matching: predicate) else {
265-
return
266-
}
294+
let predicate = NSPredicate(format: "(notificationId IN %@)", noteIDs)
295+
let notifications = derivedContext.allObjects(ofType: Notification.self, matching: predicate)
267296

268-
notification.notificationHash = nil
297+
notifications.forEach { $0.notificationHash = nil }
269298

270299
self.contextManager.save(derivedContext)
271300
}
@@ -373,8 +402,24 @@ private extension NotificationSyncMediator {
373402
/// - noteObjectID: CoreData ObjectID
374403
///
375404
func updateReadStatus(_ status: Bool, forNoteWithObjectID noteObjectID: NSManagedObjectID) {
376-
let note = mainContext.loadObject(ofType: Notification.self, with: noteObjectID)
377-
note?.read = status
405+
updateReadStatus(status, forNotesWithObjectIDs: [noteObjectID])
406+
}
407+
408+
/// Updates the Read status, of an array of Notifications, as specified.
409+
///
410+
/// Note: This method uses *saveContextAndWait* in order to prevent animation glitches when pushing
411+
/// Notification Details.
412+
///
413+
/// - Parameters:
414+
/// - status: New *read* value
415+
/// - notesObjectIDs: CoreData ObjectIDs
416+
///
417+
func updateReadStatus(_ status: Bool, forNotesWithObjectIDs notesObjectIDs: [NSManagedObjectID]) {
418+
let predicate = NSPredicate(format: "SELF IN %@", notesObjectIDs)
419+
420+
let notes = mainContext.allObjects(ofType: Notification.self, matching: predicate)
421+
422+
notes.forEach { $0.read = status }
378423
contextManager.saveContextAndWait(mainContext)
379424
}
380425

WordPress/Classes/System/WordPressAppDelegate.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {
7070

7171
private let loggingStack = WPLoggingStack()
7272

73+
private lazy var tracksLogger = TracksLogger()
74+
7375
/// Access the crash logging type
7476
class var crashLogging: CrashLogging? {
7577
shared?.loggingStack.crashLogging
@@ -275,6 +277,8 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {
275277
configureAppCenterSDK()
276278
configureAppRatingUtility()
277279

280+
TracksLogging.delegate = tracksLogger
281+
278282
printDebugLaunchInfoWithLaunchOptions(launchOptions)
279283
toggleExtraDebuggingIfNeeded()
280284

@@ -700,7 +704,6 @@ extension WordPressAppDelegate {
700704

701705
@objc class func setLogLevel(_ level: DDLogLevel) {
702706
WPSharedSetLoggingLevel(level)
703-
TracksSetLoggingLevel(level)
704707
WPAuthenticatorSetLoggingLevel(level)
705708
}
706709
}

WordPress/Classes/Utility/Analytics/WPAnalyticsEvent.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ import Foundation
264264
// Notifications
265265
case notificationsPreviousTapped
266266
case notificationsNextTapped
267+
case notificationsMarkAllReadTapped
267268

268269
// Sharing Buttons
269270
case sharingButtonsEditSharingButtonsToggled
@@ -751,6 +752,8 @@ import Foundation
751752
return "notifications_previous_tapped"
752753
case .notificationsNextTapped:
753754
return "notifications_next_tapped"
755+
case .notificationsMarkAllReadTapped:
756+
return "notifications_mark_all_read_tapped"
754757

755758
// Sharing
756759
case .sharingButtonsEditSharingButtonsToggled:

WordPress/Classes/Utility/AppIcon.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ struct AppIcon {
9393
static let imageBaseName = "icon-app-60x60"
9494
}
9595

96-
static let defaultIconName = "Blue"
96+
static let defaultIconName = "Cool Blue"
9797
static let defaultLegacyIconName = "WordPress"
9898
}

0 commit comments

Comments
 (0)