Skip to content

Commit

Permalink
Migration of data import code to BSK for re-use on iOS (#3768)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1209117022539264/f
Tech Design URL:
CC:

**Description**:
Migration of data import code from macOS to BSK as needed for iOS 18.2
Safari data importing
  • Loading branch information
amddg44 authored Jan 23, 2025
1 parent 62495e6 commit 9b65a8c
Show file tree
Hide file tree
Showing 73 changed files with 434 additions and 2,150 deletions.
78 changes: 7 additions & 71 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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" : "4232acb81dc42311832cdaab042cbcafd530f9bc",
"version" : "229.0.0"
"revision" : "123efda94c60487ecd71e6f9870902cee3c89710",
"version" : "229.1.0"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Bookmarks/Model/BookmarkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Cocoa
import Combine
import Common
import os.log
import BrowserServicesKit

protocol BookmarkManager: AnyObject {

Expand Down
13 changes: 1 addition & 12 deletions DuckDuckGo/Bookmarks/Services/BookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import Bookmarks
import Foundation
import BrowserServicesKit

enum BookmarkStoreFetchPredicateType {
case bookmarks
Expand All @@ -30,18 +31,6 @@ enum ParentFolderType: Equatable {
case parent(uuid: String)
}

struct BookmarksImportSummary: Equatable {
var successful: Int
var duplicates: Int
var failed: Int

static func += (left: inout BookmarksImportSummary, right: BookmarksImportSummary) {
left.successful += right.successful
left.duplicates += right.duplicates
left.failed += right.failed
}
}

protocol BookmarkStore {

func applyFavoritesDisplayMode(_ configuration: FavoritesDisplayMode)
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Bookmarks/Services/BookmarkStoreMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import Bookmarks
import Foundation
import BrowserServicesKit

final class BookmarkStoreMock: BookmarkStore, CustomDebugStringConvertible {

Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/Bookmarks/Services/LocalBookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Cocoa
import Persistence
import PixelKit
import os.log
import BrowserServicesKit

protocol BookmarkEntityProtocol {
var uuid: String? { get }
Expand Down
7 changes: 4 additions & 3 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import Foundation
import Navigation
import BrowserServicesKit

struct UserText {

Expand Down Expand Up @@ -1108,7 +1109,7 @@ struct UserText {

static let passwordManagerAutoPinnedPopoverText = NSLocalizedString("autofill.popover.passwords.auto-pinned.text", value: "Shortcut Added!", comment: "Text confirming the password manager has been pinned to the toolbar")

static let passwordManagerPinnedPromptPopoverText = NSLocalizedString("autofill.popover.passwords.pin-prompt.text",
static let passwordManagerPinnedPromptPopoverText = NSLocalizedString("autofill.popover.passwords.pin-prompt.text",
value: "Add passwords shortcut?",
comment: "Text prompting user to pin the password manager shortcut to the toolbar")
static let passwordManagerPinnedPromptPopoverButtonText = NSLocalizedString("autofill.popover.passwords.pin-prompt.button.text",
Expand Down Expand Up @@ -1317,7 +1318,7 @@ struct UserText {
}
}
}

// MARK: - Onboarding
enum ContextualOnboarding {
static let onboardingTryASearchTitle = NSLocalizedString("contextual.onboarding.try-a-search.title", value: "Try a search!", comment: "Title of a popover on the browser that invites the user to try a search")
Expand Down Expand Up @@ -1356,7 +1357,7 @@ struct UserText {
}

// MARK: - Privacy Pro

// Key: "subscription.menu.item"
// Comment: "Title for Subscription item in the options menu"
static let subscriptionOptionsMenuItem = "Privacy Pro"
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/DataImport/Bookmarks/BookmarkImport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

import Foundation
import BrowserServicesKit

enum BookmarkImportSource: Equatable {
case duckduckgoWebKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

import Foundation
import BrowserServicesKit

final class ChromiumBookmarksReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import AppKit
import Foundation
import GRDB
import BrowserServicesKit

final class ChromiumFaviconsReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

import Foundation
import BrowserServicesKit

final class CoreDataBookmarkImporter: BookmarkImporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import Foundation
import GRDB
import BrowserServicesKit

final class FirefoxBookmarksReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import AppKit
import Foundation
import GRDB
import BrowserServicesKit

final class FirefoxFaviconsReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

import Foundation
import BrowserServicesKit

final class BookmarkHTMLImporter: DataImporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//

import Foundation
import BrowserServicesKit

struct HTMLImportedBookmarks {
let source: BookmarkImportSource?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import Common
import Foundation
import os.log
import BrowserServicesKit

final class SafariBookmarksReader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import AppKit
import PixelKit
import BrowserServicesKit

final class SafariDataImporter: DataImporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Common
import CryptoKit
import GRDB
import os.log
import BrowserServicesKit

final class SafariFaviconsReader {

Expand Down
Loading

0 comments on commit 9b65a8c

Please sign in to comment.