Skip to content

Commit

Permalink
Merge branch 'trunk' into issue/create-order-metadata-view
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomazFB committed Jul 10, 2022
2 parents 8c4b33b + 0576bca commit ac67f55
Show file tree
Hide file tree
Showing 119 changed files with 2,893 additions and 912 deletions.
6 changes: 4 additions & 2 deletions Experiments/Experiments/DefaultFeatureFlagService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
case .shippingLabelsOnboardingM1:
return buildConfig == .localDeveloper || buildConfig == .alpha
case .inPersonPaymentGatewaySelection:
return buildConfig == .localDeveloper || buildConfig == .alpha
return true
case .unifiedOrderEditing:
return buildConfig == .localDeveloper || buildConfig == .alpha
case .backgroundProductImageUpload:
return buildConfig == .localDeveloper || buildConfig == .alpha
return true
case .consolidatedCardReaderManuals:
return buildConfig == .localDeveloper || buildConfig == .alpha
case .appleIDAccountDeletion:
return true
case .newToWooCommerceLinkInLoginPrologue:
return true
case .orderCustomFields:
return buildConfig == .localDeveloper || buildConfig == .alpha
default:
Expand Down
4 changes: 4 additions & 0 deletions Experiments/Experiments/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public enum FeatureFlag: Int {
///
case appleIDAccountDeletion

/// Showing a "New to WooCommerce" link in the login prologue screen
///
case newToWooCommerceLinkInLoginPrologue

/// Enable the Order Custom Fields button in Order Details
///
case orderCustomFields
Expand Down
19 changes: 18 additions & 1 deletion Hardware/Hardware/CardReader/CardReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ public struct CardReader {

/// The CardReader location id
public let locationId: String?

public init(serial: String,
vendorIdentifier: String?,
name: String?,
status: CardReaderStatus,
softwareVersion: String?,
batteryLevel: Float?,
readerType: CardReaderType,
locationId: String?) {
self.serial = serial
self.vendorIdentifier = vendorIdentifier
self.name = name
self.status = status
self.softwareVersion = softwareVersion
self.batteryLevel = batteryLevel
self.readerType = readerType
self.locationId = locationId
}
}


Expand All @@ -40,7 +58,6 @@ extension CardReader: Identifiable {
}
}


