Skip to content

Commit

Permalink
Address issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Mar 11, 2024
1 parent 6f6a616 commit 941e1df
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 0 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5119,8 +5119,6 @@
isa = PBXGroup;
children = (
BDA583852B98B69C00732FDC /* Subscription */,
858479C72B8792C900D156C1 /* History */,
EE7A92852AC6DE2500832A36 /* NetworkProtection */,
4B470ED4299C484B0086EBDC /* AppTrackingProtection */,
F1CE42A71ECA0A520074A8DF /* Bookmarks */,
837774491F8E1ECE00E17A29 /* ContentBlocker */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"branch" : "jacek/report-on-toggle",
"revision" : "2f6f6db79616027b27fc0a0018136307062f71f2"
"revision" : "94328e6d65d33acea4b9cfeb5aecf2640010f7e8"
}
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"branch" : "02-22-simple_report_screen",
"revision" : "2e8139b6dec68919e0f5eaea29b10f390eb71ad8"
"revision" : "505d19b0e79997db8c1789ed5dff534293f345a6"
}
},
{
Expand Down
22 changes: 15 additions & 7 deletions DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ final class PrivacyDashboardViewController: UIViewController {
}, keyValueStoring: UserDefaults.standard)
}()

private let toggleReportEvents = EventMapping<ToggleReportEvents> { event, _, _, _ in
private let toggleReportEvents = EventMapping<ToggleReportEvents> { event, _, parameters, _ in
let domainEvent: Pixel.Event
switch event {
case .toggleReportDismiss: domainEvent = .toggleReportDismiss
case .toggleReportDoNotSend: domainEvent = .toggleReportDoNotSend
}

Pixel.fire(pixel: domainEvent)
if let parameters {
Pixel.fire(pixel: domainEvent, withAdditionalParameters: parameters)
} else {
Pixel.fire(pixel: domainEvent)
}
}

init?(coder: NSCoder,
Expand Down Expand Up @@ -244,9 +247,12 @@ extension PrivacyDashboardViewController: PrivacyDashboardToggleReportDelegate {

func privacyDashboardController(_ privacyDashboardController: PrivacyDashboardController,
didRequestSubmitToggleReportWithSource source: BrokenSiteReport.Source,
didOpenReportInfo: Bool) {
didOpenReportInfo: Bool,
toggleReportCounter: Int?) {
do {
let report = try makeBrokenSiteReport(source: source, didOpenReportInfo: didOpenReportInfo)
let report = try makeBrokenSiteReport(source: source,
didOpenReportInfo: didOpenReportInfo,
toggleReportCounter: toggleReportCounter)
try toggleProtectionsOffReporter.report(report, reportMode: .toggle)
} catch {
os_log("Failed to generate or send the broken site report: %@", type: .error, error.localizedDescription)
Expand Down Expand Up @@ -278,7 +284,8 @@ extension PrivacyDashboardViewController {
private func makeBrokenSiteReport(category: String = "",
description: String = "",
source: BrokenSiteReport.Source,
didOpenReportInfo: Bool = false) throws -> BrokenSiteReport {
didOpenReportInfo: Bool = false,
toggleReportCounter: Int? = nil) throws -> BrokenSiteReport {

guard let privacyInfo = privacyDashboardController.privacyInfo,
let breakageAdditionalInfo = breakageAdditionalInfo else {
Expand Down Expand Up @@ -317,7 +324,8 @@ extension PrivacyDashboardViewController {
model: UIDevice.current.model,
errors: errors,
httpStatusCodes: statusCodes,
didOpenReportInfo: didOpenReportInfo)
didOpenReportInfo: didOpenReportInfo,
toggleReportCounter: toggleReportCounter)
}

}
2 changes: 1 addition & 1 deletion DuckDuckGo/Theme+DesignSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension Theme {

var ddgTextTintColor: UIColor { UIColor(designSystemColor: .textPrimary) }

var privacyDashboardWebviewBackgroundColor: UIColor { UIColor(designSystemColor: .surface) }
var privacyDashboardWebviewBackgroundColor: UIColor { UIColor(designSystemColor: .background) }

var iconCellBorderColor: UIColor { UIColor(designSystemColor: .icons) }

Expand Down

0 comments on commit 941e1df

Please sign in to comment.