Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/21746-wp-sign-up-happy-path
Browse files Browse the repository at this point in the history
  • Loading branch information
hassaanelgarem committed Oct 15, 2023
2 parents 10ed17e + 222d738 commit 67e1e15
Show file tree
Hide file tree
Showing 133 changed files with 2,935 additions and 2,133 deletions.
2 changes: 1 addition & 1 deletion Gutenberg/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ref:
# Example:
#
# LOCAL_GUTENBERG=../my-gutenberg-fork bundle exec pod install
tag: v1.105.0
tag: v1.106.0
github_org: wordpress-mobile
repo_name: gutenberg-mobile
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PODS:
- FSInteractiveMap (0.1.0)
- Gifu (3.3.1)
- Gridicons (1.2.0)
- Gutenberg (1.105.0)
- Gutenberg (1.106.0)
- JTAppleCalendar (8.0.5)
- Kanvas (1.4.9):
- CropViewController
Expand Down Expand Up @@ -111,7 +111,7 @@ DEPENDENCIES:
- FSInteractiveMap (from `https://github.com/wordpress-mobile/FSInteractiveMap.git`, tag `0.2.0`)
- Gifu (= 3.3.1)
- Gridicons (~> 1.2)
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.105.0.podspec`)
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.106.0.podspec`)
- JTAppleCalendar (~> 8.0.5)
- Kanvas (~> 1.4.4)
- MediaEditor (>= 1.2.2, ~> 1.2)
Expand Down Expand Up @@ -184,7 +184,7 @@ EXTERNAL SOURCES:
:git: https://github.com/wordpress-mobile/FSInteractiveMap.git
:tag: 0.2.0
Gutenberg:
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.105.0.podspec
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.106.0.podspec