/// Instances of CardReader do not mutate state during their lifecycle.
extension CardReader: Equatable {
public static func ==(lhs: CardReader, rhs: CardReader) -> Bool {
Expand Down
6 changes: 6 additions & 0 deletions Hardware/Hardware/CardReader/CardReaderStatus.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/// Models the status of a Card Reader
public struct CardReaderStatus {

/// Indicates if the CardReader is connected
public let connected: Bool

// Indicates if the CardReader is remembered by the service
public let remembered: Bool

public init(connected: Bool, remembered: Bool) {
self.connected = connected
self.remembered = remembered
}
}
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ target 'WooCommerce' do
pod 'Gridicons', '~> 1.2.0'

# To allow pod to pick up beta versions use -beta. E.g., 1.1.7-beta.1
pod 'WordPressAuthenticator', '~> 2.0.0'
pod 'WordPressAuthenticator', '~> 2.0.1-beta.2'
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'
Expand Down
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ PODS:
- GTMAppAuth (~> 1.0)
- GTMSessionFetcher/Core (~> 1.1)
- Gridicons (1.2.0)
- GTMAppAuth (1.2.2):
- GTMAppAuth (1.3.0):
- AppAuth/Core (~> 1.4)
- GTMSessionFetcher/Core (~> 1.5)
- GTMSessionFetcher/Core (1.7.0)
- GTMSessionFetcher/Core (1.7.2)
- KeychainAccess (4.2.2)
- Kingfisher (7.2.2)
- NSObject-SafeExpectations (0.0.4)
Expand All @@ -42,7 +42,7 @@ PODS:
- WordPress-Aztec-iOS (1.11.0)
- WordPress-Editor-iOS (1.11.0):
- WordPress-Aztec-iOS (= 1.11.0)
- WordPressAuthenticator (2.0.0):
- WordPressAuthenticator (2.0.1-beta.2):
- Alamofire (~> 4.8)
- CocoaLumberjack (~> 3.5)
- GoogleSignIn (~> 6.0.1)
Expand Down Expand Up @@ -92,7 +92,7 @@ DEPENDENCIES:
- Sourcery (~> 1.0.3)
- StripeTerminal (~> 2.7)
- WordPress-Editor-iOS (~> 1.11.0)
- WordPressAuthenticator (~> 2.0.0)
- WordPressAuthenticator (~> 2.0.1-beta.2)
- WordPressKit (~> 4.49.0)
- WordPressShared (~> 1.15)
- WordPressUI (~> 1.12.5)
Expand Down Expand Up @@ -149,8 +149,8 @@ SPEC CHECKSUMS:
FormatterKit: 184db51bf120b633693a73624a4cede89ec51a41
GoogleSignIn: fd381840dbe7c1137aa6dc30849a5c3e070c034a
Gridicons: 4455b9f366960121430e45997e32112ae49ffe1d
GTMAppAuth: ad5c2b70b9a8689e1a04033c9369c4915bfcbe89
GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91
GTMAppAuth: 4d8f864896f3646f0c33baf38a28362f4c601e15
GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
Kingfisher: 184d4d1a8c36666e663caf8e08abe87898595c53
NSObject-SafeExpectations: ab8fe623d36b25aa1f150affa324e40a2f3c0374
Expand All @@ -163,7 +163,7 @@ SPEC CHECKSUMS:
UIDeviceIdentifier: af4e11e25a2ea670078e2bd677bb0e8144f9f063
WordPress-Aztec-iOS: 050b34d4c3adfb7c60363849049b13d60683b348
WordPress-Editor-iOS: 304098424f1051cb271546c99f906aac296b1b81
WordPressAuthenticator: 5163f732e4e529781f931f158f54b1a1545bc536
WordPressAuthenticator: 63add0854ebb326cc35d3271901527554be96b6b
WordPressKit: 96deb6ba37ea5eaec4ddcaa53eca04d653246152
WordPressShared: 5477f179c7fe03b5d574f91adda66f67d131827e
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
Expand All @@ -179,6 +179,6 @@ SPEC CHECKSUMS:
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba

PODFILE CHECKSUM: e506e3ebc3f66ec52e6682f8369507354b022d4d
PODFILE CHECKSUM: a8387fb9e7ac8f24445f236ce48d268876e326de

COCOAPODS: 1.11.2
4 changes: 4 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
- [***] Coupons: Coupons can now be created from within the app. [https://github.com/woocommerce/woocommerce-ios/pull/7239]
- [**] Order Details: All unpaid orders have a Collect Payment button, which shows a payment method selection screen. Choices are Cash, Card, and Payment Link. [https://github.com/woocommerce/woocommerce-ios/pull/7111]
- [*] Coupons: Removed the redundant animation when reloading the coupon list. [https://github.com/woocommerce/woocommerce-ios/pull/7137]
- [*] Login: Display "What is WordPress.com?" link in "Continue With WordPress.com" flow. [https://github.com/woocommerce/woocommerce-ios/pull/7213]
- [*] Login: Display the Jetpack requirement error after login is successful.
- [*] Login: Display a "New to WooCommerce?" link in the login prologue screen above the login buttons. [https://github.com/woocommerce/woocommerce-ios/pull/7261]
- [*] In-Person Payments: Publicize the Card Present Payments feature on the Payment Method screen [https://github.com/woocommerce/woocommerce-ios/pull/7225]
- [*] In-Person Payments: Add blog_id to IPP transaction description to match WCPay [https://github.com/woocommerce/woocommerce-ios/pull/7221]
- [*] Product form: after uploading an image, the product can now be saved immediately while the image is being uploaded in the background. When no images are pending upload for the saved product, the images are added to the product. Testing instructions: https://github.com/woocommerce/woocommerce-ios/pull/7196. [https://github.com/woocommerce/woocommerce-ios/pull/7254]

9.5
-----
Expand Down
8 changes: 4 additions & 4 deletions WooCommerce.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/envoy/Embassy",
"state": {
"branch": null,
"revision": "1f1fe7eeebeb06037c23a2a89d6f8f1271d625be",
"version": "4.1.2"
"revision": "065b6ce52596bd06b867cfe17fea2c56dcb53b30",
"version": "4.1.3"
}
},
{
Expand Down Expand Up @@ -78,8 +78,8 @@
"repositoryURL": "https://github.com/markiv/SwiftUI-Shimmer",
"state": {
"branch": null,
"revision": "5b2e81191e77f66e6c6ca497f11a77fe48f7f0fc",
"version": "1.0.0"
"revision": "61411771350a5a4e96666a8a202ae4b2be327a2b",
"version": "1.0.1"
}
},
{
Expand Down
48 changes: 48 additions & 0 deletions WooCommerce/Classes/Analytics/WooAnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,54 @@ extension WooAnalyticsEvent {
}
}

// MARK: - Feature Announcement Card

extension WooAnalyticsEvent {
enum FeatureCard {
/// Possible sources for the Feature Card
///
enum Source: String {
fileprivate static let key = "source"

case paymentMethods = "payment_methods"
case orderList = "order_list"
case settings
}

/// Campaigns run using the Feature Card
///
enum Campaign: String {
fileprivate static let key = "campaign"

case upsellCardReaders = "upsell_card_readers"
}

static func shown(source: Source, campaign: Campaign) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .featureCardShown,
properties: [
Source.key: source.rawValue,
Campaign.key: campaign.rawValue
])
}

static func dismissed(source: Source, campaign: Campaign) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .featureCardDismissed,
properties: [
Source.key: source.rawValue,
Campaign.key: campaign.rawValue
])
}

static func ctaTapped(source: Source, campaign: Campaign) -> WooAnalyticsEvent {
WooAnalyticsEvent(statName: .featureCardCtaTapped,
properties: [
Source.key: source.rawValue,
Campaign.key: campaign.rawValue
])
}
}
}

// MARK: - Simple Payments
//
extension WooAnalyticsEvent {
Expand Down
7 changes: 6 additions & 1 deletion WooCommerce/Classes/Analytics/WooAnalyticsStat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum WooAnalyticsStat: String {
case signedIn = "signed_in"
case logout = "account_logout"
case openedLogin = "login_accessed"
case loginNewToWooButtonTapped = "login_new_to_woo_button_tapped"
case loginFailed = "login_failed_to_login"
case loginAutoFillCredentialsFilled = "login_autofill_credentials_filled"
case loginAutoFillCredentialsUpdated = "login_autofill_credentials_updated"
Expand Down Expand Up @@ -173,7 +174,6 @@ public enum WooAnalyticsStat: String {

// MARK: Payment Gateways selection
case cardPresentPaymentGatewaySelected = "card_present_payment_gateway_selected"
case cardPresentSelectPaymentGatewayShow = "card_present_select_payment_gateway_show"

// MARK: Order View Events
//
Expand Down Expand Up @@ -556,6 +556,11 @@ public enum WooAnalyticsStat: String {
//
case featureAnnouncementShown = "feature_announcement_shown"

// MARK: Feature Card events
case featureCardShown = "feature_card_shown"
case featureCardDismissed = "feature_card_dismissed"
case featureCardCtaTapped = "feature_card_cta_tapped"

// MARK: Simple Payments events
//
case simplePaymentsFlowStarted = "simple_payments_flow_started"
Expand Down
32 changes: 27 additions & 5 deletions WooCommerce/Classes/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state.
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
// or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks.
// Games should use this method to pause the game.
// Simulate push notification for capturing snapshot.
// This is supposed to be called only by the WooCommerceScreenshots target.
if ProcessConfiguration.shouldSimulatePushNotification {
let content = UNMutableNotificationContent()
content.title = NSLocalizedString(
"You have a new order! 🎉",
comment: "Title for the mocked order notification needed for the AppStore listing screenshot"
)
content.body = NSLocalizedString(
"New order for $13.98 on Your WooCommerce Store",
comment: "Message for the mocked order notification needed for the AppStore listing screenshot. " +
"'Your WooCommerce Store' is the name of the mocked store."
)

// show this notification seconds from now
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1.5, repeats: false)

// choose a random identifier
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)

// add our notification request
UNUserNotificationCenter.current().add(request)
}
}

func applicationDidEnterBackground(_ application: UIApplication) {
Expand Down Expand Up @@ -328,6 +346,10 @@ private extension AppDelegate {
/// Trick found at: https://twitter.com/twannl/status/1232966604142653446
UIApplication.shared.currentKeyWindow?.layer.speed = 100
}

if ProcessConfiguration.shouldSimulatePushNotification {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert]) { _, _ in }
}
}

/// Starts the AB testing platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ struct AuthenticationConstants {
"Log in with your WordPress.com account email address to manage your WooCommerce stores.",
comment: "Sign in instructions on the 'log in using WordPress.com account' screen."
)

/// What is WordPress.com? link (Continue with WordPress.com)
///
static let whatIsWPComLinkTitle = NSLocalizedString(
"_What is WordPress.com?_",
comment: "Navigates to page with details about What is WordPress.com. The underscores _..._ denote underline."
)

/// Login with Jetpack instructions.
///
static let jetpackInstructions = NSLocalizedString(
Expand Down
Loading

0 comments on commit ac67f55

Please sign in to comment.