Skip to content

Commit

Permalink
Merge branch 'develop' into sam/netp-waitlist-final-touches
Browse files Browse the repository at this point in the history
# By Graeme Arthur (3) and others
# Via GitHub
* develop:
  NetP: Remove port from server address (#2214)
  NetP: Fix list row colours (#2213)
  Reset VPN waitlist T&C (#2212)
  Report macOS active/new user for netP (#2207)
  Sabrina/sync setup update (#2198)
  new pixels for toolbars and share sheet  (#2208)
  Use design system fonts throughout NetP (#2211)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Dec 4, 2023
2 parents c537b58 + ffa0cad commit 2ce9639
Show file tree
Hide file tree
Showing 48 changed files with 1,302 additions and 1,042 deletions.
3 changes: 2 additions & 1 deletion Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,14 @@ extension Pixel {

public static func fire(pixel: Pixel.Event,
error: Error?,
includedParameters: [QueryParameters] = [.appVersion],
withAdditionalParameters params: [String: String] = [:],
onComplete: @escaping (Error?) -> Void = { _ in }) {
var newParams = params
if let error {
newParams.appendErrorPixelParams(error: error)
}
fire(pixel: pixel, withAdditionalParameters: newParams, includedParameters: [], onComplete: onComplete)
fire(pixel: pixel, withAdditionalParameters: newParams, includedParameters: includedParameters, onComplete: onComplete)
}
}

Expand Down
30 changes: 28 additions & 2 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ extension Pixel {
case browsingMenuFireproof
case browsingMenuAutofill

case addressBarShare
case addressBarSettings

case shareSheetResultSuccess
case shareSheetResultFail
case shareSheetActivityCopy
case shareSheetActivityAddBookmark
case shareSheetActivityAddFavorite
case shareSheetActivityFindInPage
case shareSheetActivityPrint
case shareSheetActivityAddToReadingList
case shareSheetActivityOther

case tabBarBackPressed
case tabBarForwardPressed
case bookmarksButtonPressed
Expand Down Expand Up @@ -570,7 +583,6 @@ extension Pixel.Event {
case .browsingMenuRemoveFromFavorites: return "mb_df"
case .browsingMenuAddToFavoritesAddFavoriteFlow: return "mb_aff"
case .browsingMenuToggleBrowsingMode: return "mb_dm"
case .browsingMenuShare: return "mb_sh"
case .browsingMenuCopy: return "mb_cp"
case .browsingMenuPrint: return "mb_pr"
case .browsingMenuSettings: return "mb_st"
Expand All @@ -580,7 +592,21 @@ extension Pixel.Event {
case .browsingMenuReportBrokenSite: return "mb_rb"
case .browsingMenuFireproof: return "mb_f"
case .browsingMenuAutofill: return "m_nav_autofill_menu_item_pressed"


case .browsingMenuShare: return "m_browsingmenu_share"

case .addressBarShare: return "m_addressbar_share"
case .addressBarSettings: return "m_addressbar_settings"
case .shareSheetResultSuccess: return "m_sharesheet_result_success"
case .shareSheetResultFail: return "m_sharesheet_result_fail"
case .shareSheetActivityCopy: return "m_sharesheet_activity_copy"
case .shareSheetActivityAddBookmark: return "m_sharesheet_activity_addbookmark"
case .shareSheetActivityAddFavorite: return "m_sharesheet_activity_addfavorite"
case .shareSheetActivityFindInPage: return "m_sharesheet_activity_findinpage"
case .shareSheetActivityPrint: return "m_sharesheet_activity_print"
case .shareSheetActivityAddToReadingList: return "m_sharesheet_activity_addtoreadinglist"
case .shareSheetActivityOther: return "m_sharesheet_activity_other"

case .tabBarBackPressed: return "mt_bk"
case .tabBarForwardPressed: return "mt_fw"
case .bookmarksButtonPressed: return "mt_bm"
Expand Down
8 changes: 6 additions & 2 deletions Core/UIViewControllerExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ extension UIViewController {
present(controller: shareController, fromButtonItem: buttonItem)
}

public func presentShareSheet(withItems activityItems: [Any], fromView sourceView: UIView, atPoint point: Point? = nil, completion: UIActivityViewController.CompletionWithItemsHandler? = nil) {
public func presentShareSheet(withItems activityItems: [Any], fromView sourceView: UIView, atPoint point: Point? = nil, overrideInterfaceStyle: UIUserInterfaceStyle? = nil, completion: UIActivityViewController.CompletionWithItemsHandler? = nil) {
let activities = buildActivities()
let shareController = UIActivityViewController(activityItems: activityItems, applicationActivities: activities)
shareController.completionWithItemsHandler = completion
shareController.overrideUserInterfaceStyle()
if let overrideInterfaceStyle {
shareController.overrideUserInterfaceStyle = overrideInterfaceStyle
} else {
shareController.overrideUserInterfaceStyle()
}
shareController.excludedActivityTypes = [.markupAsPDF]
present(controller: shareController, fromView: sourceView, atPoint: point)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
},
{
"package": "TrackerRadarKit",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit.git",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit",
"state": {
"branch": null,
"revision": "4684440d03304e7638a2c8086895367e90987463",
Expand Down
Loading

0 comments on commit 2ce9639

Please sign in to comment.