Skip to content

Commit

Permalink
Merge branch 'trunk' into wppinar/gravatar-update
Browse files Browse the repository at this point in the history
# Conflicts:
#	Podfile.lock
  • Loading branch information
pinarol committed Jun 12, 2024
2 parents 418fb5b + 3749d2f commit 1a5edd1
Show file tree
Hide file tree
Showing 33 changed files with 256 additions and 707 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ steps:
context: "UI Tests (iPhone)"

- label: "🔬 :jetpack: UI Tests (iPad)"
command: .buildkite/commands/run-ui-tests.sh 'iPad Pro (12.9-inch) (6th generation)'
command: .buildkite/commands/run-ui-tests.sh 'iPad Pro 13-inch (M4)'
depends_on: "build_jetpack"
plugins: [$CI_TOOLKIT_PLUGIN]
artifact_paths:
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.1
15.4
3 changes: 1 addition & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def gravatar
end

def wordpress_kit
# pod 'WordPressKit', '~> 17.1.2'
pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '5323909e18815c36706efca5ffd289c7d6759575'
pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'c334dad3c0e8fced5a61c5bf1d745d23d1924a9c'
# pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', branch: ''
# pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: ''
# pod 'WordPressKit', path: '../WordPressKit-iOS'
Expand Down
12 changes: 6 additions & 6 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ PODS:
- WordPressKit (~> 17.0)
- WordPressShared (~> 2.1-beta)
- WordPressUI (~> 1.7-beta)
- WordPressKit (17.1.2):
- WordPressKit (17.2.0):
- NSObject-SafeExpectations (~> 0.0.4)
- UIDeviceIdentifier (~> 2.0)
- WordPressShared (~> 2.0-beta)
Expand Down Expand Up @@ -124,7 +124,7 @@ DEPENDENCIES:
- SwiftLint (= 0.54.0)
- WordPress-Editor-iOS (~> 1.19.11)
- WordPressAuthenticator (>= 9.0.8, ~> 9.0)
- WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `5323909e18815c36706efca5ffd289c7d6759575`)
- WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `c334dad3c0e8fced5a61c5bf1d745d23d1924a9c`)
- WordPressShared (>= 2.3.1, ~> 2.3)
- WordPressUI (~> 1.16)
- ZendeskSupportSDK (= 5.3.0)
Expand Down Expand Up @@ -182,15 +182,15 @@ EXTERNAL SOURCES:
Gutenberg:
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.120.0.podspec
WordPressKit:
:commit: 5323909e18815c36706efca5ffd289c7d6759575
:commit: c334dad3c0e8fced5a61c5bf1d745d23d1924a9c
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git

CHECKOUT OPTIONS:
FSInteractiveMap:
:git: https://github.com/wordpress-mobile/FSInteractiveMap.git
:tag: 0.2.0
WordPressKit:
:commit: 5323909e18815c36706efca5ffd289c7d6759575
:commit: c334dad3c0e8fced5a61c5bf1d745d23d1924a9c
:git: https://github.com/wordpress-mobile/WordPressKit-iOS.git

SPEC CHECKSUMS:
Expand Down Expand Up @@ -226,7 +226,7 @@ SPEC CHECKSUMS:
WordPress-Aztec-iOS: 3732c6d865a5c9f35788377bdeda8a80ea10d0a1
WordPress-Editor-iOS: 453345420ced3d3ef20f0051b3df46ff10281e0c
WordPressAuthenticator: 898acaac75c5ade9b900c02622a15b9aef8fde1a
WordPressKit: bf29888bc32c1ac18669b81d49b148d867787666
WordPressKit: 98809cdb460bacc6634b49079335a5ccace34e59
WordPressShared: 0160364ed24f4d67fed4e85003fefa837faad84f
WordPressUI: ec5ebcf7e63e797ba51d07513e340c1b14cf45a4
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
Expand All @@ -239,6 +239,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced

PODFILE CHECKSUM: 06072589bd3a645f0057eb9ca3c60eb1578f99c1
PODFILE CHECKSUM: 4e9da8dde686f4a307c1014ebf43d20c689003e6

COCOAPODS: 1.15.2
5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
25.2
-----


