Skip to content

Commit

Permalink
Merge branch 'release/22.8' into compliance-pop-up
Browse files Browse the repository at this point in the history
  • Loading branch information
alpavanoglu authored Jul 11, 2023
2 parents a36288e + 928de0f commit 0dbf0f7
Show file tree
Hide file tree
Showing 262 changed files with 5,016 additions and 2,339 deletions.
2 changes: 1 addition & 1 deletion .buildkite/cache-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ common_params:
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-14.2
IMAGE_ID: xcode-14.3.1

steps:

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ common_params:
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-14.2
IMAGE_ID: xcode-14.3.1

# This is the default pipeline – it will build and test the app
steps:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ common_params:
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-14.2
IMAGE_ID: xcode-14.3.1

steps:

Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.2
14.3.1
2 changes: 1 addition & 1 deletion Gutenberg/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# LOCAL_GUTENBERG=../my-gutenberg-fork bundle exec pod install
GUTENBERG_CONFIG = {
# commit: ''
tag: 'v1.98.1'
tag: 'v1.99.0'
}

GITHUB_ORG = 'wordpress-mobile'
Expand Down
20 changes: 20 additions & 0 deletions MIGRATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
This file documents changes in the data model. Please explain any changes to the
data model as well as any custom migrations.

## WordPress 151

@dvdchr 2023-06-28

- `Blog`: added `planActiveFeatures` (optional, no default, `Transformable` with type `[String]`)

@dvdchr 2023-06-23

- Created a new entity `PublicizeInfo` with:
- `sharedPostsCount` (required, default `0`, `Int 64`)
- `sharesRemaining` (required, default `0`, `Int 64`)
- `shareLimit` (required, default `0`, `Int 64`)
- `toBePublicizedCount` (required, default `0`, `Int 64`)

- Created one-to-many relationship between `PublicizeInfo` and `Blog`
- `PublicizeInfo`
- `blog` (optional, to-one, nullify on delete)
- `Blog`
- `publicizeInfo` (optional, to-one, cascade on delete)

## WordPress 150

@momozw 2023-06-20
Expand Down
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ workspace 'WordPress.xcworkspace'
## ===================================
##
def wordpress_shared
pod 'WordPressShared', '~> 2.2-beta'
pod 'WordPressShared', '~> 2.2'
# pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', tag: ''
# pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', branch: 'trunk'
# pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', commit: ''
Expand Down Expand Up @@ -142,14 +142,14 @@ abstract_target 'Apps' do

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

pod 'WPMediaPicker', '~> 1.8-beta'
pod 'WPMediaPicker', '~> 1.8.8'
## while PR is in review:
# pod 'WPMediaPicker', git: 'https://github.com/wordpress-mobile/MediaPicker-iOS.git', branch: ''
# pod 'WPMediaPicker', path: '../MediaPicker-iOS'

pod 'Gridicons', '~> 1.1.0'

pod 'WordPressAuthenticator', '~> 6.1-beta'
pod 'WordPressAuthenticator', '~> 6.2.0'
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: ''
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: ''
# pod 'WordPressAuthenticator', path: '../WordPressAuthenticator-iOS'
Expand Down
212 changes: 106 additions & 106 deletions Podfile.lock

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
22.8
22.9
-----


