@@ -82,14 +82,10 @@ final class HubMenuViewModel: ObservableObject {
8282 @Published private( set) var hasGoogleAdsCampaigns = false
8383 @Published private var currentSite : Yosemite . Site ?
8484
85- /// Whether the app is in POS mode for an eligible site.
86- @Published var showsPOS : Bool = false
87-
8885 private let stores : StoresManager
8986 private let featureFlagService : FeatureFlagService
9087 private let generalAppSettings : GeneralAppSettingsStorage
9188 private let cardPresentPaymentsOnboarding : CardPresentPaymentsOnboardingUseCaseProtocol
92- private let posEligibilityChecker : POSEligibilityCheckerProtocol
9389 private let inboxEligibilityChecker : InboxEligibilityChecker
9490 private let blazeEligibilityChecker : BlazeEligibilityCheckerProtocol
9591 private let googleAdsEligibilityChecker : GoogleAdsEligibilityChecker
@@ -177,9 +173,6 @@ final class HubMenuViewModel: ObservableObject {
177173 self . blazeEligibilityChecker = blazeEligibilityChecker
178174 self . googleAdsEligibilityChecker = googleAdsEligibilityChecker
179175 self . cardPresentPaymentsOnboarding = CardPresentPaymentsOnboardingUseCase ( )
180- self . posEligibilityChecker = POSEligibilityChecker ( siteSettings: ServiceLocator . selectedSiteSettings,
181- currencySettings: ServiceLocator . currencySettings,
182- featureFlagService: featureFlagService)
183176 self . analytics = analytics
184177 observeSiteForUIUpdates ( )
185178 observePlanName ( )
@@ -210,7 +203,6 @@ final class HubMenuViewModel: ObservableObject {
210203 /// Resets the menu elements displayed on the menu.
211204 ///
212205 func setupMenuElements( ) {
213- setupPOSElement ( )
214206 setupSettingsElements ( )
215207 setupGeneralElements ( )
216208 }
@@ -250,14 +242,7 @@ final class HubMenuViewModel: ObservableObject {
250242 }
251243
252244 func trackMenuItemTapEvent( menu: HubMenuItem ) {
253- let eventProperties : [ AnyHashable : Any ] = {
254- var properties : [ AnyHashable : Any ] = [ AnalyticsKeys . trackingOption: menu. trackingOption]
255- if menu. id == HubMenuViewModel . PointOfSaleEntryPoint. id {
256- properties [ AnalyticsKeys . paymentsOnboardingState] = cardPresentPaymentsOnboarding. state. reasonForAnalytics
257- }
258- return properties
259- } ( )
260- analytics. track ( . hubMenuOptionTapped, withProperties: eventProperties)
245+ analytics. track ( . hubMenuOptionTapped, withProperties: [ AnalyticsKeys . trackingOption: menu. trackingOption] )
261246 }
262247
263248 func createGoogleAdsCampaignCoordinator( with navigationController: UINavigationController ) -> GoogleAdsCampaignCoordinator {
@@ -313,21 +298,6 @@ private extension HubMenuViewModel {
313298 }
314299 }
315300
316- func setupPOSElement( ) {
317- guard featureFlagService. isFeatureFlagEnabled ( . pointOfSaleAsATabi1) == false else {
318- return
319- }
320-
321- posEligibilityChecker. isEligible. map { isEligibleForPOS in
322- if isEligibleForPOS {
323- return PointOfSaleEntryPoint ( )
324- } else {
325- return nil
326- }
327- }
328- . assign ( to: & $posElement)
329- }
330-
331301 func setupSettingsElements( ) {
332302 settingsElements = [ Settings ( ) ]
333303
@@ -694,20 +664,6 @@ extension HubMenuViewModel {
694664 let navigationDestination : HubMenuNavigationDestination ? = . reviews
695665 }
696666
697- struct PointOfSaleEntryPoint : HubMenuItem {
698- static var id = " pointOfSale "
699-
700- let title : String = Localization . pos
701- let description : String = Localization . posDescription
702- let icon : UIImage = . pointOfSaleImage
703- let iconColor : UIColor = . withColorStudio( . green, shade: . shade30)
704- let accessibilityIdentifier : String = " menu-pointOfSale "
705- let trackingOption : String = " pointOfSale "
706- let iconBadge : HubMenuBadgeType ? = nil
707- // POS is presented with its own navigation stack as nested navigation stack is not supported.
708- let navigationDestination : HubMenuNavigationDestination ? = nil
709- }
710-
711667 struct Subscriptions : HubMenuItem {
712668 static var id = " subscriptions "
713669
@@ -785,15 +741,6 @@ extension HubMenuViewModel {
785741 " My Store " ,
786742 comment: " Title of the hub menu view in case there is no title for the store " )
787743
788- static let pos = NSLocalizedString (
789- " Point of Sale Mode " ,
790- comment: " Title of the POS menu in the hub menu " )
791-
792- static let posDescription = NSLocalizedString (
793- " hubMenu.pointOfSale.description " ,
794- value: " Accept payments at your physical store " ,
795- comment: " Description of the POS menu in the hub menu " )
796-
797744 static let woocommerceAdmin = NSLocalizedString (
798745 " WooCommerce Admin " ,
799746 comment: " Title of one of the hub menu options " )
@@ -855,7 +802,6 @@ extension HubMenuViewModel {
855802
856803 enum AnalyticsKeys {
857804 static let trackingOption = " option "
858- static let paymentsOnboardingState = " payments_onboarding_state "
859805 }
860806}
861807
0 commit comments