From d204b03633bdbe8dfea5645893b52a4d828545e5 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 30 Jun 2023 19:47:24 +1200 Subject: [PATCH 01/46] Retain a notification observer in StatsForegroundObservable --- .../Stats/StatsForegroundObservable.swift | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Stats/StatsForegroundObservable.swift b/WordPress/Classes/ViewRelated/Stats/StatsForegroundObservable.swift index 447af1b75cf2..63d45d12e1ef 100644 --- a/WordPress/Classes/ViewRelated/Stats/StatsForegroundObservable.swift +++ b/WordPress/Classes/ViewRelated/Stats/StatsForegroundObservable.swift @@ -4,9 +4,11 @@ protocol StatsForegroundObservable: AnyObject { func reloadStatsData() } +private var observerKey = 0 + extension StatsForegroundObservable where Self: UIViewController { func addWillEnterForegroundObserver() { - NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, + enterForegroundObserver = NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: nil) { [weak self] _ in self?.reloadStatsData() @@ -14,8 +16,18 @@ extension StatsForegroundObservable where Self: UIViewController { } func removeWillEnterForegroundObserver() { - NotificationCenter.default.removeObserver(self, - name: UIApplication.willEnterForegroundNotification, - object: nil) + if let enterForegroundObserver { + NotificationCenter.default.removeObserver(enterForegroundObserver) + } + enterForegroundObserver = nil + } + + private var enterForegroundObserver: NSObjectProtocol? { + get { + objc_getAssociatedObject(self, &observerKey) as? NSObjectProtocol + } + set { + objc_setAssociatedObject(self, &observerKey, newValue, .OBJC_ASSOCIATION_RETAIN) + } } } From c7b76d93ebc2fc3520266cb1d08cd3697efc2283 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 4 Jul 2023 15:40:21 +1200 Subject: [PATCH 02/46] Move notification handler to its own function --- .../ChangeUsernameViewController.swift | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index 062ba6d33b29..a40cdea405dd 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -156,23 +156,30 @@ private extension ChangeUsernameViewController { textField.placeholder = Constants.Alert.confirm NotificationCenter.default.addObserver(forName: UITextField.textDidChangeNotification, object: textField, - queue: .main) {_ in - if let text = textField.text, - !text.isEmpty, - let username = self?.viewModel.selectedUsername, - text == username { - self?.changeUsernameAction?.isEnabled = true - textField.textColor = .success - return - } - self?.changeUsernameAction?.isEnabled = false - textField.textColor = .text + queue: .main) { [weak self] notification in + self?.handleTextDidChangeNotification(notification) } } DDLogInfo("Prompting user for confirmation of change username") return alertController } + @objc func handleTextDidChangeNotification(_ notification: Foundation.Notification) { + guard let textField = notification.object as? UITextField else { + return + } + + if let text = textField.text, + !text.isEmpty, + text == self.viewModel.selectedUsername { + self.changeUsernameAction?.isEnabled = true + textField.textColor = .success + return + } + self.changeUsernameAction?.isEnabled = false + textField.textColor = .text + } + enum Constants { static let actionButtonTitle = NSLocalizedString("Save", comment: "Settings Text save button title") static let username = NSLocalizedString("Username", comment: "The header and main title") From 6d286e50096b480439977d9639193543444ee7e3 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 4 Jul 2023 15:42:47 +1200 Subject: [PATCH 03/46] Update notification handler function --- .../ChangeUsernameViewController.swift | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index a40cdea405dd..bdf7803e888e 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -169,15 +169,9 @@ private extension ChangeUsernameViewController { return } - if let text = textField.text, - !text.isEmpty, - text == self.viewModel.selectedUsername { - self.changeUsernameAction?.isEnabled = true - textField.textColor = .success - return - } - self.changeUsernameAction?.isEnabled = false - textField.textColor = .text + let enabled = textField.text?.isEmpty == false && textField.text == self.viewModel.selectedUsername + changeUsernameAction?.isEnabled = enabled + textField.textColor = enabled ? .success : .text } enum Constants { From 6784a648118e53875cc77bbaf442ab87611b30d1 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 4 Jul 2023 15:51:47 +1200 Subject: [PATCH 04/46] Fix incorrectly unregistered notification observer --- .../ChangeUsernameViewController.swift | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index bdf7803e888e..2e5affc71539 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -15,6 +15,8 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { } return saveItem }() + + private weak var confirmationController: UIAlertController? private var changeUsernameAction: UIAlertAction? init(service: AccountSettingsService, settings: AccountSettings?, completionBlock: @escaping CompletionBlock) { @@ -31,6 +33,13 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { super.viewDidLoad() setupViewModel() setupUI() + + NotificationCenter.default.addObserver( + self, + selector: #selector(handleTextDidChangeNotification(_:)), + name: UITextField.textDidChangeNotification, + object: nil + ) } override func viewWillAppear(_ animated: Bool) { @@ -105,7 +114,9 @@ private extension ChangeUsernameViewController { } func save() { - present(changeUsernameConfirmationPrompt(), animated: true) + let controller = changeUsernameConfirmationPrompt() + present(controller, animated: true) + confirmationController = controller } func changeUsername() { @@ -135,10 +146,7 @@ private extension ChangeUsernameViewController { preferredStyle: .alert) alertController.addAttributeMessage(String(format: Constants.Alert.message, viewModel.selectedUsername), highlighted: viewModel.selectedUsername) - alertController.addCancelActionWithTitle(Constants.Alert.cancel, handler: { [weak alertController] _ in - if let textField = alertController?.textFields?.first { - NotificationCenter.default.removeObserver(textField, name: UITextField.textDidChangeNotification, object: nil) - } + alertController.addCancelActionWithTitle(Constants.Alert.cancel, handler: { _ in DDLogInfo("User cancelled alert") }) changeUsernameAction = alertController.addDefaultActionWithTitle(Constants.Alert.change, handler: { [weak alertController] _ in @@ -148,27 +156,30 @@ private extension ChangeUsernameViewController { return } DDLogInfo("User changes username") - NotificationCenter.default.removeObserver(textField, name: UITextField.textDidChangeNotification, object: nil) self.changeUsername() }) changeUsernameAction?.isEnabled = false - alertController.addTextField { [weak self] textField in + alertController.addTextField { textField in textField.placeholder = Constants.Alert.confirm - NotificationCenter.default.addObserver(forName: UITextField.textDidChangeNotification, - object: textField, - queue: .main) { [weak self] notification in - self?.handleTextDidChangeNotification(notification) - } } DDLogInfo("Prompting user for confirmation of change username") return alertController } @objc func handleTextDidChangeNotification(_ notification: Foundation.Notification) { - guard let textField = notification.object as? UITextField else { + guard notification.name == UITextField.textDidChangeNotification, + let confirmationController, + let textField = notification.object as? UITextField, + confirmationController.textFields?.contains(textField) == true + else { + DDLogInfo("The notification is not sent from the text field within the change username confirmation prompt") return } + // We need to add another condition to check if the text field is the username confirmation text field, if there + // are more than one text field in the prompt. + precondition(confirmationController.textFields?.count == 1, "There should be only one text field in the prompt") + let enabled = textField.text?.isEmpty == false && textField.text == self.viewModel.selectedUsername changeUsernameAction?.isEnabled = enabled textField.textColor = enabled ? .success : .text From 549f96ee9158e90fa4f182b9ecdcfe754662528a Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 4 Jul 2023 15:53:03 +1200 Subject: [PATCH 05/46] Fix a retain cycle between view controller and alert action --- .../Change Username/ChangeUsernameViewController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index 2e5affc71539..13ac46dfe62d 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -149,8 +149,9 @@ private extension ChangeUsernameViewController { alertController.addCancelActionWithTitle(Constants.Alert.cancel, handler: { _ in DDLogInfo("User cancelled alert") }) - changeUsernameAction = alertController.addDefaultActionWithTitle(Constants.Alert.change, handler: { [weak alertController] _ in - guard let textField = alertController?.textFields?.first, + changeUsernameAction = alertController.addDefaultActionWithTitle(Constants.Alert.change, handler: { [weak alertController, weak self] _ in + guard let self, let alertController else { return } + guard let textField = alertController.textFields?.first, textField.text == self.viewModel.selectedUsername else { DDLogInfo("Username confirmation failed") return From 17c3f69d05c8b1b3a863df2ce62cc0f82e1246d6 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 4 Jul 2023 15:59:05 +1200 Subject: [PATCH 06/46] Delete `changeUsernameAction` property --- .../Change Username/ChangeUsernameViewController.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index 13ac46dfe62d..7c899e58b112 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -17,7 +17,6 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { }() private weak var confirmationController: UIAlertController? - private var changeUsernameAction: UIAlertAction? init(service: AccountSettingsService, settings: AccountSettings?, completionBlock: @escaping CompletionBlock) { self.viewModel = ChangeUsernameViewModel(service: service, settings: settings) @@ -149,7 +148,7 @@ private extension ChangeUsernameViewController { alertController.addCancelActionWithTitle(Constants.Alert.cancel, handler: { _ in DDLogInfo("User cancelled alert") }) - changeUsernameAction = alertController.addDefaultActionWithTitle(Constants.Alert.change, handler: { [weak alertController, weak self] _ in + let action = alertController.addDefaultActionWithTitle(Constants.Alert.change, handler: { [weak alertController, weak self] _ in guard let self, let alertController else { return } guard let textField = alertController.textFields?.first, textField.text == self.viewModel.selectedUsername else { @@ -159,7 +158,7 @@ private extension ChangeUsernameViewController { DDLogInfo("User changes username") self.changeUsername() }) - changeUsernameAction?.isEnabled = false + action.isEnabled = false alertController.addTextField { textField in textField.placeholder = Constants.Alert.confirm } @@ -181,6 +180,10 @@ private extension ChangeUsernameViewController { // are more than one text field in the prompt. precondition(confirmationController.textFields?.count == 1, "There should be only one text field in the prompt") + let actions = confirmationController.actions.filter({ $0.title == Constants.Alert.change }) + precondition(actions.count == 1, "More than one 'Change username' action found") + let changeUsernameAction = actions.first + let enabled = textField.text?.isEmpty == false && textField.text == self.viewModel.selectedUsername changeUsernameAction?.isEnabled = enabled textField.textColor = enabled ? .success : .text From 69b707af3e89f66a0e2da03ca5cac3eb9a5f5346 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 5 Jul 2023 10:13:09 +1200 Subject: [PATCH 07/46] Only observe text field change notification from the alert --- .../ChangeUsernameViewController.swift | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index 7c899e58b112..8dd57cb91311 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -1,3 +1,4 @@ +import Combine import WordPressAuthenticator class ChangeUsernameViewController: SignupUsernameTableViewController { @@ -16,7 +17,12 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { return saveItem }() - private weak var confirmationController: UIAlertController? + private var confirmationTextObserver: AnyCancellable? + private weak var confirmationController: UIAlertController? { + didSet { + observeConfirmationTextField() + } + } init(service: AccountSettingsService, settings: AccountSettings?, completionBlock: @escaping CompletionBlock) { self.viewModel = ChangeUsernameViewModel(service: service, settings: settings) @@ -32,13 +38,6 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { super.viewDidLoad() setupViewModel() setupUI() - - NotificationCenter.default.addObserver( - self, - selector: #selector(handleTextDidChangeNotification(_:)), - name: UITextField.textDidChangeNotification, - object: nil - ) } override func viewWillAppear(_ animated: Bool) { @@ -166,19 +165,35 @@ private extension ChangeUsernameViewController { return alertController } - @objc func handleTextDidChangeNotification(_ notification: Foundation.Notification) { - guard notification.name == UITextField.textDidChangeNotification, - let confirmationController, - let textField = notification.object as? UITextField, - confirmationController.textFields?.contains(textField) == true + func observeConfirmationTextField() { + confirmationTextObserver?.cancel() + confirmationTextObserver = nil + + guard let confirmationController, + let textField = confirmationController.textFields?.first else { - DDLogInfo("The notification is not sent from the text field within the change username confirmation prompt") return } // We need to add another condition to check if the text field is the username confirmation text field, if there // are more than one text field in the prompt. - precondition(confirmationController.textFields?.count == 1, "There should be only one text field in the prompt") + assert(confirmationController.textFields?.count == 1, "There should be only one text field in the prompt") + + confirmationTextObserver = NotificationCenter.default + .publisher(for: UITextField.textDidChangeNotification, object: textField) + .sink(receiveValue: { [weak self] in + self?.handleTextDidChangeNotification($0) + }) + } + + func handleTextDidChangeNotification(_ notification: Foundation.Notification) { + guard notification.name == UITextField.textDidChangeNotification, + let confirmationController, + let textField = notification.object as? UITextField + else { + DDLogInfo("The notification is not sent from the text field within the change username confirmation prompt") + return + } let actions = confirmationController.actions.filter({ $0.title == Constants.Alert.change }) precondition(actions.count == 1, "More than one 'Change username' action found") From 66fe483570ed8b570ea1c26a3fa6c601cba26868 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 5 Jul 2023 13:45:23 +1200 Subject: [PATCH 08/46] Use Combine API to observe notifications in WPLoggingStack --- .../Utility/Logging/WPCrashLoggingProvider.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/WordPress/Classes/Utility/Logging/WPCrashLoggingProvider.swift b/WordPress/Classes/Utility/Logging/WPCrashLoggingProvider.swift index 43770b7f486a..17582673230c 100644 --- a/WordPress/Classes/Utility/Logging/WPCrashLoggingProvider.swift +++ b/WordPress/Classes/Utility/Logging/WPCrashLoggingProvider.swift @@ -1,4 +1,5 @@ import UIKit +import Combine import AutomatticTracks /// A wrapper around the logging stack – provides shared initialization and configuration for Tracks Crash and Event Logging @@ -12,6 +13,8 @@ struct WPLoggingStack { private let eventLoggingDataProvider = EventLoggingDataProvider.fromDDFileLogger(WPLogger.shared().fileLogger) private let eventLoggingDelegate = EventLoggingDelegate() + private let enterForegroundObserver: AnyCancellable + init() { let eventLogging = EventLogging(dataSource: eventLoggingDataProvider, delegate: eventLoggingDelegate) @@ -20,18 +23,16 @@ struct WPLoggingStack { self.crashLogging = CrashLogging(dataProvider: WPCrashLoggingDataProvider(), eventLogging: eventLogging) /// Upload any remaining files any time the app becomes active - let willEnterForeground = UIApplication.willEnterForegroundNotification - NotificationCenter.default.addObserver(forName: willEnterForeground, object: nil, queue: nil, using: self.willEnterForeground) + enterForegroundObserver = NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification) + .sink(receiveValue: { [eventLogging] _ in + eventLogging.uploadNextLogFileIfNeeded() + DDLogDebug("📜 Resumed encrypted log upload queue due to app entering foreground") + }) } func start() throws { _ = try crashLogging.start() } - - private func willEnterForeground(note: Foundation.Notification) { - self.eventLogging.uploadNextLogFileIfNeeded() - DDLogDebug("📜 Resumed encrypted log upload queue due to app entering foreground") - } } struct WPCrashLoggingDataProvider: CrashLoggingDataProvider { From e44432eb019fc263ab39a51fdc6a75f86ab31dd9 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Thu, 6 Jul 2023 10:20:08 +1200 Subject: [PATCH 09/46] Fix memory leaks on viewing a post from a notification --- .../Reader/Comments/ReaderCommentsFollowPresenter.swift | 2 +- .../Detail/Views/ReaderDetailCommentsTableViewDelegate.swift | 2 +- .../Reader/Detail/Views/ReaderDetailHeaderView.swift | 4 ++-- .../Reader/Detail/Views/ReaderDetailLikesView.swift | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsFollowPresenter.swift b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsFollowPresenter.swift index d3d24c21c008..6736584f10a2 100644 --- a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsFollowPresenter.swift +++ b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsFollowPresenter.swift @@ -15,7 +15,7 @@ class ReaderCommentsFollowPresenter: NSObject { private let post: ReaderPost private weak var delegate: ReaderCommentsFollowPresenterDelegate? - private let presentingViewController: UIViewController + private unowned let presentingViewController: UIViewController private let followCommentsService: FollowCommentsService? // MARK: - Initialization diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift index 4cf701ed5f16..362e679b03b8 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift @@ -7,7 +7,7 @@ class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UI private(set) var totalComments = 0 private var post: ReaderPost? - private var presentingViewController: UIViewController? + private weak var presentingViewController: UIViewController? private weak var buttonDelegate: BorderedButtonTableViewCellDelegate? private(set) var headerView: ReaderDetailCommentsHeader? var followButtonTappedClosure: (() ->Void)? diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailHeaderView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailHeaderView.swift index e568c03ecef8..7109c297eb0e 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailHeaderView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailHeaderView.swift @@ -1,7 +1,7 @@ import UIKit import AutomatticTracks -protocol ReaderDetailHeaderViewDelegate { +protocol ReaderDetailHeaderViewDelegate: AnyObject { func didTapBlogName() func didTapMenuButton(_ sender: UIView) func didTapHeaderAvatar() @@ -43,7 +43,7 @@ class ReaderDetailHeaderView: UIStackView, NibLoadable { /// Any interaction with the header is sent to the delegate /// - var delegate: ReaderDetailHeaderViewDelegate? + weak var delegate: ReaderDetailHeaderViewDelegate? func configure(for post: ReaderPost) { self.post = post diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesView.swift index 6e220b113af7..be506522818d 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesView.swift @@ -1,6 +1,6 @@ import UIKit -protocol ReaderDetailLikesViewDelegate { +protocol ReaderDetailLikesViewDelegate: AnyObject { func didTapLikesView() } @@ -13,7 +13,7 @@ class ReaderDetailLikesView: UIView, NibLoadable { @IBOutlet private weak var selfAvatarImageView: CircularImageView! static let maxAvatarsDisplayed = 5 - var delegate: ReaderDetailLikesViewDelegate? + weak var delegate: ReaderDetailLikesViewDelegate? /// Stores the number of total likes _without_ adding the like from self. private var totalLikes: Int = 0 From 2a9ece2b5b0393d8639e7033ecc8bf240320e980 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 23 Jun 2023 18:14:28 -0400 Subject: [PATCH 10/46] Add improved feature flag picker --- .../FeatureFlagOverrideStore.swift | 4 + .../App Settings/DebugFeatureFlagsView.swift | 175 ++++++++++++++++++ .../DebugMenuViewController.swift | 39 +--- WordPress/WordPress.xcodeproj/project.pbxproj | 6 + 4 files changed, 194 insertions(+), 30 deletions(-) create mode 100644 WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlagOverrideStore.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlagOverrideStore.swift index 0b9b458757e5..fee62cdf6fdb 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlagOverrideStore.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlagOverrideStore.swift @@ -45,6 +45,10 @@ struct FeatureFlagOverrideStore { } } + func removeOverride(for featureFlag: OverridableFlag) { + store.removeObject(forKey: key(for: featureFlag)) + } + /// - returns: The overridden value for the specified feature flag, if one exists. /// If no override exists, returns `nil`. /// diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift b/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift new file mode 100644 index 000000000000..da39df12e583 --- /dev/null +++ b/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift @@ -0,0 +1,175 @@ +import SwiftUI + +struct DebugFeatureFlagsView: View { + @StateObject private var viewModel = DebugFeatureFlagsViewModel() + + var body: some View { + List { + sections + } + .tint(Color(UIColor.jetpackGreen)) + .listStyle(.grouped) + .searchable(text: $viewModel.filterTerm) + .navigationTitle(navigationTitle) + .navigationBarTitleDisplayMode(.inline) + .apply(addToolbarTitleMenu) + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Menu(content: { + Button("Enable All Flags", action: viewModel.enableAllFlags) + Button("Reset All Flags", role: .destructive, action: viewModel.reset) + }, label: { + Image(systemName: "ellipsis.circle") + }) + } + } + } + + @ViewBuilder + private var sections: some View { + let remoteFlags = viewModel.getRemoteFeatureFlags() + if !remoteFlags.isEmpty { + Section("Remote Feature Flags") { + ForEach(remoteFlags, id: \.self) { flag in + makeToggle(flag.description, isOn: viewModel.binding(for: flag), isOverriden: viewModel.isOverriden(flag)) + } + } + } + + let localFlags = viewModel.getLocalFeatureFlags() + if !localFlags.isEmpty { + Section("Local Feature Flags") { + ForEach(localFlags, id: \.self) { flag in + makeToggle(flag.description, isOn: viewModel.binding(for: flag), isOverriden: viewModel.isOverriden(flag)) + } + } + } + } + + private func makeToggle(_ title: String, isOn: Binding, isOverriden: Bool) -> some View { + Toggle(isOn: isOn) { + VStack(alignment: .leading) { + Text(title) + if isOverriden { + Text("Overriden") + .font(.subheadline) + .foregroundColor(.secondary) + } + } + } + } + + @ViewBuilder + func addToolbarTitleMenu(_ view: T) -> some View { + if #available(iOS 16, *) { + view.toolbarTitleMenu { + Picker("Filter", selection: $viewModel.filter) { + Text("Feature Flags (All)").tag(DebugFeatureFlagFilter.all) + Text("Remote Feature Flags").tag(DebugFeatureFlagFilter.remote) + Text("Local Feature Flags").tag(DebugFeatureFlagFilter.local) + }.pickerStyle(.inline) + } + } else { + view + } + } + + private var navigationTitle: String { + switch viewModel.filter { + case .all: return "Feature Flags" + case .remote: return "Remote Feature Flags" + case .local: return "Local Feature Flags" + } + } +} + +private final class DebugFeatureFlagsViewModel: ObservableObject { + private let remoteStore = RemoteFeatureFlagStore() + private let overrideStore = FeatureFlagOverrideStore() + + private let allRemoteFlags = RemoteFeatureFlag.allCases.filter(\.canOverride) + private let allLocalFlags = FeatureFlag.allCases.filter(\.canOverride) + + @Published var filter: DebugFeatureFlagFilter = .all + @Published var filterTerm = "" + + // MARK: Remote Feature Flags + + func getRemoteFeatureFlags() -> [RemoteFeatureFlag] { + guard [.all, .remote].contains(filter) else { return [] } + guard !filterTerm.isEmpty else { return allRemoteFlags } + return allRemoteFlags.filter { + $0.description.localizedCaseInsensitiveContains(filterTerm) || + $0.remoteKey.contains(filterTerm) + } + } + + func binding(for flag: RemoteFeatureFlag) -> Binding { + Binding(get: { [unowned self] in + flag.enabled(using: remoteStore, overrideStore: overrideStore) + }, set: { [unowned self] in + override(flag, withValue: $0) + }) + } + + func isOverriden(_ flag: OverridableFlag) -> Bool { + overrideStore.isOverridden(flag) + } + + private func override(_ flag: OverridableFlag, withValue value: Bool) { + try? overrideStore.override(flag, withValue: value) + objectWillChange.send() + } + + // MARK: Local Feature Flags + + func getLocalFeatureFlags() -> [FeatureFlag] { + guard [.all, .local].contains(filter) else { return [] } + guard !filterTerm.isEmpty else { return allLocalFlags } + return allLocalFlags.filter { + $0.description.localizedCaseInsensitiveContains(filterTerm) + } + } + + func binding(for flag: FeatureFlag) -> Binding { + Binding(get: { + flag.enabled + }, set: { [unowned self] in + override(flag, withValue: $0) + }) + } + + // MARK: Actions + + func enableAllFlags() { + for flag in RemoteFeatureFlag.allCases where !flag.enabled() { + try? overrideStore.override(flag, withValue: true) + } + for flag in FeatureFlag.allCases where !flag.enabled { + try? overrideStore.override(flag, withValue: true) + } + objectWillChange.send() + } + + func reset() { + for flag in RemoteFeatureFlag.allCases { + overrideStore.removeOverride(for: flag) + } + for flag in FeatureFlag.allCases { + overrideStore.removeOverride(for: flag) + } + objectWillChange.send() + } +} + +private enum DebugFeatureFlagFilter: Hashable { + case all + case remote + case local +} + +private extension View { + func apply(_ closure: (Self) -> T) -> T { + closure(self) + } +} diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift index 7d46004cb479..9981cfeaa4c2 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift @@ -4,8 +4,6 @@ import SwiftUI class DebugMenuViewController: UITableViewController { private var handler: ImmuTableViewHandler! - private let remoteStore = RemoteFeatureFlagStore() - private let overrideStore = FeatureFlagOverrideStore() override init(style: UITableView.Style) { super.init(style: style) @@ -39,41 +37,25 @@ class DebugMenuViewController: UITableViewController { } private func reloadViewModel() { - let remoteFeatureFlags = RemoteFeatureFlag.allCases.filter({ $0.canOverride }) - let remoteFeatureFlagsRows: [ImmuTableRow] = remoteFeatureFlags.map({ makeRemoteFeatureFlagsRows(for: $0) }) - - let localFeatureFlags = FeatureFlag.allCases.filter({ $0.canOverride }) - let localFeatureFlagsRows: [ImmuTableRow] = localFeatureFlags.map({ makeLocalFeatureFlagsRow(for: $0) }) - handler.viewModel = ImmuTable(sections: [ - ImmuTableSection(headerText: Strings.remoteFeatureFlags, rows: remoteFeatureFlagsRows), - ImmuTableSection(headerText: Strings.localFeatureFlags, rows: localFeatureFlagsRows), + ImmuTableSection(headerText: "General", rows: generalRows), ImmuTableSection(headerText: Strings.tools, rows: toolsRows), ImmuTableSection(headerText: Strings.crashLogging, rows: crashLoggingRows), ImmuTableSection(headerText: Strings.reader, rows: readerRows), ]) } - private func makeLocalFeatureFlagsRow(for flag: FeatureFlag) -> ImmuTableRow { - let overridden: String? = overrideStore.isOverridden(flag) ? Strings.overridden : nil - - return SwitchWithSubtitleRow(title: String(describing: flag), value: flag.enabled, subtitle: overridden, onChange: { isOn in - try? self.overrideStore.override(flag, withValue: isOn) - self.reloadViewModel() - }) - } + // MARK: Tools - private func makeRemoteFeatureFlagsRows(for flag: RemoteFeatureFlag) -> ImmuTableRow { - let overridden: String? = overrideStore.isOverridden(flag) ? Strings.overridden : nil - let enabled = flag.enabled(using: remoteStore, overrideStore: overrideStore) - return SwitchWithSubtitleRow(title: String(describing: flag), value: enabled, subtitle: overridden, onChange: { isOn in - try? self.overrideStore.override(flag, withValue: isOn) - self.reloadViewModel() - }) + private var generalRows: [ImmuTableRow] { + [ + NavigationItemRow(title: "Feature Flags") { [weak self] _ in + let vc = UIHostingController(rootView: DebugFeatureFlagsView()) + self?.navigationController?.pushViewController(vc, animated: true) + } + ] } - // MARK: Tools - private var toolsRows: [ImmuTableRow] { var toolsRows = [ ButtonRow(title: Strings.quickStartForNewSiteRow, action: { [weak self] _ in @@ -196,9 +178,6 @@ class DebugMenuViewController: UITableViewController { } enum Strings { - static let overridden = NSLocalizedString("Overridden", comment: "Used to indicate a setting is overridden in debug builds of the app") - static let localFeatureFlags = NSLocalizedString("debugMenu.section.localFeatureFlags", value: "Local Feature Flags", comment: "Title of the Local Feature Flags screen used in debug builds of the app") - static let remoteFeatureFlags = NSLocalizedString("debugMenu.section.remoteFeatureFlags", value: "Remote Feature Flags", comment: "Title of the Remote Feature Flags screen used in debug builds of the app") static let tools = NSLocalizedString("Tools", comment: "Title of the Tools section of the debug screen used in debug builds of the app") static let sandboxStoreCookieSecretRow = NSLocalizedString("Use Sandbox Store", comment: "Title of a row displayed on the debug screen used to configure the sandbox store use in the App.") static let quickStartForNewSiteRow = NSLocalizedString("Enable Quick Start for New Site", comment: "Title of a row displayed on the debug screen used in debug builds of the app") diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 65d8572b937c..19783c097f90 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -379,6 +379,8 @@ 0CD382862A4B6FCF00612173 /* DashboardBlazeCardCellViewModelTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CD382852A4B6FCE00612173 /* DashboardBlazeCardCellViewModelTest.swift */; }; 0CDEC40C2A2FAF0500BB3A91 /* DashboardBlazeCampaignsCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CDEC40B2A2FAF0500BB3A91 /* DashboardBlazeCampaignsCardView.swift */; }; 0CDEC40D2A2FAF0500BB3A91 /* DashboardBlazeCampaignsCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CDEC40B2A2FAF0500BB3A91 /* DashboardBlazeCampaignsCardView.swift */; }; + 0CED95602A460F4B0020F420 /* DebugFeatureFlagsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CED955F2A460F4B0020F420 /* DebugFeatureFlagsView.swift */; }; + 0CED95612A460F4B0020F420 /* DebugFeatureFlagsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CED955F2A460F4B0020F420 /* DebugFeatureFlagsView.swift */; }; 1702BBDC1CEDEA6B00766A33 /* BadgeLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1702BBDB1CEDEA6B00766A33 /* BadgeLabel.swift */; }; 1702BBE01CF3034E00766A33 /* DomainsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1702BBDF1CF3034E00766A33 /* DomainsService.swift */; }; 17039225282E6D2800F602E9 /* ViewsVisitorsLineChartCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC772B0728201F5300664C02 /* ViewsVisitorsLineChartCell.swift */; }; @@ -6095,6 +6097,7 @@ 0CD382822A4B699E00612173 /* DashboardBlazeCardCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardBlazeCardCellViewModel.swift; sourceTree = ""; }; 0CD382852A4B6FCE00612173 /* DashboardBlazeCardCellViewModelTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardBlazeCardCellViewModelTest.swift; sourceTree = ""; }; 0CDEC40B2A2FAF0500BB3A91 /* DashboardBlazeCampaignsCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardBlazeCampaignsCardView.swift; sourceTree = ""; }; + 0CED955F2A460F4B0020F420 /* DebugFeatureFlagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugFeatureFlagsView.swift; sourceTree = ""; }; 131D0EE49695795ECEDAA446 /* Pods-WordPressTest.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressTest.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressTest/Pods-WordPressTest.release-alpha.xcconfig"; sourceTree = ""; }; 150B6590614A28DF9AD25491 /* Pods-Apps-Jetpack.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Apps-Jetpack.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-Apps-Jetpack/Pods-Apps-Jetpack.release-alpha.xcconfig"; sourceTree = ""; }; 152F25D5C232985E30F56CAC /* Pods-Apps-Jetpack.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Apps-Jetpack.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-Apps-Jetpack/Pods-Apps-Jetpack.debug.xcconfig"; sourceTree = ""; }; @@ -11098,6 +11101,7 @@ 3F29EB6824041F6D005313DE /* About */, FFA162301CB7031A00E2E110 /* AppSettingsViewController.swift */, 17E4CD0B238C33F300C56916 /* DebugMenuViewController.swift */, + 0CED955F2A460F4B0020F420 /* DebugFeatureFlagsView.swift */, F9B862C82478170A008B093C /* EncryptedLogTableViewController.swift */, CECEEB542823164800A28ADE /* MediaCacheSettingsViewController.swift */, 80A2154229D1177A002FE8EB /* RemoteConfigDebugViewController.swift */, @@ -21658,6 +21662,7 @@ E15644E91CE0E47C00D96E64 /* RoundedButton.swift in Sources */, 08A250FC28D9F0E200F50420 /* CommentDetailInfoViewModel.swift in Sources */, 08CC67801C49B65A00153AD7 /* MenuLocation.m in Sources */, + 0CED95602A460F4B0020F420 /* DebugFeatureFlagsView.swift in Sources */, FA73D7D6278D9E5D00DF24B3 /* BlogDashboardViewController.swift in Sources */, 4349B0AF218A477F0034118A /* RevisionsTableViewCell.swift in Sources */, 738B9A5921B85CF20005062B /* KeyboardInfo.swift in Sources */, @@ -24651,6 +24656,7 @@ FABB23282602FC2C00C8785C /* LoggingURLRedactor.swift in Sources */, FABB23292602FC2C00C8785C /* SiteStatsTableViewCells.swift in Sources */, FABB232A2602FC2C00C8785C /* SharingButton.swift in Sources */, + 0CED95612A460F4B0020F420 /* DebugFeatureFlagsView.swift in Sources */, FABB232B2602FC2C00C8785C /* PostActionSheet.swift in Sources */, FABB232C2602FC2C00C8785C /* PublicizeConnection.swift in Sources */, FABB232D2602FC2C00C8785C /* TenorPageable.swift in Sources */, From ad1e74faa933676deef527d948926c6abc31fea4 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 23 Jun 2023 18:31:36 -0400 Subject: [PATCH 11/46] Add a way to show only overriden flags --- .../App Settings/DebugFeatureFlagsView.swift | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift b/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift index da39df12e583..627e6fa80c91 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/DebugFeatureFlagsView.swift @@ -67,6 +67,7 @@ struct DebugFeatureFlagsView: View { Text("Feature Flags (All)").tag(DebugFeatureFlagFilter.all) Text("Remote Feature Flags").tag(DebugFeatureFlagFilter.remote) Text("Local Feature Flags").tag(DebugFeatureFlagFilter.local) + Text("Overriden Feature Flags").tag(DebugFeatureFlagFilter.overriden) }.pickerStyle(.inline) } } else { @@ -79,6 +80,7 @@ struct DebugFeatureFlagsView: View { case .all: return "Feature Flags" case .remote: return "Remote Feature Flags" case .local: return "Local Feature Flags" + case .overriden: return "Overriden Feature Flags" } } } @@ -96,10 +98,15 @@ private final class DebugFeatureFlagsViewModel: ObservableObject { // MARK: Remote Feature Flags func getRemoteFeatureFlags() -> [RemoteFeatureFlag] { - guard [.all, .remote].contains(filter) else { return [] } - guard !filterTerm.isEmpty else { return allRemoteFlags } - return allRemoteFlags.filter { - $0.description.localizedCaseInsensitiveContains(filterTerm) || + allRemoteFlags.filter { + switch filter { + case .all, .remote: return true + case .local: return false + case .overriden: return isOverriden($0) + } + }.filter { + guard !filterTerm.isEmpty else { return true } + return $0.description.localizedCaseInsensitiveContains(filterTerm) || $0.remoteKey.contains(filterTerm) } } @@ -124,10 +131,15 @@ private final class DebugFeatureFlagsViewModel: ObservableObject { // MARK: Local Feature Flags func getLocalFeatureFlags() -> [FeatureFlag] { - guard [.all, .local].contains(filter) else { return [] } - guard !filterTerm.isEmpty else { return allLocalFlags } - return allLocalFlags.filter { - $0.description.localizedCaseInsensitiveContains(filterTerm) + allLocalFlags.filter { + switch filter { + case .all, .local: return true + case .remote: return false + case .overriden: return isOverriden($0) + } + }.filter { + guard !filterTerm.isEmpty else { return true } + return $0.description.localizedCaseInsensitiveContains(filterTerm) } } @@ -166,6 +178,7 @@ private enum DebugFeatureFlagFilter: Hashable { case all case remote case local + case overriden } private extension View { From 7acc7be9f700e90aef45b6937bfa772bdf65a2c0 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 29 Jun 2023 16:59:05 -0400 Subject: [PATCH 12/46] Add localization --- .../Me/App Settings/DebugMenuViewController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift index 9981cfeaa4c2..ab786cb4c732 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/DebugMenuViewController.swift @@ -38,7 +38,7 @@ class DebugMenuViewController: UITableViewController { private func reloadViewModel() { handler.viewModel = ImmuTable(sections: [ - ImmuTableSection(headerText: "General", rows: generalRows), + ImmuTableSection(headerText: Strings.general, rows: generalRows), ImmuTableSection(headerText: Strings.tools, rows: toolsRows), ImmuTableSection(headerText: Strings.crashLogging, rows: crashLoggingRows), ImmuTableSection(headerText: Strings.reader, rows: readerRows), @@ -49,7 +49,7 @@ class DebugMenuViewController: UITableViewController { private var generalRows: [ImmuTableRow] { [ - NavigationItemRow(title: "Feature Flags") { [weak self] _ in + NavigationItemRow(title: Strings.featureFlags) { [weak self] _ in let vc = UIHostingController(rootView: DebugFeatureFlagsView()) self?.navigationController?.pushViewController(vc, animated: true) } @@ -191,8 +191,8 @@ class DebugMenuViewController: UITableViewController { static let readerCssTitle = NSLocalizedString("Reader CSS URL", comment: "Title of the screen that allows the user to change the Reader CSS URL for debug builds") static let readerURLPlaceholder = NSLocalizedString("Default URL", comment: "Placeholder for the reader CSS URL") static let readerURLHint = NSLocalizedString("Add a custom CSS URL here to be loaded in Reader. If you're running Calypso locally this can be something like: http://192.168.15.23:3000/calypso/reader-mobile.css", comment: "Hint for the reader CSS URL field") - static let remoteConfigTitle = NSLocalizedString("debugMenu.remoteConfig.title", - value: "Remote Config", - comment: "Remote Config debug menu title") + static let remoteConfigTitle = NSLocalizedString("debugMenu.remoteConfig.title", value: "Remote Config", comment: "Remote Config debug menu title") + static let general = NSLocalizedString("debugMenu.generalSectionTitle", value: "General", comment: "General section title") + static let featureFlags = NSLocalizedString("debugMenu.featureFlags", value: "Feature Flags", comment: "Feature flags menu item") } } From dd4573cf7ec29527489ef1eaef4bf535dc9ff048 Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:24:00 -0400 Subject: [PATCH 13/46] Update string for Instagram to match API response --- .../Jetpack/Social/JetpackSocialNoConnectionView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift index 2c2f6fa6303a..ed954d7c49d0 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift @@ -84,7 +84,7 @@ class JetpackSocialNoConnectionViewModel: ObservableObject { case twitter case tumblr case linkedin - case instagram + case instagram = "instagram-business" case mastodon case unknown From 03c166c688c0fb634f7e0b1fc620611b55ac69fa Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:28:22 -0400 Subject: [PATCH 14/46] Split `configureShareCellForIndexPath` into multiple functions --- .../Post/PostSettingsViewController.m | 79 +++++++++++-------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 2455b7f05a4d..4660be87b398 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -875,6 +875,49 @@ - (nullable NSURL *)urlForFeaturedImage { return featuredURL; } +- (UITableViewCell *)configureSocialCellForIndexPath:(NSIndexPath *)indexPath + connection:(PublicizeConnection *)connection + canEditSharing:(BOOL)canEditSharing + section:(NSInteger)section +{ + UITableViewCell *cell = [self getWPTableViewImageAndAccessoryCell]; + UIImage *image = [WPStyleGuide iconForService: connection.service]; + [cell.imageView setImage:image]; + if (canEditSharing) { + cell.imageView.tintColor = [WPStyleGuide tintColorForConnectedService: connection.service]; + } + cell.textLabel.text = connection.externalDisplay; + cell.textLabel.enabled = canEditSharing; + if (connection.isBroken) { + cell.accessoryView = section == PostSettingsSectionShare ? + [WPStyleGuide sharingCellWarningAccessoryImageView] : + [WPStyleGuide sharingCellErrorAccessoryImageView]; + } else { + UISwitch *switchAccessory = [[UISwitch alloc] initWithFrame:CGRectZero]; + // This interaction is handled at a cell level + switchAccessory.userInteractionEnabled = NO; + switchAccessory.on = ![self.post publicizeConnectionDisabledForKeyringID:connection.keyringConnectionID]; + switchAccessory.enabled = canEditSharing; + cell.accessoryView = switchAccessory; + } + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.tag = PostSettingsRowShareConnection; + cell.accessibilityIdentifier = [NSString stringWithFormat:@"%@ %@", connection.service, connection.externalDisplay]; + return cell; +} + +- (UITableViewCell *)configureDisclosureCellWithSharing:(BOOL)canEditSharing +{ + UITableViewCell *cell = [self getWPTableViewDisclosureCell]; + cell.textLabel.text = NSLocalizedString(@"Message", @"Label for the share message field on the post settings."); + cell.textLabel.enabled = canEditSharing; + cell.detailTextLabel.text = self.post.publicizeMessage ? self.post.publicizeMessage : self.post.titleForDisplay; + cell.detailTextLabel.enabled = canEditSharing; + cell.tag = PostSettingsRowShareMessage; + cell.accessibilityIdentifier = @"Customize the message"; + return cell; +} + - (UITableViewCell *)configureShareCellForIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell; @@ -883,38 +926,12 @@ - (UITableViewCell *)configureShareCellForIndexPath:(NSIndexPath *)indexPath NSArray *connections = sec == PostSettingsSectionShare ? self.publicizeConnections : self.unsupportedConnections; if (indexPath.row < connections.count) { - cell = [self getWPTableViewImageAndAccessoryCell]; - PublicizeConnection *connection = connections[indexPath.row]; - UIImage *image = [WPStyleGuide iconForService: connection.service]; - [cell.imageView setImage:image]; - if (canEditSharing) { - cell.imageView.tintColor = [WPStyleGuide tintColorForConnectedService: connection.service]; - } - cell.textLabel.text = connection.externalDisplay; - cell.textLabel.enabled = canEditSharing; - if (connection.isBroken) { - cell.accessoryView = sec == PostSettingsSectionShare ? - [WPStyleGuide sharingCellWarningAccessoryImageView] : - [WPStyleGuide sharingCellErrorAccessoryImageView]; - } else { - UISwitch *switchAccessory = [[UISwitch alloc] initWithFrame:CGRectZero]; - // This interaction is handled at a cell level - switchAccessory.userInteractionEnabled = NO; - switchAccessory.on = ![self.post publicizeConnectionDisabledForKeyringID:connection.keyringConnectionID]; - switchAccessory.enabled = canEditSharing; - cell.accessoryView = switchAccessory; - } - cell.selectionStyle = UITableViewCellSelectionStyleNone; - cell.tag = PostSettingsRowShareConnection; - cell.accessibilityIdentifier = [NSString stringWithFormat:@"%@ %@", connection.service, connection.externalDisplay]; + cell = [self configureSocialCellForIndexPath:indexPath + connection:connections[indexPath.row] + canEditSharing:canEditSharing + section:sec]; } else { - cell = [self getWPTableViewDisclosureCell]; - cell.textLabel.text = NSLocalizedString(@"Message", @"Label for the share message field on the post settings."); - cell.textLabel.enabled = canEditSharing; - cell.detailTextLabel.text = self.post.publicizeMessage ? self.post.publicizeMessage : self.post.titleForDisplay; - cell.detailTextLabel.enabled = canEditSharing; - cell.tag = PostSettingsRowShareMessage; - cell.accessibilityIdentifier = @"Customize the message"; + cell = [self configureDisclosureCellWithSharing:canEditSharing]; } cell.userInteractionEnabled = canEditSharing; return cell; From 14da3efe961bc5f1b1ed51d9db56c260841a13c9 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 6 Jul 2023 15:47:44 -0400 Subject: [PATCH 15/46] Fix deprecation warnings --- .../ActionSheetViewController.swift | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift b/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift index 246ce62f37ab..15562d1b6fab 100644 --- a/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift +++ b/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift @@ -33,8 +33,8 @@ class ActionSheetViewController: UIViewController { enum Button { static let height: CGFloat = 54 - static let contentInsets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 18, bottom: 0, right: 35) - static let titleInsets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0) + static let contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 18, bottom: 0, trailing: 35) + static let imagePadding: CGFloat = 16 static let imageTintColor: UIColor = .neutral(.shade30) static let font: UIFont = .preferredFont(forTextStyle: .callout) static let textColor: UIColor = .text @@ -147,27 +147,32 @@ class ActionSheetViewController: UIViewController { updateScrollViewHeight() } - private func createButton(_ handler: @escaping () -> Void) -> UIButton { - let button = UIButton(type: .custom, primaryAction: UIAction(handler: { _ in handler() })) - button.titleLabel?.font = Constants.Button.font - button.setTitleColor(Constants.Button.textColor, for: .normal) - button.imageView?.tintColor = Constants.Button.imageTintColor - button.setBackgroundImage(UIImage(color: .divider), for: .highlighted) - button.titleEdgeInsets = Constants.Button.titleInsets - button.naturalContentHorizontalAlignment = .leading - button.contentEdgeInsets = Constants.Button.contentInsets - button.translatesAutoresizingMaskIntoConstraints = false - button.flipInsetsForRightToLeftLayoutDirection() - button.titleLabel?.adjustsFontForContentSizeCategory = true - return button - } - private func button(_ info: ActionSheetButton) -> UIButton { - let button = createButton(info.action) - - button.setTitle(info.title, for: .normal) - button.setImage(info.image, for: .normal) + let button = UIButton(type: .system, primaryAction: UIAction(handler: { _ in info.action() })) + + button.configuration = { + var configuration = UIButton.Configuration.plain() + configuration.attributedTitle = { + var string = AttributedString(info.title) + string.font = Constants.Button.font + string.foregroundColor = Constants.Button.textColor + return string + }() + configuration.image = info.image + configuration.imageColorTransformer = UIConfigurationColorTransformer { _ in + Constants.Button.imageTintColor + } + configuration.imagePadding = Constants.Button.imagePadding + configuration.contentInsets = Constants.Button.contentInsets + configuration.background.cornerRadius = 0 + return configuration + }() + button.configurationUpdateHandler = { button in + button.configuration?.background.backgroundColor = button.isHighlighted ? .divider : .clear + } + button.contentHorizontalAlignment = .leading button.accessibilityIdentifier = info.identifier + button.translatesAutoresizingMaskIntoConstraints = false if let badge = info.badge { button.addSubview(badge) From 38517cf8723239a1d9a91f594e940ec6933dd2af Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:17:45 -0400 Subject: [PATCH 16/46] Update social icons on the post settings screen --- .../Blog/WPStyleGuide+Sharing.swift | 8 +++++++ .../JetpackSocialNoConnectionView.swift | 21 +------------------ .../Post/PostSettingsViewController.m | 10 +++++++-- .../Contents.json | 0 .../icon-instagram.svg | 0 5 files changed, 17 insertions(+), 22 deletions(-) rename WordPress/Jetpack/AppImages.xcassets/Social/{icon-instagram.imageset => icon-instagram-business.imageset}/Contents.json (100%) rename WordPress/Jetpack/AppImages.xcassets/Social/{icon-instagram.imageset => icon-instagram-business.imageset}/icon-instagram.svg (100%) diff --git a/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift b/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift index 86d845df4d09..b5a780414504 100644 --- a/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift +++ b/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift @@ -69,6 +69,14 @@ extension WPStyleGuide { return image!.withRenderingMode(.alwaysTemplate) } + @objc public class func socialIcon(for service: NSString) -> UIImage { + guard FeatureFlag.jetpackSocial.enabled else { + return iconForService(service) + } + + return UIImage(named: "icon-\(service)") ?? iconForService(service) + } + /// Get's the tint color to use for the specified service when it is connected. /// diff --git a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift index ed954d7c49d0..b604d0804cf0 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift @@ -87,25 +87,6 @@ class JetpackSocialNoConnectionViewModel: ObservableObject { case instagram = "instagram-business" case mastodon case unknown - - var image: UIImage? { - switch self { - case .facebook: - return UIImage(named: "icon-facebook") - case .twitter: - return UIImage(named: "icon-twitter") - case .tumblr: - return UIImage(named: "icon-tumblr") - case .linkedin: - return UIImage(named: "icon-linkedin") - case .instagram: - return UIImage(named: "icon-instagram") - case .mastodon: - return UIImage(named: "icon-mastodon") - case .unknown: - return UIImage(named: "social-default")?.withRenderingMode(.alwaysTemplate) - } - } } private func updateIcons(_ services: [PublicizeService]) { @@ -113,7 +94,7 @@ class JetpackSocialNoConnectionViewModel: ObservableObject { var downloadTasks: [(url: URL, index: Int)] = [] for (index, service) in services.enumerated() { let serviceType = JetpackSocialService(rawValue: service.serviceID) ?? .unknown - let icon = serviceType.image ?? UIImage() + let icon = WPStyleGuide.socialIcon(for: service.serviceID as NSString) icons.append(icon) if serviceType == .unknown { diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 4660be87b398..f2527725dc2f 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -880,10 +880,16 @@ - (UITableViewCell *)configureSocialCellForIndexPath:(NSIndexPath *)indexPath canEditSharing:(BOOL)canEditSharing section:(NSInteger)section { + BOOL isJetpackSocialEnabled = [Feature enabled:FeatureFlagJetpackSocial]; UITableViewCell *cell = [self getWPTableViewImageAndAccessoryCell]; - UIImage *image = [WPStyleGuide iconForService: connection.service]; + UIImage *image = [WPStyleGuide socialIconFor:connection.service]; + if (isJetpackSocialEnabled) { + image = [image resizedImageWithContentMode:UIViewContentModeScaleAspectFill + bounds:CGSizeMake(28.0, 28.0) + interpolationQuality:kCGInterpolationDefault]; + } [cell.imageView setImage:image]; - if (canEditSharing) { + if (canEditSharing && !isJetpackSocialEnabled) { cell.imageView.tintColor = [WPStyleGuide tintColorForConnectedService: connection.service]; } cell.textLabel.text = connection.externalDisplay; diff --git a/WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram.imageset/Contents.json b/WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram-business.imageset/Contents.json similarity index 100% rename from WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram.imageset/Contents.json rename to WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram-business.imageset/Contents.json diff --git a/WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram.imageset/icon-instagram.svg b/WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram-business.imageset/icon-instagram.svg similarity index 100% rename from WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram.imageset/icon-instagram.svg rename to WordPress/Jetpack/AppImages.xcassets/Social/icon-instagram-business.imageset/icon-instagram.svg From 0e902de3655ec71e85070868ceb4c72767f1e3b4 Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Thu, 6 Jul 2023 17:01:15 -0400 Subject: [PATCH 17/46] Open social purchase link on subscribe now tap --- .../PostSettingsViewController+JetpackSocial.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift index f72fc1e1f7a1..9d360d61ec96 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift @@ -44,9 +44,17 @@ extension PostSettingsViewController { } @objc func createRemainingSharesView() -> UIView { - let viewModel = JetpackSocialRemainingSharesViewModel { - // TODO - print("Subscribe tap") + let viewModel = JetpackSocialRemainingSharesViewModel { [weak self] in + guard let blog = self?.apost.blog, + let hostname = blog.hostname, + let url = URL(string: "https://wordpress.com/checkout/\(hostname)/jetpack_social_basic_yearly") else { + return + } + let webViewController = WebViewControllerFactory.controller(url: url, + blog: blog, + source: "post_settings_remaining_shares_subscribe_now") + let navigationController = UINavigationController(rootViewController: webViewController) + self?.present(navigationController, animated: true) } let hostController = UIHostingController(rootView: JetpackSocialSettingsRemainingSharesView(viewModel: viewModel)) hostController.view.translatesAutoresizingMaskIntoConstraints = false From 5fbb2b5ab2c6d80086873ac4e33e269ca9c0c5da Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:08:14 -0400 Subject: [PATCH 18/46] Update display rules and values for the remaining shares view --- ...ackSocialSettingsRemainingSharesView.swift | 6 +-- ...SettingsViewController+JetpackSocial.swift | 44 ++++++++++++++----- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialSettingsRemainingSharesView.swift b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialSettingsRemainingSharesView.swift index 5ae47080ef46..5abedd1a851f 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialSettingsRemainingSharesView.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialSettingsRemainingSharesView.swift @@ -59,9 +59,9 @@ struct JetpackSocialRemainingSharesViewModel { let displayWarning: Bool let onSubscribeTap: () -> Void - init(remaining: Int = 27, - limit: Int = 30, - displayWarning: Bool = false, + init(remaining: Int, + limit: Int, + displayWarning: Bool, onSubscribeTap: @escaping () -> Void) { self.remaining = remaining self.limit = limit diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift index 9d360d61ec96..e13679a84856 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift @@ -36,26 +36,31 @@ extension PostSettingsViewController { let isJetpackSocialEnabled = FeatureFlag.jetpackSocial.enabled let blogSupportsPublicize = apost.blog.supportsPublicize() let blogHasConnections = publicizeConnections.count > 0 - // TODO: Check if there's a share limit + let isSocialSharingLimited = apost.blog.isSocialSharingLimited + let blogHasPublicizeInfo = apost.blog.publicizeInfo != nil return isJetpackSocialEnabled && blogSupportsPublicize && blogHasConnections + && isSocialSharingLimited + && blogHasPublicizeInfo } + + @objc func createRemainingSharesView() -> UIView { - let viewModel = JetpackSocialRemainingSharesViewModel { [weak self] in - guard let blog = self?.apost.blog, - let hostname = blog.hostname, - let url = URL(string: "https://wordpress.com/checkout/\(hostname)/jetpack_social_basic_yearly") else { - return - } - let webViewController = WebViewControllerFactory.controller(url: url, - blog: blog, - source: "post_settings_remaining_shares_subscribe_now") - let navigationController = UINavigationController(rootViewController: webViewController) - self?.present(navigationController, animated: true) + guard let sharingLimit = apost.blog.sharingLimit else { + // This scenario *shouldn't* happen since we check that the publicize info is not nil before + // showing this view + assertionFailure("No sharing limit on the blog") + return UIView() } + + let shouldDisplayWarning = publicizeConnections.count > sharingLimit.remaining + let viewModel = JetpackSocialRemainingSharesViewModel(remaining: sharingLimit.remaining, + limit: sharingLimit.limit, + displayWarning: shouldDisplayWarning, + onSubscribeTap: onSubscribeTap()) let hostController = UIHostingController(rootView: JetpackSocialSettingsRemainingSharesView(viewModel: viewModel)) hostController.view.translatesAutoresizingMaskIntoConstraints = false hostController.view.backgroundColor = .listForeground @@ -96,6 +101,21 @@ private extension PostSettingsViewController { } } + func onSubscribeTap() -> () -> Void { + return { [weak self] in + guard let blog = self?.apost.blog, + let hostname = blog.hostname, + let url = URL(string: "https://wordpress.com/checkout/\(hostname)/jetpack_social_basic_yearly") else { + return + } + let webViewController = WebViewControllerFactory.controller(url: url, + blog: blog, + source: "post_settings_remaining_shares_subscribe_now") + let navigationController = UINavigationController(rootViewController: webViewController) + self?.present(navigationController, animated: true) + } + } + func availableServices() -> [PublicizeService] { let context = apost.managedObjectContext ?? ContextManager.shared.mainContext let services = try? PublicizeService.allPublicizeServices(in: context) From d7dd9582fd4c8a8976eab5129bf0cc65925f2b20 Mon Sep 17 00:00:00 2001 From: Alex Grebenyuk Date: Thu, 6 Jul 2023 23:51:13 -0400 Subject: [PATCH 19/46] Update ActionSheetViewController.swift --- .../System/Action Sheet/ActionSheetViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift b/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift index 15562d1b6fab..0ec101e40121 100644 --- a/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift +++ b/WordPress/Classes/ViewRelated/System/Action Sheet/ActionSheetViewController.swift @@ -33,7 +33,7 @@ class ActionSheetViewController: UIViewController { enum Button { static let height: CGFloat = 54 - static let contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 18, bottom: 0, trailing: 35) + static let contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 18, bottom: 0, trailing: 35) static let imagePadding: CGFloat = 16 static let imageTintColor: UIColor = .neutral(.shade30) static let font: UIFont = .preferredFont(forTextStyle: .callout) From 9986f5a9329415e5a6bbf54e4c1d9dc3e3c7e2b5 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 7 Jul 2023 11:09:21 -0400 Subject: [PATCH 20/46] Show campaigns list from site menu --- .../BlazeCampaignsViewController.swift | 4 ++++ .../Blog Details/BlogDetailsViewController.m | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift b/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift index f442473c0d46..9fdc053487f0 100644 --- a/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift +++ b/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift @@ -42,6 +42,10 @@ final class BlazeCampaignsViewController: UIViewController, NoResultsViewHost, B super.init(nibName: nil, bundle: nil) } + @objc class func make(blog: Blog) -> BlazeCampaignsViewController { + BlazeCampaignsViewController(blog: blog) + } + required init?(coder: NSCoder) { // This VC is designed to be initialized programmatically. fatalError("init(coder:) has not been implemented") diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m index 935cb8bbfded..1d7e979e9588 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m @@ -805,7 +805,7 @@ - (BlogDetailsRow *)blazeRow callback:^{ [weakSelf showBlaze]; }]; - blazeRow.showsSelectionState = NO; + blazeRow.showsSelectionState = [RemoteFeature enabled:RemoteFeatureFlagBlazeManageCampaigns]; return blazeRow; } @@ -1984,11 +1984,16 @@ - (void)showActivity - (void)showBlaze { [BlazeEventsTracker trackEntryPointTappedFor:BlazeSourceMenuItem]; - - [BlazeFlowCoordinator presentBlazeInViewController:self - source:BlazeSourceMenuItem - blog:self.blog - post:nil]; + + if ([RemoteFeature enabled:RemoteFeatureFlagBlazeManageCampaigns]) { + BlazeCampaignsViewController *controller = [BlazeCampaignsViewController makeWithBlog:self.blog]; + [self.presentationDelegate presentBlogDetailsViewController:controller]; + } else { + [BlazeFlowCoordinator presentBlazeInViewController:self + source:BlazeSourceMenuItem + blog:self.blog + post:nil]; + } } - (void)showScan From 2cff209997c9a87caf355df8d38daee3721a80ed Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 7 Jul 2023 12:57:05 -0400 Subject: [PATCH 21/46] Remove unused code --- .../System/Floating Create Button/SheetActions.swift | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift b/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift index 6bbde69070af..ba7c16a2cd88 100644 --- a/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift +++ b/WordPress/Classes/ViewRelated/System/Floating Create Button/SheetActions.swift @@ -63,16 +63,4 @@ struct StoryAction: ActionSheetItem { handler() }) } - - static func newBadge(title: String) -> UIButton { - let badge = UIButton(type: .custom) - badge.translatesAutoresizingMaskIntoConstraints = false - badge.setTitle(title, for: .normal) - badge.titleLabel?.font = Constants.Badge.font - badge.contentEdgeInsets = Constants.Badge.insets - badge.layer.cornerRadius = Constants.Badge.cornerRadius - badge.isUserInteractionEnabled = false - badge.backgroundColor = Constants.Badge.backgroundColor - return badge - } } From 436ded4fc5f4189fe37949debc8f1b9301d2d240 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 7 Jul 2023 13:19:57 -0400 Subject: [PATCH 22/46] Fix UIButton deprecation warnings --- .../ViewRelated/What's New/Views/WhatIsNewView.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/What's New/Views/WhatIsNewView.swift b/WordPress/Classes/ViewRelated/What's New/Views/WhatIsNewView.swift index 7308bffc3ca3..b5d757b6669f 100644 --- a/WordPress/Classes/ViewRelated/What's New/Views/WhatIsNewView.swift +++ b/WordPress/Classes/ViewRelated/What's New/Views/WhatIsNewView.swift @@ -61,9 +61,14 @@ class WhatIsNewView: UIView { private lazy var backButton: UIButton = { let button = UIButton(type: .custom) button.translatesAutoresizingMaskIntoConstraints = false - button.contentEdgeInsets = UIEdgeInsets(top: self.appearance.backButtonInset, left: self.appearance.backButtonInset, bottom: 0, right: 0) - button.setImage(UIImage.gridicon(.arrowLeft), for: .normal) + button.configuration = { + var configuration = UIButton.Configuration.plain() + configuration.contentInsets = NSDirectionalEdgeInsets(top: self.appearance.backButtonInset, leading: self.appearance.backButtonInset, bottom: 0, trailing: 0) + configuration.image = UIImage.gridicon(.arrowLeft) + return configuration + }() button.addTarget(self, action: #selector(backButtonTapped), for: .touchUpInside) + button.semanticContentAttribute = .forceLeftToRight button.accessibilityLabel = NSLocalizedString("Back", comment: "Dismiss view") button.tintColor = self.appearance.backButtonTintColor return button From 49957b098b3545260af9b6332235faeed0040093 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 7 Jul 2023 15:52:15 -0400 Subject: [PATCH 23/46] Fix skipping duplicate files warning --- WordPress/WordPress.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 1437352faa27..44334cd44c3f 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -803,7 +803,6 @@ 3F421DF524A3EC2B00CA9B9E /* Spotlightable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F421DF424A3EC2B00CA9B9E /* Spotlightable.swift */; }; 3F435220289B2B2B00CE19ED /* JetpackBrandingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43704328932F0100475B6E /* JetpackBrandingCoordinator.swift */; }; 3F435221289B2B5100CE19ED /* JetpackOverlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43703E2893201400475B6E /* JetpackOverlayViewController.swift */; }; - 3F435222289B2B5A00CE19ED /* JetpackOverlayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F4370402893207C00475B6E /* JetpackOverlayView.swift */; }; 3F43602F23F31D48001DEE70 /* ScenePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43602E23F31D48001DEE70 /* ScenePresenter.swift */; }; 3F43603123F31E09001DEE70 /* MeScenePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43603023F31E09001DEE70 /* MeScenePresenter.swift */; }; 3F43603323F36515001DEE70 /* BlogListViewController+BlogDetailsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43603223F36515001DEE70 /* BlogListViewController+BlogDetailsFactory.swift */; }; @@ -25279,7 +25278,6 @@ 8313B9EF298B1ACD000AF26E /* SiteSettingsViewController+Blogging.swift in Sources */, 982DA9A8263B1E2F00E5743B /* CommentService+Likes.swift in Sources */, FABB24E12602FC2C00C8785C /* MediaLibraryPicker.swift in Sources */, - 3F435222289B2B5A00CE19ED /* JetpackOverlayView.swift in Sources */, 46F583D52624D0BC0010A723 /* Blog+BlockEditorSettings.swift in Sources */, FABB24E22602FC2C00C8785C /* SharingAccountViewController.swift in Sources */, FABB24E32602FC2C00C8785C /* TodayExtensionService.m in Sources */, From 769748545b2d84aa51debbcf1599e1277f771e3e Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:43:01 -0400 Subject: [PATCH 24/46] Update show remaining shares view conditions --- .../Post/PostSettingsViewController+JetpackSocial.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift index e13679a84856..b05f336dc957 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift @@ -36,18 +36,14 @@ extension PostSettingsViewController { let isJetpackSocialEnabled = FeatureFlag.jetpackSocial.enabled let blogSupportsPublicize = apost.blog.supportsPublicize() let blogHasConnections = publicizeConnections.count > 0 - let isSocialSharingLimited = apost.blog.isSocialSharingLimited - let blogHasPublicizeInfo = apost.blog.publicizeInfo != nil + let blogHasSharingLimit = apost.blog.sharingLimit != nil return isJetpackSocialEnabled && blogSupportsPublicize && blogHasConnections - && isSocialSharingLimited - && blogHasPublicizeInfo + && blogHasSharingLimit } - - @objc func createRemainingSharesView() -> UIView { guard let sharingLimit = apost.blog.sharingLimit else { // This scenario *shouldn't* happen since we check that the publicize info is not nil before From 05d8f17ce6c2986f7dc09565a33d2e71e63b7550 Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Fri, 7 Jul 2023 18:04:53 -0400 Subject: [PATCH 25/46] Add new error for post settings sharing view --- .../Post/PostSettingsViewController+JetpackSocial.swift | 3 +++ .../Jetpack/Classes/Utility/JetpackSocialError.swift | 4 ++++ WordPress/WordPress.xcodeproj/project.pbxproj | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 WordPress/Jetpack/Classes/Utility/JetpackSocialError.swift diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift index b05f336dc957..f19daf336f67 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+JetpackSocial.swift @@ -1,4 +1,5 @@ import SwiftUI +import AutomatticTracks extension PostSettingsViewController { @@ -49,6 +50,8 @@ extension PostSettingsViewController { // This scenario *shouldn't* happen since we check that the publicize info is not nil before // showing this view assertionFailure("No sharing limit on the blog") + let error = JetpackSocialError.missingSharingLimit + CrashLogging.main.logError(error, userInfo: ["source": "post_settings"]) return UIView() } diff --git a/WordPress/Jetpack/Classes/Utility/JetpackSocialError.swift b/WordPress/Jetpack/Classes/Utility/JetpackSocialError.swift new file mode 100644 index 000000000000..a667b501f95d --- /dev/null +++ b/WordPress/Jetpack/Classes/Utility/JetpackSocialError.swift @@ -0,0 +1,4 @@ + +enum JetpackSocialError: Error { + case missingSharingLimit +} diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 6cfebe3c1810..cdb313c3cabf 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -2104,6 +2104,8 @@ 83C972E1281C45AB0049E1FE /* Post+BloggingPrompts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C972DF281C45AB0049E1FE /* Post+BloggingPrompts.swift */; }; 83DC5C462A4B769000DAA422 /* JetpackSocialSettingsRemainingSharesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DC5C452A4B769000DAA422 /* JetpackSocialSettingsRemainingSharesView.swift */; }; 83DC5C472A4B769000DAA422 /* JetpackSocialSettingsRemainingSharesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DC5C452A4B769000DAA422 /* JetpackSocialSettingsRemainingSharesView.swift */; }; + 83E1E5592A58B5C2000B576F /* JetpackSocialError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83E1E5582A58B5C2000B576F /* JetpackSocialError.swift */; }; + 83E1E55A2A58B5C2000B576F /* JetpackSocialError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83E1E5582A58B5C2000B576F /* JetpackSocialError.swift */; }; 83EF3D7B2937D703000AF9BF /* SharedDataIssueSolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = FED65D78293511E4008071BF /* SharedDataIssueSolver.swift */; }; 83EF3D7F2937F08C000AF9BF /* SharedDataIssueSolverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83EF3D7C2937E969000AF9BF /* SharedDataIssueSolverTests.swift */; }; 83F3E26011275E07004CD686 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F3E25F11275E07004CD686 /* MapKit.framework */; }; @@ -7473,6 +7475,7 @@ 83B1D036282C62620061D911 /* BloggingPromptsAttribution.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BloggingPromptsAttribution.swift; sourceTree = ""; }; 83C972DF281C45AB0049E1FE /* Post+BloggingPrompts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Post+BloggingPrompts.swift"; sourceTree = ""; }; 83DC5C452A4B769000DAA422 /* JetpackSocialSettingsRemainingSharesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackSocialSettingsRemainingSharesView.swift; sourceTree = ""; }; + 83E1E5582A58B5C2000B576F /* JetpackSocialError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackSocialError.swift; sourceTree = ""; }; 83EF3D7C2937E969000AF9BF /* SharedDataIssueSolverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedDataIssueSolverTests.swift; sourceTree = ""; }; 83F3E25F11275E07004CD686 /* MapKit.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 83F3E2D211276371004CD686 /* CoreLocation.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; @@ -13378,9 +13381,10 @@ 8332DD2229259ABA00802F7D /* Utility */ = { isa = PBXGroup; children = ( + F4DD58312A095210009A772D /* DataMigrationError.swift */, 8332DD2329259AE300802F7D /* DataMigrator.swift */, + 83E1E5582A58B5C2000B576F /* JetpackSocialError.swift */, FED65D78293511E4008071BF /* SharedDataIssueSolver.swift */, - F4DD58312A095210009A772D /* DataMigrationError.swift */, ); path = Utility; sourceTree = ""; @@ -22472,6 +22476,7 @@ D80BC7A22074739400614A59 /* MediaLibraryStrings.swift in Sources */, 9A09F915230C3E9700F42AB7 /* StoreFetchingStatus.swift in Sources */, F582060223A85495005159A9 /* SiteDateFormatters.swift in Sources */, + 83E1E5592A58B5C2000B576F /* JetpackSocialError.swift in Sources */, F504D44825D717F600A2764C /* PostEditor.swift in Sources */, 837B49D7283C2AE80061A657 /* BloggingPromptSettings+CoreDataClass.swift in Sources */, 98BC522A27F6259700D6E8C2 /* BloggingPromptsFeatureDescriptionView.swift in Sources */, @@ -23946,6 +23951,7 @@ 011F52BE2A15327700B04114 /* BaseDashboardDomainsCardCell.swift in Sources */, FABB211B2602FC2C00C8785C /* CredentialsService.swift in Sources */, 3F5AAC242877791900AEF5DD /* JetpackButton.swift in Sources */, + 83E1E55A2A58B5C2000B576F /* JetpackSocialError.swift in Sources */, FABB211C2602FC2C00C8785C /* EncryptedLogTableViewController.swift in Sources */, FABB211D2602FC2C00C8785C /* ActivityDateFormatting.swift in Sources */, FABB211E2602FC2C00C8785C /* UIView+Subviews.m in Sources */, From d3fe93a9677e76e71f61f926c3e98eb3e5e21a65 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Sun, 9 Jul 2023 00:51:25 +0700 Subject: [PATCH 26/46] Refactor Jetpack Social enums to be under PublicizeService --- .../Classes/Models/PublicizeService.swift | 26 +++++++++++++++++++ .../Blog/WPStyleGuide+Sharing.swift | 1 + .../JetpackSocialNoConnectionView.swift | 13 +--------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/WordPress/Classes/Models/PublicizeService.swift b/WordPress/Classes/Models/PublicizeService.swift index 5dc3a35a6f6e..5f4fc89baf39 100644 --- a/WordPress/Classes/Models/PublicizeService.swift +++ b/WordPress/Classes/Models/PublicizeService.swift @@ -24,3 +24,29 @@ open class PublicizeService: NSManagedObject { status == Self.defaultStatus } } + +// MARK: - Convenience Methods + +extension PublicizeService { + + /// A convenient value-type representation for the destination sharing service. + enum ServiceName: String { + case facebook + case twitter + case tumblr + case linkedin + case instagram = "instagram-business" + case mastodon + case unknown + + /// Returns an image of the social network's icon. + /// If the icon is not available locally, + var iconImage: UIImage { + WPStyleGuide.socialIcon(for: rawValue as NSString) + } + } + + var name: ServiceName { + .init(rawValue: serviceID) ?? .unknown + } +} diff --git a/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift b/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift index b5a780414504..17027d9e3a25 100644 --- a/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift +++ b/WordPress/Classes/ViewRelated/Blog/WPStyleGuide+Sharing.swift @@ -106,6 +106,7 @@ extension WPStyleGuide { } } + // TODO: Remove this in favor of `PublicizeService.ServiceName` once `jetpackSocial` flag is removed. enum SharingServiceNames: String { case Facebook = "facebook" case Twitter = "twitter" diff --git a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift index b604d0804cf0..325342326186 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Social/JetpackSocialNoConnectionView.swift @@ -79,25 +79,14 @@ class JetpackSocialNoConnectionViewModel: ObservableObject { updateIcons(services) } - enum JetpackSocialService: String { - case facebook - case twitter - case tumblr - case linkedin - case instagram = "instagram-business" - case mastodon - case unknown - } - private func updateIcons(_ services: [PublicizeService]) { var icons: [UIImage] = [] var downloadTasks: [(url: URL, index: Int)] = [] for (index, service) in services.enumerated() { - let serviceType = JetpackSocialService(rawValue: service.serviceID) ?? .unknown let icon = WPStyleGuide.socialIcon(for: service.serviceID as NSString) icons.append(icon) - if serviceType == .unknown { + if service.name == .unknown { guard let iconUrl = URL(string: service.icon) else { continue } From 7bd15647c4b1f69dafd64d4c3400c9587cd85b05 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Sun, 9 Jul 2023 15:26:23 +0700 Subject: [PATCH 27/46] Remove unused docs, update var name --- WordPress/Classes/Models/PublicizeService.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/Models/PublicizeService.swift b/WordPress/Classes/Models/PublicizeService.swift index 5f4fc89baf39..957801209b7d 100644 --- a/WordPress/Classes/Models/PublicizeService.swift +++ b/WordPress/Classes/Models/PublicizeService.swift @@ -39,9 +39,8 @@ extension PublicizeService { case mastodon case unknown - /// Returns an image of the social network's icon. - /// If the icon is not available locally, - var iconImage: UIImage { + /// Returns the local image for the icon representing the social network. + var localIconImage: UIImage { WPStyleGuide.socialIcon(for: rawValue as NSString) } } From 66be8921cff24041a791bbf66ca7fd376e149046 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:41:32 +0700 Subject: [PATCH 28/46] Add configuration methods for social cell in prepublishing VC --- .../Models/PublicizeService+Lookup.swift | 14 +++++ ...blishingViewController+JetpackSocial.swift | 23 +++++++ .../Post/PrepublishingViewController.swift | 60 ++++++++++++------- WordPress/WordPress.xcodeproj/project.pbxproj | 6 ++ 4 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift diff --git a/WordPress/Classes/Models/PublicizeService+Lookup.swift b/WordPress/Classes/Models/PublicizeService+Lookup.swift index 09884c044ecc..59f09b3de4a0 100644 --- a/WordPress/Classes/Models/PublicizeService+Lookup.swift +++ b/WordPress/Classes/Models/PublicizeService+Lookup.swift @@ -27,4 +27,18 @@ extension PublicizeService { request.sortDescriptors = [sortDescriptor] return try context.fetch(request) } + + /// Returns an array of all cached `PublicizeService` objects that are supported by Jetpack Social. + /// + /// Note that services without a `status` field from the remote will be marked as supported by default. + /// + /// - Parameter context: The managed object context. + /// - Returns: An array of `PublicizeService`. The array is empty if no objects are cached. + static func allSupportedServices(in context: NSManagedObjectContext) throws -> [PublicizeService] { + let request = NSFetchRequest(entityName: PublicizeService.classNameWithoutNamespaces()) + let sortDescriptor = NSSortDescriptor(key: "order", ascending: true) + request.predicate = NSPredicate(format: "status == %@", Self.defaultStatus) + request.sortDescriptors = [sortDescriptor] + return try context.fetch(request) + } } diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift new file mode 100644 index 000000000000..eb2d710dade2 --- /dev/null +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift @@ -0,0 +1,23 @@ +extension PrepublishingViewController { + + /// Determines whether the account and the post's blog is eligible to see auto-sharing options. + var isEligibleForAutoSharing: Bool { + let postObjectID = post.objectID + let blogSupportsPublicize = coreDataStack.performQuery { context in + let post = (try? context.existingObject(with: postObjectID)) as? Post + return post?.blog.supportsPublicize() ?? false + } + + return blogSupportsPublicize && FeatureFlag.jetpackSocial.enabled + } + + func configureSocialCell(_ cell: UITableViewCell) { + // TODO: + // - Show the PrepublishingAutoSharingView. + // - Show the NoConnectionView if user has 0 connections. + // - Properly configure the view models. + let autoSharingView = UIView() + cell.contentView.addSubview(autoSharingView) + cell.pinSubviewToAllEdges(autoSharingView) + } +} diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift index 60230af09e7a..49e25b58549b 100644 --- a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift @@ -11,15 +11,7 @@ private struct PrepublishingOption { private enum PrepublishingCellType { case value case textField - - var cellType: UITableViewCell.Type { - switch self { - case .value: - return WPTableViewCell.self - case .textField: - return WPTextFieldTableViewCell.self - } - } + case customContainer } enum PrepublishingIdentifier { @@ -28,10 +20,12 @@ enum PrepublishingIdentifier { case visibility case tags case categories + case autoSharing } class PrepublishingViewController: UITableViewController { let post: Post + let coreDataStack: CoreDataStack private lazy var publishSettingsViewModel: PublishSettingsViewModel = { return PublishSettingsViewModel(post: post) @@ -48,7 +42,23 @@ class PrepublishingViewController: UITableViewController { private let completion: (CompletionResult) -> () - private let options: [PrepublishingOption] + private let identifiers: [PrepublishingIdentifier] + + private lazy var options: [PrepublishingOption] = { + return identifiers.compactMap { identifier in + switch identifier { + case .autoSharing: + // skip the social cell if the post's blog is not eligible for auto-sharing. + guard isEligibleForAutoSharing else { + return nil + } + break + default: + break + } + return .init(identifier: identifier) + } + }() private var didTapPublish = false @@ -64,12 +74,14 @@ class PrepublishingViewController: UITableViewController { /// Determines whether the text has been first responder already. If it has, don't force it back on the user unless it's been selected by them. private var hasSelectedText: Bool = false - init(post: Post, identifiers: [PrepublishingIdentifier], completion: @escaping (CompletionResult) -> ()) { + init(post: Post, + identifiers: [PrepublishingIdentifier], + completion: @escaping (CompletionResult) -> (), + coreDataStack: CoreDataStack = ContextManager.shared) { self.post = post - self.options = identifiers.map { identifier in - return PrepublishingOption(identifier: identifier) - } + self.identifiers = identifiers self.completion = completion + self.coreDataStack = coreDataStack super.init(nibName: nil, bundle: nil) } @@ -142,10 +154,9 @@ class PrepublishingViewController: UITableViewController { } override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { - // Forced unwrap copied from this guide by Apple: - // https://developer.apple.com/documentation/uikit/views_and_controls/table_views/adding_headers_and_footers_to_table_sections - // - let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: Constants.headerReuseIdentifier) as! PrepublishingHeaderView + guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: Constants.headerReuseIdentifier) as? PrepublishingHeaderView else { + return nil + } header.delegate = self header.configure(post.blog) @@ -179,6 +190,8 @@ class PrepublishingViewController: UITableViewController { case .value: cell.accessoryType = .disclosureIndicator cell.textLabel?.text = option.title + default: + break } switch option.id { @@ -194,6 +207,8 @@ class PrepublishingViewController: UITableViewController { configureScheduleCell(cell) case .categories: configureCategoriesCell(cell) + case .autoSharing: + configureSocialCell(cell) } return cell @@ -211,13 +226,13 @@ class PrepublishingViewController: UITableViewController { return WPTableViewCell.init(style: .value1, reuseIdentifier: Constants.reuseIdentifier) } return cell + case .customContainer: + return WPTableViewCell() } } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch options[indexPath.row].id { - case .title: - break case .tags: didTapTagCell() case .visibility: @@ -226,6 +241,8 @@ class PrepublishingViewController: UITableViewController { didTapSchedule(indexPath) case .categories: didTapCategoriesCell() + default: + break } } @@ -523,6 +540,9 @@ private extension PrepublishingOption { self.init(id: .visibility, title: NSLocalizedString("Visibility", comment: "Label for Visibility"), type: .value) case .tags: self.init(id: .tags, title: NSLocalizedString("Tags", comment: "Label for Tags"), type: .value) + case .autoSharing: + // TODO: Which cell to show? + self.init(id: .autoSharing, title: "Jetpack Social", type: .customContainer) } } } diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 1437352faa27..127ea843aba9 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -5609,6 +5609,8 @@ FED77259298BC5B300C2346E /* PluginJetpackProxyService.swift in Sources */ = {isa = PBXBuildFile; fileRef = FED77257298BC5B300C2346E /* PluginJetpackProxyService.swift */; }; FEDA1AD8269D475D0038EC98 /* ListTableViewCell+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA1AD7269D475D0038EC98 /* ListTableViewCell+Comments.swift */; }; FEDA1AD9269D475D0038EC98 /* ListTableViewCell+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA1AD7269D475D0038EC98 /* ListTableViewCell+Comments.swift */; }; + FEDA8D9C2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */; }; + FEDA8D9D2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */; }; FEDDD46F26A03DE900F8942B /* ListTableViewCell+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */; }; FEDDD47026A03DE900F8942B /* ListTableViewCell+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */; }; FEE48EFC2A4C8312008A48E0 /* Blog+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE48EFB2A4C8312008A48E0 /* Blog+JetpackSocial.swift */; }; @@ -9408,6 +9410,7 @@ FED65D78293511E4008071BF /* SharedDataIssueSolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedDataIssueSolver.swift; sourceTree = ""; }; FED77257298BC5B300C2346E /* PluginJetpackProxyService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginJetpackProxyService.swift; sourceTree = ""; }; FEDA1AD7269D475D0038EC98 /* ListTableViewCell+Comments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ListTableViewCell+Comments.swift"; sourceTree = ""; }; + FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PrepublishingViewController+JetpackSocial.swift"; sourceTree = ""; }; FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ListTableViewCell+Notifications.swift"; sourceTree = ""; }; FEE48EFB2A4C8312008A48E0 /* Blog+JetpackSocial.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+JetpackSocial.swift"; sourceTree = ""; }; FEE48EFE2A4C9855008A48E0 /* Blog+PublicizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+PublicizeTests.swift"; sourceTree = ""; }; @@ -14803,6 +14806,7 @@ 593F26601CAB00CA00F14073 /* PostSharingController.swift */, E155EC711E9B7DCE009D7F63 /* PostTagPickerViewController.swift */, 8BAD272B241FEF3300E9D105 /* PrepublishingViewController.swift */, + FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */, 5DB3BA0318D0E7B600F3F3E9 /* WPPickerView.h */, 5DB3BA0418D0E7B600F3F3E9 /* WPPickerView.m */, C9F1D4B92706EEEB00BDF917 /* HomepageEditorNavigationBarManager.swift */, @@ -22076,6 +22080,7 @@ F5E032E82408D537003AF350 /* BottomSheetPresentationController.swift in Sources */, FA98A24D2832A5E9003B9233 /* NewQuickStartChecklistView.swift in Sources */, FA98B61929A3BF050071AAE8 /* DashboardBlazePromoCardView.swift in Sources */, + FEDA8D9C2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */, AB758D9E25EFDF9C00961C0B /* LikesListController.swift in Sources */, E1FD45E01C030B3800750F4C /* AccountSettingsService.swift in Sources */, 8BDC4C39249BA5CA00DE0A2D /* ReaderCSS.swift in Sources */, @@ -25225,6 +25230,7 @@ F4D9188729D78C9100974A71 /* BlogDetailsViewController+Strings.swift in Sources */, FABB24B82602FC2C00C8785C /* DynamicHeightCollectionView.swift in Sources */, FABB24B92602FC2C00C8785C /* RegisterDomainDetailsViewModel+RowList.swift in Sources */, + FEDA8D9D2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */, FABB24BA2602FC2C00C8785C /* TenorGIF.swift in Sources */, FABB24BB2602FC2C00C8785C /* ThemeBrowserViewController.swift in Sources */, FA73D7ED27987E4500DF24B3 /* SitePickerViewController+QuickStart.swift in Sources */, From a2aba99c78b80f52492d3223708f77b1ab8ef9e4 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:52:26 +0700 Subject: [PATCH 29/46] Create initial SwiftUI view for prepublishing social cell --- .../Post/PrepublishingAutoSharingView.swift | 37 +++++++++++++++++++ ...blishingViewController+JetpackSocial.swift | 2 +- WordPress/WordPress.xcodeproj/project.pbxproj | 6 +++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift new file mode 100644 index 000000000000..d7860cfb13a9 --- /dev/null +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift @@ -0,0 +1,37 @@ +import SwiftUI + +struct PrepublishingAutoSharingView: View { + + var body: some View { + HStack { + textStack + Spacer() + iconTrain + } + } + + var textStack: some View { + VStack { + Text("Sharing to @sporadicthoughts") + .font(.body) + .foregroundColor(Color(.label)) + Text("27/30 social shares remaining") + .font(.subheadline) + .foregroundColor(Color(.secondaryLabel)) + } + } + + var iconTrain: some View { + HStack { + if let uiImage = UIImage(named: "icon-tumblr") { + Image(uiImage: uiImage) + .resizable() + .frame(width: 32.0, height: 32.0) + .background(Color(UIColor.listForeground)) + .clipShape(Circle()) + .overlay(Circle().stroke(Color(UIColor.listForeground), lineWidth: 2.0)) + } + } + } + +} diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift index eb2d710dade2..c203c35600a3 100644 --- a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift @@ -16,7 +16,7 @@ extension PrepublishingViewController { // - Show the PrepublishingAutoSharingView. // - Show the NoConnectionView if user has 0 connections. // - Properly configure the view models. - let autoSharingView = UIView() + let autoSharingView = UIView.embedSwiftUIView(PrepublishingAutoSharingView()) cell.contentView.addSubview(autoSharingView) cell.pinSubviewToAllEdges(autoSharingView) } diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 127ea843aba9..c034b14cf364 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -5611,6 +5611,8 @@ FEDA1AD9269D475D0038EC98 /* ListTableViewCell+Comments.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA1AD7269D475D0038EC98 /* ListTableViewCell+Comments.swift */; }; FEDA8D9C2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */; }; FEDA8D9D2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */; }; + FEDA8D9F2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9E2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift */; }; + FEDA8DA02A5B1B1B0081314F /* PrepublishingAutoSharingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDA8D9E2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift */; }; FEDDD46F26A03DE900F8942B /* ListTableViewCell+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */; }; FEDDD47026A03DE900F8942B /* ListTableViewCell+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */; }; FEE48EFC2A4C8312008A48E0 /* Blog+JetpackSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE48EFB2A4C8312008A48E0 /* Blog+JetpackSocial.swift */; }; @@ -9411,6 +9413,7 @@ FED77257298BC5B300C2346E /* PluginJetpackProxyService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginJetpackProxyService.swift; sourceTree = ""; }; FEDA1AD7269D475D0038EC98 /* ListTableViewCell+Comments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ListTableViewCell+Comments.swift"; sourceTree = ""; }; FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PrepublishingViewController+JetpackSocial.swift"; sourceTree = ""; }; + FEDA8D9E2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrepublishingAutoSharingView.swift; sourceTree = ""; }; FEDDD46E26A03DE900F8942B /* ListTableViewCell+Notifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ListTableViewCell+Notifications.swift"; sourceTree = ""; }; FEE48EFB2A4C8312008A48E0 /* Blog+JetpackSocial.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+JetpackSocial.swift"; sourceTree = ""; }; FEE48EFE2A4C9855008A48E0 /* Blog+PublicizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+PublicizeTests.swift"; sourceTree = ""; }; @@ -14807,6 +14810,7 @@ E155EC711E9B7DCE009D7F63 /* PostTagPickerViewController.swift */, 8BAD272B241FEF3300E9D105 /* PrepublishingViewController.swift */, FEDA8D9B2A5AA7050081314F /* PrepublishingViewController+JetpackSocial.swift */, + FEDA8D9E2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift */, 5DB3BA0318D0E7B600F3F3E9 /* WPPickerView.h */, 5DB3BA0418D0E7B600F3F3E9 /* WPPickerView.m */, C9F1D4B92706EEEB00BDF917 /* HomepageEditorNavigationBarManager.swift */, @@ -20989,6 +20993,7 @@ C395FB262821FE7B00AE7C11 /* RemoteSiteDesign+Thumbnail.swift in Sources */, 9A73B7152362FBAE004624A8 /* SiteStatsViewModel+AsyncBlock.swift in Sources */, 74AF4D7C1FE417D200E3EBFE /* PostUploadOperation.swift in Sources */, + FEDA8D9F2A5B1B1B0081314F /* PrepublishingAutoSharingView.swift in Sources */, 0857BB40299275760011CBD1 /* JetpackDefaultOverlayCoordinator.swift in Sources */, 37022D931981C19000F322B7 /* VerticallyStackedButton.m in Sources */, 59DCA5211CC68AF3000F245F /* PageListViewController.swift in Sources */, @@ -25101,6 +25106,7 @@ FABB24602602FC2C00C8785C /* BlogDetailsViewController+DomainCredit.swift in Sources */, 17C1D67D2670E3DC006C8970 /* SiteIconPickerView.swift in Sources */, 8BAC9D9F27BAB97E008EA44C /* BlogDashboardRemoteEntity.swift in Sources */, + FEDA8DA02A5B1B1B0081314F /* PrepublishingAutoSharingView.swift in Sources */, 80EF9287280D272E0064A971 /* DashboardPostsSyncManager.swift in Sources */, FABB24612602FC2C00C8785C /* KeyringAccountHelper.swift in Sources */, FABB24622602FC2C00C8785C /* ManagedAccountSettings+CoreDataProperties.swift in Sources */, From 9df56a8ccb2719fb70dfa2607b5f882cf196bc28 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:52:49 +0700 Subject: [PATCH 30/46] Modify entry points to allow displaying autosharing cell --- WordPress/Classes/Services/Stories/StoryEditor.swift | 4 ++++ WordPress/Classes/ViewRelated/Post/PostEditor.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/WordPress/Classes/Services/Stories/StoryEditor.swift b/WordPress/Classes/Services/Stories/StoryEditor.swift index fbc73a01cc0e..6df1047eaf86 100644 --- a/WordPress/Classes/Services/Stories/StoryEditor.swift +++ b/WordPress/Classes/Services/Stories/StoryEditor.swift @@ -222,6 +222,10 @@ class StoryEditor: CameraController { extension StoryEditor: PublishingEditor { var prepublishingIdentifiers: [PrepublishingIdentifier] { + if FeatureFlag.jetpackSocial.enabled { + return [.title, .visibility, .schedule, .tags, .categories, .autoSharing] + } + return [.title, .visibility, .schedule, .tags, .categories] } diff --git a/WordPress/Classes/ViewRelated/Post/PostEditor.swift b/WordPress/Classes/ViewRelated/Post/PostEditor.swift index 7badef9fb5b9..6e47e13a7490 100644 --- a/WordPress/Classes/ViewRelated/Post/PostEditor.swift +++ b/WordPress/Classes/ViewRelated/Post/PostEditor.swift @@ -145,6 +145,10 @@ extension PostEditor { } var prepublishingIdentifiers: [PrepublishingIdentifier] { + if FeatureFlag.jetpackSocial.enabled { + return [.visibility, .schedule, .tags, .categories, .autoSharing] + } + return [.visibility, .schedule, .tags, .categories] } } From bbbaeaaf62a387c19a4bfcf58acd000574ca1321 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Mon, 10 Jul 2023 00:38:10 +0700 Subject: [PATCH 31/46] Fix layout, add localized strings --- .../Post/PrepublishingAutoSharingView.swift | 41 +++++++++++++++++-- ...blishingViewController+JetpackSocial.swift | 13 ++++-- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift index d7860cfb13a9..b66d92eeb224 100644 --- a/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingAutoSharingView.swift @@ -2,6 +2,8 @@ import SwiftUI struct PrepublishingAutoSharingView: View { + // TODO: view model. + var body: some View { HStack { textStack @@ -11,16 +13,17 @@ struct PrepublishingAutoSharingView: View { } var textStack: some View { - VStack { - Text("Sharing to @sporadicthoughts") + VStack(alignment: .leading) { + Text(String(format: Strings.primaryLabelActiveConnectionsFormat, 3)) .font(.body) .foregroundColor(Color(.label)) - Text("27/30 social shares remaining") + Text(String(format: Strings.remainingSharesTextFormat, 27, 30)) .font(.subheadline) .foregroundColor(Color(.secondaryLabel)) } } + // TODO: This will be implemented separately. var iconTrain: some View { HStack { if let uiImage = UIImage(named: "icon-tumblr") { @@ -33,5 +36,37 @@ struct PrepublishingAutoSharingView: View { } } } +} + +// MARK: - Helpers + +private extension PrepublishingAutoSharingView { + + enum Strings { + static let primaryLabelActiveConnectionsFormat = NSLocalizedString( + "prepublishing.social.text.activeConnections", + value: "Sharing to %1$d accounts", + comment: """ + The primary label for the auto-sharing row on the pre-publishing sheet. + Indicates the number of social accounts that will be auto-sharing the blog post. + %1$d is a placeholder for the number of social network accounts that will be auto-shared. + Example: Sharing to 3 accounts + """ + ) + + // TODO: More text variations. + + static let remainingSharesTextFormat = NSLocalizedString( + "prepublishing.social.remainingShares", + value: "%1$d/%2$d social shares remaining", + comment: """ + A subtext that's shown below the primary label in the auto-sharing row on the pre-publishing sheet. + Informs the remaining limit for post auto-sharing. + %1$d is a placeholder for the remaining shares. + %2$d is a placeholder for the maximum shares allowed for the user's blog. + Example: 27/30 social shares remaining + """ + ) + } } diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift index c203c35600a3..aaabc472a3fe 100644 --- a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController+JetpackSocial.swift @@ -13,11 +13,18 @@ extension PrepublishingViewController { func configureSocialCell(_ cell: UITableViewCell) { // TODO: - // - Show the PrepublishingAutoSharingView. // - Show the NoConnectionView if user has 0 connections. - // - Properly configure the view models. + // - Properly create and configure the view models. let autoSharingView = UIView.embedSwiftUIView(PrepublishingAutoSharingView()) cell.contentView.addSubview(autoSharingView) - cell.pinSubviewToAllEdges(autoSharingView) + + // Pin constraints to the cell's layoutMarginsGuide so that the content is properly aligned. + NSLayoutConstraint.activate([ + autoSharingView.leadingAnchor.constraint(equalTo: cell.contentView.layoutMarginsGuide.leadingAnchor), + autoSharingView.topAnchor.constraint(equalTo: cell.contentView.layoutMarginsGuide.topAnchor), + autoSharingView.bottomAnchor.constraint(equalTo: cell.contentView.layoutMarginsGuide.bottomAnchor), + autoSharingView.trailingAnchor.constraint(equalTo: cell.contentView.layoutMarginsGuide.trailingAnchor) + ]) + cell.accessoryType = .disclosureIndicator } } From 13f67d40eb95790530e5a2f5fd206cc8b79bb0f1 Mon Sep 17 00:00:00 2001 From: jos <17252150+jostnes@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:15:13 +0800 Subject: [PATCH 32/46] remove unused mock files and add scheduled post mocks --- .../mappings/wpcom/posts/categories.json | 51 - .../mappings/wpcom/posts/post-formats.json | 20 - .../mappings/wpcom/posts/post_0_diffs.json | 18 - .../mappings/wpcom/posts/post_213_diffs.json | 1916 ----------------- .../mappings/wpcom/posts/post_215_diffs.json | 71 - .../mappings/wpcom/posts/post_387_diffs.json | 71 - .../mappings/wpcom/posts/post_396_diffs.json | 130 -- .../mappings/wpcom/posts/posts-diff.json | 38 - .../wpcom/posts/posts-draft,pending.json | 1272 ++++++++++- .../wpcom/posts/posts-draft,pending_v2.json | 1308 ----------- .../mappings/wpcom/posts/posts-first.json | 60 - .../mappings/wpcom/posts/posts-future.json | 44 - .../mappings/wpcom/posts/posts-new-after.json | 192 +- .../posts/posts-new-scheduled-after.json | 145 ++ .../wpcom/posts/posts-new-scheduled.json | 146 ++ .../mocks/mappings/wpcom/posts/posts-new.json | 28 +- .../wpcom/posts/posts-private,publish.json | 651 +++++- .../wpcom/posts/posts-private,publish_v2.json | 677 ------ .../mocks/mappings/wpcom/posts/posts_106.json | 160 -- .../mocks/mappings/wpcom/posts/posts_134.json | 151 -- .../mocks/mappings/wpcom/posts/posts_213.json | 196 -- .../mocks/mappings/wpcom/posts/posts_215.json | 140 -- .../mocks/mappings/wpcom/posts/posts_225.json | 191 -- .../mocks/mappings/wpcom/posts/posts_237.json | 216 -- .../mocks/mappings/wpcom/posts/posts_265.json | 148 -- .../mocks/mappings/wpcom/posts/posts_387.json | 140 -- .../mocks/mappings/wpcom/posts/posts_396.json | 154 -- .../mocks/mappings/wpcom/posts/posts_90.json | 171 -- ...st_sites_106707880_posts_439_replies.json} | 0 ...ites_106707880_posts_439_replies_new.json} | 0 ..._sites_181851495_posts-draft,pending.json} | 0 ..._sites_181977606_posts-draft,pending.json} | 0 ...rest_sites_181977606_posts-scheduled.json} | 6 +- ...rest_v11_sites_posts_subscribers_mine.json | 20 - 34 files changed, 2335 insertions(+), 6196 deletions(-) delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/categories.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post-formats.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_0_diffs.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_213_diffs.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_215_diffs.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_387_diffs.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_396_diffs.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-diff.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending_v2.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-first.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-future.json create mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled-after.json create mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish_v2.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_106.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_134.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_213.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_215.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_225.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_237.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_265.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_387.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_396.json delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_90.json rename API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/{rest_v11_sites_106707880_posts_439_replies.json => rest_sites_106707880_posts_439_replies.json} (100%) rename API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/{rest_v11_sites_106707880_posts_439_replies_new.json => rest_sites_106707880_posts_439_replies_new.json} (100%) rename API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/{rest_v12_sites_181851495_posts-draft,pending.json => rest_sites_181851495_posts-draft,pending.json} (100%) rename API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/{rest_v12_sites_181977606_posts-draft,pending.json => rest_sites_181977606_posts-draft,pending.json} (100%) rename API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/{rest_v12_sites_181977606_posts-scheduled.json => rest_sites_181977606_posts-scheduled.json} (95%) delete mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_posts_subscribers_mine.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/categories.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/categories.json deleted file mode 100644 index f375b04e7a6c..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/categories.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/categories", - "queryParameters": { - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 2, - "categories": [ - { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "feed_url": "http://infocusphotographers.com/category/uncategorized/feed/", - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - }, - { - "ID": 1674, - "name": "Wedding", - "slug": "wedding", - "description": "", - "post_count": 1, - "feed_url": "http://infocusphotographers.com/category/wedding/feed/", - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - ] - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post-formats.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post-formats.json deleted file mode 100644 index bed37adadcf9..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post-formats.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPattern": "/rest/v1.1/sites/[0-9]+/post-formats(.*)" - }, - "response": { - "status": 200, - "jsonBody": { - "formats": { - "aside": "Aside", - "image": "Image", - "video": "Video", - "quote": "Quote", - "link": "Link", - "status": "Status", - "gallery": "Gallery" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_0_diffs.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_0_diffs.json deleted file mode 100644 index 8aca6e9500b5..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_0_diffs.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "request": { - "urlPattern": "/rest/v1.1/sites/.*/post/[0-9]+/diffs.*", - "method": "GET" - }, - "response": { - "status": 400, - "jsonBody": { - "error": "User cannot edit this post", - "message": 403 - }, - "headers": { - "Content-Type": "application/json", - "Connection": "keep-alive", - "Cache-Control": "no-cache, must-revalidate, max-age=0" - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_213_diffs.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_213_diffs.json deleted file mode 100644 index d3ed9d7e4255..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_213_diffs.json +++ /dev/null @@ -1,1916 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/post/213/diffs/", - "queryParameters": { - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "diffs": [ - { - "from": 400, - "to": 401, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n\n\n\n
\"\"
\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 309, - "to": 400, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n\n\n\n
\"\"
\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 303, - "to": 309, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n" - }, - { - "op": "add", - "value": "\n\n
\"\"
\n\n\n\n
\"\"
\n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "add": 50 - } - } - }, - { - "from": 300, - "to": 303, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n" - }, - { - "op": "del", - "value": "\n\n
\"\"
\n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 26 - } - } - }, - { - "from": 299, - "to": 300, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!" - }, - { - "op": "del", - "value": " ..." - }, - { - "op": "copy", - "value": "

\n\n\n\n
\"\"
\n\n" - } - ], - "totals": { - "del": 0 - } - } - }, - { - "from": 298, - "to": 299, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots! ...

\n\n\n\n
\"\"
\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 297, - "to": 298, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots! ...

\n\n\n\n
\"\"
\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 296, - "to": 297, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!" - }, - { - "op": "add", - "value": " ..." - }, - { - "op": "copy", - "value": "

\n\n\n\n
\"\"
\n\n" - } - ], - "totals": { - "add": 0 - } - } - }, - { - "from": 292, - "to": 296, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n" - }, - { - "op": "del", - "value": "\t \t " - }, - { - "op": "copy", - "value": "\n
""
" - }, - { - "op": "del", - "value": "\t \t " - }, - { - "op": "copy", - "value": "\n\n" - } - ], - "totals": { - "del": 0 - } - } - }, - { - "from": 291, - "to": 292, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 289, - "to": 291, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 288, - "to": 289, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 287, - "to": 288, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 286, - "to": 287, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 285, - "to": 286, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 284, - "to": 285, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

" - }, - { - "op": "del", - "value": "Blue" - }, - { - "op": "add", - "value": "This" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "skies" - }, - { - "op": "add", - "value": "event" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "and" - }, - { - "op": "add", - "value": "was" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "warm" - }, - { - "op": "add", - "value": "so" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "weather" - }, - { - "op": "add", - "value": "much fun" - }, - { - "op": "copy", - "value": ", " - }, - { - "op": "del", - "value": "what's" - }, - { - "op": "add", - "value": "I" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "not" - }, - { - "op": "add", - "value": "couldn’t wait" - }, - { - "op": "copy", - "value": " to " - }, - { - "op": "del", - "value": "love" - }, - { - "op": "add", - "value": "share a few of my" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "about" - }, - { - "op": "add", - "value": "favorite" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "summer?" - }, - { - "op": "add", - "value": "shots!" - }, - { - "op": "copy", - "value": "

\n\n\n\n

It's" - }, - { - "op": "add", - "value": "image" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "a great season for outdoor family portrait sessions and now is the time to book them!" - }, - { - "op": "del", - "value": "

\n\n\n\n

We offer a number of family portrait packages" - }, - { - "op": "add", - "value": ":209}" - }, - { - "op": "del", - "value": " and for a limited time are offering 15% off packages booked before May 1.