CHECKOUT OPTIONS:
FSInteractiveMap:
Expand All @@ -207,7 +207,7 @@ SPEC CHECKSUMS:
FSInteractiveMap: a396f610f48b76cb540baa87139d056429abda86
Gifu: 416d4e38c4c2fed012f019e0a1d3ffcb58e5b842
Gridicons: 4455b9f366960121430e45997e32112ae49ffe1d
Gutenberg: 8c216a2ee60fcfacffd470d05ffbd7fbf01886eb
Gutenberg: 46edef6239e4fa8c032aee57f67c9a258edf0cc1
JTAppleCalendar: 16c6501b22cb27520372c28b0a2e0b12c8d0cd73
Kanvas: cc027f8058de881a4ae2b5aa5f05037b6d054d08
MediaEditor: d08314cfcbfac74361071a306b4bc3a39b3356ae
Expand Down
7 changes: 7 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
-----
* [*] Fix a crash when the blog's blogging prompt settings contain invalid JSON [#21677]
* [*] [WordPress-only] Fixes an issue where users would land on the Reader after signup while it should not be accessible. [#21751]
* [*] Block Editor: Split formatted text on triple Enter [https://github.com/WordPress/gutenberg/pull/53354]
* [*] Block Editor: Quote block: Ensure border is visible with block-based themes in dark [https://github.com/WordPress/gutenberg/pull/54964]
* [*] (Internal) Remove .nativePhotoPicker feature flag and the disabled code [#21681](https://github.com/wordpress-mobile/WordPress-iOS/pull/21681)

23.4
-----
Expand All @@ -13,6 +16,10 @@
* [*] Fix an issue with non-admins being able to see the plugin menu on the Atomic sites [https://github.com/wordpress-mobile/WordPress-iOS/pull/21657]
* [**] Block Editor: Fallback to Twitter provider when embedding X URLs [https://github.com/WordPress/gutenberg/pull/54876]

23.3.1
-----
* [*] Resolve the unresponsiveness of the compliance popover on iPhone SE devices when large fonts are enabled. [#21609]

23.3
-----
* [***] [Jetpack-only] Lock Screen Widgets are now available on Jetpack. Quickly view your site stats without unlocking your phone. [#21535]
Expand Down
58 changes: 0 additions & 58 deletions WordPress/Classes/Services/MediaService.m
Original file line number Diff line number Diff line change
Expand Up @@ -416,64 +416,6 @@ - (void)deleteMedia:(nonnull NSArray<Media *> *)mediaObjects
});
}

#pragma mark - Getting media

- (void) getMediaWithID:(NSNumber *) mediaID inBlog:(Blog *) blog
success:(void (^)(Media *media))success
failure:(void (^)(NSError *error))failure
{
id<MediaServiceRemote> remote = [self remoteForBlog:blog];
NSManagedObjectID *blogID = blog.objectID;

[remote getMediaWithID:mediaID success:^(RemoteMedia *remoteMedia) {
[self.managedObjectContext performBlock:^{
Blog *blog = (Blog *)[self.managedObjectContext existingObjectWithID:blogID error:nil];
if (!blog) {
return;
}
Media *media = [Media existingMediaWithMediaID:remoteMedia.mediaID inBlog:blog];
if (!media) {
media = [Media makeMediaWithBlog:blog];
}
[MediaHelper updateMedia:media withRemoteMedia:remoteMedia];

[[ContextManager sharedInstance] saveContextAndWait:self.managedObjectContext];

if (success){
success(media);

if ([media hasChanges]) {
NSCAssert(NO, @"The success callback should not modify the Media instance");
[[ContextManager sharedInstance] saveContext:self.managedObjectContext];
}
}
}];
} failure:^(NSError *error) {
if (failure) {
[self.managedObjectContext performBlock:^{
failure(error);
}];
}
}];
}

- (void)getMetadataFromVideoPressID:(NSString *)videoPressID
inBlog:(Blog *)blog
success:(void (^)(RemoteVideoPressVideo *metadata))success
failure:(void (^)(NSError *error))failure
{
id<MediaServiceRemote> remote = [self remoteForBlog:blog];
[remote getMetadataFromVideoPressID:videoPressID isSitePrivate:blog.isPrivate success:^(RemoteVideoPressVideo *metadata) {
if (success) {
success(metadata);
}
} failure:^(NSError * error) {
if (failure) {
failure(error);
}
}];
}

- (void)syncMediaLibraryForBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure
Expand Down
16 changes: 16 additions & 0 deletions WordPress/Classes/Services/Stories/DisabledVideoOverlay.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import UIKit

/// An overlay for videos that exceed allowed duration
class DisabledVideoOverlay: UIView {

static let overlayTransparency: CGFloat = 0.8

init() {
super.init(frame: .zero)
backgroundColor = .gray.withAlphaComponent(Self.overlayTransparency)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
1 change: 0 additions & 1 deletion WordPress/Classes/System/WordPress-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
#import "WPWebViewController.h"
#import "WPTabBarController.h"
#import "WPUserAgent.h"
#import "WPAndDeviceMediaLibraryDataSource.h"
#import "WPLogger.h"
#import "WPException.h"

Expand Down
10 changes: 0 additions & 10 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ enum FeatureFlag: Int, CaseIterable {
case commentModerationUpdate
case compliancePopover
case domainFocus
case nativePhotoPicker
case readerImprovements // pcdRpT-3Eb-p2
case mediaModernization

/// Returns a boolean indicating if the feature is enabled
Expand Down Expand Up @@ -43,10 +41,6 @@ enum FeatureFlag: Int, CaseIterable {
return true
case .domainFocus:
return true
case .nativePhotoPicker:
return true
case .readerImprovements:
return false
case .mediaModernization:
return false
}
Expand Down Expand Up @@ -91,10 +85,6 @@ extension FeatureFlag {
return "Compliance Popover"
case .domainFocus:
return "Domain Focus"
case .nativePhotoPicker:
return "Native Photo Picker"
case .readerImprovements:
return "Reader Improvements v1"
case .mediaModernization:
return "Media Modernization"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum RemoteFeatureFlag: Int, CaseIterable {
case jetpackSocialImprovements
case domainManagement
case plansInSiteCreation
case readerImprovements // pcdRpT-3Eb-p2

var defaultValue: Bool {
switch self {
Expand Down Expand Up @@ -62,6 +63,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return false
case .plansInSiteCreation:
return false
case .readerImprovements:
return false
}
}

Expand Down Expand Up @@ -106,6 +109,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return "domain_management"
case .plansInSiteCreation:
return "plans_in_site_creation"
case .readerImprovements:
return "reader_improvements"
}
}

Expand Down Expand Up @@ -149,6 +154,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return "Domain Management"
case .plansInSiteCreation:
return "Plans in Site Creation"
case .readerImprovements:
return "Reader Improvements v1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Utility/WPTableViewHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ - (void)refreshTableViewPreservingOffset
}
newIndexPath = [self.resultsController indexPathForObject:obj];

if (i > visibleCellFrames.count) {
if (i >= visibleCellFrames.count) {
break;
}

Expand Down
16 changes: 15 additions & 1 deletion WordPress/Classes/Utility/WebKitViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ extension WebKitAuthenticatable {

class WebKitViewController: UIViewController, WebKitAuthenticatable {
@objc let webView: WKWebView
@objc let progressView = WebProgressView()
@objc let progressView: WebProgressView = {
let progressView = WebProgressView()
progressView.isHidden = true
return progressView
}()
@objc let titleView = NavigationTitleView()
let analyticsSource: String?

Expand Down Expand Up @@ -86,6 +90,7 @@ class WebKitViewController: UIViewController, WebKitAuthenticatable {
@objc var secureInteraction = false
@objc var addsWPComReferrer = false
@objc var customTitle: String?
@objc var displayStatusInNavigationBar = true
private let opensNewInSafari: Bool
let linkBehavior: LinkBehavior

Expand Down Expand Up @@ -128,6 +133,7 @@ class WebKitViewController: UIViewController, WebKitAuthenticatable {
opensNewInSafari = configuration.opensNewInSafari
onClose = configuration.onClose
analyticsSource = configuration.analyticsSource
displayStatusInNavigationBar = configuration.displayStatusInNavigationBar

super.init(nibName: nil, bundle: nil)
hidesBottomBarWhenPushed = true
Expand Down Expand Up @@ -253,6 +259,10 @@ class WebKitViewController: UIViewController, WebKitAuthenticatable {
// MARK: Navigation bar setup

@objc func configureNavigation() {
guard displayStatusInNavigationBar else {
return
}

setupNavBarTitleView()
setupRefreshButton()

Expand Down Expand Up @@ -470,6 +480,10 @@ class WebKitViewController: UIViewController, WebKitAuthenticatable {
}

override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
guard displayStatusInNavigationBar else {
return
}

guard let object = object as? WKWebView,
object == webView,
let keyPath = keyPath else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class WebViewControllerConfiguration: NSObject {
@objc var optionsButton: UIBarButtonItem?
@objc var secureInteraction = false
@objc var addsWPComReferrer = false
@objc var displayStatusInNavigationBar = true
@objc var analyticsSource: String?

/// Opens any new pages in Safari. Otherwise, a new web view will be opened
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,11 @@ final class MySiteViewController: UIViewController, UIScrollViewDelegate, NoSite

func didTapAccountAndSettingsButton() {
let meViewController = MeViewController()
showDetailViewController(meViewController, sender: self)
if MySitesCoordinator.isSplitViewEnabled {
showDetailViewController(meViewController, sender: self)
} else {
navigationController?.pushViewController(meViewController, animated: true)
}
}

@objc
Expand Down Expand Up @@ -884,6 +888,8 @@ extension MySiteViewController: BlogDetailsPresentationDelegate {
blogDetailsViewController?.showDetailView(for: subsection)
}

// TODO: Refactor presentation from routes
// More context: https://github.com/wordpress-mobile/WordPress-iOS/issues/21759
func presentBlogDetailsViewController(_ viewController: UIViewController) {
viewController.loadViewIfNeeded()
if MySitesCoordinator.isSplitViewEnabled {
Expand All @@ -894,7 +900,12 @@ extension MySiteViewController: BlogDetailsPresentationDelegate {
blogDetailsViewController?.showDetailViewController(viewController, sender: blogDetailsViewController)
}
} else {
blogDetailsViewController?.show(viewController, sender: nil)
switch currentSection {
case .dashboard:
blogDashboardViewController?.show(viewController, sender: blogDashboardViewController)
case .siteMenu:
blogDetailsViewController?.show(viewController, sender: blogDetailsViewController)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,11 @@ extension SitePickerViewController {

let presenter = makeSiteIconPresenter()
let mediaMenu = MediaPickerMenu(viewController: self, filter: .images)
var actions: [UIAction] = []
if FeatureFlag.nativePhotoPicker.enabled {
actions += [
mediaMenu.makePhotosAction(delegate: presenter),
mediaMenu.makeCameraAction(delegate: presenter),
mediaMenu.makeMediaAction(blog: blog, delegate: presenter)
]
} else {
actions.append(UIAction(
title: SiteIconAlertStrings.Actions.changeSiteIcon,
image: UIImage(systemName: "photo.on.rectangle"),
handler: { [weak self] _ in
guard let self else { return }
presenter.presentPickerFrom(self)
}
))
}
var actions = [
mediaMenu.makePhotosAction(delegate: presenter),
mediaMenu.makeCameraAction(delegate: presenter),
mediaMenu.makeMediaAction(blog: blog, delegate: presenter)
]
if FeatureFlag.siteIconCreator.enabled {
actions.append(UIAction(
title: SiteIconAlertStrings.Actions.createWithEmoji,
Expand Down Expand Up @@ -210,8 +198,6 @@ extension SitePickerViewController {
static let title = NSLocalizedString("Update Site Icon", comment: "Title for sheet displayed allowing user to update their site icon")

enum Actions {
static let changeSiteIcon = NSLocalizedString("Change Site Icon", comment: "Change site icon button")
static let chooseImage = NSLocalizedString("Choose Image From My Device", comment: "Button allowing the user to choose an image from their device to use as their site icon")
static let createWithEmoji = NSLocalizedString("Create With Emoji", comment: "Button allowing the user to create a site icon by choosing an emoji character")
static let removeSiteIcon = NSLocalizedString("Remove Site Icon", comment: "Remove site icon button")
static let cancel = NSLocalizedString("Cancel", comment: "Cancel button")
Expand Down
Loading

0 comments on commit 67e1e15

Please sign in to comment.