25.1
-----
* [*] [internal] Block editor: Add onContentUpdate bridge functionality [#23234]
* [*] Fix a rare crash when trashing posts [#23321]
* [*] Fix an issue with a missing navigation bar background in Post Settings [#23334]

25.0
-----
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Models/AbstractPost+Searchable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ fileprivate extension AbstractPost {
title = postTitle
}

guard status != .publish, let statusTitle = statusTitle else {
guard status != .publish, let status else {
return title
}
return "[\(statusTitle)] \(title)"
return "[\(AbstractPost.title(for: status))] \(title)"
}
}
37 changes: 4 additions & 33 deletions WordPress/Classes/Models/AbstractPost.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
AbstractPostRemoteStatusPushingMedia, // Push Media
AbstractPostRemoteStatusAutoSaved, // Post remote auto-saved

// All the previous states were deprecated in 24.7 and are no longer used
// All the previous states were deprecated in 24.9 and are no longer used
// by the app. To get the status of the uploads, use `PostCoordinator`.

/// The default state of the newly created local revision.
Expand All @@ -35,22 +35,12 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
@property (nonatomic, strong) NSSet *comments;
@property (nonatomic, strong, nullable) Media *featuredImage;

// By convention these should be treated as read only and not manually set.
// These are primarily used as helpers sorting fetchRequests.
@property (nonatomic, assign) BOOL metaIsLocal;
@property (nonatomic, assign) BOOL metaPublishImmediately;
/**
This array will contain a list of revision IDs.
*/
/// This array will contain a list of revision IDs.
@property (nonatomic, strong, nullable) NSArray *revisions;
/**
The default value of autoUploadAttemptsCount is 0.
*/
/// The default value of autoUploadAttemptsCount is 0.
@property (nonatomic, strong, nonnull) NSNumber *autoUploadAttemptsCount;

/**
Autosave attributes hold a snapshot of the post's content.
*/
/// 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;
Expand All @@ -60,19 +50,12 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
/// Used to deduplicate new posts
@property (nonatomic, strong, nullable) NSUUID *foreignID;

/// - warning: deprecated (kahu-offline-mode)
@property (nonatomic, strong, nullable) NSString *confirmedChangesHash;
@property (nonatomic, strong, nullable) NSDate *confirmedChangesTimestamp;

@property (nonatomic, strong, nullable) NSString *voiceContent;

// Revision management
- (AbstractPost *)createRevision;
/// A new version of `createRevision` that allows you to create revisions based
/// on other revisions.
///
/// - warning: Work-in-progress (kahu-offline-mode)
- (AbstractPost *)_createRevision;
- (void)deleteRevision;
- (void)applyRevision;
- (AbstractPost *)updatePostFrom:(AbstractPost *)revision;
Expand All @@ -88,9 +71,6 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
- (BOOL)hasCategories;
- (BOOL)hasTags;

/// - note: deprecated (kahu-offline-mode)
@property (nonatomic, assign, readonly) BOOL isFailed;

@property (nonatomic, assign, readonly) BOOL hasFailedMedia;

/**
Expand All @@ -101,7 +81,6 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
- (BOOL)hasRevision;

#pragma mark - Conveniece Methods
/// - note: deprecated (kahu-offline-mode)
- (BOOL)shouldPublishImmediately;
- (NSString *)authorNameForDisplay;
- (NSString *)blavatarForDisplay;
Expand Down Expand Up @@ -130,16 +109,8 @@ typedef NS_ENUM(NSUInteger, AbstractPostRemoteStatus) {
/**
Returns YES if the original post is a draft
*/
/// - note: deprecated (kahu-offline-mode)
- (BOOL)originalIsDraft;

/**
Returns YES if dateCreated is nil, or if dateCreated and dateModified are equal.
Used when determining if a post should publish immediately.
*/
/// - note: deprecated (kahu-offline-mode)
- (BOOL)dateCreatedIsNilOrEqualToDateModified;

// Does the post exist on the blog?
- (BOOL)hasRemote;

Expand Down
40 changes: 0 additions & 40 deletions WordPress/Classes/Models/AbstractPost.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ @implementation AbstractPost
@dynamic blog;
@dynamic dateModified;
@dynamic media;
@dynamic metaIsLocal;
@dynamic metaPublishImmediately;
@dynamic comments;
@dynamic featuredImage;
@dynamic revisions;
@dynamic confirmedChangesHash;
@dynamic confirmedChangesTimestamp;
@dynamic autoUploadAttemptsCount;
@dynamic autosaveContent;
Expand All @@ -26,19 +23,6 @@ @implementation AbstractPost
@dynamic foreignID;
@synthesize voiceContent;

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
{
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"metaIsLocal"]) {
keyPaths = [keyPaths setByAddingObjectsFromArray:@[@"remoteStatusNumber"]];

} else if ([key isEqualToString:@"metaPublishImmediately"]) {
keyPaths = [keyPaths setByAddingObjectsFromArray:@[@"date_created_gmt"]];
}

return keyPaths;
}

#pragma mark - Life Cycle Methods

- (void)save
Expand All @@ -53,7 +37,6 @@ - (void)setRemoteStatusNumber:(NSNumber *)remoteStatusNumber
{
NSString *key = @"remoteStatusNumber";
[self willChangeValueForKey:key];
self.metaIsLocal = ([remoteStatusNumber integerValue] == AbstractPostRemoteStatusLocal);
[self setPrimitiveValue:remoteStatusNumber forKey:key];
[self didChangeValueForKey:key];
}
Expand All @@ -62,7 +45,6 @@ - (void)setDate_created_gmt:(NSDate *)date_created_gmt
{
NSString *key = @"date_created_gmt";
[self willChangeValueForKey:key];
self.metaPublishImmediately = [self shouldPublishImmediately];
[self setPrimitiveValue:date_created_gmt forKey:key];
[self didChangeValueForKey:key];
}
Expand Down Expand Up @@ -97,23 +79,6 @@ - (AbstractPost *)cloneFrom:(AbstractPost *)source