\n" - }, - { - "op": "del", - "value": "\n\n" - }, - { - "op": "copy", - "value": "\n
""
" - }, - { - "op": "add", - "value": "\t \t " - }, - { - "op": "copy", - "value": "\n\n" - }, - { - "op": "del", - "value": "\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 127, - "add": 26 - } - } - }, - { - "from": 283, - "to": 284, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

" - }, - { - "op": "del", - "value": "This" - }, - { - "op": "add", - "value": "Blue" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "event" - }, - { - "op": "add", - "value": "skies" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "was" - }, - { - "op": "add", - "value": "and" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "so" - }, - { - "op": "add", - "value": "warm" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "much fun" - }, - { - "op": "add", - "value": "weather" - }, - { - "op": "copy", - "value": ", " - }, - { - "op": "del", - "value": "I" - }, - { - "op": "add", - "value": "what's" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "couldn’t wait" - }, - { - "op": "add", - "value": "not" - }, - { - "op": "copy", - "value": " to " - }, - { - "op": "del", - "value": "share a few of my" - }, - { - "op": "add", - "value": "love" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "favorite" - }, - { - "op": "add", - "value": "about" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "shots!" - }, - { - "op": "add", - "value": "summer?" - }, - { - "op": "copy", - "value": "

\n\n\n\n

It's" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "add", - "value": "a great season for outdoor family portrait sessions and now is the time to book them!" - }, - { - "op": "del", - "value": "{" - }, - { - "op": "add", - "value": "

\n\n\n\n

We offer a number of family portrait packages" - }, - { - "op": "add", - "value": " and for a limited time are offering 15% off packages booked before May 1.

\n" - }, - { - "op": "del", - "value": "\t" - }, - { - "op": "add", - "value": "\n\n" - }, - { - "op": "copy", - "value": "\n
""
" - }, - { - "op": "del", - "value": "\t \t " - }, - { - "op": "copy", - "value": "\n\n" - }, - { - "op": "add", - "value": "\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 26, - "add": 127 - } - } - }, - { - "from": 280, - "to": 283, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n" - }, - { - "op": "add", - "value": "\n\t \t \n
\"\"
\t \t \n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "add": 26 - } - } - }, - { - "from": 277, - "to": 280, - "diff": { - "post_title": [ - { - "op": "del", - "value": "(no" - }, - { - "op": "add", - "value": "Summer" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "title)" - }, - { - "op": "add", - "value": "Band Jam" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n" - } - ], - "totals": { - "del": 2, - "add": 3 - } - } - }, - { - "from": 273, - "to": 277, - "diff": { - "post_title": [ - { - "op": "del", - "value": "Summer" - }, - { - "op": "add", - "value": "(no" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "Band Jam" - }, - { - "op": "add", - "value": "title)" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n" - } - ], - "totals": { - "del": 3, - "add": 2 - } - } - }, - { - "from": 267, - "to": 273, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "copy", - "value": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n" - }, - { - "op": "del", - "value": "\n\n
\"\"
\n" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 26 - } - } - }, - { - "from": 240, - "to": 267, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Summer Band Jam" - } - ], - "post_content": [ - { - "op": "add", - "value": "\n

" - }, - { - "op": "copy", - "value": "This event was so much fun, I couldn’t wait to share a few of my favorite shots!" - }, - { - "op": "add", - "value": "

\n" - }, - { - "op": "copy", - "value": "\n\n<" - }, - { - "op": "del", - "value": "img" - }, - { - "op": "add", - "value": "!-- wp:image" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "class=" - }, - { - "op": "add", - "value": "{" - }, - { - "op": "copy", - "value": """ - }, - { - "op": "del", - "value": "alignnone" - }, - { - "op": "add", - "value": "id":209}" - }, - { - "op": "copy", - "value": " " - }, - { - "op": "del", - "value": "size" - }, - { - "op": "add", - "value": "" - }, - { - "op": "copy", - "value": "-" - }, - { - "op": "del", - "value": "full" - }, - { - "op": "add", - "value": "->\n\n\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "400": { - "post_date_gmt": "2019-06-28 21:04:40Z", - "post_modified_gmt": "2019-06-28 21:04:40Z", - "post_author": "68646169", - "id": 400, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "" - }, - "309": { - "post_date_gmt": "2019-05-27 21:36:25Z", - "post_modified_gmt": "2019-05-27 21:36:25Z", - "post_author": "742098", - "id": 309, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "303": { - "post_date_gmt": "2019-05-27 19:26:17Z", - "post_modified_gmt": "2019-05-27 19:26:17Z", - "post_author": "742098", - "id": 303, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "300": { - "post_date_gmt": "2019-04-17 10:45:45Z", - "post_modified_gmt": "2019-04-17 10:45:45Z", - "post_author": "67626417", - "id": 300, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "299": { - "post_date_gmt": "2019-04-17 10:45:25Z", - "post_modified_gmt": "2019-04-17 10:45:25Z", - "post_author": "67626417", - "id": 299, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots! ...

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "298": { - "post_date_gmt": "2019-04-17 10:44:49Z", - "post_modified_gmt": "2019-04-17 10:44:49Z", - "post_author": "68646169", - "id": 298, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots! ...

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "" - }, - "297": { - "post_date_gmt": "2019-04-17 10:44:12Z", - "post_modified_gmt": "2019-04-17 10:44:12Z", - "post_author": "67626417", - "id": 297, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots! ...

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "296": { - "post_date_gmt": "2019-04-17 10:42:14Z", - "post_modified_gmt": "2019-04-17 10:42:14Z", - "post_author": "67626417", - "id": 296, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "292": { - "post_date_gmt": "2019-04-17 10:39:09Z", - "post_modified_gmt": "2019-04-17 10:39:09Z", - "post_author": "67626417", - "id": 292, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "291": { - "post_date_gmt": "2019-04-17 10:36:25Z", - "post_modified_gmt": "2019-04-17 10:36:25Z", - "post_author": "68646169", - "id": 291, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "" - }, - "289": { - "post_date_gmt": "2019-04-17 10:29:16Z", - "post_modified_gmt": "2019-04-17 10:29:16Z", - "post_author": "67626417", - "id": 289, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "288": { - "post_date_gmt": "2019-04-17 10:28:37Z", - "post_modified_gmt": "2019-04-17 10:28:37Z", - "post_author": "68646169", - "id": 288, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "" - }, - "287": { - "post_date_gmt": "2019-04-17 10:27:45Z", - "post_modified_gmt": "2019-04-17 10:27:45Z", - "post_author": "67626417", - "id": 287, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "286": { - "post_date_gmt": "2019-04-17 10:27:13Z", - "post_modified_gmt": "2019-04-17 10:27:13Z", - "post_author": "68646169", - "id": 286, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "" - }, - "285": { - "post_date_gmt": "2019-04-17 09:35:57Z", - "post_modified_gmt": "2019-04-17 09:35:57Z", - "post_author": "67626417", - "id": 285, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "284": { - "post_date_gmt": "2019-04-17 09:32:58Z", - "post_modified_gmt": "2019-04-17 09:32:58Z", - "post_author": "68646169", - "id": 284, - "post_content": "\n

Blue skies and warm weather, what's not to love about summer?

\n\n\n\n

It's a great season for outdoor family portrait sessions and now is the time to book them!

\n\n\n\n

We offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.

\n\n\n\n
\"beach-clouds-daytime-994605\"
\n\n\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n", - "post_excerpt": "", - "post_title": "" - }, - "283": { - "post_date_gmt": "2019-04-17 09:32:34Z", - "post_modified_gmt": "2019-04-17 09:32:34Z", - "post_author": "67626417", - "id": 283, - "post_content": "\r\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\r\n\r\n\r\n\t \t \r\n
\"\"
\t \t \r\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "280": { - "post_date_gmt": "2019-04-17 09:23:35Z", - "post_modified_gmt": "2019-04-17 09:23:35Z", - "post_author": "67626417", - "id": 280, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "277": { - "post_date_gmt": "2019-04-16 14:21:22Z", - "post_modified_gmt": "2019-04-16 14:21:22Z", - "post_author": "68646169", - "id": 277, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n", - "post_excerpt": "", - "post_title": "" - }, - "273": { - "post_date_gmt": "2019-03-21 17:23:26Z", - "post_modified_gmt": "2019-03-21 17:23:26Z", - "post_author": "68646169", - "id": 273, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "267": { - "post_date_gmt": "2019-03-21 17:17:59Z", - "post_modified_gmt": "2019-03-21 17:17:59Z", - "post_author": "68646169", - "id": 267, - "post_content": "\n

This event was so much fun, I couldn’t wait to share a few of my favorite shots!

\n\n\n\n
\"\"
\n", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "240": { - "post_date_gmt": "2019-03-20 23:45:49Z", - "post_modified_gmt": "2019-03-20 23:45:49Z", - "post_author": "14151046", - "id": 240, - "post_content": "This event was so much fun, I couldn’t wait to share a few of my favorite shots!\n\n\"concert-effect-entertainment-1150837\"", - "post_excerpt": "", - "post_title": "Summer Band Jam" - }, - "214": { - "post_date_gmt": "2019-02-15 23:26:48Z", - "post_modified_gmt": "2019-02-15 23:26:48Z", - "post_author": "68646169", - "id": 214, - "post_content": "This event was so much fun, I couldn’t wait to share a few of my favorite shots!", - "post_excerpt": "", - "post_title": "Summer Band Jam" - } - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_215_diffs.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_215_diffs.json deleted file mode 100644 index d6f530c3fee7..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_215_diffs.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/post/215/diffs/", - "queryParameters": { - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "diffs": [ - { - "from": 0, - "to": 216, - "diff": { - "post_title": [ - { - "op": "del", - "value": "" - }, - { - "op": "add", - "value": "Ideas" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "add", - "value": "Returning client special - Offer a discount to clients who have left a review." - }, - { - "op": "copy", - "value": "\n\n" - }, - { - "op": "add", - "value": "Photography classes at the local" - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 0, - "add": 20 - } - } - } - ], - "revisions": { - "216": { - "post_date_gmt": "2019-02-15 23:27:13Z", - "post_modified_gmt": "2019-02-15 23:27:13Z", - "post_author": "68646169", - "id": 216, - "post_content": "Returning client special - Offer a discount to clients who have left a review.\n\nPhotography classes at the local", - "post_excerpt": "", - "post_title": "Ideas" - } - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_387_diffs.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_387_diffs.json deleted file mode 100644 index 4e1dbb8b8a10..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_387_diffs.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/post/387/diffs/", - "queryParameters": { - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "diffs": [ - { - "from": 0, - "to": 390, - "diff": { - "post_title": [ - { - "op": "del", - "value": "" - }, - { - "op": "add", - "value": "Time to Book Summer Sessions" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "add", - "value": "Blue skies and warm weather, what's not to love about summer?" - }, - { - "op": "copy", - "value": "\n\n" - }, - { - "op": "add", - "value": "It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.\n\n\"beach-clouds-daytime-994605\"\n\nHow to book\nEmail us to set up a time to visit our studio." - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 0, - "add": 86 - } - } - } - ], - "revisions": { - "390": { - "post_date_gmt": "2019-05-28 21:03:03Z", - "post_modified_gmt": "2019-05-28 21:03:03Z", - "post_author": "742098", - "id": 390, - "post_content": "Blue skies and warm weather, what's not to love about summer?\n\nIt's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.\n\n\"beach-clouds-daytime-994605\"\n\nHow to book\nEmail us to set up a time to visit our studio.", - "post_excerpt": "", - "post_title": "Time to Book Summer Sessions" - } - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_396_diffs.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_396_diffs.json deleted file mode 100644 index 5634833bff6f..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/post_396_diffs.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/post/396/diffs/", - "queryParameters": { - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "diffs": [ - { - "from": 398, - "to": 399, - "diff": { - "post_title": [ - { - "op": "copy", - "value": "Now Booking Summer Sessions" - } - ], - "post_content": [ - { - "op": "copy", - "value": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\n" - }, - { - "op": "add", - "value": "\n" - }, - { - "op": "copy", - "value": "\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book" - }, - { - "op": "del", - "value": "\n<" - }, - { - "op": "add", - "value": "<" - }, - { - "op": "copy", - "value": "/strong>" - }, - { - "op": "add", - "value": "\n\n\n" - }, - { - "op": "copy", - "value": "Email us to set up a time to visit our studio.\n" - } - ], - "totals": { - "add": 0, - "del": 0 - } - } - }, - { - "from": 0, - "to": 398, - "diff": { - "post_title": [ - { - "op": "del", - "value": "" - }, - { - "op": "add", - "value": "Now Booking Summer Sessions" - }, - { - "op": "copy", - "value": "\n" - } - ], - "post_content": [ - { - "op": "add", - "value": "
“One must maintain a little bit of summer, even in the middle of winter.”" - }, - { - "op": "copy", - "value": "\n\n" - }, - { - "op": "add", - "value": "– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\nEmail us to set up a time to visit our studio." - }, - { - "op": "copy", - "value": "\n" - } - ], - "totals": { - "del": 0, - "add": 101 - } - } - } - ], - "revisions": { - "399": { - "post_date_gmt": "2019-05-28 21:06:50Z", - "post_modified_gmt": "2019-05-28 21:06:50Z", - "post_author": "742098", - "id": 399, - "post_content": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\n\n\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\n\n\nEmail us to set up a time to visit our studio.", - "post_excerpt": "", - "post_title": "Now Booking Summer Sessions" - }, - "398": { - "post_date_gmt": "2019-05-28 21:05:17Z", - "post_modified_gmt": "2019-05-28 21:05:17Z", - "post_author": "742098", - "id": 398, - "post_content": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\nEmail us to set up a time to visit our studio.", - "post_excerpt": "", - "post_title": "Now Booking Summer Sessions" - } - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-diff.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-diff.json deleted file mode 100644 index e5687df6fdba..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-diff.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/", - "queryParameters": { - "after": { - "matches": "(.*)" - }, - "before": { - "matches": "(.*)" - }, - "fields": { - "equalTo": "ID, title, URL" - }, - "number": { - "matches": "(.*)" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 0, - "posts": [ - - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" - }, - "wpcom": true - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending.json index 6dd5353c09bb..da83a98cc5b0 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending.json @@ -1,28 +1,25 @@ { "request": { "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/", + "urlPath": "/rest/v1.2/sites/106707880/posts", "queryParameters": { - "number": { - "equalTo": "60" + "locale": { + "matches": "(.*)" }, "context": { "equalTo": "edit" }, - "order_by": { - "equalTo": "date" - }, - "fields": { - "equalTo": "ID,modified,status,meta,date" + "meta": { + "equalTo": "autosave" }, - "order": { - "equalTo": "DESC" + "number": { + "equalTo": "40" }, "status": { "equalTo": "draft,pending" }, - "locale": { - "matches": "(.*)" + "type": { + "equalTo": "post" } } }, @@ -33,43 +30,1276 @@ "posts": [ { "ID": 213, - "modified": "2019-07-16T02:39:45+00:00", - "status": "draft" + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2020-08-24T12:17:14-07:00", + "modified": "2020-08-27T16:31:00-07:00", + "title": "Our Services", + "URL": "https://fourpawsdoggrooming.wordpress.com/our-services/", + "short_URL": "https://wp.me/Pcj1SD-J", + "content": "\n
\n

Mobile grooming salon for cats and dogs.

\n\n\n\n\n
\n\n\n\n

Dog grooming

\n\n\n\n
\n
\n

Our deluxe grooming service includes:

\n\n\n\n
  • Nail clip
  • Ear cleaning
  • 1st shampoo
  • 2nd shampoo
  • Conditioning rinse
  • Towel dry
  • Blow dry
  • Brush out
  • And a treat!
\n
\n\n\n\n
\n
\"\"
\n
\n
\n\n\n\n

Deluxe Cut and Groom

\n\n\n\n

Our deluxe cut and groom package includes everything in the deluxe groom plus a haircut.

\n\n\n\n

Add on services

\n\n\n\n

Pamper your pup even more with one of our signature add on services:

\n\n\n\n
  • Aloe conditioning treatment
  • Soothing medicated shampoos
  • Tooth brushing
  • Creative styling with temporary color
  • Nail polish application
  • Coat braiding
  • Bows and other accessories
\n\n\n\n
\n

\n
\n\n\n\n

\n", + "excerpt": "", + "slug": "our-services", + "guid": "https://fourpawsdoggrooming.wordpress.com/?p=45", + "status": "publish", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": false, + "comment_status": "closed", + "pings_open": false, + "ping_status": "closed", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "e41d1c97a7b93a594b07e4df51dfafb3", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + "65": { + "ID": 65, + "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg", + "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg", + "date": "2020-08-27T16:30:36-07:00", + "post_ID": 45, + "author_ID": 191794483, + "file": "image-1.jpg", + "mime_type": "image/jpeg", + "extension": "jpg", + "title": "image", + "caption": "", + "description": "", + "alt": "", + "thumbnails": { + "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=107", + "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=214", + "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=731", + "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200&h=900&crop=1", + "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=900&h=1200&crop=1", + "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200&h=1200&crop=1", + "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=800&h=600&crop=1", + "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=600&h=800&crop=1", + "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=800&h=800&crop=1", + "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=400&h=300&crop=1", + "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=300&h=400&crop=1", + "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=400&h=400&crop=1", + "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=200&h=150&crop=1", + "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=150&h=200&crop=1", + "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=200&h=200&crop=1", + "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200" + }, + "height": 1848, + "width": 1320, + "exif": { + "aperture": "0", + "credit": "", + "camera": "", + "caption": "", + "created_timestamp": "0", + "copyright": "", + "focal_length": "0", + "iso": "0", + "shutter_speed": "0", + "title": "", + "orientation": "1", + "keywords": [ + + ] + }, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/65", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/65/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", + "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" + } + } + }, + "63": { + "ID": 63, + "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg", + "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg", + "date": "2020-08-26T12:20:02-07:00", + "post_ID": 45, + "author_ID": 191794483, + "file": "wp-1598469598971.jpg", + "mime_type": "image/jpeg", + "extension": "jpg", + "title": "wp-1598469598971.jpg", + "caption": "", + "description": "", + "alt": "", + "thumbnails": { + "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=100", + "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200", + "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=682", + "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200&h=900&crop=1", + "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=900&h=1200&crop=1", + "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200&h=1200&crop=1", + "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=800&h=600&crop=1", + "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=600&h=800&crop=1", + "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=800&h=800&crop=1", + "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=400&h=300&crop=1", + "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=300&h=400&crop=1", + "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=400&h=400&crop=1", + "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200&h=150&crop=1", + "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=150&h=200&crop=1", + "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200&h=200&crop=1", + "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200" + }, + "height": 2780, + "width": 1851, + "exif": { + "aperture": "0", + "credit": "", + "camera": "", + "caption": "", + "created_timestamp": "0", + "copyright": "", + "focal_length": "0", + "iso": "0", + "shutter_speed": "0", + "title": "", + "orientation": "0", + "keywords": [ + + ] + }, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/63", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/63/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", + "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" + } + } + }, + "61": { + "ID": 61, + "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg", + "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg", + "date": "2020-08-25T12:05:54-07:00", + "post_ID": 45, + "author_ID": 191794483, + "file": "image.jpg", + "mime_type": "image/jpeg", + "extension": "jpg", + "title": "image", + "caption": "", + "description": "", + "alt": "", + "thumbnails": { + "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=150", + "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=300", + "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1024", + "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200&h=900&crop=1", + "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=900&h=1200&crop=1", + "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200&h=1200&crop=1", + "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=800&h=600&crop=1", + "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=600&h=800&crop=1", + "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=800&h=800&crop=1", + "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=400&h=300&crop=1", + "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=300&h=400&crop=1", + "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=400&h=400&crop=1", + "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=200&h=150&crop=1", + "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=150&h=200&crop=1", + "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=200&h=200&crop=1", + "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200" + }, + "height": 1848, + "width": 1846, + "exif": { + "aperture": "0", + "credit": "", + "camera": "", + "caption": "", + "created_timestamp": "0", + "copyright": "", + "focal_length": "0", + "iso": "0", + "shutter_speed": "0", + "title": "", + "orientation": "1", + "keywords": [ + + ] + }, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/61", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/61/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", + "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" + } + } + } + }, + "attachment_count": 3, + "metadata": [ + { + "id": "502", + "key": "email_notification", + "value": "1553125754" + }, + { + "id": "564", + "key": "geo_public", + "value": "0" + }, + { + "id": "496", + "key": "jabber_published", + "value": "1553125752" + }, + { + "id": "503", + "key": "timeline_notification", + "value": "1553125801" + }, + { + "id": "563", + "key": "_edit_last", + "value": "67626417" + }, + { + "id": "556", + "key": "_edit_lock", + "value": "1565368108:742098" + }, + { + "id": "501", + "key": "_publicize_job_id", + "value": "28865441316" + }, + { + "id": "500", + "key": "_rest_api_client_id", + "value": "-1" + }, + { + "id": "499", + "key": "_rest_api_published", + "value": "1" + }, + { + "id": "565", + "key": "_thumbnail_id", + "value": "151" + }, + { + "id": "514", + "key": "_wp_old_date", + "value": "2019-03-20" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/213/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 402, + 401, + 400, + 309, + 303, + 300, + 299, + 298, + 297, + 296, + 292, + 291, + 289, + 288, + 287, + 286, + 285, + 284, + 283, + 280, + 277, + 273, + 267, + 240, + 214 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/07/16/%postname%/", + "suggested_slug": "summer-band-jam" + } }, { "ID": 396, + "site_ID": 106707880, + "author": { + "ID": 742098, + "login": "jkmassel", + "email": "jeremy.massel@gmail.com", + "name": "Jeremy Massel", + "first_name": "Jeremy", + "last_name": "Massel", + "nice_name": "jkmassel", + "URL": "https://jkmassel.wordpress.com", + "avatar_URL": "https://2.gravatar.com/avatar/58fc51586c9a1f9895ac70e3ca60886e?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/jkmassel", + "site_ID": 1562023 + }, + "date": "2019-05-28T21:06:45+00:00", "modified": "2019-05-28T21:08:03+00:00", - "status": "draft" + "title": "Now Booking Summer Sessions", + "URL": "http://infocusphotographers.com/?p=396", + "short_URL": "https://wp.me/p7dJAQ-6o", + "content": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\n\nEmail us to set up a time to visit our studio.", + "excerpt": "", + "slug": "", + "guid": "http://infocusphotographers.com/?p=396", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": false, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "276e4cea0342ec68e69a0ca537acfce1", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "742", + "key": "sharing_disabled", + "value": [ + + ] + }, + { + "id": "741", + "key": "switch_like_status", + "value": "" + }, + { + "id": "743", + "key": "_edit_lock", + "value": "1565368199:742098" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/396/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 399, + 398 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", + "suggested_slug": "now-booking-summer-sessions-2" + } }, { "ID": 387, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-05-28T21:03:22+00:00", "modified": "2019-05-28T21:03:22+00:00", - "status": "draft" + "title": "Time to Book Summer Sessions", + "URL": "http://infocusphotographers.com/?p=387", + "short_URL": "https://wp.me/p7dJAQ-6f", + "content": "Blue skies and warm weather, what's not to love about summer?\n\nIt's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.\n\n\"beach-clouds-daytime-994605\"\n\nHow to book\nEmail us to set up a time to visit our studio.", + "excerpt": "", + "slug": "", + "guid": "http://infocusphotographers.com/?p=387", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "a9037bde04073835b078a1b1bb48b7de", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "731", + "key": "_edit_lock", + "value": "1559077396:742098" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/387/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 390 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", + "suggested_slug": "time-to-book-summer-sessions" + } }, { "ID": 265, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-04-17T10:40:39+00:00", "modified": "2019-04-17T10:41:03+00:00", - "status": "draft" + "title": "What we've been doing lately", + "URL": "http://infocusphotographers.com/?p=265", + "short_URL": "https://wp.me/p7dJAQ-4h", + "content": "\r\n

The last few weeks have been a blur! Here are a few shots we really like. What do you think?

\r\n\r\n\r\n\r\n\r\n", + "excerpt": "", + "slug": "", + "guid": "http://infocusphotographers.com/?p=265", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "2f7a8f8da665b6469d91f96108fb24c6", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "567", + "key": "geo_public", + "value": "0" + }, + { + "id": "566", + "key": "_edit_last", + "value": "67626417" + }, + { + "id": "555", + "key": "_edit_lock", + "value": "1555497522:67626417" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/265/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 294, + 293, + 266 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/04/17/%postname%/", + "suggested_slug": "what-weve-been-doing-lately" + } }, { "ID": 134, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-03-19T03:08:16+00:00", "modified": "2019-05-27T21:39:08+00:00", - "status": "draft" + "title": "Now Booking Summer Sessions", + "URL": "http://infocusphotographers.com/?p=134", + "short_URL": "https://wp.me/p7dJAQ-2a", + "content": "
“One must maintain a little bit of summer, even in the middle of winter.” \n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n

How to book

\nEmail us to set up a time to visit our studio.", + "excerpt": "", + "slug": "now-booking-summer-sessions", + "guid": "http://infocusphotographers.com/?p=134", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "e9bb2d5021873cf97e6ced1f9308bdd5", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "560", + "key": "_edit_lock", + "value": "1559078929:742098" + }, + { + "id": "478", + "key": "_wp_desired_post_slug", + "value": "" + }, + { + "id": "481", + "key": "_wp_desired_post_slug", + "value": "__trashed-5" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/134/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/likes/", + "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/autosave" + }, + "data": { + "autosave": { + "ID": 397, + "author_ID": "742098", + "post_ID": 134, + "title": "Now Booking Summer Sessions", + "content": "
“One must maintain a little bit of summer, even in the middle of winter.” \n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n

How to book

\nEmail us to set up a time to visit our studio.", + "excerpt": "", + "preview_URL": "http://infocusphotographers.com/?p=134&preview=true&preview_nonce=fcfb9daa0a", + "modified": "2019-05-28T21:05:12+00:00" + } + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 397, + 310, + 274, + 236, + 231, + 230, + 220, + 219, + 218, + 136, + 135 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/03/19/%postname%/", + "suggested_slug": "now-booking-summer-sessions" + } }, { "ID": 215, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-02-15T23:27:13+00:00", "modified": "2019-02-15T23:27:13+00:00", - "status": "draft" + "title": "Ideas", + "URL": "http://infocusphotographers.com/?p=215", + "short_URL": "https://wp.me/p7dJAQ-3t", + "content": "Returning client special - Offer a discount to clients who have left a review.\n\nPhotography classes at the local", + "excerpt": "", + "slug": "", + "guid": "http://infocusphotographers.com/?p=215", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "50d8150dfae26a5bef18779211142b65", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "561", + "key": "_edit_lock", + "value": "1553718391:742098" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/215/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 216 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/02/15/%postname%/", + "suggested_slug": "ideas" + } }, { "ID": 225, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-01-01T21:54:15+00:00", "modified": "2019-03-21T17:20:44+00:00", - "status": "draft" + "title": "Book Your Summer Sessions", + "URL": "http://infocusphotographers.com/?p=225", + "short_URL": "https://wp.me/p7dJAQ-3D", + "content": "\n

“One must maintain a little bit of summer, even in the middle of winter.

– Henry David Thoreau
\n\n\n\n

Blue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!

\n\n\n\n

We offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.

\n\n\n\n
\"beach-children-family-39691\"
\n\n\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n", + "excerpt": "", + "slug": "__trashed-2", + "guid": "http://infocusphotographers.com/?p=225", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "2d07f957bcc110149b8aa37bd1231ad1", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + "243": { + "ID": 243, + "URL": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", + "guid": "http://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", + "date": "2019-03-20T23:56:52+00:00", + "post_ID": 225, + "author_ID": 14151046, + "file": "beach-children-family-39691.jpg", + "mime_type": "image/jpeg", + "extension": "jpg", + "title": "beach-children-family-39691", + "caption": "", + "description": "", + "alt": "", + "thumbnails": { + "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=150", + "medium": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=300", + "large": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=1024" + }, + "height": 2446, + "width": 3669, + "exif": { + "aperture": "0", + "credit": "", + "camera": "", + "caption": "", + "created_timestamp": "0", + "copyright": "", + "focal_length": "0", + "iso": "0", + "shutter_speed": "0", + "title": "", + "orientation": "0", + "keywords": [ + + ] + }, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/243", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/243/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225" + } + } + } + }, + "attachment_count": 1, + "metadata": [ + { + "id": "558", + "key": "_edit_lock", + "value": "1559077412:742098" + }, + { + "id": "468", + "key": "_wp_desired_post_slug", + "value": "" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/225/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 271, + 235, + 229, + 228, + 227, + 226 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/01/01/%postname%/", + "suggested_slug": "__trashed-2" + } } ], "meta": { "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" + "counts": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/post-counts/post" }, "wpcom": true } diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending_v2.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending_v2.json deleted file mode 100644 index da83a98cc5b0..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-draft,pending_v2.json +++ /dev/null @@ -1,1308 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.2/sites/106707880/posts", - "queryParameters": { - "locale": { - "matches": "(.*)" - }, - "context": { - "equalTo": "edit" - }, - "meta": { - "equalTo": "autosave" - }, - "number": { - "equalTo": "40" - }, - "status": { - "equalTo": "draft,pending" - }, - "type": { - "equalTo": "post" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 7, - "posts": [ - { - "ID": 213, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2020-08-24T12:17:14-07:00", - "modified": "2020-08-27T16:31:00-07:00", - "title": "Our Services", - "URL": "https://fourpawsdoggrooming.wordpress.com/our-services/", - "short_URL": "https://wp.me/Pcj1SD-J", - "content": "\n
\n

Mobile grooming salon for cats and dogs.

\n\n\n\n\n
\n\n\n\n

Dog grooming

\n\n\n\n
\n
\n

Our deluxe grooming service includes:

\n\n\n\n
  • Nail clip
  • Ear cleaning
  • 1st shampoo
  • 2nd shampoo
  • Conditioning rinse
  • Towel dry
  • Blow dry
  • Brush out
  • And a treat!
\n
\n\n\n\n
\n
\"\"
\n
\n
\n\n\n\n

Deluxe Cut and Groom

\n\n\n\n

Our deluxe cut and groom package includes everything in the deluxe groom plus a haircut.

\n\n\n\n

Add on services

\n\n\n\n

Pamper your pup even more with one of our signature add on services:

\n\n\n\n
  • Aloe conditioning treatment
  • Soothing medicated shampoos
  • Tooth brushing
  • Creative styling with temporary color
  • Nail polish application
  • Coat braiding
  • Bows and other accessories
\n\n\n\n
\n

\n
\n\n\n\n

\n", - "excerpt": "", - "slug": "our-services", - "guid": "https://fourpawsdoggrooming.wordpress.com/?p=45", - "status": "publish", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": false, - "comment_status": "closed", - "pings_open": false, - "ping_status": "closed", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "e41d1c97a7b93a594b07e4df51dfafb3", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - "65": { - "ID": 65, - "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg", - "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg", - "date": "2020-08-27T16:30:36-07:00", - "post_ID": 45, - "author_ID": 191794483, - "file": "image-1.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "image", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=107", - "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=214", - "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=731", - "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200&h=900&crop=1", - "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=900&h=1200&crop=1", - "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200&h=1200&crop=1", - "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=800&h=600&crop=1", - "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=600&h=800&crop=1", - "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=800&h=800&crop=1", - "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=400&h=300&crop=1", - "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=300&h=400&crop=1", - "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=400&h=400&crop=1", - "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=200&h=150&crop=1", - "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=150&h=200&crop=1", - "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=200&h=200&crop=1", - "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image-1.jpg?w=1200" - }, - "height": 1848, - "width": 1320, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "1", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/65", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/65/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" - } - } - }, - "63": { - "ID": 63, - "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg", - "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg", - "date": "2020-08-26T12:20:02-07:00", - "post_ID": 45, - "author_ID": 191794483, - "file": "wp-1598469598971.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "wp-1598469598971.jpg", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=100", - "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200", - "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=682", - "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200&h=900&crop=1", - "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=900&h=1200&crop=1", - "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200&h=1200&crop=1", - "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=800&h=600&crop=1", - "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=600&h=800&crop=1", - "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=800&h=800&crop=1", - "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=400&h=300&crop=1", - "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=300&h=400&crop=1", - "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=400&h=400&crop=1", - "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200&h=150&crop=1", - "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=150&h=200&crop=1", - "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=200&h=200&crop=1", - "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/wp-1598469598971.jpg?w=1200" - }, - "height": 2780, - "width": 1851, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "0", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/63", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/63/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" - } - } - }, - "61": { - "ID": 61, - "URL": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg", - "guid": "http://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg", - "date": "2020-08-25T12:05:54-07:00", - "post_ID": 45, - "author_ID": 191794483, - "file": "image.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "image", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=150", - "medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=300", - "large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1024", - "newspack-article-block-landscape-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200&h=900&crop=1", - "newspack-article-block-portrait-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=900&h=1200&crop=1", - "newspack-article-block-square-large": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200&h=1200&crop=1", - "newspack-article-block-landscape-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=800&h=600&crop=1", - "newspack-article-block-portrait-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=600&h=800&crop=1", - "newspack-article-block-square-medium": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=800&h=800&crop=1", - "newspack-article-block-landscape-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=400&h=300&crop=1", - "newspack-article-block-portrait-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=300&h=400&crop=1", - "newspack-article-block-square-small": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=400&h=400&crop=1", - "newspack-article-block-landscape-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=200&h=150&crop=1", - "newspack-article-block-portrait-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=150&h=200&crop=1", - "newspack-article-block-square-tiny": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=200&h=200&crop=1", - "newspack-article-block-uncropped": "https://fourpawsdoggrooming.files.wordpress.com/2020/08/image.jpg?w=1200" - }, - "height": 1848, - "width": 1846, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "1", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/61", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495/media/61/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/181851495", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/181851495/posts/45" - } - } - } - }, - "attachment_count": 3, - "metadata": [ - { - "id": "502", - "key": "email_notification", - "value": "1553125754" - }, - { - "id": "564", - "key": "geo_public", - "value": "0" - }, - { - "id": "496", - "key": "jabber_published", - "value": "1553125752" - }, - { - "id": "503", - "key": "timeline_notification", - "value": "1553125801" - }, - { - "id": "563", - "key": "_edit_last", - "value": "67626417" - }, - { - "id": "556", - "key": "_edit_lock", - "value": "1565368108:742098" - }, - { - "id": "501", - "key": "_publicize_job_id", - "value": "28865441316" - }, - { - "id": "500", - "key": "_rest_api_client_id", - "value": "-1" - }, - { - "id": "499", - "key": "_rest_api_published", - "value": "1" - }, - { - "id": "565", - "key": "_thumbnail_id", - "value": "151" - }, - { - "id": "514", - "key": "_wp_old_date", - "value": "2019-03-20" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/213/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 402, - 401, - 400, - 309, - 303, - 300, - 299, - 298, - 297, - 296, - 292, - 291, - 289, - 288, - 287, - 286, - 285, - 284, - 283, - 280, - 277, - 273, - 267, - 240, - 214 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/07/16/%postname%/", - "suggested_slug": "summer-band-jam" - } - }, - { - "ID": 396, - "site_ID": 106707880, - "author": { - "ID": 742098, - "login": "jkmassel", - "email": "jeremy.massel@gmail.com", - "name": "Jeremy Massel", - "first_name": "Jeremy", - "last_name": "Massel", - "nice_name": "jkmassel", - "URL": "https://jkmassel.wordpress.com", - "avatar_URL": "https://2.gravatar.com/avatar/58fc51586c9a1f9895ac70e3ca60886e?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/jkmassel", - "site_ID": 1562023 - }, - "date": "2019-05-28T21:06:45+00:00", - "modified": "2019-05-28T21:08:03+00:00", - "title": "Now Booking Summer Sessions", - "URL": "http://infocusphotographers.com/?p=396", - "short_URL": "https://wp.me/p7dJAQ-6o", - "content": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\n\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=396", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": false, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "276e4cea0342ec68e69a0ca537acfce1", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "742", - "key": "sharing_disabled", - "value": [ - - ] - }, - { - "id": "741", - "key": "switch_like_status", - "value": "" - }, - { - "id": "743", - "key": "_edit_lock", - "value": "1565368199:742098" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/396/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 399, - 398 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", - "suggested_slug": "now-booking-summer-sessions-2" - } - }, - { - "ID": 387, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-05-28T21:03:22+00:00", - "modified": "2019-05-28T21:03:22+00:00", - "title": "Time to Book Summer Sessions", - "URL": "http://infocusphotographers.com/?p=387", - "short_URL": "https://wp.me/p7dJAQ-6f", - "content": "Blue skies and warm weather, what's not to love about summer?\n\nIt's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.\n\n\"beach-clouds-daytime-994605\"\n\nHow to book\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=387", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "a9037bde04073835b078a1b1bb48b7de", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "731", - "key": "_edit_lock", - "value": "1559077396:742098" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/387/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 390 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", - "suggested_slug": "time-to-book-summer-sessions" - } - }, - { - "ID": 265, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-04-17T10:40:39+00:00", - "modified": "2019-04-17T10:41:03+00:00", - "title": "What we've been doing lately", - "URL": "http://infocusphotographers.com/?p=265", - "short_URL": "https://wp.me/p7dJAQ-4h", - "content": "\r\n

The last few weeks have been a blur! Here are a few shots we really like. What do you think?

\r\n\r\n\r\n\r\n\r\n", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=265", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "2f7a8f8da665b6469d91f96108fb24c6", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "567", - "key": "geo_public", - "value": "0" - }, - { - "id": "566", - "key": "_edit_last", - "value": "67626417" - }, - { - "id": "555", - "key": "_edit_lock", - "value": "1555497522:67626417" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/265/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 294, - 293, - 266 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/04/17/%postname%/", - "suggested_slug": "what-weve-been-doing-lately" - } - }, - { - "ID": 134, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-03-19T03:08:16+00:00", - "modified": "2019-05-27T21:39:08+00:00", - "title": "Now Booking Summer Sessions", - "URL": "http://infocusphotographers.com/?p=134", - "short_URL": "https://wp.me/p7dJAQ-2a", - "content": "
“One must maintain a little bit of summer, even in the middle of winter.” \n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n

How to book

\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "now-booking-summer-sessions", - "guid": "http://infocusphotographers.com/?p=134", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "e9bb2d5021873cf97e6ced1f9308bdd5", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "560", - "key": "_edit_lock", - "value": "1559078929:742098" - }, - { - "id": "478", - "key": "_wp_desired_post_slug", - "value": "" - }, - { - "id": "481", - "key": "_wp_desired_post_slug", - "value": "__trashed-5" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/134/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/likes/", - "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/autosave" - }, - "data": { - "autosave": { - "ID": 397, - "author_ID": "742098", - "post_ID": 134, - "title": "Now Booking Summer Sessions", - "content": "
“One must maintain a little bit of summer, even in the middle of winter.” \n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n

How to book

\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "preview_URL": "http://infocusphotographers.com/?p=134&preview=true&preview_nonce=fcfb9daa0a", - "modified": "2019-05-28T21:05:12+00:00" - } - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 397, - 310, - 274, - 236, - 231, - 230, - 220, - 219, - 218, - 136, - 135 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/03/19/%postname%/", - "suggested_slug": "now-booking-summer-sessions" - } - }, - { - "ID": 215, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-02-15T23:27:13+00:00", - "modified": "2019-02-15T23:27:13+00:00", - "title": "Ideas", - "URL": "http://infocusphotographers.com/?p=215", - "short_URL": "https://wp.me/p7dJAQ-3t", - "content": "Returning client special - Offer a discount to clients who have left a review.\n\nPhotography classes at the local", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=215", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "50d8150dfae26a5bef18779211142b65", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "561", - "key": "_edit_lock", - "value": "1553718391:742098" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/215/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 216 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/02/15/%postname%/", - "suggested_slug": "ideas" - } - }, - { - "ID": 225, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-01-01T21:54:15+00:00", - "modified": "2019-03-21T17:20:44+00:00", - "title": "Book Your Summer Sessions", - "URL": "http://infocusphotographers.com/?p=225", - "short_URL": "https://wp.me/p7dJAQ-3D", - "content": "\n

“One must maintain a little bit of summer, even in the middle of winter.

– Henry David Thoreau
\n\n\n\n

Blue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!

\n\n\n\n

We offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.

\n\n\n\n
\"beach-children-family-39691\"
\n\n\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n", - "excerpt": "", - "slug": "__trashed-2", - "guid": "http://infocusphotographers.com/?p=225", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "2d07f957bcc110149b8aa37bd1231ad1", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - "243": { - "ID": 243, - "URL": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", - "date": "2019-03-20T23:56:52+00:00", - "post_ID": 225, - "author_ID": 14151046, - "file": "beach-children-family-39691.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "beach-children-family-39691", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=150", - "medium": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=300", - "large": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=1024" - }, - "height": 2446, - "width": 3669, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "0", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/243", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/243/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225" - } - } - } - }, - "attachment_count": 1, - "metadata": [ - { - "id": "558", - "key": "_edit_lock", - "value": "1559077412:742098" - }, - { - "id": "468", - "key": "_wp_desired_post_slug", - "value": "" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/225/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 271, - 235, - 229, - 228, - 227, - 226 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/01/01/%postname%/", - "suggested_slug": "__trashed-2" - } - } - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/post-counts/post" - }, - "wpcom": true - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-first.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-first.json deleted file mode 100644 index 99bef23f4ce7..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-first.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPattern": "/rest/v1.1/sites/.*/posts/.*", - "queryParameters": { - "locale": { - "matches": "(.*)" - }, - "fields": { - "equalTo": "ID, title, URL, discussion, like_count, date" - }, - "number": { - "matches": "1" - }, - "order_by": { - "equalTo": "date" - }, - "type": { - "equalTo": "post" - } - } - }, - "response": { - "status": 200, - "fixedDelayMilliseconds": 1000, - "jsonBody": { - "found": 2, - "posts": [ - { - "ID": 106, - "date": "2016-04-19T21:28:27+00:00", - "title": "Some News to Share", - "URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "like_count": 0 - } - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" - }, - "next_page": "value=2016-04-19T21%3A28%3A27%2B00%3A00&id=106", - "wpcom": true - } - }, - "headers": { - "Content-Type": "application/json", - "Connection": "keep-alive", - "Cache-Control": "no-cache, must-revalidate, max-age=0" - } - }, - "scenarioName": "new-post", - "newScenarioState": "Post Published" -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-future.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-future.json deleted file mode 100644 index 36a6269b1b62..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-future.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/", - "queryParameters": { - "number": { - "equalTo": "60" - }, - "context": { - "equalTo": "edit" - }, - "order_by": { - "equalTo": "date" - }, - "fields": { - "matches": "ID,modified,status(,meta)?(,date)?" - }, - "order": { - "equalTo": "DESC" - }, - "status": { - "equalTo": "future" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 0, - "posts": [ - - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" - }, - "wpcom": true - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-after.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-after.json index 5dd572a60bdc..e149f56bc87f 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-after.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-after.json @@ -1,56 +1,146 @@ { - "request": { - "method": "GET", - "urlPattern": "/rest/v1.1/sites/106707880/posts(/)\\?($|\\?.*)", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "status": { - "equalTo": "publish,private" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 4, - "posts": [ - { - "ID": 5, - "modified": "2019-03-12T15:00:53+00:00", - "status": "publish" - }, - { - "ID": 237, - "modified": "2019-03-21T17:19:25+00:00", - "status": "private" - }, - { - "ID": 106, - "modified": "2018-03-23T00:20:36+00:00", - "status": "publish" - }, - { - "ID": 90, - "modified": "2016-03-16T02:01:50+00:00", - "status": "publish" + "request": { + "method": "POST", + "urlPattern": "/rest/v1.2/sites/106707880/posts/5?($|\\?.*)", + "queryParameters": { + "context": { + "equalTo": "edit" } - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" + } + }, + "response": { + "status": 200, + "fixedDelayMilliseconds": 1000, + "jsonBody": { + "ID": 5, + "site_ID": 106707880, + "author": { + "ID": 152748359, + "login": "e2eflowtestingmobile", + "email": "e2eflowtestingmobile@example.com", + "name": "e2eflowtestingmobile", + "first_name": "", + "last_name": "", + "nice_name": "e2eflowtestingmobile", + "URL": "https://infocusphotographers.com", + "avatar_URL": "https://1.gravatar.com/avatar/7a4015c11be6a342f65e0e169092d402?s=96&d=identicon&r=G", + "profile_URL": "http://en.gravatar.com/e2eflowtestingmobile", + "site_ID": 1 + }, + "date": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}", + "modified": "{{now format=customformat}}", + "title": "{{jsonPath request.body '$.title'}}", + "URL": "https://lowtestingmobile.wordpress.com/2019/03/12/title-33/", + "short_URL": "https://e/paIC9Y-1r", + "content": "\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue efficitur leo eget porta.

\n", + "excerpt": "", + "slug": "title-33", + "guid": "https://infocusphotographers.com/2019/03/12/title-33/", + "status": "publish", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": true, + "global_ID": "127876e9017a09034bcf41ee80428027", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { }, - "next_page": "value=&id=29", - "wpcom": true + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "909", + "key": "jabber_published", + "value": "1552402855" + } + ], + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/posts/5/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880", + "replies": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/replies/", + "likes": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "other_URLs": { + } + }, + "headers": { + "Content-Type": "application/json", + "Connection": "keep-alive", + "Cache-Control": "no-cache, must-revalidate, max-age=0" } }, - "headers": { - "Content-Type": "application/json", - "Connection": "keep-alive", - "Cache-Control": "no-cache, must-revalidate, max-age=0" - } - }, - "scenarioName": "new-post", - "requiredScenarioState": "Post Published" -} \ No newline at end of file + "scenarioName": "new-post", + "newScenarioState": "Post Published" + } \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled-after.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled-after.json new file mode 100644 index 000000000000..af305e34c97d --- /dev/null +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled-after.json @@ -0,0 +1,145 @@ +{ + "request": { + "method": "POST", + "urlPattern": "/rest/v1.2/sites/181977606/posts/15?($|\\?.*)", + "queryParameters": { + "context": { + "equalTo": "edit" + } + } + }, + "response": { + "status": 200, + "jsonBody": { + "ID": 15, + "site_ID": 181977606, + "author": { + "ID": 152748359, + "login": "e2eflowtestingmobile", + "email": "e2eflowtestingmobile@example.com", + "name": "e2eflowtestingmobile", + "first_name": "", + "last_name": "", + "nice_name": "e2eflowtestingmobile", + "URL": "https://infocusphotographers.com", + "avatar_URL": "https://1.gravatar.com/avatar/7a4015c11be6a342f65e0e169092d402?s=96&d=identicon&r=G", + "profile_URL": "http://en.gravatar.com/e2eflowtestingmobile", + "site_ID": 1 + }, + "date": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now offset='+2 hours' format=customformat}}", + "modified": "{{now offset='+2 hours' format=customformat}}", + "title": "{{jsonPath request.body '$.title'}}", + "URL": "https://lowtestingmobile.wordpress.com/2019/03/12/title-33/", + "short_URL": "https://e/paIC9Y-1r", + "content": "\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue efficitur leo eget porta.

\n", + "excerpt": "", + "slug": "title-33", + "guid": "https://infocusphotographers.com/2019/03/12/title-33/", + "status": "future", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": true, + "global_ID": "127876e9017a09034bcf41ee80428027", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "909", + "key": "jabber_published", + "value": "1552402855" + } + ], + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/posts/5/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606", + "replies": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5/replies/", + "likes": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "other_URLs": { + } + }, + "headers": { + "Content-Type": "application/json", + "Connection": "keep-alive", + "Cache-Control": "no-cache, must-revalidate, max-age=0" + } + }, + "scenarioName": "new-scheduled-post", + "requiredScenarioState": "Scheduled Post Published" + } \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled.json new file mode 100644 index 000000000000..7391a5adf318 --- /dev/null +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new-scheduled.json @@ -0,0 +1,146 @@ +{ + "request": { + "method": "POST", + "urlPattern": "/rest/v1.2/sites/181977606/posts/new?($|\\?.*)", + "queryParameters": { + "context": { + "equalTo": "edit" + } + } + }, + "response": { + "status": 200, + "fixedDelayMilliseconds": 1000, + "jsonBody": { + "ID": 15, + "site_ID": 181977606, + "author": { + "ID": 152748359, + "login": "e2eflowtestingmobile", + "email": "e2eflowtestingmobile@example.com", + "name": "e2eflowtestingmobile", + "first_name": "", + "last_name": "", + "nice_name": "e2eflowtestingmobile", + "URL": "https://infocusphotographers.com", + "avatar_URL": "https://1.gravatar.com/avatar/7a4015c11be6a342f65e0e169092d402?s=96&d=identicon&r=G", + "profile_URL": "http://en.gravatar.com/e2eflowtestingmobile", + "site_ID": 1 + }, + "date": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now offset='+2 hours' format=customformat}}", + "modified": "{{now offset='+2 hours' format=customformat}}", + "title": "{{jsonPath request.body '$.title'}}", + "URL": "https://lowtestingmobile.wordpress.com/2019/03/12/title-33/", + "short_URL": "https://e/paIC9Y-1r", + "content": "\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam congue efficitur leo eget porta.

\n", + "excerpt": "", + "slug": "title-33", + "guid": "https://infocusphotographers.com/2019/03/12/title-33/", + "status": "future", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": true, + "global_ID": "127876e9017a09034bcf41ee80428027", + "featured_image": "", + "post_thumbnail": null, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 82, + "parent": 0, + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "909", + "key": "jabber_published", + "value": "1552402855" + } + ], + "meta": { + "links": { + "self": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/181977606/posts/5/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/181977606", + "replies": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5/replies/", + "likes": "https://public-api.wordpress.com/rest/v1.1/sites/181977606/posts/5/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "other_URLs": { + } + }, + "headers": { + "Content-Type": "application/json", + "Connection": "keep-alive", + "Cache-Control": "no-cache, must-revalidate, max-age=0" + } + }, + "scenarioName": "new-scheduled-post", + "newScenarioState": "Scheduled Post Published" + } \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new.json index e9bbdb4c3058..1c605251f963 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-new.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "urlPattern": "/rest/v1.2/sites/.*/posts/new(/)?($|\\?.*)", + "urlPattern": "/rest/v1.2/sites/106707880/posts/new?($|\\?.*)", "queryParameters": { "context": { "equalTo": "edit" @@ -27,8 +27,8 @@ "profile_URL": "http://en.gravatar.com/e2eflowtestingmobile", "site_ID": 1 }, - "date": "2019-03-12T15:00:53+00:00", - "modified": "2019-03-12T15:00:53+00:00", + "date": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now format=customformat}}", + "modified": "{{now format=customformat}}", "title": "{{jsonPath request.body '$.title'}}", "URL": "https://lowtestingmobile.wordpress.com/2019/03/12/title-33/", "short_URL": "https://e/paIC9Y-1r", @@ -75,9 +75,9 @@ "parent": 0, "meta": { "links": { - "self": "https://ic-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880" + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880" } } } @@ -101,9 +101,9 @@ "parent": 0, "meta": { "links": { - "self": "https://ic-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880" + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880" } } } @@ -120,11 +120,11 @@ ], "meta": { "links": { - "self": "https://ic-api.wordpress.com/rest/v1.1/sites/106707880/posts/5", - "help": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880/posts/5/help", - "site": "https://ic-api.wordpress.com/rest/v1.2/sites/106707880", - "replies": "https://ic-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/replies/", - "likes": "https://ic-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/likes/" + "self": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5", + "help": "https://public-api.wordpress.com/rest/v1.2/sites/106707880/posts/5/help", + "site": "https://public-api.wordpress.com/rest/v1.2/sites/106707880", + "replies": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/replies/", + "likes": "https://public-api.wordpress.com/rest/v1.1/sites/106707880/posts/5/likes/" } }, "capabilities": { diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish.json index dcb60cf5f74e..f4209469721d 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish.json @@ -1,28 +1,25 @@ { "request": { "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/", + "urlPattern": "/rest/v1.2/sites/.*/posts.*", "queryParameters": { - "number": { - "equalTo": "60" + "locale": { + "matches": "(.*)" }, "context": { "equalTo": "edit" }, - "order_by": { - "equalTo": "date" - }, - "fields": { - "equalTo": "ID,modified,status,meta,date" + "meta": { + "equalTo": "autosave" }, - "order": { - "equalTo": "DESC" + "number": { + "matches": "(.*)" }, "status": { "equalTo": "publish,private" }, - "locale": { - "matches": "(.*)" + "type": { + "equalTo": "post" } } }, @@ -33,23 +30,645 @@ "posts": [ { "ID": 237, + "site_ID": 106707880, + "author": { + "ID": 68646169, + "login": "thenomadicwordsmith", + "email": "thenomadicwordsmith@gmail.com", + "name": "thenomadicwordsmith", + "first_name": "Nomadic", + "last_name": "Wordsmith", + "nice_name": "thenomadicwordsmith", + "URL": "http://thenomadicwordsmith.wordpress.com", + "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", + "site_ID": 71769073 + }, + "date": "2019-03-13T23:48:58+00:00", "modified": "2019-03-21T17:19:25+00:00", - "status": "private" + "title": "Photo Contest", + "URL": "http://infocusphotographers.com/2019/03/13/some-news-to-share-2/", + "short_URL": "https://wp.me/p7dJAQ-3P", + "content": "\n

In Focus Photography was nominated for an international photo award!

\n\n\n\n

Please vote for us!

\n", + "excerpt": "", + "slug": "some-news-to-share-2", + "guid": "http://infocusphotographers.com/?p=237", + "status": "private", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "9dc6f7941b6a68fc2323b652c4e9516b", + "featured_image": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", + "post_thumbnail": { + "ID": 238, + "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", + "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", + "mime_type": "image/jpeg", + "width": 4256, + "height": 2628 + }, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + "238": { + "ID": 238, + "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", + "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", + "date": "2019-03-20T23:44:49+00:00", + "post_ID": 237, + "author_ID": 14151046, + "file": "art-bright-celebration-1313817.jpg", + "mime_type": "image/jpeg", + "extension": "jpg", + "title": "art-bright-celebration-1313817", + "caption": "", + "description": "", + "alt": "", + "thumbnails": { + "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=150", + "medium": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=300", + "large": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=1024" + }, + "height": 2628, + "width": 4256, + "exif": { + "aperture": "0", + "credit": "", + "camera": "", + "caption": "", + "created_timestamp": "0", + "copyright": "", + "focal_length": "0", + "iso": "0", + "shutter_speed": "0", + "title": "", + "orientation": "0", + "keywords": [ + + ] + }, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/238", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/238/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237" + } + } + } + }, + "attachment_count": 1, + "metadata": [ + { + "id": "493", + "key": "email_notification", + "value": "1553125740" + }, + { + "id": "486", + "key": "jabber_published", + "value": "1553125739" + }, + { + "id": "491", + "key": "timeline_notification", + "value": "1553125810" + }, + { + "id": "557", + "key": "_edit_lock", + "value": "1553188814:68646169" + }, + { + "id": "492", + "key": "_publicize_job_id", + "value": "28865445244" + }, + { + "id": "490", + "key": "_rest_api_client_id", + "value": "-1" + }, + { + "id": "489", + "key": "_rest_api_published", + "value": "1" + }, + { + "id": "484", + "key": "_thumbnail_id", + "value": "238" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/237/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 269, + 263, + 239 + ], + "other_URLs": { + "permalink_URL": "http://infocusphotographers.com/2019/03/13/%postname%/", + "suggested_slug": "some-news-to-share-2" + } }, { "ID": 106, + "site_ID": 106707880, + "author": { + "ID": 100907762, + "login": "leahelainerand", + "email": "andreazoellner+leahrand@gmail.com", + "name": "Leah Elaine Rand", + "first_name": "Leah", + "last_name": "Rand", + "nice_name": "leahelainerand", + "URL": "", + "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/leahelainerand", + "site_ID": 106523982 + }, + "date": "2016-04-19T21:28:27+00:00", "modified": "2018-03-23T00:20:36+00:00", - "status": "publish" + "title": "Some News to Share", + "URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/", + "short_URL": "https://wp.me/p7dJAQ-1I", + "content": "John was shortlisted for the World Press Photo competition, an international celebration of the best photojournalism of the year.\n\nhttps://twitter.com/wordpressdotcom/status/702181837079187456", + "excerpt": "", + "slug": "some-news-to-share", + "guid": "https://infocusphotographers.wordpress.com/?p=106", + "status": "publish", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "3a10a002b4f389596205c24992732a3e", + "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", + "post_thumbnail": { + "ID": 62, + "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", + "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", + "mime_type": "image/jpeg", + "width": 1080, + "height": 720 + }, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Uncategorized": { + "ID": 1, + "name": "Uncategorized", + "slug": "uncategorized", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "254", + "key": "jabber_published", + "value": "1461101308" + }, + { + "id": "267", + "key": "_oembed_00ce3f36d70c72c174774d1222895a08", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "294", + "key": "_oembed_33aac0b04f7a7bc31eec252936d4ae4a", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "257", + "key": "_oembed_4e3318c4371cf9880f6705450efd7fe6", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "251", + "key": "_oembed_8655c52bd5f940727d92329c248de249", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "262", + "key": "_oembed_eb2de30a8aa65d93ca387e4a12fd9f06", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "268", + "key": "_oembed_time_00ce3f36d70c72c174774d1222895a08", + "value": "1461200444" + }, + { + "id": "295", + "key": "_oembed_time_33aac0b04f7a7bc31eec252936d4ae4a", + "value": "1521764439" + }, + { + "id": "258", + "key": "_oembed_time_4e3318c4371cf9880f6705450efd7fe6", + "value": "1461101310" + }, + { + "id": "252", + "key": "_oembed_time_8655c52bd5f940727d92329c248de249", + "value": "1461101270" + }, + { + "id": "263", + "key": "_oembed_time_eb2de30a8aa65d93ca387e4a12fd9f06", + "value": "1461101311" + }, + { + "id": "261", + "key": "_publicize_job_id", + "value": "21955598041" + }, + { + "id": "260", + "key": "_rest_api_client_id", + "value": "-1" + }, + { + "id": "259", + "key": "_rest_api_published", + "value": "1" + }, + { + "id": "266", + "key": "_thumbnail_id", + "value": "62" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/106/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/likes/", + "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/autosave" + }, + "data": { + "autosave": { + "ID": 262, + "author_ID": "14151046", + "post_ID": 106, + "title": "Photo Contest", + "content": "John was shortlisted for the World Press Photo competition, an international celebration of the best photojournalism of the year.\n\nhttps://twitter.com/wordpressdotcom/status/702181837079187456", + "excerpt": "", + "preview_URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/?preview=true&preview_nonce=ef0913f6c4", + "modified": "2019-03-21T00:23:25+00:00" + } + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 262, + 109, + 108, + 107 + ], + "other_URLs": { + } }, { "ID": 90, + "site_ID": 106707880, + "author": { + "ID": 100907762, + "login": "leahelainerand", + "email": "andreazoellner+leahrand@gmail.com", + "name": "Leah Elaine Rand", + "first_name": "Leah", + "last_name": "Rand", + "nice_name": "leahelainerand", + "URL": "", + "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", + "profile_URL": "https://en.gravatar.com/leahelainerand", + "site_ID": 106523982 + }, + "date": "2016-03-07T18:32:11+00:00", "modified": "2016-03-16T02:01:50+00:00", - "status": "publish" + "title": "Martin and Amy's Wedding", + "URL": "http://infocusphotographers.com/2016/03/07/martin-and-amys-wedding/", + "short_URL": "https://wp.me/p7dJAQ-1s", + "content": "Martin and Amy are a wonderful couple that John and I were lucky to photograph. The theme for their wedding was sophisticated but warm and everything had a clearly personal touch.\n\nThey decided they wanted the bulk of their wedding photos to be black and white. While some couples like personal, goofy photos, Amy and Martin found a perfect balance between classic elegance and shots with personality.\n\n \n\nhttps://www.instagram.com/p/BCF4Z6UjRjE/?taken-by=photomatt\n\n \n\nhttps://www.instagram.com/p/8qwIAWDRum/?taken-by=photomatt\n\n ", + "excerpt": "", + "slug": "martin-and-amys-wedding", + "guid": "https://infocusphotographers.wordpress.com/?p=90", + "status": "publish", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "discussion": { + "comments_open": true, + "comment_status": "open", + "pings_open": true, + "ping_status": "open", + "comment_count": 0 + }, + "likes_enabled": true, + "sharing_enabled": true, + "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, + "global_ID": "8ffbda2c616a90c6b92efe4fb016fe95", + "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", + "post_thumbnail": { + "ID": 82, + "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", + "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", + "mime_type": "image/jpeg", + "width": 3853, + "height": 2384 + }, + "format": "standard", + "geo": false, + "menu_order": 0, + "page_template": "", + "publicize_URLs": [ + + ], + "terms": { + "category": { + "Wedding": { + "ID": 1674, + "name": "Wedding", + "slug": "wedding", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:wedding/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "post_tag": { + }, + "post_format": { + }, + "mentions": { + } + }, + "tags": { + }, + "categories": { + "Wedding": { + "ID": 1674, + "name": "Wedding", + "slug": "wedding", + "description": "", + "post_count": 1, + "parent": 0, + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:wedding/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" + } + } + } + }, + "attachments": { + }, + "attachment_count": 0, + "metadata": [ + { + "id": "201", + "key": "jabber_published", + "value": "1457375532" + }, + { + "id": "562", + "key": "_edit_lock", + "value": "1555492632:67626417" + }, + { + "id": "248", + "key": "_oembed_4e3318c4371cf9880f6705450efd7fe6", + "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" + }, + { + "id": "249", + "key": "_oembed_time_4e3318c4371cf9880f6705450efd7fe6", + "value": "1461101264" + }, + { + "id": "233", + "key": "_publicize_done_13969716", + "value": "1" + }, + { + "id": "232", + "key": "_publicize_done_external", + "value": { + "facebook": { + "13895248": "https://facebook.com/10208752052869141" + } + } + }, + { + "id": "206", + "key": "_publicize_job_id", + "value": "20665553278" + }, + { + "id": "205", + "key": "_rest_api_client_id", + "value": "-1" + }, + { + "id": "204", + "key": "_rest_api_published", + "value": "1" + }, + { + "id": "198", + "key": "_thumbnail_id", + "value": "82" + }, + { + "id": "234", + "key": "_wpas_done_13895248", + "value": "1" + }, + { + "id": "231", + "key": "_wpas_mess", + "value": "An amazing weekend, a wonderful couple, and beautiful photos to match! Check it out!" + } + ], + "meta": { + "links": { + "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90", + "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/90/help", + "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", + "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/replies/", + "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/likes/" + } + }, + "capabilities": { + "publish_post": true, + "delete_post": true, + "edit_post": true + }, + "revisions": [ + 102, + 101, + 100, + 93, + 92, + 91 + ], + "other_URLs": { + } } ], "meta": { "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/post-counts/post" + "counts": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/post-counts/post" }, "wpcom": true } diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish_v2.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish_v2.json deleted file mode 100644 index f4209469721d..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts-private,publish_v2.json +++ /dev/null @@ -1,677 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPattern": "/rest/v1.2/sites/.*/posts.*", - "queryParameters": { - "locale": { - "matches": "(.*)" - }, - "context": { - "equalTo": "edit" - }, - "meta": { - "equalTo": "autosave" - }, - "number": { - "matches": "(.*)" - }, - "status": { - "equalTo": "publish,private" - }, - "type": { - "equalTo": "post" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "found": 3, - "posts": [ - { - "ID": 237, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@gmail.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-03-13T23:48:58+00:00", - "modified": "2019-03-21T17:19:25+00:00", - "title": "Photo Contest", - "URL": "http://infocusphotographers.com/2019/03/13/some-news-to-share-2/", - "short_URL": "https://wp.me/p7dJAQ-3P", - "content": "\n

In Focus Photography was nominated for an international photo award!

\n\n\n\n

Please vote for us!

\n", - "excerpt": "", - "slug": "some-news-to-share-2", - "guid": "http://infocusphotographers.com/?p=237", - "status": "private", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "9dc6f7941b6a68fc2323b652c4e9516b", - "featured_image": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "post_thumbnail": { - "ID": 238, - "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "mime_type": "image/jpeg", - "width": 4256, - "height": 2628 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - "238": { - "ID": 238, - "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "date": "2019-03-20T23:44:49+00:00", - "post_ID": 237, - "author_ID": 14151046, - "file": "art-bright-celebration-1313817.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "art-bright-celebration-1313817", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=150", - "medium": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=300", - "large": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=1024" - }, - "height": 2628, - "width": 4256, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "0", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/238", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/media/238/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237" - } - } - } - }, - "attachment_count": 1, - "metadata": [ - { - "id": "493", - "key": "email_notification", - "value": "1553125740" - }, - { - "id": "486", - "key": "jabber_published", - "value": "1553125739" - }, - { - "id": "491", - "key": "timeline_notification", - "value": "1553125810" - }, - { - "id": "557", - "key": "_edit_lock", - "value": "1553188814:68646169" - }, - { - "id": "492", - "key": "_publicize_job_id", - "value": "28865445244" - }, - { - "id": "490", - "key": "_rest_api_client_id", - "value": "-1" - }, - { - "id": "489", - "key": "_rest_api_published", - "value": "1" - }, - { - "id": "484", - "key": "_thumbnail_id", - "value": "238" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/237/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 269, - 263, - 239 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/03/13/%postname%/", - "suggested_slug": "some-news-to-share-2" - } - }, - { - "ID": 106, - "site_ID": 106707880, - "author": { - "ID": 100907762, - "login": "leahelainerand", - "email": "andreazoellner+leahrand@gmail.com", - "name": "Leah Elaine Rand", - "first_name": "Leah", - "last_name": "Rand", - "nice_name": "leahelainerand", - "URL": "", - "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/leahelainerand", - "site_ID": 106523982 - }, - "date": "2016-04-19T21:28:27+00:00", - "modified": "2018-03-23T00:20:36+00:00", - "title": "Some News to Share", - "URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/", - "short_URL": "https://wp.me/p7dJAQ-1I", - "content": "John was shortlisted for the World Press Photo competition, an international celebration of the best photojournalism of the year.\n\nhttps://twitter.com/wordpressdotcom/status/702181837079187456", - "excerpt": "", - "slug": "some-news-to-share", - "guid": "https://infocusphotographers.wordpress.com/?p=106", - "status": "publish", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "3a10a002b4f389596205c24992732a3e", - "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "post_thumbnail": { - "ID": 62, - "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "mime_type": "image/jpeg", - "width": 1080, - "height": 720 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "254", - "key": "jabber_published", - "value": "1461101308" - }, - { - "id": "267", - "key": "_oembed_00ce3f36d70c72c174774d1222895a08", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "294", - "key": "_oembed_33aac0b04f7a7bc31eec252936d4ae4a", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "257", - "key": "_oembed_4e3318c4371cf9880f6705450efd7fe6", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "251", - "key": "_oembed_8655c52bd5f940727d92329c248de249", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "262", - "key": "_oembed_eb2de30a8aa65d93ca387e4a12fd9f06", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "268", - "key": "_oembed_time_00ce3f36d70c72c174774d1222895a08", - "value": "1461200444" - }, - { - "id": "295", - "key": "_oembed_time_33aac0b04f7a7bc31eec252936d4ae4a", - "value": "1521764439" - }, - { - "id": "258", - "key": "_oembed_time_4e3318c4371cf9880f6705450efd7fe6", - "value": "1461101310" - }, - { - "id": "252", - "key": "_oembed_time_8655c52bd5f940727d92329c248de249", - "value": "1461101270" - }, - { - "id": "263", - "key": "_oembed_time_eb2de30a8aa65d93ca387e4a12fd9f06", - "value": "1461101311" - }, - { - "id": "261", - "key": "_publicize_job_id", - "value": "21955598041" - }, - { - "id": "260", - "key": "_rest_api_client_id", - "value": "-1" - }, - { - "id": "259", - "key": "_rest_api_published", - "value": "1" - }, - { - "id": "266", - "key": "_thumbnail_id", - "value": "62" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/106/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/likes/", - "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/autosave" - }, - "data": { - "autosave": { - "ID": 262, - "author_ID": "14151046", - "post_ID": 106, - "title": "Photo Contest", - "content": "John was shortlisted for the World Press Photo competition, an international celebration of the best photojournalism of the year.\n\nhttps://twitter.com/wordpressdotcom/status/702181837079187456", - "excerpt": "", - "preview_URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/?preview=true&preview_nonce=ef0913f6c4", - "modified": "2019-03-21T00:23:25+00:00" - } - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 262, - 109, - 108, - 107 - ], - "other_URLs": { - } - }, - { - "ID": 90, - "site_ID": 106707880, - "author": { - "ID": 100907762, - "login": "leahelainerand", - "email": "andreazoellner+leahrand@gmail.com", - "name": "Leah Elaine Rand", - "first_name": "Leah", - "last_name": "Rand", - "nice_name": "leahelainerand", - "URL": "", - "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", - "profile_URL": "https://en.gravatar.com/leahelainerand", - "site_ID": 106523982 - }, - "date": "2016-03-07T18:32:11+00:00", - "modified": "2016-03-16T02:01:50+00:00", - "title": "Martin and Amy's Wedding", - "URL": "http://infocusphotographers.com/2016/03/07/martin-and-amys-wedding/", - "short_URL": "https://wp.me/p7dJAQ-1s", - "content": "Martin and Amy are a wonderful couple that John and I were lucky to photograph. The theme for their wedding was sophisticated but warm and everything had a clearly personal touch.\n\nThey decided they wanted the bulk of their wedding photos to be black and white. While some couples like personal, goofy photos, Amy and Martin found a perfect balance between classic elegance and shots with personality.\n\n \n\nhttps://www.instagram.com/p/BCF4Z6UjRjE/?taken-by=photomatt\n\n \n\nhttps://www.instagram.com/p/8qwIAWDRum/?taken-by=photomatt\n\n ", - "excerpt": "", - "slug": "martin-and-amys-wedding", - "guid": "https://infocusphotographers.wordpress.com/?p=90", - "status": "publish", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "8ffbda2c616a90c6b92efe4fb016fe95", - "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "post_thumbnail": { - "ID": 82, - "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "mime_type": "image/jpeg", - "width": 3853, - "height": 2384 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Wedding": { - "ID": 1674, - "name": "Wedding", - "slug": "wedding", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:wedding/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Wedding": { - "ID": 1674, - "name": "Wedding", - "slug": "wedding", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/categories/slug:wedding/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "201", - "key": "jabber_published", - "value": "1457375532" - }, - { - "id": "562", - "key": "_edit_lock", - "value": "1555492632:67626417" - }, - { - "id": "248", - "key": "_oembed_4e3318c4371cf9880f6705450efd7fe6", - "value": "

Congrats to the photojournalists on WordPress who won #WPPh16 @WorldPressPhoto prizes: https://t.co/9ya2boX1Yy pic.twitter.com/ZFAHNngh1f

— WordPress.com (@wordpressdotcom) February 23, 2016
" - }, - { - "id": "249", - "key": "_oembed_time_4e3318c4371cf9880f6705450efd7fe6", - "value": "1461101264" - }, - { - "id": "233", - "key": "_publicize_done_13969716", - "value": "1" - }, - { - "id": "232", - "key": "_publicize_done_external", - "value": { - "facebook": { - "13895248": "https://facebook.com/10208752052869141" - } - } - }, - { - "id": "206", - "key": "_publicize_job_id", - "value": "20665553278" - }, - { - "id": "205", - "key": "_rest_api_client_id", - "value": "-1" - }, - { - "id": "204", - "key": "_rest_api_published", - "value": "1" - }, - { - "id": "198", - "key": "_thumbnail_id", - "value": "82" - }, - { - "id": "234", - "key": "_wpas_done_13895248", - "value": "1" - }, - { - "id": "231", - "key": "_wpas_mess", - "value": "An amazing weekend, a wonderful couple, and beautiful photos to match! Check it out!" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90", - "help": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/posts/90/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 102, - 101, - 100, - 93, - 92, - 91 - ], - "other_URLs": { - } - } - ], - "meta": { - "links": { - "counts": "{{request.requestLine.baseUrl}}/rest/v1.2/sites/106707880/post-counts/post" - }, - "wpcom": true - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_106.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_106.json deleted file mode 100644 index a13aaf8e9b34..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_106.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/106/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 106, - "site_ID": 106707880, - "author": { - "ID": 100907762, - "login": "leahelainerand", - "email": "andreazoellner+leahrand@gmail.com", - "name": "Leah Elaine Rand", - "first_name": "Leah", - "last_name": "Rand", - "nice_name": "leahelainerand", - "URL": "", - "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/leahelainerand", - "site_ID": 106523982 - }, - "date": "2016-04-19T21:28:27+00:00", - "modified": "2018-03-23T00:20:36+00:00", - "title": "Some News to Share", - "URL": "http://infocusphotographers.com/2016/04/19/some-news-to-share/", - "short_URL": "https://wp.me/p7dJAQ-1I", - "content": "John was shortlisted for the World Press Photo competition, an international celebration of the best photojournalism of the year.\n\nhttps://twitter.com/wordpressdotcom/status/702181837079187456", - "excerpt": "", - "slug": "some-news-to-share", - "guid": "https://infocusphotographers.wordpress.com/?p=106", - "status": "publish", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "3a10a002b4f389596205c24992732a3e", - "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "post_thumbnail": { - "ID": 62, - "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1449761485030-c9bf16154670.jpg", - "mime_type": "image/jpeg", - "width": 1080, - "height": 720 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "254", - "key": "jabber_published", - "value": "1461101308" - }, - { - "id": "266", - "key": "_thumbnail_id", - "value": "62" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/likes/", - "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/106/autosave" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 262, - 109, - 108, - 107 - ], - "other_URLs": { - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_134.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_134.json deleted file mode 100644 index 7037dd231942..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_134.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/134/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 134, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-03-19T03:08:16+00:00", - "modified": "2019-05-27T21:39:08+00:00", - "title": "Now Booking Summer Sessions", - "URL": "http://infocusphotographers.com/?p=134", - "short_URL": "https://wp.me/p7dJAQ-2a", - "content": "
“One must maintain a little bit of summer, even in the middle of winter.” \n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n

How to book

\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "now-booking-summer-sessions", - "guid": "http://infocusphotographers.com/?p=134", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "e9bb2d5021873cf97e6ced1f9308bdd5", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": false, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/likes/", - "autosave": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/134/autosave" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 397, - 310, - 274, - 236, - 231, - 230, - 220, - 219, - 218, - 136, - 135 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/03/19/%postname%/", - "suggested_slug": "now-booking-summer-sessions" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_213.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_213.json deleted file mode 100644 index 23911bcd2955..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_213.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/213/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 213, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-07-16T02:39:44+00:00", - "modified": "2019-07-16T02:39:45+00:00", - "title": "Our Services", - "URL": "http://infocusphotographers.com/?p=213", - "short_URL": "https://wp.me/p7dJAQ-3r", - "content": "\n
\n

Mobile grooming salon for cats and dogs.

\n\n\n\n\n
\n\n\n\n

Dog grooming

\n\n\n\n
\n
\n

Our deluxe grooming service includes:

\n\n\n\n
  • Nail clip
  • Ear cleaning
  • 1st shampoo
  • 2nd shampoo
  • Conditioning rinse
  • Towel dry
  • Blow dry
  • Brush out
  • And a treat!
\n
\n\n\n\n
\n
\"\"
\n
\n
\n\n\n\n

Deluxe Cut and Groom

\n\n\n\n

Our deluxe cut and groom package includes everything in the deluxe groom plus a haircut.

\n\n\n\n

Add on services

\n\n\n\n

Pamper your pup even more with one of our signature add on services:

\n\n\n\n
  • Aloe conditioning treatment
  • Soothing medicated shampoos
  • Tooth brushing
  • Creative styling with temporary color
  • Nail polish application
  • Coat braiding
  • Bows and other accessories
\n\n\n\n
\n

\n
\n\n\n\n

\n", - "excerpt": "", - "slug": "summer-band-jam", - "guid": "http://infocusphotographers.com/?p=213", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "e41d1c97a7b93a594b07e4df51dfafb3", - "featured_image": "https://infocusphotographers.files.wordpress.com/2019/02/adult-band-concert-995301.jpg", - "post_thumbnail": { - "ID": 151, - "URL": "https://infocusphotographers.files.wordpress.com/2019/02/adult-band-concert-995301.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/02/adult-band-concert-995301.jpg", - "mime_type": "image/jpeg", - "width": 5184, - "height": 3456 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "502", - "key": "email_notification", - "value": "1553125754" - }, - { - "id": "564", - "key": "geo_public", - "value": "0" - }, - { - "id": "496", - "key": "jabber_published", - "value": "1553125752" - }, - { - "id": "503", - "key": "timeline_notification", - "value": "1553125801" - }, - { - "id": "565", - "key": "_thumbnail_id", - "value": "151" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/213/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 401, - 400, - 309, - 303, - 300, - 299, - 298, - 297, - 296, - 292, - 291, - 289, - 288, - 287, - 286, - 285, - 284, - 283, - 280, - 277, - 273, - 267, - 240, - 214 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/07/16/%postname%/", - "suggested_slug": "summer-band-jam" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_215.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_215.json deleted file mode 100644 index 0f9e249b8b3e..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_215.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/215/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 215, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-02-15T23:27:13+00:00", - "modified": "2019-02-15T23:27:13+00:00", - "title": "Ideas", - "URL": "http://infocusphotographers.com/?p=215", - "short_URL": "https://wp.me/p7dJAQ-3t", - "content": "Returning client special - Offer a discount to clients who have left a review.\n\nPhotography classes at the local", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=215", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "50d8150dfae26a5bef18779211142b65", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": false, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/215/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 216 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/02/15/%postname%/", - "suggested_slug": "ideas" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_225.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_225.json deleted file mode 100644 index 96a16c9a971d..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_225.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/225/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 225, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-01-01T21:54:15+00:00", - "modified": "2019-03-21T17:20:44+00:00", - "title": "Book Your Summer Sessions", - "URL": "http://infocusphotographers.com/?p=225", - "short_URL": "https://wp.me/p7dJAQ-3D", - "content": "\n

“One must maintain a little bit of summer, even in the middle of winter.”

– Henry David Thoreau
\n\n\n\n

Blue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!

\n\n\n\n

We offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.

\n\n\n\n
\"beach-children-family-39691\"
\n\n\n\n

How to book

\n\n\n\n

Email us to set up a time to visit our studio.

\n", - "excerpt": "", - "slug": "__trashed-2", - "guid": "http://infocusphotographers.com/?p=225", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "2d07f957bcc110149b8aa37bd1231ad1", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - "243": { - "ID": 243, - "URL": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg", - "date": "2019-03-20T23:56:52+00:00", - "post_ID": 225, - "author_ID": 14151046, - "file": "beach-children-family-39691.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "beach-children-family-39691", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=150", - "medium": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=300", - "large": "https://infocusphotographers.files.wordpress.com/2019/01/beach-children-family-39691.jpg?w=1024" - }, - "height": 2446, - "width": 3669, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "0", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/media/243", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/media/243/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225" - } - } - } - }, - "attachment_count": 1, - "metadata": false, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/225/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 271, - 235, - 229, - 228, - 227, - 226 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/01/01/%postname%/", - "suggested_slug": "__trashed-2" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_237.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_237.json deleted file mode 100644 index 886c2c03c1e9..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_237.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/237/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 237, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-03-13T23:48:58+00:00", - "modified": "2019-03-21T17:19:25+00:00", - "title": "Photo Contest", - "URL": "http://infocusphotographers.com/2019/03/13/some-news-to-share-2/", - "short_URL": "https://wp.me/p7dJAQ-3P", - "content": "\n

In Focus Photography was nominated for an international photo award!

\n\n\n\n

Please vote for us!

\n", - "excerpt": "", - "slug": "some-news-to-share-2", - "guid": "http://infocusphotographers.com/?p=237", - "status": "private", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "9dc6f7941b6a68fc2323b652c4e9516b", - "featured_image": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "post_thumbnail": { - "ID": 238, - "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "mime_type": "image/jpeg", - "width": 4256, - "height": 2628 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - "238": { - "ID": 238, - "URL": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "guid": "http://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg", - "date": "2019-03-20T23:44:49+00:00", - "post_ID": 237, - "author_ID": 14151046, - "file": "art-bright-celebration-1313817.jpg", - "mime_type": "image/jpeg", - "extension": "jpg", - "title": "art-bright-celebration-1313817", - "caption": "", - "description": "", - "alt": "", - "thumbnails": { - "thumbnail": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=150", - "medium": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=300", - "large": "https://infocusphotographers.files.wordpress.com/2019/03/art-bright-celebration-1313817.jpg?w=1024" - }, - "height": 2628, - "width": 4256, - "exif": { - "aperture": "0", - "credit": "", - "camera": "", - "caption": "", - "created_timestamp": "0", - "copyright": "", - "focal_length": "0", - "iso": "0", - "shutter_speed": "0", - "title": "", - "orientation": "0", - "keywords": [ - - ] - }, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/media/238", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/media/238/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "parent": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237" - } - } - } - }, - "attachment_count": 1, - "metadata": [ - { - "id": "493", - "key": "email_notification", - "value": "1553125740" - }, - { - "id": "486", - "key": "jabber_published", - "value": "1553125739" - }, - { - "id": "491", - "key": "timeline_notification", - "value": "1553125810" - }, - { - "id": "484", - "key": "_thumbnail_id", - "value": "238" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/237/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 269, - 263, - 239 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/03/13/%postname%/", - "suggested_slug": "some-news-to-share-2" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_265.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_265.json deleted file mode 100644 index d9353f7b5fed..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_265.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/265/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 265, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-04-17T10:40:39+00:00", - "modified": "2019-04-17T10:41:03+00:00", - "title": "What we've been doing lately", - "URL": "http://infocusphotographers.com/?p=265", - "short_URL": "https://wp.me/p7dJAQ-4h", - "content": "\r\n

The last few weeks have been a blur! Here are a few shots we really like. What do you think?

\r\n\r\n\r\n\r\n\r\n", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=265", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "2f7a8f8da665b6469d91f96108fb24c6", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "567", - "key": "geo_public", - "value": "0" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/265/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 294, - 293, - 266 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/04/17/%postname%/", - "suggested_slug": "what-weve-been-doing-lately" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_387.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_387.json deleted file mode 100644 index d0d103a3d30b..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_387.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/387/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 387, - "site_ID": 106707880, - "author": { - "ID": 68646169, - "login": "thenomadicwordsmith", - "email": "thenomadicwordsmith@wordpress.com", - "name": "thenomadicwordsmith", - "first_name": "Nomadic", - "last_name": "Wordsmith", - "nice_name": "thenomadicwordsmith", - "URL": "http://thenomadicwordsmith.wordpress.com", - "avatar_URL": "https://0.gravatar.com/avatar/9ba48385fc40dfd9a55a3348d8e7f4d9?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/thenomadicwordsmith", - "site_ID": 71769073 - }, - "date": "2019-05-28T21:03:22+00:00", - "modified": "2019-05-28T21:03:22+00:00", - "title": "Time to Book Summer Sessions", - "URL": "http://infocusphotographers.com/?p=387", - "short_URL": "https://wp.me/p7dJAQ-6f", - "content": "Blue skies and warm weather, what's not to love about summer?\n\nIt's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before May 1.\n\n\"beach-clouds-daytime-994605\"\n\nHow to book\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=387", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "a9037bde04073835b078a1b1bb48b7de", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": false, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/387/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 390 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", - "suggested_slug": "time-to-book-summer-sessions" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_396.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_396.json deleted file mode 100644 index c864647c6a79..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_396.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/396/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 396, - "site_ID": 106707880, - "author": { - "ID": 742098, - "login": "jkmassel", - "email": "jeremy.massel@gmail.com", - "name": "Jeremy Massel", - "first_name": "Jeremy", - "last_name": "Massel", - "nice_name": "jkmassel", - "URL": "https://jkmassel.wordpress.com", - "avatar_URL": "https://2.gravatar.com/avatar/58fc51586c9a1f9895ac70e3ca60886e?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/jkmassel", - "site_ID": 1562023 - }, - "date": "2019-05-28T21:06:45+00:00", - "modified": "2019-05-28T21:08:03+00:00", - "title": "Now Booking Summer Sessions", - "URL": "http://infocusphotographers.com/?p=396", - "short_URL": "https://wp.me/p7dJAQ-6o", - "content": "
“One must maintain a little bit of summer, even in the middle of winter.”\n\n– Henry David Thoreau
\nBlue skies and warm weather, what's not to love about summer? It's a great season for outdoor family portrait sessions and now is the time to book them!\n\nWe offer a number of family portrait packages and for a limited time are offering 15% off packages booked before April 1.\n\nHow to book\n\nEmail us to set up a time to visit our studio.", - "excerpt": "", - "slug": "", - "guid": "http://infocusphotographers.com/?p=396", - "status": "draft", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": false, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "276e4cea0342ec68e69a0ca537acfce1", - "featured_image": "", - "post_thumbnail": null, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Uncategorized": { - "ID": 1, - "name": "Uncategorized", - "slug": "uncategorized", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:uncategorized/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "742", - "key": "sharing_disabled", - "value": [ - - ] - }, - { - "id": "741", - "key": "switch_like_status", - "value": "" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/396/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 399, - 398 - ], - "other_URLs": { - "permalink_URL": "http://infocusphotographers.com/2019/05/28/%postname%/", - "suggested_slug": "now-booking-summer-sessions-2" - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_90.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_90.json deleted file mode 100644 index c9e49d952aee..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/posts_90.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/90/", - "queryParameters": { - "context": { - "equalTo": "edit" - }, - "locale": { - "matches": "(.*)" - } - } - }, - "response": { - "status": 200, - "jsonBody": { - "ID": 90, - "site_ID": 106707880, - "author": { - "ID": 100907762, - "login": "leahelainerand", - "email": "andreazoellner+leahrand@gmail.com", - "name": "Leah Elaine Rand", - "first_name": "Leah", - "last_name": "Rand", - "nice_name": "leahelainerand", - "URL": "", - "avatar_URL": "https://0.gravatar.com/avatar/62937c26a2a79bae5921ca9e85be8040?s=96&d=identicon&r=G", - "profile_URL": "http://en.gravatar.com/leahelainerand", - "site_ID": 106523982 - }, - "date": "2016-03-07T18:32:11+00:00", - "modified": "2016-03-16T02:01:50+00:00", - "title": "Martin and Amy's Wedding", - "URL": "http://infocusphotographers.com/2016/03/07/martin-and-amys-wedding/", - "short_URL": "https://wp.me/p7dJAQ-1s", - "content": "Martin and Amy are a wonderful couple that John and I were lucky to photograph. The theme for their wedding was sophisticated but warm and everything had a clearly personal touch.\n\nThey decided they wanted the bulk of their wedding photos to be black and white. While some couples like personal, goofy photos, Amy and Martin found a perfect balance between classic elegance and shots with personality.\n\n \n\nhttps://www.instagram.com/p/BCF4Z6UjRjE/?taken-by=photomatt\n\n \n\nhttps://www.instagram.com/p/8qwIAWDRum/?taken-by=photomatt\n\n ", - "excerpt": "", - "slug": "martin-and-amys-wedding", - "guid": "https://infocusphotographers.wordpress.com/?p=90", - "status": "publish", - "sticky": false, - "password": "", - "parent": false, - "type": "post", - "discussion": { - "comments_open": true, - "comment_status": "open", - "pings_open": true, - "ping_status": "open", - "comment_count": 0 - }, - "likes_enabled": true, - "sharing_enabled": true, - "like_count": 0, - "i_like": false, - "is_reblogged": false, - "is_following": false, - "global_ID": "8ffbda2c616a90c6b92efe4fb016fe95", - "featured_image": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "post_thumbnail": { - "ID": 82, - "URL": "https://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "guid": "http://infocusphotographers.files.wordpress.com/2016/02/photo-1453857271477-4f9a4081966e1.jpeg", - "mime_type": "image/jpeg", - "width": 3853, - "height": 2384 - }, - "format": "standard", - "geo": false, - "menu_order": 0, - "page_template": "", - "publicize_URLs": [ - - ], - "terms": { - "category": { - "Wedding": { - "ID": 1674, - "name": "Wedding", - "slug": "wedding", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "post_tag": { - }, - "post_format": { - }, - "mentions": { - } - }, - "tags": { - }, - "categories": { - "Wedding": { - "ID": 1674, - "name": "Wedding", - "slug": "wedding", - "description": "", - "post_count": 1, - "parent": 0, - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/categories/slug:wedding/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880" - } - } - } - }, - "attachments": { - }, - "attachment_count": 0, - "metadata": [ - { - "id": "201", - "key": "jabber_published", - "value": "1457375532" - }, - { - "id": "198", - "key": "_thumbnail_id", - "value": "82" - }, - { - "id": "234", - "key": "_wpas_done_13895248", - "value": "1" - }, - { - "id": "231", - "key": "_wpas_mess", - "value": "An amazing weekend, a wonderful couple, and beautiful photos to match! Check it out!" - } - ], - "meta": { - "links": { - "self": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/help", - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "replies": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/replies/", - "likes": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/90/likes/" - } - }, - "capabilities": { - "publish_post": true, - "delete_post": true, - "edit_post": true - }, - "revisions": [ - 102, - 101, - 100, - 93, - 92, - 91 - ], - "other_URLs": { - } - } - } -} \ No newline at end of file diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_106707880_posts_439_replies.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_replies.json similarity index 100% rename from API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_106707880_posts_439_replies.json rename to API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_replies.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_106707880_posts_439_replies_new.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_replies_new.json similarity index 100% rename from API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_106707880_posts_439_replies_new.json rename to API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_replies_new.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181851495_posts-draft,pending.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181851495_posts-draft,pending.json similarity index 100% rename from API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181851495_posts-draft,pending.json rename to API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181851495_posts-draft,pending.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181977606_posts-draft,pending.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181977606_posts-draft,pending.json similarity index 100% rename from API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181977606_posts-draft,pending.json rename to API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181977606_posts-draft,pending.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181977606_posts-scheduled.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181977606_posts-scheduled.json similarity index 95% rename from API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181977606_posts-scheduled.json rename to API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181977606_posts-scheduled.json index 814834a89655..b4054b30aeef 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v12_sites_181977606_posts-scheduled.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_181977606_posts-scheduled.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "urlPath": "/rest/v1.2/sites/181977606/posts", + "urlPattern": "/rest/v1.2/sites/181977606/posts", "queryParameters": { "locale": { "matches": "(.*)" @@ -44,8 +44,8 @@ "profile_URL": "https://en.gravatar.com/appstorescreens", "site_ID": 181977606 }, - "date": "{{now offset='+2 days'}}", - "modified": "2020-10-05T15:04:51+00:00", + "date": "{{#assign 'customformat'}}yyyy-MM-dd'T'HH:mm:ss{{/assign}}{{now offset='+2 hours' format=customformat}}", + "modified": "{{now offset='+2 hours' format=customformat}}", "title": "Lemon Cheesecake Tartlets", "URL": "https://weekendbakesblog.wordpress.com/easy-blueberry-muffins/", "short_URL": "https://wp.me/pcjyGG-e", diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_posts_subscribers_mine.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_posts_subscribers_mine.json deleted file mode 100644 index a5d3d70cf98b..000000000000 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_v11_sites_posts_subscribers_mine.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "request": { - "method": "GET", - "urlPath": "/rest/v1.1/sites/106707880/posts/439/subscribers/mine" - }, - "response": { - "status": 200, - "jsonBody": { - "i_subscribe": false, - "receives_notifications": false, - "meta": { - "links": { - "site": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880", - "posts": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/439", - "help": "{{request.requestLine.baseUrl}}/rest/v1.1/sites/106707880/posts/439/subscribers/help" - } - } - } - } -} From ba97a832fa6770bfcef78bfbc81920795719a770 Mon Sep 17 00:00:00 2001 From: jos <17252150+jostnes@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:53:34 +0800 Subject: [PATCH 33/46] update blog url to match what's displayed in ui --- .../main/assets/mocks/mappings/wpcom/me/rest_v11_me_sites.json | 2 +- .../JetpackScreenshotGeneration.swift | 2 +- .../WordPressScreenshotGeneration.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/me/rest_v11_me_sites.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/me/rest_v11_me_sites.json index 68c2dc010113..1a523d55e311 100644 --- a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/me/rest_v11_me_sites.json +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/me/rest_v11_me_sites.json @@ -359,7 +359,7 @@ "ID": 181977606, "description": "Site with everything enabled", "name": "Weekend Bakes", - "URL": "yourjetpack.blog", + "URL": "weekendbakesblog.wordpress.com", "user_can_manage": false, "capabilities": { "edit_pages": true, diff --git a/WordPress/JetpackScreenshotGeneration/JetpackScreenshotGeneration.swift b/WordPress/JetpackScreenshotGeneration/JetpackScreenshotGeneration.swift index 6b0c6cbc9e71..00ecd1c24c0d 100644 --- a/WordPress/JetpackScreenshotGeneration/JetpackScreenshotGeneration.swift +++ b/WordPress/JetpackScreenshotGeneration/JetpackScreenshotGeneration.swift @@ -25,7 +25,7 @@ class JetpackScreenshotGeneration: XCTestCase { try LoginFlow.login(email: WPUITestCredentials.testWPcomUserEmail, password: WPUITestCredentials.testWPcomPassword, - selectedSiteTitle: "yourjetpack.blog") + selectedSiteTitle: "weekendbakesblog.wordpress.com") } override func tearDown() { diff --git a/WordPress/WordPressScreenshotGeneration/WordPressScreenshotGeneration.swift b/WordPress/WordPressScreenshotGeneration/WordPressScreenshotGeneration.swift index 379e0109d919..9f8d7839d337 100644 --- a/WordPress/WordPressScreenshotGeneration/WordPressScreenshotGeneration.swift +++ b/WordPress/WordPressScreenshotGeneration/WordPressScreenshotGeneration.swift @@ -58,7 +58,7 @@ class WordPressScreenshotGeneration: XCTestCase { if XCUIDevice.isPad { let ipadScreenshot = try MySiteScreen() .showSiteSwitcher() - .switchToSite(withTitle: "yourjetpack.blog") + .switchToSite(withTitle: "weekendbakesblog.wordpress.com") .gotoPostsScreen() .showOnly(.drafts) .selectPost(withSlug: "easy-blueberry-muffins") From 9d08541fe3ad618de76a8d8dec41ddacab7860b3 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 09:46:41 -0400 Subject: [PATCH 34/46] Bump version number --- config/Version.internal.xcconfig | 4 ++-- config/Version.public.xcconfig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/Version.internal.xcconfig b/config/Version.internal.xcconfig index 8be7920a3779..3f4183673d42 100644 --- a/config/Version.internal.xcconfig +++ b/config/Version.internal.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=22.7 +VERSION_SHORT=22.8 // Internal long version example: VERSION_LONG=9.9.0.20180423 -VERSION_LONG=22.7.0.20230707 +VERSION_LONG=22.8.0.20230710 diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index e4f36ae3cc00..0441a4bd8f3c 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=22.7 +VERSION_SHORT=22.8 // Public long version example: VERSION_LONG=9.9.0.0 -VERSION_LONG=22.7.0.2 +VERSION_LONG=22.8.0.0 From de3863176fbb1c6c1504c50042132bb26c61dfab Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 09:46:41 -0400 Subject: [PATCH 35/46] Update draft release notes for 22.8. --- WordPress/Resources/release_notes.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/WordPress/Resources/release_notes.txt b/WordPress/Resources/release_notes.txt index 3c0fb643df2b..42816e59d62b 100644 --- a/WordPress/Resources/release_notes.txt +++ b/WordPress/Resources/release_notes.txt @@ -1,6 +1,8 @@ -We fixed an issue with the home screen’s “Work on a draft post” card. The app will no longer crash when you access drafts while they’re in the middle of uploading. +* [*] 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] -We also solved a couple of problems in the block editor. - -- Right on—image blocks now display the correct aspect ratio, whether or not the image has a set width and height. -- When you’re dictating text, the cursor’s position will stay where it’s supposed to—no more jumping around. Keep calm and dictate on. From bd9ca1e636307562f6765ac321a9360b72bccd94 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 09:46:41 -0400 Subject: [PATCH 36/46] Update draft release notes for 22.8. --- WordPress/Jetpack/Resources/release_notes.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/WordPress/Jetpack/Resources/release_notes.txt b/WordPress/Jetpack/Resources/release_notes.txt index 3c0fb643df2b..42816e59d62b 100644 --- a/WordPress/Jetpack/Resources/release_notes.txt +++ b/WordPress/Jetpack/Resources/release_notes.txt @@ -1,6 +1,8 @@ -We fixed an issue with the home screen’s “Work on a draft post” card. The app will no longer crash when you access drafts while they’re in the middle of uploading. +* [*] 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] -We also solved a couple of problems in the block editor. - -- Right on—image blocks now display the correct aspect ratio, whether or not the image has a set width and height. -- When you’re dictating text, the cursor’s position will stay where it’s supposed to—no more jumping around. Keep calm and dictate on. From d98b25450d26ab6833bd56791f036d6bd7b1f9c4 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 09:46:41 -0400 Subject: [PATCH 37/46] Release Notes: add new section for next version (22.9) --- RELEASE-NOTES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index f4db083c0afa..bf2d6f7fc5d0 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,3 +1,7 @@ +22.9 +----- + + 22.8 ----- * [*] Blogging Reminders: Disabled prompt for self-hosted sites not connected to Jetpack. [#20970] From bfed0b97ae094721ded3076c3d8cc2601269053c Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 11:36:43 -0400 Subject: [PATCH 38/46] Update WordPressShared to 2.2 --- Podfile | 2 +- Podfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Podfile b/Podfile index e3bc85766801..8e77821749b4 100644 --- a/Podfile +++ b/Podfile @@ -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: '' diff --git a/Podfile.lock b/Podfile.lock index 13c21db26f3d..dc587a4cd61a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -613,7 +613,7 @@ DEPENDENCIES: - WordPress-Editor-iOS (~> 1.19.8) - WordPressAuthenticator (~> 6.1-beta) - WordPressKit (~> 8.5-beta) - - WordPressShared (~> 2.2-beta) + - WordPressShared (~> 2.2) - WordPressUI (~> 1.12.5) - WPMediaPicker (~> 1.8-beta) - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.99.0/third-party-podspecs/Yoga.podspec.json`) @@ -895,6 +895,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: dd2923ba0655d06a0e85bdf9aa0d38304e8f087e +PODFILE CHECKSUM: 083ba0431a3f9b99fbe76f863d853355f9432eae COCOAPODS: 1.12.1 From d9b9b1d1ac071db2a8f2c0820b0ab2931eada922 Mon Sep 17 00:00:00 2001 From: kean Date: Mon, 10 Jul 2023 11:38:33 -0400 Subject: [PATCH 39/46] Fix Blaze dashboard card not reloading when switching blogs --- .../BlogDashboardViewController.swift | 5 +---- .../Blaze/DashboardBlazeCardCellViewModel.swift | 2 +- .../ViewModel/BlogDashboardViewModel.swift | 15 ++++++++++++--- .../Blog/My Site/MySiteViewController.swift | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift index e6b2a62a5aea..3e5bd432ca8b 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift @@ -112,10 +112,7 @@ final class BlogDashboardViewController: UIViewController { } self.blog = blog - viewModel.blog = blog - BlogDashboardAnalytics.shared.reset() - viewModel.loadCardsFromCache() - viewModel.loadCards() + self.viewModel.update(blog: blog) } @objc func refreshControlPulled() { diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Blaze/DashboardBlazeCardCellViewModel.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Blaze/DashboardBlazeCardCellViewModel.swift index fecbb50eaac3..6b829bef2c4a 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Blaze/DashboardBlazeCardCellViewModel.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Blaze/DashboardBlazeCardCellViewModel.swift @@ -4,7 +4,7 @@ import WordPressKit final class DashboardBlazeCardCellViewModel { private(set) var state: State = .promo - private let blog: Blog + private var blog: Blog private let service: BlazeServiceProtocol private let store: DashboardBlazeStoreProtocol private var isRefreshing = false diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/ViewModel/BlogDashboardViewModel.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/ViewModel/BlogDashboardViewModel.swift index 9f7335f6ce2b..41a9b92b6ae5 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/ViewModel/BlogDashboardViewModel.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/ViewModel/BlogDashboardViewModel.swift @@ -19,12 +19,12 @@ enum DashboardItem: Hashable { typealias DashboardSnapshot = NSDiffableDataSourceSnapshot typealias DashboardDataSource = UICollectionViewDiffableDataSource -class BlogDashboardViewModel { +final class BlogDashboardViewModel { private weak var viewController: BlogDashboardViewController? private let managedObjectContext: NSManagedObjectContext - var blog: Blog + private var blog: Blog private var currentCards: [DashboardCardModel] = [] @@ -78,7 +78,7 @@ class BlogDashboardViewModel { } }() - private let blazeViewModel: DashboardBlazeCardCellViewModel + private var blazeViewModel: DashboardBlazeCardCellViewModel init(viewController: BlogDashboardViewController, managedObjectContext: NSManagedObjectContext = ContextManager.shared.mainContext, blog: Blog) { self.viewController = viewController @@ -93,6 +93,15 @@ class BlogDashboardViewModel { loadCardsFromCache() } + /// Update to display the selected blog. + func update(blog: Blog) { + BlogDashboardAnalytics.shared.reset() + self.blog = blog + self.blazeViewModel = DashboardBlazeCardCellViewModel(blog: blog) + self.loadCardsFromCache() + self.loadCards() + } + /// Call the API to return cards for the current blog func loadCards(completion: (([DashboardCardModel]) -> Void)? = nil) { viewController?.showLoading() diff --git a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift index 4812d2cf0152..9aeaebd7d58c 100644 --- a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift +++ b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift @@ -145,7 +145,7 @@ class MySiteViewController: UIViewController, NoResultsViewHost { blogDetailsViewController?.presentationDelegate = self } } - private(set) var blogDashboardViewController: BlogDashboardViewController? + private var blogDashboardViewController: BlogDashboardViewController? /// When we display a no results view, we'll do so in a scrollview so that /// we can allow pull to refresh to sync the user's list of sites. From 99a948aa96f7b12bb9995040bfe6181c10d2f0be Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 11:38:50 -0400 Subject: [PATCH 40/46] Update WordPressKit to 8.5 --- Podfile | 2 +- Podfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Podfile b/Podfile index 8e77821749b4..818456a9bc41 100644 --- a/Podfile +++ b/Podfile @@ -50,7 +50,7 @@ def wordpress_ui end def wordpress_kit - pod 'WordPressKit', '~> 8.5-beta' + pod 'WordPressKit', '~> 8.5' # 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', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: '' diff --git a/Podfile.lock b/Podfile.lock index dc587a4cd61a..bcbc4ab9b1ac 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -512,7 +512,7 @@ PODS: - WordPressKit (~> 8.0-beta) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (8.5.0-beta.2): + - WordPressKit (8.5.0): - Alamofire (~> 4.8.0) - NSObject-SafeExpectations (~> 0.0.4) - UIDeviceIdentifier (~> 2.0) @@ -612,7 +612,7 @@ DEPENDENCIES: - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.8) - WordPressAuthenticator (~> 6.1-beta) - - WordPressKit (~> 8.5-beta) + - WordPressKit (~> 8.5) - WordPressShared (~> 2.2) - WordPressUI (~> 1.12.5) - WPMediaPicker (~> 1.8-beta) @@ -880,7 +880,7 @@ SPEC CHECKSUMS: WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 WordPressAuthenticator: b0b900696de5129a215adcd1e9ae6eb89da36ac8 - WordPressKit: 31f5a9809b9c732e0da517967d8a94de725c15e6 + WordPressKit: f6943a6e927e9f57bc8793938af1e3a4c3adb614 WordPressShared: 87f3ee89b0a3e83106106f13a8b71605fb8eb6d2 WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac WPMediaPicker: 0d40b8d66b6dfdaa2d6a41e3be51249ff5898775 @@ -895,6 +895,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: 083ba0431a3f9b99fbe76f863d853355f9432eae +PODFILE CHECKSUM: a148c9229bd69ca5a13d46500cfecc3c7c2cedbe COCOAPODS: 1.12.1 From 12c7aa56a5e3216afcbcc3a995d46adc4c9384ea Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 11:40:01 -0400 Subject: [PATCH 41/46] Update WPMediaPicker to 1.8.8 --- Podfile | 2 +- Podfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Podfile b/Podfile index 818456a9bc41..a93ed2947f3c 100644 --- a/Podfile +++ b/Podfile @@ -142,7 +142,7 @@ 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' diff --git a/Podfile.lock b/Podfile.lock index bcbc4ab9b1ac..b2202a8d379c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -615,7 +615,7 @@ DEPENDENCIES: - WordPressKit (~> 8.5) - WordPressShared (~> 2.2) - WordPressUI (~> 1.12.5) - - WPMediaPicker (~> 1.8-beta) + - WPMediaPicker (~> 1.8.8) - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.99.0/third-party-podspecs/Yoga.podspec.json`) - ZendeskSupportSDK (= 5.3.0) - ZIPFoundation (~> 0.9.8) @@ -895,6 +895,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: a148c9229bd69ca5a13d46500cfecc3c7c2cedbe +PODFILE CHECKSUM: 52738e8a9294398036caa4be0c073e4996b83424 COCOAPODS: 1.12.1 From 289db2e21ecd62d9b6f41cce0ea467c311219363 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 11:41:40 -0400 Subject: [PATCH 42/46] Update WordPressAuthenticator to 6.2.0 --- Podfile | 2 +- Podfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Podfile b/Podfile index a93ed2947f3c..766ca7036a5e 100644 --- a/Podfile +++ b/Podfile @@ -149,7 +149,7 @@ abstract_target 'Apps' do 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' diff --git a/Podfile.lock b/Podfile.lock index b2202a8d379c..03c54408dff3 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -611,7 +611,7 @@ DEPENDENCIES: - SVProgressHUD (= 2.2.5) - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.8) - - WordPressAuthenticator (~> 6.1-beta) + - WordPressAuthenticator (~> 6.2.0) - WordPressKit (~> 8.5) - WordPressShared (~> 2.2) - WordPressUI (~> 1.12.5) @@ -895,6 +895,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: 52738e8a9294398036caa4be0c073e4996b83424 +PODFILE CHECKSUM: 463ed7d39926c127d8197fe925fd7d05125f647b COCOAPODS: 1.12.1 From 3d8c016d34629b3dcca79484abb50cdcc9d6cf51 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 11:42:19 -0400 Subject: [PATCH 43/46] Update strings for localization --- .../Resources/en.lproj/Localizable.strings | 136 +++++++++++------- 1 file changed, 81 insertions(+), 55 deletions(-) diff --git a/WordPress/Resources/en.lproj/Localizable.strings b/WordPress/Resources/en.lproj/Localizable.strings index 863ed3860a00..73a4d4d9dbb8 100644 --- a/WordPress/Resources/en.lproj/Localizable.strings +++ b/WordPress/Resources/en.lproj/Localizable.strings @@ -230,11 +230,8 @@ /* translators: accessibility text for blocks with invalid content. %d: localized block title */ "%s block. This block has invalid content" = "%s block. This block has invalid content"; -/* translators: %s: name of the reusable block */ -"%s converted to regular block" = "%s converted to regular block"; - -/* translators: %s: name of the reusable block */ -"%s converted to regular blocks" = "%s converted to regular blocks"; +/* translators: %s: name of the synced block */ +"%s detached" = "%s detached"; /* translators: %s: embed block variant's label e.g: \"Twitter\". */ "%s embed block previews are coming soon" = "%s embed block previews are coming soon"; @@ -770,10 +767,10 @@ "Alt Text" = "Alt Text"; /* No comment provided by engineer. */ -"Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”." = "Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”."; +"Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”." = "Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”."; /* No comment provided by engineer. */ -"Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”." = "Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”."; +"Alternatively, you can detach and edit this block separately by tapping “Detach pattern”." = "Alternatively, you can detach and edit this block separately by tapping “Detach pattern”."; /* Instruction text to explain to help users type their password instead of using magic link login option. */ "Alternatively, you may enter the password for this account." = "Alternatively, you may enter the password for this account."; @@ -1173,9 +1170,6 @@ /* All Time Stats 'Best views ever' label */ "Best views ever" = "Best views ever"; -/* Text for related post cell preview */ -"Big iPhone/iPad Update Now Available" = "Big iPhone/iPad Update Now Available"; - /* Notice that a page without content has been created */ "Blank page created" = "Blank page created"; @@ -1188,6 +1182,12 @@ /* Title displayed when there are no Blaze campaigns to display. */ "blaze.campaigns.empty.title" = "You have no campaigns"; +/* Text displayed when there is a failure loading Blaze campaigns. */ +"blaze.campaigns.errorMessage" = "There was an error loading campaigns."; + +/* Title for the view when there's an error loading Blaze campiagns. */ +"blaze.campaigns.errorTitle" = "Oops"; + /* Displayed while Blaze campaigns are being loaded. */ "blaze.campaigns.loading.title" = "Loading campaigns..."; @@ -1240,10 +1240,10 @@ "blazeCampaign.status.completed" = "Completed"; /* Short status description */ -"blazeCampaign.status.created" = "Created"; +"blazeCampaign.status.inmoderation" = "In Moderation"; /* Short status description */ -"blazeCampaign.status.inmoderation" = "In Moderation"; +"blazeCampaign.status.processing" = "Processing"; /* Short status description */ "blazeCampaign.status.rejected" = "Rejected"; @@ -2518,6 +2518,9 @@ marketing activities based on your consent and our legitimate interest."; /* Title for the Pages dashboard card. */ "dashboardCard.Pages.title" = "Pages"; +/* Title for the View stats button in the More menu */ +"dashboardCard.stats.viewStats" = "View stats"; + /* Title for a threat that includes the number of database rows affected */ "Database %1$d threats" = "Database %1$d threats"; @@ -3066,10 +3069,10 @@ marketing activities based on your consent and our legitimate interest."; "Edit video" = "Edit video"; /* translators: %s: name of the host app (e.g. WordPress) */ -"Editing reusable blocks is not yet supported on %s for Android" = "Editing reusable blocks is not yet supported on %s for Android"; +"Editing synced patterns is not yet supported on %s for Android" = "Editing synced patterns is not yet supported on %s for Android"; /* translators: %s: name of the host app (e.g. WordPress) */ -"Editing reusable blocks is not yet supported on %s for iOS" = "Editing reusable blocks is not yet supported on %s for iOS"; +"Editing synced patterns is not yet supported on %s for iOS" = "Editing synced patterns is not yet supported on %s for iOS"; /* Editing GIF alert message. */ "Editing this GIF will remove its animation." = "Editing this GIF will remove its animation."; @@ -3490,6 +3493,9 @@ marketing activities based on your consent and our legitimate interest."; /* Option to select the Fastmail app when logging in with magic links */ "Fastmail" = "Fastmail"; +/* Title of screen the displays the details of an advertisement campaign. */ +"feature.blaze.campaignDetails.title" = "Campaign Details"; + /* Name of a feature that allows the user to promote their posts. */ "feature.blaze.title" = "Blaze"; @@ -3752,6 +3758,12 @@ marketing activities based on your consent and our legitimate interest."; Title for the general section in site settings screen */ "General" = "General"; +/* A generic error message for a footer view in a list with pagination */ +"general.pagingFooterView.errorMessage" = "An error occurred"; + +/* A footer retry button */ +"general.pagingFooterView.retry" = "Retry"; + /* Title. A call to action to generate a new invite link. */ "Generate new link" = "Generate new link"; @@ -4182,15 +4194,6 @@ marketing activities based on your consent and our legitimate interest."; /* Footer for the Serve images from our servers setting */ "Improve your site's speed by only loading images visible on the screen. New images will load just before they scroll into view. This prevents viewers from having to download all the images on a page all at once, even ones they can't see." = "Improve your site's speed by only loading images visible on the screen. New images will load just before they scroll into view. This prevents viewers from having to download all the images on a page all at once, even ones they can't see."; -/* Text for related post cell preview */ -"in \"Apps\"" = "in \"Apps\""; - -/* Text for related post cell preview */ -"in \"Mobile\"" = "in \"Mobile\""; - -/* Text for related post cell preview */ -"in \"Upgrade\"" = "in \"Upgrade\""; - /* Explain what is the purpose of the tagline */ "In a few words, explain what this site is about." = "In a few words, explain what this site is about."; @@ -5531,15 +5534,15 @@ Please install the %3$@ to use the app with this site."; /* Title for the card displaying draft posts. */ "my-sites.drafts.card.title" = "Work on a draft post"; -/* The part in the title that should be highlighted. */ -"my-sites.drafts.card.title.hint" = "draft post"; +/* Title for the View all drafts button in the More menu */ +"my-sites.drafts.card.viewAllDrafts" = "View all drafts"; + +/* Title for the View all scheduled drafts button in the More menu */ +"my-sites.scheduled.card.viewAllScheduledPosts" = "View all scheduled posts"; /* Title for the card displaying today's stats. */ "my-sites.stats.card.title" = "Today's Stats"; -/* The part of the title that needs to be emphasized */ -"my-sites.stats.card.title.hint" = "Stats"; - /* Accessibility label for the Email text field. Header for a comment author's name, shown when editing a comment. Name text field placeholder @@ -6074,7 +6077,6 @@ Please install the %3$@ to use the app with this site."; /* An informal exclaimation that means `something went wrong`. Title for the view when there's an error loading a comment. Title for the view when there's an error loading Activity Log - Title for the view when there's an error loading Blaze campiagns. Title for the view when there's an error loading blogging prompts. Title for the view when there's an error loading scan status Title for the view when there's an error loading the history @@ -6718,6 +6720,15 @@ Please install the %3$@ to use the app with this site."; /* Section title for the disabled Twitter service in the Post Settings screen */ "postSettings.section.disabledTwitter.header" = "Twitter Auto-Sharing Is No Longer Available"; +/* Title for the button to subscribe to Jetpack Social on the remaining shares view */ +"postsettings.social.remainingshares.subscribe" = "Subscribe now to share more"; + +/* Beginning text of the remaining social shares a user has left. %1$d is their current remaining shares. %2$d is their share limit. This text is combined with ' in the next 30 days' if there is no warning displayed. */ +"postsettings.social.remainingshares.text.format" = "%1$d/%2$d social shares remaining"; + +/* The second half of the remaining social shares a user has. This is only displayed when there is no social limit warning. */ +"postsettings.social.remainingshares.text.part" = " in the next 30 days"; + /* Subtitle for placeholder in Tenor picker. `The company name 'Tenor' should always be written as it is. */ "Powered by Tenor" = "Powered by Tenor"; @@ -6734,7 +6745,6 @@ Please install the %3$@ to use the app with this site."; "Preparing..." = "Preparing..."; /* Displays the Post Preview Interface - Section title for related posts section preview Title for button to preview a selected layout Title for screen to preview a selected homepage design. Title for screen to preview a static content. */ @@ -7073,13 +7083,50 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Displayed in the Notifications Tab as a message, when the Unread Filter shows no notifications */ "Reignite the conversation: write a new post." = "Reignite the conversation: write a new post."; -/* Label for Related Post header preview - Label for selecting the related posts options - Title for screen that allows configuration of your blog/site related posts settings. */ +/* Label for selecting the related posts options */ "Related Posts" = "Related Posts"; /* Information of what related post are and how they are presented */ -"Related Posts displays relevant content from your site below your posts" = "Related Posts displays relevant content from your site below your posts"; +"relatedPostsSettings.optionsFooter" = "Related Posts displays relevant content from your site below your posts"; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview1.details" = "in \"Mobile\""; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview1.title" = "Big iPhone/iPad Update Now Available"; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview2.details" = "in \"Apps\""; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview2.title" = "The WordPress for Android App Gets a Big Facelift"; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview3.details" = "in \"Upgrade\""; + +/* Text for related post cell preview */ +"relatedPostsSettings.preview3.title" = "Upgrade Focus: VideoPress For Weddings"; + +/* Section title for related posts section preview */ +"relatedPostsSettings.previewsHeaders" = "Preview"; + +/* Label for Related Post header preview */ +"relatedPostsSettings.relatedPostsHeader" = "Related Posts"; + +/* Message to show when setting save failed */ +"relatedPostsSettings.settingsUpdateFailed" = "Settings update failed"; + +/* Label for configuration switch to show/hide the header for the related posts section */ +"relatedPostsSettings.showHeader" = "Show Header"; + +/* Label for configuration switch to enable/disable related posts */ +"relatedPostsSettings.showRelatedPosts" = "Show Related Posts"; + +/* Label for configuration switch to show/hide images thumbnail for the related posts */ +"relatedPostsSettings.showThumbnail" = "Show Images"; + +/* Title for screen that allows configuration of your blog/site related posts settings. */ +"relatedPostsSettings.title" = "Related Posts"; /* Button title on the blogging prompt's feature introduction view to set a reminder. */ "Remind me" = "Remind me"; @@ -7328,9 +7375,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Share extension error dialog cancel button text */ "Return to post" = "Return to post"; -/* No comment provided by engineer. */ -"Reusable" = "Reusable"; - /* Cancels a pending Email Change */ "Revert Pending Change" = "Revert Pending Change"; @@ -7865,12 +7909,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Share extension error dialog title. */ "Sharing Error" = "Sharing Error"; -/* Label for configuration switch to show/hide the header for the related posts section */ -"Show Header" = "Show Header"; - -/* Label for configuration switch to show/hide images thumbnail for the related posts */ -"Show Images" = "Show Images"; - /* Title for the `show like button` setting */ "Show Like button" = "Show Like button"; @@ -7890,9 +7928,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Title for the `show reblog button` setting */ "Show Reblog button" = "Show Reblog button"; -/* Label for configuration switch to enable/disable related posts */ -"Show Related Posts" = "Show Related Posts"; - /* Alert title picking theme type to browse */ "Show themes:" = "Show themes:"; @@ -8923,9 +8958,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Message shown when a video failed to load while trying to add it to the Media library. */ "The video could not be added to the Media Library." = "The video could not be added to the Media Library."; -/* Text for related post cell preview */ -"The WordPress for Android App Gets a Big Facelift" = "The WordPress for Android App Gets a Big Facelift"; - /* Example post title used in the login prologue screens. This is a post about football fans. */ "The World's Best Fans" = "The World's Best Fans"; @@ -9019,9 +9051,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Text displayed when there is a failure loading the activity feed */ "There was an error loading activities" = "There was an error loading activities"; -/* Text displayed when there is a failure loading Blaze campaigns. */ -"There was an error loading campaigns." = "There was an error loading campaigns."; - /* Text displayed when there is a failure loading the plan list */ "There was an error loading plans" = "There was an error loading plans"; @@ -9759,9 +9788,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Text displayed in HUD while a draft or scheduled post is being updated. */ "Updating..." = "Updating..."; -/* Text for related post cell preview */ -"Upgrade Focus: VideoPress For Weddings" = "Upgrade Focus: VideoPress For Weddings"; - /* No comment provided by engineer. */ "Upgrade your plan to upload audio" = "Upgrade your plan to upload audio"; From 928de0faf1ff8a8e94d64ca18e7925232e815e32 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Mon, 10 Jul 2023 12:45:47 -0400 Subject: [PATCH 44/46] Remove Jetpack-only release notes from WordPress 22.8 release notes --- WordPress/Resources/release_notes.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPress/Resources/release_notes.txt b/WordPress/Resources/release_notes.txt index 42816e59d62b..5622d406fc18 100644 --- a/WordPress/Resources/release_notes.txt +++ b/WordPress/Resources/release_notes.txt @@ -3,6 +3,5 @@ * [**] [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] From ba5e5c2ea34136c067b5f58e8cf81a501df6e486 Mon Sep 17 00:00:00 2001 From: Momo Ozawa Date: Mon, 10 Jul 2023 17:49:27 +0100 Subject: [PATCH 45/46] update bar button item for blaze campaigns screen --- .../Blaze Campaigns/BlazeCampaignsViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift b/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift index 9fdc053487f0..a003f51a6a00 100644 --- a/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift +++ b/WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift @@ -5,8 +5,8 @@ import WordPressFlux final class BlazeCampaignsViewController: UIViewController, NoResultsViewHost, BlazeCampaignsStreamDelegate { // MARK: - Views - private lazy var plusButton = UIBarButtonItem( - image: UIImage(systemName: "plus"), + private lazy var createButton = UIBarButtonItem( + title: Strings.createButtonTitle, style: .plain, target: self, action: #selector(buttonCreateCampaignTapped) @@ -169,7 +169,7 @@ final class BlazeCampaignsViewController: UIViewController, NoResultsViewHost, B private func setupNavBar() { title = Strings.navigationTitle - navigationItem.rightBarButtonItem = plusButton + navigationItem.rightBarButtonItem = createButton } private func setupNoResults() { @@ -245,6 +245,7 @@ private extension BlazeCampaignsViewController { enum Strings { static let navigationTitle = NSLocalizedString("blaze.campaigns.title", value: "Blaze Campaigns", comment: "Title for the screen that allows users to manage their Blaze campaigns.") static let promoteButtonTitle = NSLocalizedString("blaze.campaigns.promote.button.title", value: "Promote", comment: "Button title for the button that shows the Blaze flow when tapped.") + static let createButtonTitle = NSLocalizedString("blaze.campaigns.create.button.title", value: "Create", comment: "Button title for the button that shows the Blaze flow when tapped.") enum NoResults { static let loadingTitle = NSLocalizedString("blaze.campaigns.loading.title", value: "Loading campaigns...", comment: "Displayed while Blaze campaigns are being loaded.") From 1344696eec6b1d02868a5f636196df7888f25f45 Mon Sep 17 00:00:00 2001 From: kean Date: Mon, 10 Jul 2023 18:14:54 -0400 Subject: [PATCH 46/46] Fix hang when updating remote users --- WordPress/Classes/Services/BlogService.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/Services/BlogService.m b/WordPress/Classes/Services/BlogService.m index 45c8e38bb8ab..e59ef224fb2a 100644 --- a/WordPress/Classes/Services/BlogService.m +++ b/WordPress/Classes/Services/BlogService.m @@ -161,8 +161,9 @@ - (void)syncBlogAndAllMetadata:(Blog *)blog completionHandler:(void (^)(void))co dispatch_group_enter(syncGroup); [remote getAllAuthorsWithSuccess:^(NSArray *users) { - [self updateMultiAuthor:users forBlog:blogObjectID]; - dispatch_group_leave(syncGroup); + [self updateMultiAuthor:users forBlog:blogObjectID completionHandler:^{ + dispatch_group_leave(syncGroup); + }]; } failure:^(NSError *error) { DDLogError(@"Failed checking multi-author status for blog %@: %@", blog.url, error); dispatch_group_leave(syncGroup); @@ -261,8 +262,7 @@ - (void)syncAuthorsForBlog:(Blog *)blog id remote = [self remoteForBlog:blog]; [remote getAllAuthorsWithSuccess:^(NSArray *users) { - [self updateMultiAuthor:users forBlog:blogObjectID]; - success(); + [self updateMultiAuthor:users forBlog:blogObjectID completionHandler:success]; } failure:^(NSError *error) { DDLogError(@"Failed checking multi-author status for blog %@: %@", blog.url, error); failure(error); @@ -585,7 +585,7 @@ - (Blog *)migrateRemoteJetpackBlog:(RemoteBlog *)remoteBlog #pragma mark - Completion handlers -- (void)updateMultiAuthor:(NSArray *)users forBlog:(NSManagedObjectID *)blogObjectID +- (void)updateMultiAuthor:(NSArray *)users forBlog:(NSManagedObjectID *)blogObjectID completionHandler:(void (^)(void))completion { [self.coreDataStack performAndSaveUsingBlock:^(NSManagedObjectContext *context) { NSError *error; @@ -623,7 +623,7 @@ - (void)updateMultiAuthor:(NSArray *)users forBlog:(NSManagedObjec } } } - }]; + } completion: completion onQueue:dispatch_get_main_queue()]; } - (BlogDetailsHandler)blogDetailsHandlerWithBlogObjectID:(NSManagedObjectID *)blogObjectID