Skip to content

Commit

Permalink
Remove usage of isLaunchedROW and isLaunchedROWOverride flags
Browse files Browse the repository at this point in the history
  • Loading branch information
miasma13 committed Jan 8, 2025
1 parent bbb980e commit 903c778
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 31 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15341,7 +15341,7 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
branch = "michal/fix-expired-subscription-refresh-loop";
branch = "michal/international-pp-cleanup";
kind = branch;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ extension DefaultSubscriptionManager {
}

switch feature {
case .isLaunchedROW:
return featureFlagger.isFeatureOn(.isPrivacyProLaunchedROW)
case .isLaunchedROWOverride:
return featureFlagger.isFeatureOn(.isPrivacyProLaunchedROWOverride)
case .usePrivacyProUSARegionOverride:
return (featureFlagger.internalUserDecider.isInternalUser &&
subscriptionEnvironment.serviceEnvironment == .staging &&
Expand All @@ -76,15 +72,13 @@ extension DefaultSubscriptionManager {
subscriptionEndpointService: subscriptionEndpointService,
authEndpointService: authEndpointService,
subscriptionFeatureMappingCache: subscriptionFeatureMappingCache,
subscriptionEnvironment: subscriptionEnvironment,
subscriptionFeatureFlagger: subscriptionFeatureFlagger)
subscriptionEnvironment: subscriptionEnvironment)
} else {
self.init(accountManager: accountManager,
subscriptionEndpointService: subscriptionEndpointService,
authEndpointService: authEndpointService,
subscriptionFeatureMappingCache: subscriptionFeatureMappingCache,
subscriptionEnvironment: subscriptionEnvironment,
subscriptionFeatureFlagger: subscriptionFeatureFlagger)
subscriptionEnvironment: subscriptionEnvironment)
}

accountManager.delegate = self
Expand Down
13 changes: 2 additions & 11 deletions LocalPackages/FeatureFlags/Sources/FeatureFlags/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ public enum FeatureFlag: String, CaseIterable {
/// https://app.asana.com/0/72649045549333/1208241266421040/f
case htmlNewTabPage

case isPrivacyProLaunchedROW
case isPrivacyProLaunchedROWOverride

case autofillPartialFormSaves
}

extension FeatureFlag: FeatureFlagDescribing {
public var supportsLocalOverriding: Bool {
switch self {
case .htmlNewTabPage,
.isPrivacyProLaunchedROWOverride:
case .htmlNewTabPage:
return true
case .maliciousSiteProtection:
return true
Expand All @@ -71,8 +67,7 @@ extension FeatureFlag: FeatureFlagDescribing {
.unknownUsernameCategorization,
.credentialsImportPromotionForExistingUsers,
.networkProtectionUserTips,
.networkProtectionEnforceRoutes,
.isPrivacyProLaunchedROW:
.networkProtectionEnforceRoutes:
return false
}
}
Expand Down Expand Up @@ -101,10 +96,6 @@ extension FeatureFlag: FeatureFlagDescribing {
return .remoteDevelopment(.subfeature(NetworkProtectionSubfeature.enforceRoutes))
case .htmlNewTabPage:
return .disabled
case .isPrivacyProLaunchedROW:
return .remoteReleasable(.subfeature(PrivacyProSubfeature.isLaunchedROW))
case .isPrivacyProLaunchedROWOverride:
return .remoteReleasable(.subfeature(PrivacyProSubfeature.isLaunchedROWOverride))
case .autofillPartialFormSaves:
return .remoteReleasable(.subfeature(AutofillSubfeature.partialFormSaves))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public final class PreferencesSubscriptionModel: ObservableObject {
var hasEmail: Bool { !(email?.isEmpty ?? true) }

let featureFlagger: FeatureFlagger
var isROWLaunched: Bool = false

private var subscriptionPlatform: Subscription.Platform?

Expand Down Expand Up @@ -165,7 +164,6 @@ public final class PreferencesSubscriptionModel: ObservableObject {
} else {
self.subscriptionStorefrontRegion = currentStorefrontRegion()
}
isROWLaunched = featureFlagger.isFeatureOn(.isPrivacyProLaunchedROW) || featureFlagger.isFeatureOn(.isPrivacyProLaunchedROWOverride)
}

private func updateUserAuthenticatedState(_ isUserAuthenticated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,10 @@ public struct PreferencesSubscriptionView: View {
private var helpSection: some View {
PreferencePaneSection {
TextMenuItemHeader(UserText.preferencesSubscriptionFooterTitle, bottomPadding: 0)
if !model.isROWLaunched {
TextMenuItemCaption(UserText.preferencesSubscriptionFooterCaption)
.padding(.bottom, 8)
} else {
TextMenuItemCaption(UserText.preferencesSubscriptionHelpFooterCaption)
.padding(.bottom, 8)
}

TextMenuItemCaption(UserText.preferencesSubscriptionHelpFooterCaption)
.padding(.bottom, 8)

VStack(alignment: .leading, spacing: 16) {
TextButton(UserText.viewFaqsButton, weight: .semibold) { model.openFAQ() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3713,7 +3713,7 @@
},
"subscription.preferences.subscription.footer.caption" : {
"comment" : "Caption for the subscription preferences pane footer",
"extractionState" : "extracted_with_value",
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ enum UserText {

// MARK: Preferences footer
static let preferencesSubscriptionFooterTitle = NSLocalizedString("subscription.preferences.subscription.footer.title", bundle: Bundle.module, value: "Need help with Privacy Pro?", comment: "Title for the subscription preferences pane footer")
static let preferencesSubscriptionFooterCaption = NSLocalizedString("subscription.preferences.subscription.footer.caption", bundle: Bundle.module, value: "Get answers to frequently asked questions or contact Privacy Pro support from our help pages.", comment: "Caption for the subscription preferences pane footer")
static let preferencesSubscriptionHelpFooterCaption = NSLocalizedString("subscription.preferences.subscription.help.footer.caption", bundle: Bundle.module, value: "Get answers to frequently asked questions or contact Privacy Pro support from our help pages. Feature availability varies by country.", comment: "Caption for the subscription preferences pane footer")
static let viewFaqsButton = NSLocalizedString("subscription.preferences.view.faqs.button", bundle: Bundle.module, value: "FAQs and Support", comment: "Button to open page for FAQs")
static let preferencesSubscriptionFeedbackTitle = NSLocalizedString("subscription.preferences.feedback.title", bundle: Bundle.module, value: "Send Feedback", comment: "Title for the subscription feedback section")
Expand Down

0 comments on commit 903c778

Please sign in to comment.