Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privacy Dashboard 8.0.0: Improved breakage form #3802

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -857,16 +857,9 @@ extension Pixel {
case secureVaultL2KeyMigration
case secureVaultL2KeyPasswordMigration

// MARK: Experimental report broken site flows
// MARK: Report broken site flows
case reportBrokenSiteShown
case reportBrokenSiteBreakageCategorySelected
case reportBrokenSiteSent
case reportBrokenSiteOverallCategorySelected
case reportBrokenSiteFeedbackCategorySubmitted
case reportBrokenSiteTogglePromptNo
case reportBrokenSiteTogglePromptYes
case reportBrokenSiteSkipToggleStep
case reportBrokenSiteToggleProtectionOff

// MARK: New Tab Page baseline engagement
case addFavoriteDaily
Expand Down Expand Up @@ -1812,16 +1805,9 @@ extension Pixel.Event {
case .secureVaultL2KeyMigration: return "m_secure-vault_keystore_event_l2-key-migration"
case .secureVaultL2KeyPasswordMigration: return "m_secure-vault_keystore_event_l2-key-password-migration"

// MARK: Experimental report broken site flows
// MARK: Report broken site flows
case .reportBrokenSiteShown: return "m_report-broken-site_shown"
case .reportBrokenSiteBreakageCategorySelected: return "m_report-broken-site_breakage-category-selected"
case .reportBrokenSiteSent: return "m_report-broken-site_sent"
case .reportBrokenSiteOverallCategorySelected: return "m_report-broken-site_overall-category-selected"
case .reportBrokenSiteFeedbackCategorySubmitted: return "m_report-broken-site_feedback-category-submitted"
case .reportBrokenSiteTogglePromptNo: return "m_report-broken-site_toggle-prompt-no"
case .reportBrokenSiteTogglePromptYes: return "m_report-broken-site_toggle-prompt-yes"
case .reportBrokenSiteSkipToggleStep: return "m_report-broken-site_skip-toggle-step"
case .reportBrokenSiteToggleProtectionOff: return "m_report-broken-site_toggle-protection-off"

// MARK: New Tab Page baseline engagement
case .addFavoriteDaily: return "m_add_favorite_daily"
Expand Down
12 changes: 2 additions & 10 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,6 @@
CB5516D2286500290079B175 /* AtbServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85F21DBD21121147002631A6 /* AtbServerTests.swift */; };
CB6CC7E42CD2529000320907 /* BrokenSitePrompt in Frameworks */ = {isa = PBXBuildFile; productRef = CB6CC7E32CD2529000320907 /* BrokenSitePrompt */; };
CB6D8E982C80A9B100D0E772 /* SpecialErrorPages in Frameworks */ = {isa = PBXBuildFile; productRef = CB6D8E972C80A9B100D0E772 /* SpecialErrorPages */; };
CB825C922C071B1400BCC586 /* AlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB825C912C071B1400BCC586 /* AlertView.swift */; };
CB825C962C071C9300BCC586 /* AlertViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB825C952C071C9300BCC586 /* AlertViewPresenter.swift */; };
CB84C7BD29A3EF530088A5B8 /* AppConfigurationURLProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB24F70E29A3EB15006DCC58 /* AppConfigurationURLProvider.swift */; };
CB941A6E2B96AB08000F9E7A /* PrivacyDashboard in Frameworks */ = {isa = PBXBuildFile; productRef = CB941A6D2B96AB08000F9E7A /* PrivacyDashboard */; };
CB9B873E278C93C2001F4906 /* HomeMessage.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CB9B873D278C93C2001F4906 /* HomeMessage.xcassets */; };
Expand Down Expand Up @@ -2957,8 +2955,6 @@
CB6CE65B2AF6D4EE00119848 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB7407BC2AF6D56D0090A41C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB75AA132AF6D5AA00AED266 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB825C912C071B1400BCC586 /* AlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertView.swift; sourceTree = "<group>"; };
CB825C952C071C9300BCC586 /* AlertViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertViewPresenter.swift; sourceTree = "<group>"; };
CB84C7C029A3F0280088A5B8 /* ConfigurationStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationStore.swift; sourceTree = "<group>"; };
CB8EF4A32AF6D4C200EF158D /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB8F1F7D2AF6D5370024BF0E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3536,8 +3532,6 @@
1E162604296840D80004127F /* Triangle.swift */,
1E1626062968413B0004127F /* ViewExtension.swift */,
EE4BE0082A740BED00CD6AA8 /* ClearTextField.swift */,
CB825C912C071B1400BCC586 /* AlertView.swift */,
CB825C952C071C9300BCC586 /* AlertViewPresenter.swift */,
6FD3F80E2C3EF4F000DA5797 /* DeviceOrientationEnvironmentValue.swift */,
9FEA222D2C324ECD006B03BF /* ViewVisibility.swift */,
9F69331E2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift */,
Expand Down Expand Up @@ -8085,7 +8079,6 @@
7B059F112D0387E900371ED0 /* WidgetEducationViewController.swift in Sources */,
7B059F122D0387E900371ED0 /* WidgetEducationView.swift in Sources */,
9F9A92342C86B42B001D036D /* AppIconPicker.swift in Sources */,
CB825C962C071C9300BCC586 /* AlertViewPresenter.swift in Sources */,
1EE7C299294227EC0026C8CB /* AutoconsentSettingsViewController.swift in Sources */,
1E8AD1D527C2E22900ABA377 /* DownloadsListSectionViewModel.swift in Sources */,
EE0798C52B179936000A4F64 /* NetworkProtectionVPNCountryLabelsModel.swift in Sources */,
Expand Down Expand Up @@ -8294,7 +8287,6 @@
1DEAADEC2BA45B4500E25A97 /* SettingsAccessibilityView.swift in Sources */,
85C8E61D2B0E47380029A6BD /* BookmarksDatabaseSetup.swift in Sources */,
3132FA2C27A07A1B00DD7A12 /* FilePreview.swift in Sources */,
CB825C922C071B1400BCC586 /* AlertView.swift in Sources */,
1DDF40292BA04FCD006850D9 /* SettingsPrivacyProtectionsView.swift in Sources */,
BDE91CD82C629A910005CB74 /* UnifiedFeedbackSender.swift in Sources */,
7B4DC5C32CB2AF0700EE5CC2 /* WidgetKind.swift in Sources */,
Expand Down Expand Up @@ -11960,8 +11952,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 225.0.0;
branch = "mgurgel/improved-breakage-form-pixel";
kind = branch;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "20e6eaf0b1e423d9a270e2d460cae284c08f73d8",
"version" : "225.0.0"
"branch" : "mgurgel/improved-breakage-form-pixel",
"revision" : "f85a4199ba4251921ecff6d110527c8d5c44e329"
}
},
{
Expand Down Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"revision" : "bea4d750913ef82c10cd06e791686501c8e648e4",
"version" : "7.6.0"
"branch" : "pr-releases/pr-302",
"revision" : "05d04de7505117b32949b2007e5a56ba2d39469b"
}
},
{
Expand Down
83 changes: 0 additions & 83 deletions DuckDuckGo/AlertView.swift

This file was deleted.

90 changes: 0 additions & 90 deletions DuckDuckGo/AlertViewPresenter.swift

This file was deleted.

8 changes: 1 addition & 7 deletions DuckDuckGo/FeedbackFormViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class FeedbackFormViewController: UIViewController {
@IBOutlet weak var submitFeedbackButton: UIButton!

private var model: FormModel?
private var isFromBrokenSiteReportFlow: Bool = false

static func loadFromStoryboard() -> FeedbackFormViewController {
let storyboard = UIStoryboard(name: "Feedback", bundle: nil)
Expand Down Expand Up @@ -94,13 +93,11 @@ class FeedbackFormViewController: UIViewController {
}

func configureForNegativeSentiment(for type: FormType,
with feedbackModel: Feedback.Model,
isFromBrokenSiteReportFlow: Bool) {
with feedbackModel: Feedback.Model) {
guard let category = feedbackModel.category else {
fatalError("Feedback model is incomplete!")
}
model = .negative(feedbackModel)
self.isFromBrokenSiteReportFlow = isFromBrokenSiteReportFlow

loadViewIfNeeded()

Expand Down Expand Up @@ -165,9 +162,6 @@ class FeedbackFormViewController: UIViewController {
}
case .negative(let feedbackModel):
feedbackSender.fireNegativeSentimentPixel(with: feedbackModel)
if isFromBrokenSiteReportFlow {
feedbackSender.fireBrokenSiteReportPixel(with: feedbackModel)
}
if message.trimmingWhitespace().isEmpty == false {
feedbackSender.submitNegativeSentiment(message: message,
url: websiteTextField.text,
Expand Down
17 changes: 7 additions & 10 deletions DuckDuckGo/FeedbackNavigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,29 @@ class FeedbackNavigator {

static func navigate(to nextStep: Feedback.NextStep,
from controller: UIViewController,
with model: Feedback.Model,
isFromBrokenSiteReportFlow: Bool) {
with model: Feedback.Model) {
switch nextStep {
case .presentEntries(let entries):
navigateToFeedbackPicker(with: entries, model: model, from: controller, isFromBrokenSiteReportFlow: isFromBrokenSiteReportFlow)
navigateToFeedbackPicker(with: entries, model: model, from: controller)
case .presentForm(let formType):
navigateToFeedbackForm(of: formType, with: model, from: controller, isFromBrokenSiteReportFlow: isFromBrokenSiteReportFlow)
navigateToFeedbackForm(of: formType, with: model, from: controller)
}
}

private static func navigateToFeedbackPicker(with entries: [FeedbackEntry],
model: Feedback.Model,
from controller: UIViewController,
isFromBrokenSiteReportFlow: Bool) {
from controller: UIViewController) {
let pickerViewController = FeedbackPickerViewController.loadFromStoryboard()
pickerViewController.configureFor(entries: entries, with: model, isFromBrokenSiteReportFlow: isFromBrokenSiteReportFlow)
pickerViewController.configureFor(entries: entries, with: model)
controller.navigationController?.pushViewController(pickerViewController, animated: true)
}

private static func navigateToFeedbackForm(of type: FeedbackFormViewController.FormType,
with model: Feedback.Model,
from controller: UIViewController,
isFromBrokenSiteReportFlow: Bool) {
from controller: UIViewController) {
let formViewController = FeedbackFormViewController.loadFromStoryboard()

formViewController.configureForNegativeSentiment(for: type, with: model, isFromBrokenSiteReportFlow: isFromBrokenSiteReportFlow)
formViewController.configureForNegativeSentiment(for: type, with: model)
controller.navigationController?.pushViewController(formViewController, animated: true)
}
}
Loading
Loading