22.8
-----
* [*] Blogging Reminders: Disabled prompt for self-hosted sites not connected to Jetpack. [#20970]
* [**] [internal] Do not save synced blogs if the app has signed out. [#20959]
* [**] [internal] Make sure synced posts are saved before calling completion block. [#20960]
* [**] [internal] Fix observing Quick Start notifications. [#20997]
* [**] [internal] Fixed an issue that was causing a memory leak in the domain selection flow. [#20813]
* [*] [Jetpack-only] Block editor: Rename "Reusable blocks" to "Synced patterns", aligning with the web editor. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5885]
* [**] [internal] Block editor: Fix a crash related to Reanimated when closing the editor [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5938]

22.7
-----
* [**] [internal] Blaze: Switch to using new canBlaze property to determine Blaze eligiblity. [#20916]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,20 @@ extension WPStyleGuide {

/// Style `UITableView` in the app
class func configureTableViewAppearance() {
if #available(iOS 15.0, *) {
UITableView.appearance().sectionHeaderTopPadding = 0
}
UITableView.appearance().sectionHeaderTopPadding = 0
}

/// Style the tab bar using Muriel colors
class func configureTabBarAppearance() {
UITabBar.appearance().tintColor = .tabSelected
UITabBar.appearance().unselectedItemTintColor = .tabUnselected

if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .systemBackground
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .systemBackground

UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}

/// Style the `LightNavigationController` UINavigationBar and BarButtonItems
Expand Down Expand Up @@ -114,10 +110,7 @@ extension WPStyleGuide {
appearance.configureWithDefaultBackground()

UIToolbar.appearance().standardAppearance = appearance

if #available(iOS 15.0, *) {
UIToolbar.appearance().scrollEdgeAppearance = appearance
}
UIToolbar.appearance().scrollEdgeAppearance = appearance
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ public extension NSAttributedString {
for (value, image) in unwrappedEmbeds {
let imageAttachment = NSTextAttachment()
let gifType = UTType.gif.identifier
var displayAnimatedGifs = false

// Check to see if the animated gif view provider is registered
if #available(iOS 15.0, *) {
displayAnimatedGifs = NSTextAttachment.textAttachmentViewProviderClass(forFileType: gifType) == AnimatedGifAttachmentViewProvider.self
}
let displayAnimatedGifs = NSTextAttachment.textAttachmentViewProviderClass(forFileType: gifType) == AnimatedGifAttachmentViewProvider.self

// When displaying an animated gif pass the gif data instead of the image
if
Expand Down
10 changes: 3 additions & 7 deletions WordPress/Classes/Extensions/UIApplication+mainWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import UIKit

extension UIApplication {
@objc var mainWindow: UIWindow? {
if #available(iOS 15, *) {
return connectedScenes
.compactMap { ($0 as? UIWindowScene)?.keyWindow }
.first
} else {
return windows.filter { $0.isKeyWindow }.first
}
connectedScenes
.compactMap { ($0 as? UIWindowScene)?.keyWindow }
.first
}

@objc var currentStatusBarFrame: CGRect {
Expand Down

This file was deleted.

31 changes: 31 additions & 0 deletions WordPress/Classes/Models/Blog+JetpackSocial.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Foundation

/// Blog extension for methods related to Jetpack Social.
extension Blog {
// MARK: - Publicize

/// Whether the blog has Social auto-sharing limited.
/// Note that sites hosted at WP.com has no Social sharing limitations.
var isSocialSharingLimited: Bool {
let features = planActiveFeatures ?? []
return !isHostedAtWPcom && !features.contains(Constants.socialSharingFeature)
}

/// The auto-sharing limit information for the blog.
var sharingLimit: PublicizeInfo.SharingLimit? {
// For blogs with unlimited shares, return nil early.
// This is because the endpoint will still return sharing limits as if the blog doesn't have unlimited sharing.
guard isSocialSharingLimited else {
return nil
}
return publicizeInfo?.sharingLimit
}

// MARK: - Private constants

private enum Constants {
/// The feature key listed in the blog's plan's features. At the moment, `social-shares-1000` means unlimited
/// sharing, but in the future we might introduce a proper differentiation between 1000 and unlimited.
static let socialSharingFeature = "social-shares-1000"
}
}
7 changes: 7 additions & 0 deletions WordPress/Classes/Models/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@class SiteSuggestion;
@class PageTemplateCategory;
@class JetpackFeaturesRemovalCoordinator;
@class PublicizeInfo;

extern NSString * const BlogEntityName;
extern NSString * const PostFormatStandard;
Expand Down Expand Up @@ -163,6 +164,7 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
@property (nonatomic, assign, readwrite) SiteVisibility siteVisibility;
@property (nonatomic, strong, readwrite, nullable) NSNumber *planID;
@property (nonatomic, strong, readwrite, nullable) NSString *planTitle;
@property (nonatomic, strong, readwrite, nullable) NSArray<NSString *> *planActiveFeatures;
@property (nonatomic, assign, readwrite) BOOL hasPaidPlan;
@property (nonatomic, strong, readwrite, nullable) NSSet *sharingButtons;
@property (nonatomic, strong, readwrite, nullable) NSDictionary *capabilities;
Expand All @@ -181,6 +183,11 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
*/
@property (nonatomic, strong, readwrite, nullable) BlogSettings *settings;

/**
* @details Maps to a PublicizeInfo instance, which contains Jetpack Social auto-sharing information.
*/
@property (nonatomic, strong, readwrite, nullable) PublicizeInfo *publicizeInfo;

/**
* @details Flags whether the current user is an admin on the blog.
*/
Expand Down
3 changes: 2 additions & 1 deletion WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#import "NSURL+IDN.h"
#import "CoreDataStack.h"
#import "Constants.h"
#import "WordPress-Swift.h"
#import "WPUserAgent.h"
#import "WordPress-Swift.h"

Expand Down Expand Up @@ -82,6 +81,7 @@ @implementation Blog
@dynamic settings;
@dynamic planID;
@dynamic planTitle;
@dynamic planActiveFeatures;
@dynamic hasPaidPlan;
@dynamic sharingButtons;
@dynamic capabilities;
Expand All @@ -91,6 +91,7 @@ @implementation Blog
@dynamic quotaSpaceAllowed;
@dynamic quotaSpaceUsed;
@dynamic pageTemplateCategories;
@dynamic publicizeInfo;

@synthesize isSyncingPosts;
@synthesize isSyncingPages;
Expand Down
40 changes: 40 additions & 0 deletions WordPress/Classes/Models/PublicizeInfo+CoreDataClass.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Foundation
import CoreData
import WordPressKit

/// `PublicizeInfo` encapsulates the information related to Jetpack Social auto-sharing.
///
/// WP.com sites will not have a `PublicizeInfo`, and currently doesn't have auto-sharing limitations.
/// Furthermore, sites eligible for unlimited sharing will still return a `PublicizeInfo` along with its sharing
/// limitations, but the numbers should be ignored (at least for now).
///
@objc public class PublicizeInfo: NSManagedObject {

var sharingLimit: SharingLimit {
SharingLimit(remaining: Int(sharesRemaining), limit: Int(shareLimit))
}

@nonobjc public class func fetchRequest() -> NSFetchRequest<PublicizeInfo> {
return NSFetchRequest<PublicizeInfo>(entityName: "PublicizeInfo")
}

@nonobjc public class func newObject(in context: NSManagedObjectContext) -> PublicizeInfo? {
return NSEntityDescription.insertNewObject(forEntityName: Self.classNameWithoutNamespaces(), into: context) as? PublicizeInfo
}

func configure(with remote: RemotePublicizeInfo) {
self.shareLimit = Int64(remote.shareLimit)
self.toBePublicizedCount = Int64(remote.toBePublicizedCount)
self.sharedPostsCount = Int64(remote.sharedPostsCount)
self.sharesRemaining = Int64(remote.sharesRemaining)
}

/// A value-type representation for Publicize auto-sharing usage.
struct SharingLimit {
/// The remaining shares available for use.
let remaining: Int

/// Maximum number of shares allowed for the site.
let limit: Int
}
}
19 changes: 19 additions & 0 deletions WordPress/Classes/Models/PublicizeInfo+CoreDataProperties.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation
import CoreData

extension PublicizeInfo {
/// The maximum number of Social shares for the associated `blog`.
@NSManaged public var shareLimit: Int64

/// The number of Social sharing to be published in the future.
@NSManaged public var toBePublicizedCount: Int64

/// The number of posts that have been auto-shared.
@NSManaged public var sharedPostsCount: Int64

/// The remaining Social shares available for the associated `blog`.
@NSManaged public var sharesRemaining: Int64

/// The associated Blog instance.
@NSManaged public var blog: Blog?
}
Loading

0 comments on commit 0dbf0f7

Please sign in to comment.