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

Subscriptions Base Implementation #2259

Merged
merged 106 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
7422774
General View, Sync, Logins, Appeareance first implementation
afterxleep Dec 6, 2023
f85324f
Extract Model and State to separate classes
afterxleep Dec 7, 2023
2060dc1
Improve separation of concerns/responsibilities
afterxleep Dec 7, 2023
317ca72
Use LazyViews
afterxleep Dec 7, 2023
4a8946a
Removed unnecesary viewcontrollers
afterxleep Dec 7, 2023
a63bb5a
Application Lock
afterxleep Dec 7, 2023
1779ecc
Present legacy views from the Root Navigation Controller
afterxleep Dec 7, 2023
67436be
State Management Updates
afterxleep Dec 8, 2023
2cc396e
Email Protection and other links
afterxleep Dec 8, 2023
2102043
State initialization
afterxleep Dec 8, 2023
81d0502
Added Required Cells
afterxleep Dec 8, 2023
8a64f7b
Dismiss legacy ViewControllers and update settings
afterxleep Dec 8, 2023
38f07c0
Network Protection Status
afterxleep Dec 8, 2023
50f5731
Remaining views and cleanup
afterxleep Dec 8, 2023
dd5ae07
Fix Debug Menu
afterxleep Dec 8, 2023
3fa4ee9
Move Font settings out of viewModel
afterxleep Dec 8, 2023
18f4d2a
Fix presentation for login
afterxleep Dec 9, 2023
7f61c51
Cell design
afterxleep Dec 9, 2023
b79586e
Renamed Type
afterxleep Dec 9, 2023
99d8be2
Dismiss the view
afterxleep Dec 9, 2023
a85d5e8
UI Cleanup
afterxleep Dec 9, 2023
c84b756
Add Required Strings to UserText
afterxleep Dec 11, 2023
067d0d9
Move all strings to UserText
afterxleep Dec 11, 2023
eab0239
Merge branch 'main' into daniel/settings-swiftui
afterxleep Dec 11, 2023
897d021
Updated Strings
afterxleep Dec 11, 2023
eab5c1d
Fixed Remaining Strings
afterxleep Dec 11, 2023
a6cc6df
Localization Files
afterxleep Dec 11, 2023
7f43367
Remove SettingsViewController
afterxleep Dec 11, 2023
92e0afd
Update layout priority for Text accesory
afterxleep Dec 11, 2023
2f7c31b
Merge branch 'main' into daniel/settings-swiftui
afterxleep Dec 11, 2023
2607889
Cleanup
afterxleep Dec 11, 2023
3355e92
Revert Appicon changes
afterxleep Dec 11, 2023
f2bcb58
Revert AppIcon Changes
afterxleep Dec 11, 2023
1e7d33a
Fix linter issues (pass 1)
afterxleep Dec 11, 2023
f88de4d
Remove cyclomatic warning
afterxleep Dec 11, 2023
394e3f2
Added debug to previews
afterxleep Dec 11, 2023
d987709
Add all params to preview
afterxleep Dec 11, 2023
4cc3c7a
Comment out preview
afterxleep Dec 11, 2023
f484f89
Passes content from a variable
afterxleep Dec 11, 2023
5521fd0
Make disclosure indicator conditional
afterxleep Dec 11, 2023
ad637f4
Comment out cell
afterxleep Dec 11, 2023
970c283
Add additional debug options to the VPN debug menu (#2251)
samsymons Dec 11, 2023
9c0b336
Quality metrics for Sync (#2254)
bwaresiak Dec 11, 2023
af736fc
Release 7.101.0 (#2257)
jaceklyp Dec 11, 2023
72fe6c6
Fix VPN IPv6 connectivity (#2258)
samsymons Dec 11, 2023
b2b07cb
Run sync e2e on multiple OS versions (#2256)
loremattei Dec 12, 2023
8cbb935
Updated packages
afterxleep Dec 12, 2023
c5a5f65
Added base subscription Packages
afterxleep Nov 24, 2023
a3c991e
Added subscription local packages
afterxleep Nov 27, 2023
d09dc98
Updated constraints
afterxleep Nov 27, 2023
6253101
Moved Dependencies into a single package
afterxleep Nov 27, 2023
db15d93
Display Base Webview
afterxleep Nov 28, 2023
1a33d17
Properly configure userscripts
afterxleep Nov 28, 2023
61830e8
Confirm mesages are being properly received
afterxleep Nov 29, 2023
1762cf8
Display Webview
afterxleep Nov 29, 2023
cfa4241
Implement Settings cell in storyboard
afterxleep Nov 29, 2023
8572ce8
Fix constraints
afterxleep Nov 29, 2023
0184e8e
Only load the WebApp when we have products Available
afterxleep Nov 29, 2023
bd64542
User PurchaseManager publishers
afterxleep Nov 30, 2023
f7621dc
Base Purchase Flow
afterxleep Nov 30, 2023
c816b2b
Remove unwanted reference
afterxleep Nov 30, 2023
66755fc
Add transaction progress view
afterxleep Dec 1, 2023
5762d05
Adjust progress view colors
afterxleep Dec 1, 2023
4595d46
Debug Settings
afterxleep Dec 1, 2023
ca4b133
Update Debug Options
afterxleep Dec 4, 2023
d6be013
Update Settings view to dynamicall show PrivacyPro settings
afterxleep Dec 4, 2023
2547e9c
Inject Fake Authentication
afterxleep Dec 4, 2023
a0f60b4
Updated agent
afterxleep Dec 12, 2023
855774c
Fix conflicts
afterxleep Dec 12, 2023
f8e92ee
Merge branch 'main' into daniel/subscriptions/1.headless-webview
afterxleep Dec 12, 2023
90c0849
Added compiler conditional
afterxleep Dec 12, 2023
a981a07
Remove SettingsVC
afterxleep Dec 12, 2023
73a8afc
Updated Profiles
afterxleep Dec 12, 2023
8599afd
Add IAP Capability
afterxleep Dec 12, 2023
3e78942
Create debug build configuration
afterxleep Dec 12, 2023
53e0974
Hide netP subtitle if “”
afterxleep Dec 12, 2023
ccc4924
Updated missing string
afterxleep Dec 12, 2023
ccb0e3d
Revert Localizable change
afterxleep Dec 12, 2023
9634cff
Updated translations from Smartling
afterxleep Dec 12, 2023
45bb821
Updated missing string
afterxleep Dec 12, 2023
620920e
Revert Localizable change
afterxleep Dec 12, 2023
673d94a
Updated translations from Smartling
afterxleep Dec 12, 2023
379b6c9
Base Privacy Pro Cell in Settings
afterxleep Dec 12, 2023
ea0abd6
Display Privacy Pro Cell when available
afterxleep Dec 12, 2023
e4f9232
Update caption style
afterxleep Dec 12, 2023
b724c35
Added Debug flag
afterxleep Dec 12, 2023
224c683
Use a custom view to render Privacy Pro Cells
afterxleep Dec 12, 2023
70d0355
Section title is now Privacy Pro
afterxleep Dec 12, 2023
8ccd30f
Remove subscription flag from Debug version
afterxleep Dec 12, 2023
044c525
Merge branch 'main' into daniel/settings-swiftui
afterxleep Dec 12, 2023
140bdb6
Merge branch 'daniel/subscriptions-integration' into daniel/subscript…
afterxleep Dec 12, 2023
1735eb6
Update Subscription Code from macOS
afterxleep Dec 13, 2023
61d4bea
Use a custom agent temporarily
afterxleep Dec 13, 2023
66cc3b7
Initialize subscription environment in AppDelegate
afterxleep Dec 13, 2023
01c0fbe
Move subscription init to a method
afterxleep Dec 13, 2023
264766d
Removed non-required scripts
afterxleep Dec 13, 2023
d0e199d
Noop change
afterxleep Jan 5, 2024
c103960
NOOP
afterxleep Jan 5, 2024
5b41f0d
Merge branch 'daniel/settings-swiftui' into daniel/subscriptions/1.he…
afterxleep Jan 5, 2024
10fa11d
We are now using “Passwords” for login items
afterxleep Jan 5, 2024
06ffe72
Merged Feedback from Settings Swift UI PR
afterxleep Jan 8, 2024
6a34923
Apply Grouped UI Style for settings
afterxleep Jan 8, 2024
874e2ca
Update locig to display netP
afterxleep Jan 9, 2024
b6f4cfd
Merge branch 'main' into daniel/subscriptions/1.headless-webview
afterxleep Jan 9, 2024
d4b11a4
Move properties to Settings State
afterxleep Jan 9, 2024
b31a1fd
Fix lint issues
afterxleep Jan 10, 2024
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
3 changes: 2 additions & 1 deletion Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ public enum FeatureFlag: String {
case networkProtection
case networkProtectionWaitlistAccess
case networkProtectionWaitlistActive
case privacyPro
}

extension FeatureFlag: FeatureFlagSourceProviding {
public var source: FeatureFlagSource {
switch self {
case .debugMenu, .appTrackingProtection:
case .debugMenu, .appTrackingProtection, .privacyPro:
return .internalOnly
case .sync:
return .remoteReleasable(.subfeature(SyncSubfeature.level0ShowSync))
Expand Down
726 changes: 694 additions & 32 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
buildConfiguration = "Alpha Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Alpha Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand All @@ -51,7 +51,7 @@
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Alpha"
buildConfiguration = "Alpha Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
Expand All @@ -68,10 +68,10 @@
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Alpha">
buildConfiguration = "Alpha Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Alpha"
buildConfiguration = "Alpha Debug"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
90 changes: 0 additions & 90 deletions DuckDuckGo/AddressBarPositionSettingsViewController.swift

This file was deleted.

10 changes: 10 additions & 0 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
widgetRefreshModel.beginObservingVPNStatus()
NetworkProtectionAccessController().refreshNetworkProtectionAccess()
#endif

#if SUBSCRIPTION
setupSubscriptionsEnvironment()
#endif

return true
}
Expand Down Expand Up @@ -351,6 +355,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
})
}

#if SUBSCRIPTION
private func setupSubscriptionsEnvironment() {
SubscriptionPurchaseEnvironment.current = .appStore
}
#endif

func applicationDidBecomeActive(_ application: UIApplication) {
guard !testing else { return }

Expand Down
22 changes: 22 additions & 0 deletions DuckDuckGo/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@

import Bookmarks

enum AddressBarPosition: String, CaseIterable, CustomStringConvertible {
case top
case bottom

var isBottom: Bool {
self == .bottom
}

var description: String {
return descriptionText
}

var descriptionText: String {
switch self {
case .top:
return UserText.addressBarPositionTop
case .bottom:
return UserText.addressBarPositionBottom
}
}
}

protocol AppSettings: AnyObject {
var autocomplete: Bool { get set }
var currentThemeName: ThemeName { get set }
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/AutoClearSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import UIKit
import MessageUI
import Core
import SwiftUI

class AutoClearSettingsViewController: UITableViewController {

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/AutoconsentSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class AutoconsentSettingsViewController: UITableViewController {

autoconsentToggle.isOn = appSettings.autoconsentEnabled

let fontSize = SettingsViewController.fontSizeForHeaderView
let fontSize = FontSettings.fontSizeForHeaderView
let text = NSAttributedString(string: UserText.autoconsentInfoText, attributes: [
NSAttributedString.Key.font: UIFont.systemFont(ofSize: fontSize)
])
Expand Down
16 changes: 14 additions & 2 deletions DuckDuckGo/AutofillLoginSettingsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import BrowserServicesKit
import Common
import DDGSync
import DesignResourcesKit
import SwiftUI

// swiftlint:disable file_length type_body_length

protocol AutofillLoginSettingsListViewControllerDelegate: AnyObject {
func autofillLoginSettingsListViewControllerDidFinish(_ controller: AutofillLoginSettingsListViewController)
}
Expand Down Expand Up @@ -102,14 +102,17 @@ final class AutofillLoginSettingsListViewController: UIViewController {
multiplier: 1,
constant: (tableView.frame.height / 2))
}()

var selectedAccount: SecureVaultModels.WebsiteAccount?

init(appSettings: AppSettings, currentTabUrl: URL? = nil, syncService: DDGSyncing, syncDataProviders: SyncDataProviders) {
init(appSettings: AppSettings, currentTabUrl: URL? = nil, syncService: DDGSyncing, syncDataProviders: SyncDataProviders, selectedAccount: SecureVaultModels.WebsiteAccount?) {
let secureVault = try? AutofillSecureVaultFactory.makeVault(errorReporter: SecureVaultErrorReporter.shared)
if secureVault == nil {
os_log("Failed to make vault")
}
self.viewModel = AutofillLoginListViewModel(appSettings: appSettings, tld: tld, secureVault: secureVault, currentTabUrl: currentTabUrl)
self.syncService = syncService
self.selectedAccount = selectedAccount
super.init(nibName: nil, bundle: nil)

syncUpdatesCancellable = syncDataProviders.credentialsAdapter.syncDidCompletePublisher
Expand Down Expand Up @@ -148,6 +151,7 @@ final class AutofillLoginSettingsListViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
authenticate()

}

override func viewWillDisappear(_ animated: Bool) {
Expand Down Expand Up @@ -290,10 +294,18 @@ final class AutofillLoginSettingsListViewController: UIViewController {
self.delegate?.autofillLoginSettingsListViewControllerDidFinish(self)
}
} else {
showSelectedAccountIfRequired()
self.syncService.scheduler.requestSyncImmediately()
}
}
}

private func showSelectedAccountIfRequired() {
if let account = selectedAccount {
showAccountDetails(account)
selectedAccount = nil
}
}

private func presentDeleteConfirmation(for title: String, domain: String) {
let message = title.isEmpty ? UserText.autofillLoginListLoginDeletedToastMessageNoTitle
Expand Down
Loading
Loading