diff --git a/MIGRATIONS.md b/MIGRATIONS.md index bce800aade79..2c30aac2716d 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -3,6 +3,12 @@ This file documents changes in the data model. Please explain any changes to the data model as well as any custom migrations. +## WordPress 93 + +@guarani 2019-10-27 + +- `AbstractPost` added `autosaveTitle` (`nullable` `String`), `autosaveExcerpt` (`nullable` `String`), `autosaveContent` (`nullable` `String`), and `autosaveModifiedDate` (`nullable` `Date`) properties. + ## WordPress 92 @jklausa 2019-08-19 diff --git a/Podfile b/Podfile index 27b516c4b084..948c97e2c6d2 100644 --- a/Podfile +++ b/Podfile @@ -43,8 +43,8 @@ def wordpress_ui end def wordpress_kit - pod 'WordPressKit', '~> 4.5.3-beta.1' - #pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => '' + pod 'WordPressKit', '~> 4.5.3-beta.2' + #pod 'WordPressKit', :git => 'https://github.com/guarani/WordPressKit-iOS.git', :branch => 'issue/12141-restore-revision-dialog' #pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => '' #pod 'WordPressKit', :path => '../WordPressKit-iOS' end diff --git a/Podfile.lock b/Podfile.lock index a357651611d5..6b153a29773a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -222,7 +222,7 @@ PODS: - WordPressKit (~> 4.5.1) - WordPressShared (~> 1.8) - WordPressUI (~> 1.4-beta.1) - - WordPressKit (4.5.3-beta.1): + - WordPressKit (4.5.3-beta.2): - Alamofire (~> 4.7.3) - CocoaLumberjack (~> 3.4) - NSObject-SafeExpectations (= 0.0.3) @@ -300,7 +300,7 @@ DEPENDENCIES: - SVProgressHUD (= 2.2.5) - WordPress-Editor-iOS (~> 1.11.0) - WordPressAuthenticator (~> 1.10.2) - - WordPressKit (~> 4.5.3-beta.1) + - WordPressKit (~> 4.5.3-beta.2) - WordPressMocks (~> 0.0.6) - WordPressShared (~> 1.8.8) - WordPressUI (~> 1.5.0) @@ -489,7 +489,7 @@ SPEC CHECKSUMS: WordPress-Aztec-iOS: 050b34d4c3adfb7c60363849049b13d60683b348 WordPress-Editor-iOS: 304098424f1051cb271546c99f906aac296b1b81 WordPressAuthenticator: af8a2b733b8a33d2ad04cdd30f5410bfe772f439 - WordPressKit: 6e02d166cbc6c6482987f5107f53d6cc1e8cbc87 + WordPressKit: 620bff49011b1e888a6132410c700a25dd059f2d WordPressMocks: 5913bd04586a360212e07a8ccbcb36068d4425a3 WordPressShared: 64332b24b8a70b7796ee137847cd0d66bdb6b4c1 WordPressUI: 4a4adafd2b052e94e4846c0a0203761773dc4fd5 @@ -499,6 +499,6 @@ SPEC CHECKSUMS: ZendeskSDK: 35b16898fae049f6ebffba96793f209b03a41495 ZIPFoundation: 89df685c971926b0323087952320bdfee9f0b6ef -PODFILE CHECKSUM: f0c0f973e03d32d504ef8ec8d6532b61f97761a8 +PODFILE CHECKSUM: 6a663fb0ac12175246b87a8c071b48000e3e97bc COCOAPODS: 1.8.4 diff --git a/WordPress/Classes/Models/AbstractPost.h b/WordPress/Classes/Models/AbstractPost.h index bbcd686ccda6..407f0532a8ed 100644 --- a/WordPress/Classes/Models/AbstractPost.h +++ b/WordPress/Classes/Models/AbstractPost.h @@ -49,6 +49,14 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) { */ @property (nonatomic, strong, nonnull) NSNumber *autoUploadAttemptsCount; +/** + Autosave attributes hold a snapshot of the post's content. + */ +@property (nonatomic, copy, nullable) NSString *autosaveContent; +@property (nonatomic, copy, nullable) NSString *autosaveExcerpt; +@property (nonatomic, copy, nullable) NSString *autosaveTitle; +@property (nonatomic, copy, nullable) NSDate *autosaveModifiedDate; + // Revision management - (AbstractPost *)createRevision; - (void)deleteRevision; diff --git a/WordPress/Classes/Models/AbstractPost.m b/WordPress/Classes/Models/AbstractPost.m index 285a7fcbb876..c7a86672f5b5 100644 --- a/WordPress/Classes/Models/AbstractPost.m +++ b/WordPress/Classes/Models/AbstractPost.m @@ -33,6 +33,10 @@ @implementation AbstractPost @dynamic confirmedChangesHash; @dynamic confirmedChangesTimestamp; @dynamic autoUploadAttemptsCount; +@dynamic autosaveContent; +@dynamic autosaveExcerpt; +@dynamic autosaveTitle; +@dynamic autosaveModifiedDate; @synthesize restorableStatus; diff --git a/WordPress/Classes/Services/PostService.m b/WordPress/Classes/Services/PostService.m index 236de8036fd1..fd959e00abc7 100644 --- a/WordPress/Classes/Services/PostService.m +++ b/WordPress/Classes/Services/PostService.m @@ -736,6 +736,11 @@ - (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost [self updateCommentsForPost:post]; } + post.autosaveTitle = remotePost.autosave.title; + post.autosaveExcerpt = remotePost.autosave.excerpt; + post.autosaveContent = remotePost.autosave.content; + post.autosaveModifiedDate = remotePost.autosave.modifiedDate; + if ([post isKindOfClass:[Page class]]) { Page *pagePost = (Page *)post; pagePost.parentID = remotePost.parentID; diff --git a/WordPress/Classes/Services/PostServiceOptions.h b/WordPress/Classes/Services/PostServiceOptions.h index 334a88101bc5..76e4f3e03c0d 100644 --- a/WordPress/Classes/Services/PostServiceOptions.h +++ b/WordPress/Classes/Services/PostServiceOptions.h @@ -24,5 +24,6 @@ @property (nonatomic, assign) PostServiceResultsOrdering orderBy; @property (nonatomic, strong) NSNumber *authorID; @property (nonatomic, copy) NSString *search; +@property (nonatomic, copy) NSString *meta; @end diff --git a/WordPress/Classes/Services/PostServiceOptions.m b/WordPress/Classes/Services/PostServiceOptions.m index ea12a0eaef8e..9dc0e8cf8b1f 100644 --- a/WordPress/Classes/Services/PostServiceOptions.m +++ b/WordPress/Classes/Services/PostServiceOptions.m @@ -2,4 +2,13 @@ @implementation PostServiceSyncOptions +- (instancetype)init +{ + self = [super init]; + if (self) { + self.meta = @"autosave"; + } + return self; +} + @end diff --git a/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion b/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion index d0e34e3ed5e7..63d4048a9798 100644 --- a/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion +++ b/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - WordPress 92.xcdatamodel + WordPress 93.xcdatamodel diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents b/WordPress/Classes/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents new file mode 100644 index 000000000000..b5ea7c9172e1 --- /dev/null +++ b/WordPress/Classes/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents @@ -0,0 +1,842 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 54067155efab..05477d47f68a 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -2438,6 +2438,7 @@ 31EC15061A5B6675009FC8B3 /* WPStyleGuide+Suggestions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WPStyleGuide+Suggestions.h"; sourceTree = ""; }; 31EC15071A5B6675009FC8B3 /* WPStyleGuide+Suggestions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WPStyleGuide+Suggestions.m"; sourceTree = ""; }; 31FA16CC1A49B3C0003E1887 /* WordPress 25.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 25.xcdatamodel"; sourceTree = ""; }; + 32A29A16236BC8BC009488C2 /* WordPress 93.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 93.xcdatamodel"; sourceTree = ""; }; 33D5016BDA00B45DFCAF3818 /* Pods-WordPressNotificationServiceExtension.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressNotificationServiceExtension.release-internal.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressNotificationServiceExtension/Pods-WordPressNotificationServiceExtension.release-internal.xcconfig"; sourceTree = ""; }; 368127CE6F1CA15EC198147D /* Pods-WordPressTodayWidget.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressTodayWidget.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressTodayWidget/Pods-WordPressTodayWidget.debug.xcconfig"; sourceTree = ""; }; 37022D8F1981BF9200F322B7 /* VerticallyStackedButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VerticallyStackedButton.h; sourceTree = ""; }; @@ -14804,6 +14805,7 @@ E125443B12BF5A7200D87A0A /* WordPress.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 32A29A16236BC8BC009488C2 /* WordPress 93.xcdatamodel */, 57CCB37E2358E5DC003ECD0C /* WordPress 92.xcdatamodel */, E63EC3632356633B008CEB16 /* WordPress 91.xcdatamodel */, F14E844C2317252200D0C63E /* WordPress 90.xcdatamodel */, @@ -14897,7 +14899,7 @@ 8350E15911D28B4A00A7B073 /* WordPress.xcdatamodel */, E125443D12BF5A7200D87A0A /* WordPress 2.xcdatamodel */, ); - currentVersion = 57CCB37E2358E5DC003ECD0C /* WordPress 92.xcdatamodel */; + currentVersion = 32A29A16236BC8BC009488C2 /* WordPress 93.xcdatamodel */; name = WordPress.xcdatamodeld; path = Classes/WordPress.xcdatamodeld; sourceTree = "";