Skip to content

Commit

Permalink
Add NetP feedback form (#2343)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/72649045549333/1206151925871430/f

Description:

Implements the native feedback form for NetP and collect necessary metadata.
  • Loading branch information
quanganhdo authored Jan 22, 2024
1 parent f309487 commit 5533bb1
Show file tree
Hide file tree
Showing 16 changed files with 833 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ extension Pixel {

case networkProtectionEnabledOnSearch

case networkProtectionBreakageReport

case networkProtectionRekeyCompleted

case networkProtectionTunnelConfigurationNoServerRegistrationInfo
Expand Down Expand Up @@ -780,6 +782,7 @@ extension Pixel.Event {
case .networkProtectionLatencyError: return "m_netp_ev_latency_error_d"
case .networkProtectionRekeyCompleted: return "m_netp_rekey_completed"
case .networkProtectionEnabledOnSearch: return "m_netp_ev_enabled_on_search"
case .networkProtectionBreakageReport: return "m_vpn_breakage_report"
case .networkProtectionTunnelConfigurationNoServerRegistrationInfo: return "m_netp_tunnel_config_error_no_server_registration_info"
case .networkProtectionTunnelConfigurationCouldNotSelectClosestServer: return "m_netp_tunnel_config_error_could_not_select_closest_server"
case .networkProtectionTunnelConfigurationCouldNotGetPeerPublicKey: return "m_netp_tunnel_config_error_could_not_get_peer_public_key"
Expand Down
30 changes: 29 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,11 @@
B6BA95C528894A28004ABA20 /* BrowsingMenuViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B6BA95C428894A28004ABA20 /* BrowsingMenuViewController.storyboard */; };
B6BA95E828924730004ABA20 /* JSAlertController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B6BA95E728924730004ABA20 /* JSAlertController.storyboard */; };
B6CB93E5286445AB0090FEB4 /* Base64DownloadSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6CB93E4286445AB0090FEB4 /* Base64DownloadSession.swift */; };
BD862E032B30DA170073E2EE /* VPNFeedbackFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD862E022B30DA170073E2EE /* VPNFeedbackFormViewModel.swift */; };
BD862E052B30DB250073E2EE /* VPNFeedbackCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD862E042B30DB250073E2EE /* VPNFeedbackCategory.swift */; };
BD862E072B30F5E30073E2EE /* VPNFeedbackSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD862E062B30F5E30073E2EE /* VPNFeedbackSender.swift */; };
BD862E092B30F63E0073E2EE /* VPNMetadataCollector.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD862E082B30F63E0073E2EE /* VPNMetadataCollector.swift */; };
BD862E0B2B30F9300073E2EE /* VPNFeedbackFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD862E0A2B30F9300073E2EE /* VPNFeedbackFormView.swift */; };
BDC234F72B27F51100D3C798 /* UniquePixel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC234F62B27F51100D3C798 /* UniquePixel.swift */; };
C10CB5F32A1A5BDF0048E503 /* AutofillViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = C10CB5F22A1A5BDF0048E503 /* AutofillViews.swift */; };
C111B26927F579EF006558B1 /* BookmarkOrFolderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C111B26827F579EF006558B1 /* BookmarkOrFolderTests.swift */; };
Expand Down Expand Up @@ -2324,6 +2329,11 @@
B6BA95C428894A28004ABA20 /* BrowsingMenuViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = BrowsingMenuViewController.storyboard; sourceTree = "<group>"; };
B6BA95E728924730004ABA20 /* JSAlertController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = JSAlertController.storyboard; sourceTree = "<group>"; };
B6CB93E4286445AB0090FEB4 /* Base64DownloadSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base64DownloadSession.swift; sourceTree = "<group>"; };
BD862E022B30DA170073E2EE /* VPNFeedbackFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNFeedbackFormViewModel.swift; sourceTree = "<group>"; };
BD862E042B30DB250073E2EE /* VPNFeedbackCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNFeedbackCategory.swift; sourceTree = "<group>"; };
BD862E062B30F5E30073E2EE /* VPNFeedbackSender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNFeedbackSender.swift; sourceTree = "<group>"; };
BD862E082B30F63E0073E2EE /* VPNMetadataCollector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNMetadataCollector.swift; sourceTree = "<group>"; };
BD862E0A2B30F9300073E2EE /* VPNFeedbackFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNFeedbackFormView.swift; sourceTree = "<group>"; };
BDC234F62B27F51100D3C798 /* UniquePixel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UniquePixel.swift; sourceTree = "<group>"; };
C10CB5F22A1A5BDF0048E503 /* AutofillViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillViews.swift; sourceTree = "<group>"; };
C111B26827F579EF006558B1 /* BookmarkOrFolderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkOrFolderTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4372,6 +4382,18 @@
name = ContentBlocking;
sourceTree = "<group>";
};
BD862E012B30D9FB0073E2EE /* Feedback */ = {
isa = PBXGroup;
children = (
BD862E022B30DA170073E2EE /* VPNFeedbackFormViewModel.swift */,
BD862E042B30DB250073E2EE /* VPNFeedbackCategory.swift */,
BD862E062B30F5E30073E2EE /* VPNFeedbackSender.swift */,
BD862E082B30F63E0073E2EE /* VPNMetadataCollector.swift */,
BD862E0A2B30F9300073E2EE /* VPNFeedbackFormView.swift */,
);
path = Feedback;
sourceTree = "<group>";
};
C14882D627F2010700D59F0C /* ImportExport */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -4790,6 +4812,7 @@
EE0153E22A6FE031002A8B26 /* Root */,
EE0153DF2A6EABAF002A8B26 /* Helpers */,
EEFD562D2A65B68B00DAEC48 /* Invite */,
BD862E012B30D9FB0073E2EE /* Feedback */,
EECD94B32A28B96C0085C66E /* Status */,
4B5C46282AF2A6DB002A4432 /* Intents */,
4B274F5E2AFEAEB3003F0745 /* Widget */,
Expand Down Expand Up @@ -6597,6 +6620,7 @@
CB258D1329A4F24E00DEBA24 /* ConfigurationStore.swift in Sources */,
85058370219F424500ED4EDB /* SearchBarExtension.swift in Sources */,
310D09212799FD1A00DC0060 /* MIMEType.swift in Sources */,
BD862E032B30DA170073E2EE /* VPNFeedbackFormViewModel.swift in Sources */,
F4147354283BF834004AA7A5 /* AutofillContentScopeFeatureToggles.swift in Sources */,
986DA94A24884B18004A7E39 /* WebViewTransition.swift in Sources */,
31B524572715BB23002225AB /* WebJSAlert.swift in Sources */,
Expand Down Expand Up @@ -6682,6 +6706,7 @@
D6E83C602B22B3C9006C8AFB /* SettingsState.swift in Sources */,
D6E83C482B20C812006C8AFB /* SettingsHostingController.swift in Sources */,
F46FEC5727987A5F0061D9DF /* KeychainItemsDebugViewController.swift in Sources */,
BD862E0B2B30F9300073E2EE /* VPNFeedbackFormView.swift in Sources */,
02341FA62A4379CC008A1531 /* OnboardingStepViewModel.swift in Sources */,
850365F323DE087800D0F787 /* UIImageViewExtension.swift in Sources */,
373608922ABB430D00629E7F /* FavoritesDisplayMode+UserDefaults.swift in Sources */,
Expand Down Expand Up @@ -6714,6 +6739,7 @@
EEC02C142B0519DE0045CE11 /* NetworkProtectionVPNLocationViewModel.swift in Sources */,
F13B4BC01F180D8A00814661 /* TabsModel.swift in Sources */,
02025B0C29884D2C00E694E7 /* AppTrackerData.swift in Sources */,
BD862E052B30DB250073E2EE /* VPNFeedbackCategory.swift in Sources */,
85AE6690209724120014CF04 /* NotificationView.swift in Sources */,
1EA51376286596A000493C6A /* PrivacyIconLogic.swift in Sources */,
980891A92238504B00313A70 /* UILabelExtension.swift in Sources */,
Expand Down Expand Up @@ -6790,6 +6816,7 @@
B652DF13287C373A00C12A9C /* ScriptSourceProviding.swift in Sources */,
854A012B2A54412600FCC628 /* ActivityViewController.swift in Sources */,
F1CA3C391F045885005FADB3 /* PrivacyUserDefaults.swift in Sources */,
BD862E072B30F5E30073E2EE /* VPNFeedbackSender.swift in Sources */,
AA4D6A6A23DB87B1007E8790 /* AppIconManager.swift in Sources */,
8563A03C1F9288D600F04442 /* BrowserChromeManager.swift in Sources */,
980891A32237146B00313A70 /* Feedback.swift in Sources */,
Expand Down Expand Up @@ -6865,6 +6892,7 @@
1E7A711C2934EEBC00B7EA19 /* OmniBarNotification.swift in Sources */,
02EC02C429AFA33000557F1A /* AppTPBreakageFormView.swift in Sources */,
F15D43201E706CC500BF2CDC /* AutocompleteViewController.swift in Sources */,
BD862E092B30F63E0073E2EE /* VPNMetadataCollector.swift in Sources */,
98728E822417E3300033960E /* BrokenSiteInfo.swift in Sources */,
D6E83C682B23B6A3006C8AFB /* FontSettings.swift in Sources */,
31EF52E1281B3BDC0034796E /* AutofillLoginListItemViewModel.swift in Sources */,
Expand Down Expand Up @@ -9934,7 +9962,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 101.1.5;
version = 101.2.0;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "1d3a891fa58182d10b7bfa3a9b29cec51909c3c7",
"version" : "101.1.5"
"revision" : "4b9b5339f21647efca6aef66b8ed400a7cfa804f",
"version" : "101.2.0"
}
},
{
Expand Down Expand Up @@ -156,7 +156,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"state" : {
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
Expand Down
42 changes: 42 additions & 0 deletions DuckDuckGo/Feedback/VPNFeedbackCategory.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// VPNFeedbackCategory.swift
// DuckDuckGo
//
// Copyright © 2023 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

enum VPNFeedbackCategory: String, CaseIterable {
case unableToInstall
case failsToConnect
case tooSlow
case issueWithAppOrWebsite
case cantConnectToLocalDevice
case appCrashesOrFreezes
case featureRequest
case somethingElse

var displayName: String {
switch self {
case .unableToInstall: return UserText.vpnFeedbackFormCategoryUnableToInstall
case .failsToConnect: return UserText.vpnFeedbackFormCategoryFailsToConnect
case .tooSlow: return UserText.vpnFeedbackFormCategoryTooSlow
case .issueWithAppOrWebsite: return UserText.vpnFeedbackFormCategoryIssuesWithApps
case .cantConnectToLocalDevice: return UserText.vpnFeedbackFormCategoryLocalDeviceConnectivity
case .appCrashesOrFreezes: return UserText.vpnFeedbackFormCategoryBrowserCrashOrFreeze
case .featureRequest: return UserText.vpnFeedbackFormCategoryFeatureRequest
case .somethingElse: return UserText.vpnFeedbackFormCategoryOther
}
}
}
Loading

0 comments on commit 5533bb1

Please sign in to comment.