From 606ccf9e86f5cad3ae83132f46241357feecf152 Mon Sep 17 00:00:00 2001 From: Anh Do <18567+quanganhdo@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:21:03 -0400 Subject: [PATCH] Unified feedback form for Privacy Pro (#922) Please review the release process for BrowserServicesKit [here](https://app.asana.com/0/1200194497630846/1200837094583426). **Required**: Task/Issue URL: https://app.asana.com/0/1205922231854923/1207701941801991/f iOS PR: https://github.com/duckduckgo/iOS/pull/3172 macOS PR: https://github.com/duckduckgo/macos-browser/pull/3058 What kind of version bump will this require?: Major/Minor/Patch **Optional**: Tech Design URL: CC: **Description**: **Steps to test this PR**: 1. 1. **OS Testing**: * [ ] iOS 14 * [ ] iOS 15 * [ ] iOS 16 * [ ] macOS 10.15 * [ ] macOS 11 * [ ] macOS 12 --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) --- .../PrivacyConfig/Features/PrivacyFeature.swift | 1 + .../Subscription/SubscriptionFeatureAvailability.swift | 5 +++++ Sources/PixelKit/PixelKit+Parameters.swift | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift index c740a73dd..3eef7c05a 100644 --- a/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift +++ b/Sources/BrowserServicesKit/PrivacyConfig/Features/PrivacyFeature.swift @@ -117,6 +117,7 @@ public enum PrivacyProSubfeature: String, Equatable, PrivacySubfeature { case allowPurchaseStripe case isLaunchedOverride case isLaunchedOverrideStripe + case useUnifiedFeedback } public enum sslCertificatesSubfeature: String, PrivacySubfeature { diff --git a/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift b/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift index 1fb03ce44..6a4f04879 100644 --- a/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift +++ b/Sources/BrowserServicesKit/Subscription/SubscriptionFeatureAvailability.swift @@ -22,6 +22,7 @@ import Subscription public protocol SubscriptionFeatureAvailability { var isFeatureAvailable: Bool { get } var isSubscriptionPurchaseAllowed: Bool { get } + var usesUnifiedFeedbackForm: Bool { get } } public final class DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAvailability { @@ -52,6 +53,10 @@ public final class DefaultSubscriptionFeatureAvailability: SubscriptionFeatureAv return isPurchaseAllowed || isInternalUser } + public var usesUnifiedFeedbackForm: Bool { + privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(PrivacyProSubfeature.useUnifiedFeedback) + } + // MARK: - Conditions private var isInternalUser: Bool { diff --git a/Sources/PixelKit/PixelKit+Parameters.swift b/Sources/PixelKit/PixelKit+Parameters.swift index 8941b0e1c..2e846b32c 100644 --- a/Sources/PixelKit/PixelKit+Parameters.swift +++ b/Sources/PixelKit/PixelKit+Parameters.swift @@ -70,6 +70,14 @@ public extension PixelKit { public static let reason = "reason" public static let vpnCohort = "cohort" + + // Unified Feedback Form + public static let pproIssueDescription = "description" + public static let pproIssueSource = "source" + public static let pproIssueReportType = "reportType" + public static let pproIssueCategory = "category" + public static let pproIssueSubcategory = "subcategory" + public static let pproIssueMetadata = "customMetadata" } enum Values {