Skip to content

Commit

Permalink
Update to Privacy Pro settings footer (#3679)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1142021229838617/1209014429605257/f
Description:
Following https://app.asana.com/0/1142021229838617/1208961863805375/f:

Update the Privacy Pro settings to include link to Privacy Policy.
Restore right alignment fro buttons on subscription dialogs.
# Conflicts:
#	DuckDuckGo/Localizable.xcstrings
  • Loading branch information
miasma13 authored and samsymons committed Dec 19, 2024
1 parent c64f8f4 commit cf52650
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ public final class PreferencesSubscriptionModel: ObservableObject {
userEventHandler(.openFeedback)
}

@MainActor
func openPrivacyPolicy() {
openURLHandler(URL(string: "https://duckduckgo.com/pro/privacy-terms")!)
}

@MainActor
func refreshSubscriptionPendingState() {
if subscriptionManager.currentEnvironment.purchasePlatform == .appStore {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public struct PreferencesSubscriptionView: View {

// Help section
helpSection

// Feedback section
if subscriptionFeatureAvailability.usesUnifiedFeedbackForm, state == .subscriptionActive {
feedbackSection
}
}
.onAppear(perform: {
model.didAppear()
Expand Down Expand Up @@ -303,24 +298,21 @@ public struct PreferencesSubscriptionView: View {
private var helpSection: some View {
PreferencePaneSection {
TextMenuItemHeader(UserText.preferencesSubscriptionFooterTitle, bottomPadding: 0)
HStack(alignment: .top, spacing: 6) {
if !model.isROWLaunched {
TextMenuItemCaption(UserText.preferencesSubscriptionFooterCaption)
} else {
TextMenuItemCaption(UserText.preferencesSubscriptionHelpFooterCaption)
}
Button(UserText.viewFaqsButton) { model.openFAQ() }
if !model.isROWLaunched {
TextMenuItemCaption(UserText.preferencesSubscriptionFooterCaption)
.padding(.bottom, 8)
} else {
TextMenuItemCaption(UserText.preferencesSubscriptionHelpFooterCaption)
.padding(.bottom, 8)
}
}
}
VStack(alignment: .leading, spacing: 16) {
TextButton(UserText.viewFaqsButton, weight: .semibold) { model.openFAQ() }

@ViewBuilder
private var feedbackSection: some View {
PreferencePaneSection {
TextMenuItemHeader(UserText.preferencesSubscriptionFeedbackTitle, bottomPadding: 0)
HStack(alignment: .top, spacing: 6) {
TextMenuItemCaption(UserText.preferencesSubscriptionFeedbackCaption)
Button(UserText.preferencesSubscriptionFeedbackButton) { model.openUnifiedFeedbackForm() }
if subscriptionFeatureAvailability.usesUnifiedFeedbackForm, state == .subscriptionActive {
TextButton(UserText.preferencesSubscriptionFeedbackButton, weight: .semibold) { model.openUnifiedFeedbackForm() }
}

TextButton(UserText.preferencesPrivacyPolicyButton, weight: .semibold) { model.openPrivacyPolicy() }
}
}
}
Expand Down Expand Up @@ -495,6 +487,7 @@ private struct SubscriptionDialog<Buttons>: View where Buttons: View {
.fixMultilineScrollableText()
.foregroundColor(Color(.textPrimary))
} buttons: {
Spacer()
buttons()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,66 @@
}
}
},
"subscription.preferences.privacypolicy.button" : {
"comment" : "Title for the privacy policy button",
"extractionState" : "extracted_with_value",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Datenschutzerklärung und Nutzungsbedingungen"
}
},
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Privacy Policy and Terms of Service"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Política de privacidad y condiciones del servicio"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Politique de confidentialité et conditions d'utilisation"
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Privacy policy e Termini del servizio"
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Privacybeleid en servicevoorwaarden"
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Polityka prywatności i warunki użytkowania"
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
"value" : "Política de Privacidade e Termos de Serviço"
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
"value" : "Политика конфиденциальности и условия обслуживания"
}
}
}
},
"subscription.preferences.purchase.button" : {
"comment" : "Button to open a page where user can learn more and purchase the subscription",
"extractionState" : "extracted_with_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum UserText {
static let preferencesSubscriptionFeedbackTitle = NSLocalizedString("subscription.preferences.feedback.title", bundle: Bundle.module, value: "Send Feedback", comment: "Title for the subscription feedback section")
static let preferencesSubscriptionFeedbackCaption = NSLocalizedString("subscription.preferences.feedback.caption", bundle: Bundle.module, value: "Help improve Privacy Pro. Your feedback matters to us. Feel free to report any issues or provide general feedback.", comment: "Caption for the subscription feedback section")
static let preferencesSubscriptionFeedbackButton = NSLocalizedString("subscription.preferences.feedback.button", bundle: Bundle.module, value: "Send Feedback", comment: "Title for the subscription feedback button")
static let preferencesPrivacyPolicyButton = NSLocalizedString("subscription.preferences.privacypolicy.button", bundle: Bundle.module, value: "Privacy Policy and Terms of Service", comment: "Title for the privacy policy button")

static func preferencesSubscriptionRenewingCaption(billingPeriod: Subscription.BillingPeriod, formattedDate: String) -> String {
let localized: String
Expand Down

0 comments on commit cf52650

Please sign in to comment.