Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 22.3.0.1 and editorialized release notes for 22.3 #20634

Merged
merged 31 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
951f6d1
Update Automattic-Tracks-iOS version
salimbraksa Apr 25, 2023
bffae92
Handle a compilation error due to updating Automattic-Tracks-iOS pod …
salimbraksa Apr 25, 2023
7084790
Set TracksService.platform property to wpios for WordPress and Jetpack
salimbraksa Apr 25, 2023
450c777
Remove Sentry pod regex logic and explicity list the Sentry pods to i…
salimbraksa May 2, 2023
74f92c5
Podfile.lock update due to pod install
salimbraksa May 2, 2023
2df7bb1
Add localized strings for domain checkout failure
salimbraksa Apr 26, 2023
d5c08b3
Show error message when domain checkout fails
salimbraksa Apr 26, 2023
2dfea22
Add ability to retry domain checkout if it fails
salimbraksa Apr 26, 2023
238e0a4
Move to progress state when retrying domain purchasing
salimbraksa Apr 26, 2023
bf6fc4b
Fix contact support was not displaying
salimbraksa Apr 26, 2023
8318bd3
Resolve an issue that was causing multiple error state views to be di…
salimbraksa Apr 26, 2023
4466ad4
Refactor ABTest enum to enable experiments for Jetpack only
salimbraksa Apr 24, 2023
fef2d0e
Add siteCreationDomainPurchasing case to ABTest enum
salimbraksa Apr 24, 2023
7c227dc
Update is domain purchasing enabled logic to include the AB experiment
salimbraksa Apr 24, 2023
0c5566b
Refactor enhancedSiteCreationAccessed event tracking to SiteCreationA…
salimbraksa Apr 24, 2023
28bcde4
Add domainPurchasingExperiment track event
salimbraksa Apr 24, 2023
c4b3cc9
Add missing documentation
salimbraksa Apr 24, 2023
a58884f
Refactor domainPurchasingExperiment event tracking to take into ExPla…
salimbraksa Apr 26, 2023
89da278
Add explicit self in closure
salimbraksa Apr 27, 2023
41dc007
Add A/B test experiment for domain purchasing (#20590)
mokagio May 2, 2023
c91b8a8
Use Tracks version 2.2.0
mokagio May 2, 2023
1c8fa0e
Merge pull request #20613 from wordpress-mobile/task/domain-purchasin…
mkevins May 2, 2023
0167583
Add support for ExPlat in the Jetpack app via workaround (#20607)
mokagio May 2, 2023
7b46500
Update app translations – `Localizable.strings`
mokagio May 2, 2023
0683f78
Update WordPress metadata translations
mokagio May 2, 2023
0d4dd56
Update Jetpack metadata translations
mokagio May 2, 2023
535b327
Bump version number
mokagio May 2, 2023
f1772c3
Add editorialized release notes for WordPress 22.3
mokagio May 4, 2023
73e80e2
Add editorialized release notes for Jetpack 22.3
mokagio May 4, 2023
1f1f1d0
Update metadata strings
mokagio May 4, 2023
676e103
Update metadata strings
mokagio May 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ abstract_target 'Apps' do

# Production

pod 'Automattic-Tracks-iOS', '~> 0.13'
pod 'Automattic-Tracks-iOS', '~> 2.2'
# While in PR
# pod 'Automattic-Tracks-iOS', git: 'https://github.com/Automattic/Automattic-Tracks-iOS.git', branch: ''
# Local Development
Expand Down Expand Up @@ -404,7 +404,7 @@ pre_install do |installer|
installer.pod_targets.each do |pod|
# Statically linking Sentry results in a conflict with `NSDictionary.objectAtKeyPath`, but dynamically
# linking it resolves this.
if pod.name == 'Sentry'
if %w[Sentry SentryPrivate].include? pod.name
dynamic << pod
next
end
Expand Down
27 changes: 16 additions & 11 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ PODS:
- AppCenter/Core
- AppCenter/Distribute (4.4.1):
- AppCenter/Core
- Automattic-Tracks-iOS (0.13.0):
- Sentry (~> 7.25)
- Automattic-Tracks-iOS (2.2.0):
- Sentry (~> 8.0)
- Sodium (>= 0.9.1)
- UIDeviceIdentifier (~> 2.0)
- boost (1.76.0)
Expand Down Expand Up @@ -490,14 +490,17 @@ PODS:
- SDWebImageWebPCoder (0.8.5):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.10)
- Sentry (7.27.0):
- Sentry/Core (= 7.27.0)
- Sentry/Core (7.27.0)
- Sentry (8.6.0):
- Sentry/Core (= 8.6.0)
- SentryPrivate (= 8.6.0)
- Sentry/Core (8.6.0):
- SentryPrivate (= 8.6.0)
- SentryPrivate (8.6.0)
- Sodium (0.9.1)
- Starscream (3.0.6)
- SVProgressHUD (2.2.5)
- SwiftLint (0.50.3)
- UIDeviceIdentifier (2.1.0)
- UIDeviceIdentifier (2.3.0)
- WordPress-Aztec-iOS (1.19.8)
- WordPress-Editor-iOS (1.19.8):
- WordPress-Aztec-iOS (= 1.19.8)
Expand Down Expand Up @@ -541,7 +544,7 @@ DEPENDENCIES:
- AlamofireNetworkActivityIndicator (~> 2.4)
- AppCenter (~> 4.1)
- AppCenter/Distribute (~> 4.1)
- Automattic-Tracks-iOS (~> 0.13)
- Automattic-Tracks-iOS (~> 2.2)
- boost (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.94.0/third-party-podspecs/boost.podspec.json`)
- BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.94.0/third-party-podspecs/BVLinearGradient.podspec.json`)
- CocoaLumberjack/Swift (~> 3.0)
Expand Down Expand Up @@ -651,6 +654,7 @@ SPEC REPOS:
- SDWebImage
- SDWebImageWebPCoder
- Sentry
- SentryPrivate
- Sodium
- Starscream
- SVProgressHUD
Expand Down Expand Up @@ -800,7 +804,7 @@ SPEC CHECKSUMS:
AlamofireNetworkActivityIndicator: 9acc3de3ca6645bf0efed462396b0df13dd3e7b8
AppAuth: e48b432bb4ba88b10cb2bcc50d7f3af21e78b9c2
AppCenter: b0b6f1190215b5f983c42934db718f3b46fff3c0
Automattic-Tracks-iOS: 63e55654f500b3e8fb35087e64575e00d12eb2f5
Automattic-Tracks-iOS: a1b020ab02f0e5a39c5d4e6870a498273f286158
boost: 32a63928ef0a5bf8b60f6b930c8864113fa28779
BVLinearGradient: 708898fab8f7113d927b0ef611a321e759f6ad3e
CocoaLumberjack: 78abfb691154e2a9df8ded4350d504ee19d90732
Expand Down Expand Up @@ -871,12 +875,13 @@ SPEC CHECKSUMS:
RNTAztecView: 80480c43423929f7e3b7012670787e7375fbac9c
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
Sentry: 026b36fdc09531604db9279e55f047fe652e3f4a
Sentry: d80553ff85ea72def75b792aaa5a71c158e51595
SentryPrivate: ef1c5b3dfe44ec0c70e2eb343a5be2689164c021
Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da
Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
SwiftLint: 77f7cb2b9bb81ab4a12fcc86448ba3f11afa50c6
UIDeviceIdentifier: e6a801d25f4f178de5bdf475ffe29050d0148176
UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345
WordPressAuthenticator: b0b900696de5129a215adcd1e9ae6eb89da36ac8
Expand All @@ -895,6 +900,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37

PODFILE CHECKSUM: d48e2c793016c27a80eba0bc3b3ccb30ee05ba6f
PODFILE CHECKSUM: ab88bd849ac377484fd7f0c4b079701ce16de5a3

COCOAPODS: 1.11.3
5 changes: 4 additions & 1 deletion WordPress/Classes/Services/SiteAddressService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ final class DomainsServiceAdapter: SiteAddressService {

// MARK: Properties

private let domainPurchasingEnabled = FeatureFlag.siteCreationDomainPurchasing.enabled
/// Checks if the Domain Purchasing Feature Flag and AB Experiment are enabled
private var domainPurchasingEnabled: Bool {
FeatureFlag.siteCreationDomainPurchasing.enabled && ABTest.siteCreationDomainPurchasing.isTreatmentVariation
}

/**
Corresponds to:
Expand Down
22 changes: 16 additions & 6 deletions WordPress/Classes/Utility/AB Testing/ABTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,35 @@ import AutomatticTracks
// Jetpack is not supported
enum ABTest: String, CaseIterable {
case unknown = "unknown"
case siteCreationDomainPurchasing = "jpios_site_creation_domain_purchasing_v1"

/// Returns a variation for the given experiment
var variation: Variation {
return ExPlat.shared?.experiment(self.rawValue) ?? .control
}

/// Flag indicating whether the experiment's variation is treament or not.
var isTreatmentVariation: Bool {
switch variation {
case .treatment, .customTreatment: return true
case .control: return false
}
}
}

extension ABTest {
/// Start the AB Testing platform if any experiment exists
///
static func start() {
guard ABTest.allCases.count > 1, AccountHelper.isLoggedIn,
AppConfiguration.isWordPress else {
guard ABTest.allCases.count > 1,
AccountHelper.isLoggedIn,
AppConfiguration.isJetpack,
let exPlat = ExPlat.shared
else {
return
}

let experimentNames = ABTest.allCases.filter { $0 != .unknown }.map { $0.rawValue }
ExPlat.shared?.register(experiments: experimentNames)

ExPlat.shared?.refresh()
exPlat.register(experiments: experimentNames)
exPlat.refresh()
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Foundation

extension WPAnalytics {

/// Checks if the Domain Purchasing Feature Flag and AB Experiment are enabled
private static var domainPurchasingEnabled: Bool {
FeatureFlag.siteCreationDomainPurchasing.enabled && ABTest.siteCreationDomainPurchasing.isTreatmentVariation
}

static func domainsProperties(for blog: Blog) -> [AnyHashable: Any] {
// For now we do not have the `siteCreation` route implemented so hardcoding `menu`
domainsProperties(usingCredit: blog.canRegisterDomainWithPaidPlan, origin: .menu)
Expand All @@ -11,7 +17,7 @@ extension WPAnalytics {
origin: DomainPurchaseWebViewViewOrigin?
) -> [AnyHashable: Any] {
var dict: [AnyHashable: Any] = ["using_credit": usingCredit.stringLiteral]
if FeatureFlag.siteCreationDomainPurchasing.enabled,
if Self.domainPurchasingEnabled,
let origin = origin {
dict["origin"] = origin.rawValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ - (instancetype)init
_contextManager = [TracksContextManager new];
_tracksService = [[TracksService alloc] initWithContextManager:_contextManager];
_tracksService.eventNamePrefix = AppConstants.eventNamePrefix;
_tracksService.platform = AppConstants.explatPlatform;
}
return self;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import WordPressAuthenticator
static let shareAppName: ShareAppName = .wordpress
static let mobileAnnounceAppId = "2"
@objc static let eventNamePrefix = "wpios"
@objc static let explatPlatform = "wpios"
@objc static let authKeychainServiceName = "public-api.wordpress.com"

/// Notifications Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension BlogListViewController {
return
}
self.present(wizard, animated: true)
WPAnalytics.track(.enhancedSiteCreationAccessed, withProperties: ["source": source])
SiteCreationAnalyticsHelper.trackSiteCreationAccessed(source: source)
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
return
}
self.present(wizard, animated: true)
WPAnalytics.track(.enhancedSiteCreationAccessed, withProperties: ["source": source])
SiteCreationAnalyticsHelper.trackSiteCreationAccessed(source: source)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ extension WordPressAuthenticationManager: WordPressAuthenticatorDelegate {
}

navigationController.present(wizard, animated: true)
WPAnalytics.track(.enhancedSiteCreationAccessed, withProperties: ["source": source])
SiteCreationAnalyticsHelper.trackSiteCreationAccessed(source: source)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ final class SiteAssemblyContentView: UIView {
label.font = WPStyleGuide.fontForTextStyle(.title1, fontWeight: .bold)
label.textColor = .text

if FeatureFlag.siteCreationDomainPurchasing.enabled {
if siteCreator.domainPurchasingEnabled {
label.textAlignment = .natural
} else {
label.textAlignment = .center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,17 @@ final class SiteAssemblyWizardContent: UIViewController {
case .success(let domain):
self.contentView.siteName = domain
self.contentView.isFreeDomain = false
case .failure:
self.contentView.status = .succeeded
case .failure(let error):
self.contentView.isFreeDomain = true
// TODO: We should discuss how to handle domain purchasing errors
break
switch error {
case .unsupportedRedirect, .internal, .invalidInput, .other:
self.installDomainCheckoutErrorStateViewController(domain: domain, site: site)
self.contentView.status = .failed
case .canceled:
self.contentView.status = .succeeded
}
}
self.contentView.status = .succeeded
}
}

Expand All @@ -185,30 +190,63 @@ final class SiteAssemblyWizardContent: UIViewController {
private func installErrorStateViewController(with type: ErrorStateViewType) {
var configuration = ErrorStateViewConfiguration.configuration(type: type)

configuration.contactSupportActionHandler = { [weak self] in
configuration.retryActionHandler = { [weak self] in
guard let self = self else {
return
}
self.contactSupportTapped()
self.retryTapped()
}

self.installErrorStateViewController(with: configuration)
}

private func installDomainCheckoutErrorStateViewController(domain: DomainSuggestion, site: Blog) {
var configuration = ErrorStateViewConfiguration.configuration(type: .domainCheckoutFailed)

configuration.retryActionHandler = { [weak self] in
guard let self = self else {
guard let self else {
return
}
self.retryTapped()
self.contentView.status = .inProgress
self.attemptDomainPurchasing(domain: domain, site: site)
}

configuration.dismissalActionHandler = { [weak self] in
guard let self = self else {
return
self.installErrorStateViewController(with: configuration)
}

private func installErrorStateViewController(with configuration: ErrorStateViewConfiguration) {
var configuration = configuration

if configuration.contactSupportActionHandler == nil {
configuration.contactSupportActionHandler = { [weak self] in
guard let self = self else {
return
}
self.contactSupportTapped()
}
self.dismissTapped()
}

if configuration.dismissalActionHandler == nil {
configuration.dismissalActionHandler = { [weak self] in
guard let self = self else {
return
}
self.dismissTapped()
}
}

// Remove previous error state view controller
if let errorStateViewController {
errorStateViewController.willMove(toParent: nil)
errorStateViewController.view?.removeFromSuperview()
errorStateViewController.removeFromParent()
errorStateViewController.didMove(toParent: nil)
}

// Install new error state view controller
let errorStateViewController = ErrorStateViewController(with: configuration)

contentView.errorStateView = errorStateViewController.view
self.contentView.errorStateView = errorStateViewController.view

errorStateViewController.willMove(toParent: self)
addChild(errorStateViewController)
Expand All @@ -223,9 +261,8 @@ final class SiteAssemblyWizardContent: UIViewController {
private extension SiteAssemblyWizardContent {
func contactSupportTapped() {
// TODO : capture analytics event via #10335

let supportVC = SupportTableViewController()
supportVC.showFromTabBar()
supportVC.show(from: self)
}

func dismissTapped(viaDone: Bool = false, completion: (() -> Void)? = nil) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum ErrorStateViewType {
case general
case networkUnreachable
case siteLoading
case domainCheckoutFailed
}

// MARK: ErrorViewConfiguration
Expand Down Expand Up @@ -53,7 +54,7 @@ struct ErrorStateViewConfiguration {
extension ErrorStateViewType {
var localizedTitle: String {
switch self {
case .general, .siteLoading:
case .general, .siteLoading, .domainCheckoutFailed:
return NSLocalizedString("There was a problem",
comment: "This primary message message is displayed if a user encounters a general error.")
case .networkUnreachable:
Expand All @@ -69,6 +70,12 @@ extension ErrorStateViewType {
comment: "This secondary message is displayed if a user encounters a general error.")
case .networkUnreachable:
return nil
case .domainCheckoutFailed:
return NSLocalizedString(
"site.creation.assembly.step.domain.checkout.error.subtitle",
value: "Your website has been created successfully, but we encountered an issue while preparing your custom domain for checkout. Please try again or contact support for assistance.",
comment: "The error message to show in the 'Site Creation > Assembly Step' when the domain checkout fails for unknown reasons."
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation

enum SiteCreationAnalyticsEvent: String {
case domainPurchasingExperiment = "site_creation_domain_purchasing_experiment"
}
Loading