- (AbstractPost *)createRevision
{
if ([self isRevision]) {
DDLogInfo(@"Post is already a revision, no need to create a new one");
return self;
}
if (self.revision) {
DDLogInfo(@"Returning existing revision");
return self.revision;
}

AbstractPost *post = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass(self.class) inManagedObjectContext:self.managedObjectContext];
[post cloneFrom:self];
[post setValue:self forKey:@"original"];
[post setValue:nil forKey:@"revision"];
return post;
}

- (AbstractPost *)_createRevision {
NSParameterAssert(self.revision == nil);

AbstractPost *post = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass(self.class) inManagedObjectContext:self.managedObjectContext];
Expand Down Expand Up @@ -230,11 +195,6 @@ - (BOOL)hasVideo
return NO;
}

- (BOOL)isFailed
{
return self.remoteStatus == AbstractPostRemoteStatusFailed || [[MediaCoordinator shared] hasFailedMediaFor:self] || self.hasFailedMedia;
}

- (BOOL)hasFailedMedia
{
if ([self.media count] == 0) {
Expand Down
51 changes: 0 additions & 51 deletions WordPress/Classes/Models/AbstractPost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ extension AbstractPost {
statuses.contains(status ?? .draft)
}

/// - note: deprecated (kahu-offline-mode)
@objc
var statusTitle: String? {
guard let status = self.status else {
return nil
}

return AbstractPost.title(for: status)
}

@objc
var remoteStatus: AbstractPostRemoteStatus {
get {
Expand All @@ -59,47 +49,6 @@ extension AbstractPost {
}
}

/// The status of self when we last received its data from the API.
///
/// This is mainly used to identify which Post List tab should the post be shown in. For
/// example, if a published post is transitioned to a draft but the app has not finished
/// updating the server yet, we will continue to show the post in the Published list instead of
/// the Drafts list. We believe this behavior is less confusing for the user.
///
/// This is not meant to be up to date with the remote API. Eventually, this information will
/// be outdated. For example, the user could have changed the status in the web while the device
/// was offline. So we wouldn't recommend using this value aside from its original intention.
///
/// - SeeAlso: PostService
/// - SeeAlso: PostListFilter
///
/// - note: deprecated (kahu-offline-mode)
var statusAfterSync: Status? {
get {
return rawValue(forKey: "statusAfterSync")
}
set {
setRawValue(newValue, forKey: "statusAfterSync")
}
}

/// The string value of `statusAfterSync` based on `BasePost.Status`.
///
/// This should only be used in Objective-C. For Swift, use `statusAfterSync`.
///
/// - SeeAlso: statusAfterSync
///
/// - note: deprecated (kahu-offline-mode)
@objc(statusAfterSync)
var statusAfterSyncString: String? {
get {
return statusAfterSync?.rawValue
}
set {
statusAfterSync = newValue.flatMap { Status(rawValue: $0) }
}
}

static func title(for status: Status) -> String {
return title(forStatus: status.rawValue)
}
Expand Down
7 changes: 0 additions & 7 deletions WordPress/Classes/Models/BasePost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,3 @@ extension BasePost {
return nil
}
}

extension Sequence where Iterator.Element == BasePost.Status {
/// - warning: deprecated (kahu-offline-mode)
var strings: [String] {
return map({ $0.rawValue })
}
}
2 changes: 0 additions & 2 deletions WordPress/Classes/Services/PostHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ + (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost
postPost.publicizeMessageID = publicizeMessageID;
postPost.disabledPublicizeConnections = [self disabledPublicizeConnectionsForPost:post andMetadata:remotePost.metadata];
}

post.statusAfterSync = post.status;
}

+ (void)updatePost:(Post *)post withRemoteCategories:(NSArray *)remoteCategories inContext:(NSManagedObjectContext *)managedObjectContext {
Expand Down
5 changes: 3 additions & 2 deletions WordPress/Classes/Services/PostRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,9 @@ extension PostRepository {
throw PostRepository.Error.remoteAPIUnavailable
}

let statuses = statuses?.map { $0.rawValue }
let options = PostRepositoryPostsSerivceRemoteOptions(options: .init(
statuses: statuses?.strings,
statuses: statuses,
number: range.count,
offset: range.lowerBound,
order: descending ? .descending : .ascending,
Expand All @@ -656,7 +657,7 @@ extension PostRepository {
let updatedPosts = PostHelper.merge(
remotePosts,
ofType: postType,
withStatuses: statuses?.strings,
withStatuses: statuses,
byAuthor: authorUserID,
for: try context.existingObject(with: blogID),
purgeExisting: deleteOtherLocalPosts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ extension MySiteViewController {

if UIDevice.isPad() {
host.modalPresentationStyle = .formSheet
host.preferredContentSize = CGSize(width: 380, height: 480)
} else {
if let sheetController = host.sheetPresentationController {
sheetController.detents = [.medium()]
Expand Down
Loading

0 comments on commit 1a5edd1

Please sign in to comment.