Skip to content

Commit 2cd4929

Browse files
Add CustomHelpCenterContent struct.
1 parent 676b6b2 commit 2cd4929

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import Foundation
2+
3+
/// For holding the custom help center content URL
4+
/// and analytics tracking values
5+
///
6+
struct CustomHelpCenterContent {
7+
/// Custom help center web page's URL
8+
///
9+
let helpCenterContentURL: URL
10+
11+
/// Provides a dictionary for analytics tracking
12+
///
13+
let trackingProperties: [String: String]
14+
}
15+
16+
extension CustomHelpCenterContent {
17+
/// Initializes a `CustomHelpCenterContent` instance using `Step` and `Flow` from `AuthenticatorAnalyticsTracker`
18+
///
19+
init?(step: String, flow: String) {
20+
switch step {
21+
case "start" where flow == "login_site_address":
22+
helpCenterContentURL = WooConstants.URLs.helpCenterForEnterStoreAddress.asURL()
23+
default:
24+
return nil
25+
}
26+
27+
trackingProperties = [
28+
"source_step": step,
29+
"source_flow": flow,
30+
"help_content_url": helpCenterContentURL.absoluteString
31+
]
32+
}
33+
}

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,7 @@
17561756
E1E636BB26FB467A00C9D0D7 /* Comparable+Woo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E636BA26FB467A00C9D0D7 /* Comparable+Woo.swift */; };
17571757
E1ED16E4266E10A10037B8DB /* ApplicationLogViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1ED16E3266E10A10037B8DB /* ApplicationLogViewModel.swift */; };
17581758
E1F52DC62668E03B00349D75 /* CardPresentModalBluetoothRequired.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1F52DC52668E03B00349D75 /* CardPresentModalBluetoothRequired.swift */; };
1759+
EE0EE7A628B7415200F6061E /* CustomHelpCenterContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0EE7A528B7415200F6061E /* CustomHelpCenterContent.swift */; };
17591760
EE81B1382865BB0B0032E0D4 /* ProductImagesProductIDUpdaterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE81B1372865BB0B0032E0D4 /* ProductImagesProductIDUpdaterTests.swift */; };
17601761
EEADF622281A40CB001B40F1 /* ShippingValueLocalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEADF621281A40CB001B40F1 /* ShippingValueLocalizer.swift */; };
17611762
EEADF624281A421A001B40F1 /* DefaultShippingValueLocalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEADF623281A421A001B40F1 /* DefaultShippingValueLocalizer.swift */; };
@@ -3607,6 +3608,7 @@
36073608
E1E636BA26FB467A00C9D0D7 /* Comparable+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Comparable+Woo.swift"; sourceTree = "<group>"; };
36083609
E1ED16E3266E10A10037B8DB /* ApplicationLogViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationLogViewModel.swift; sourceTree = "<group>"; };
36093610
E1F52DC52668E03B00349D75 /* CardPresentModalBluetoothRequired.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardPresentModalBluetoothRequired.swift; sourceTree = "<group>"; };
3611+
EE0EE7A528B7415200F6061E /* CustomHelpCenterContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomHelpCenterContent.swift; sourceTree = "<group>"; };
36103612
EE81B1372865BB0B0032E0D4 /* ProductImagesProductIDUpdaterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductImagesProductIDUpdaterTests.swift; sourceTree = "<group>"; };
36113613
EEADF621281A40CB001B40F1 /* ShippingValueLocalizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingValueLocalizer.swift; sourceTree = "<group>"; };
36123614
EEADF623281A421A001B40F1 /* DefaultShippingValueLocalizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultShippingValueLocalizer.swift; sourceTree = "<group>"; };
@@ -6641,6 +6643,7 @@
66416643
DE77889926FD7EF0008DFF44 /* ShippingLabelPackageItem.swift */,
66426644
DEF3300B270444060073AE29 /* ShippingLabelSelectedRate.swift */,
66436645
DECE13FF279A595200816ECD /* Coupon+Woo.swift */,
6646+
EE0EE7A528B7415200F6061E /* CustomHelpCenterContent.swift */,
66446647
);
66456648
path = Model;
66466649
sourceTree = "<group>";
@@ -9551,6 +9554,7 @@
95519554
26B3D8A0252235C50054C319 /* RefundShippingDetailsViewModel.swift in Sources */,
95529555
45DB7040261209B10064A6CF /* ItemToFulfillRow.swift in Sources */,
95539556
02564A8C246CE38E00D6DB2A /* SwappableSubviewContainerView.swift in Sources */,
9557+
EE0EE7A628B7415200F6061E /* CustomHelpCenterContent.swift in Sources */,
95549558
023453F22579DA1A00A6BB20 /* ShippingLabelPrintingInstructionsViewController.swift in Sources */,
95559559
024DF31223742B18006658FE /* AztecItalicFormatBarCommand.swift in Sources */,
95569560
02AAD54525023A8300BA1E26 /* ProductFormRemoteActionUseCase.swift in Sources */,

0 commit comments

Comments
 (0)