From eacdf20819f3b7e0c312a5521791c6b45e183d28 Mon Sep 17 00:00:00 2001 From: tomasstrba <57389842+tomasstrba@users.noreply.github.com> Date: Wed, 8 Jul 2020 14:43:53 +0200 Subject: [PATCH] Deprecating harmful terminology --- App/AppDelegate.swift | 2 +- App/Base.lproj/Main.storyboard | 47 +++---- .../Contents.json | 0 .../Contents.json | 0 App/MainViewController.swift | 2 +- App/TrustedSitesViewController.swift | 5 +- DuckDuckGo.xcodeproj/project.pbxproj | 16 +-- SafariAppExtension/Dashboard.storyboard | 132 +++++++++--------- .../MainDashboardViewController.swift | 24 ++-- Shared/AppLinks.swift | 2 +- StatisticsFramework/Pixel.swift | 4 +- SyncSupport/SyncRunner.swift | 16 +-- .../BlockerListManager.swift | 6 +- .../ContentBlockerRulesBuilder.swift | 9 +- .../TempUnprotectedSitesDataService.swift | 123 ++++++++++++++++ .../TempWhitelistDataService.swift | 123 ---------------- .../TrustedSitesManager.swift | 22 +-- UnitTests/BlockerListManagerTests.swift | 4 +- .../ContentBlockerRulesBuilderTests.swift | 2 +- UnitTests/SyncRunnerTests.swift | 10 +- ...edSitesDataServiceUserDefaultsTests.swift} | 8 +- UnitTests/TrustedSitesManagerTests.swift | 13 +- UnitTests/mocks.swift | 6 +- 23 files changed, 289 insertions(+), 287 deletions(-) rename App/Colours.xcassets/{WhitelistEmptyBorder.colorset => NoUnprotectedSitesBorder.colorset}/Contents.json (100%) rename App/Colours.xcassets/{WhitelistEmptyFill.colorset => NoUnprotectedSitesFill.colorset}/Contents.json (100%) create mode 100644 TrackerBlockingFramework/TempUnprotectedSitesDataService.swift delete mode 100644 TrackerBlockingFramework/TempWhitelistDataService.swift rename UnitTests/{TempWhitelistDataServiceUserDefaultsTests.swift => TempUnprotectedSitesDataServiceUserDefaultsTests.swift} (75%) diff --git a/App/AppDelegate.swift b/App/AppDelegate.swift index 638d583..58c3fea 100644 --- a/App/AppDelegate.swift +++ b/App/AppDelegate.swift @@ -51,7 +51,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { switch urls[0].absoluteString { - case AppLinks.manageWhitelist: + case AppLinks.manageUnprotectedSites: controller.selectTrustedSites(self) default: diff --git a/App/Base.lproj/Main.storyboard b/App/Base.lproj/Main.storyboard index 7c7febe..239f2b0 100644 --- a/App/Base.lproj/Main.storyboard +++ b/App/Base.lproj/Main.storyboard @@ -1,7 +1,7 @@ - + - + @@ -243,8 +243,8 @@ - - + + @@ -521,7 +521,6 @@ - @@ -539,7 +538,7 @@ - + @@ -559,7 +558,7 @@ - + @@ -664,28 +663,28 @@ - - + + - + - + - + - + - + @@ -698,7 +697,7 @@ - + - + @@ -720,8 +719,8 @@ - - + + @@ -1089,6 +1088,12 @@ + + + + + + @@ -1098,11 +1103,5 @@ - - - - - - diff --git a/App/Colours.xcassets/WhitelistEmptyBorder.colorset/Contents.json b/App/Colours.xcassets/NoUnprotectedSitesBorder.colorset/Contents.json similarity index 100% rename from App/Colours.xcassets/WhitelistEmptyBorder.colorset/Contents.json rename to App/Colours.xcassets/NoUnprotectedSitesBorder.colorset/Contents.json diff --git a/App/Colours.xcassets/WhitelistEmptyFill.colorset/Contents.json b/App/Colours.xcassets/NoUnprotectedSitesFill.colorset/Contents.json similarity index 100% rename from App/Colours.xcassets/WhitelistEmptyFill.colorset/Contents.json rename to App/Colours.xcassets/NoUnprotectedSitesFill.colorset/Contents.json diff --git a/App/MainViewController.swift b/App/MainViewController.swift index 3954638..67ef455 100644 --- a/App/MainViewController.swift +++ b/App/MainViewController.swift @@ -55,7 +55,7 @@ class MainViewController: NSViewController { } @IBAction func selectTrustedSites(_ sender: Any) { - pixel.fire(.homeWhitelistOpened) + pixel.fire(.homeUnprotectedSitesOpened) deselectAllSectionButtons() tabs.selectTabViewItem(at: 1) setSectionButtonSelected(atIndex: 1) diff --git a/App/TrustedSitesViewController.swift b/App/TrustedSitesViewController.swift index 54f8263..43261d4 100644 --- a/App/TrustedSitesViewController.swift +++ b/App/TrustedSitesViewController.swift @@ -59,7 +59,8 @@ extension TrustedSitesViewController: NSTableViewDelegate { if row == 0 { return tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("Header"), owner: nil) } else { - guard let entry = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("Entry"), owner: nil) as? WhitelistEntryView else { + guard let entry = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier("Entry"), owner: nil) as? ProtectionEntryTableCellView + else { fatalError("Failed to make 'Entry' view") } entry.textField?.stringValue = trustedSites.allDomains()[row - 1] @@ -86,7 +87,7 @@ extension TrustedSitesViewController: NSTableViewDataSource { } -class WhitelistEntryView: NSTableCellView { +class ProtectionEntryTableCellView: NSTableCellView { typealias OnDelete = () -> Void diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index e7ddfc1..91d51bf 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -86,10 +86,10 @@ 854A9F542271CB01008F2A93 /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 854A9F532271CB01008F2A93 /* AppIcon.xcassets */; }; 854A9F552271CB0A008F2A93 /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 854A9F532271CB01008F2A93 /* AppIcon.xcassets */; }; 854A9F562271CB0B008F2A93 /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 854A9F532271CB01008F2A93 /* AppIcon.xcassets */; }; - 854EFAD72333974D00A6BDC3 /* TempWhitelistDataService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFAD5233394F400A6BDC3 /* TempWhitelistDataService.swift */; }; + 854EFAD72333974D00A6BDC3 /* TempUnprotectedSitesDataService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFAD5233394F400A6BDC3 /* TempUnprotectedSitesDataService.swift */; }; 854EFADA233397D100A6BDC3 /* HTTPURLResponseExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFAD82333977A00A6BDC3 /* HTTPURLResponseExtension.swift */; }; 854EFADD23339C9500A6BDC3 /* DataCompletion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFADB23339C4A00A6BDC3 /* DataCompletion.swift */; }; - 854EFADF2333A03400A6BDC3 /* TempWhitelistDataServiceUserDefaultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFADE2333A03400A6BDC3 /* TempWhitelistDataServiceUserDefaultsTests.swift */; }; + 854EFADF2333A03400A6BDC3 /* TempUnprotectedSitesDataServiceUserDefaultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFADE2333A03400A6BDC3 /* TempUnprotectedSitesDataServiceUserDefaultsTests.swift */; }; 854EFAE12333B4AF00A6BDC3 /* TrustedSitesManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFAE02333B4AF00A6BDC3 /* TrustedSitesManagerTests.swift */; }; 854EFAE32333BB4D00A6BDC3 /* BlockerListManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854EFAE22333BB4D00A6BDC3 /* BlockerListManagerTests.swift */; }; 8551502A2375AA7900DBC528 /* SyncSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 855150282375AA7900DBC528 /* SyncSupport.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -529,10 +529,10 @@ 854A9F4622708783008F2A93 /* TrustedSitesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedSitesManager.swift; sourceTree = ""; }; 854A9F4F2271B078008F2A93 /* Shared.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Shared.xcassets; sourceTree = ""; }; 854A9F532271CB01008F2A93 /* AppIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = AppIcon.xcassets; sourceTree = ""; }; - 854EFAD5233394F400A6BDC3 /* TempWhitelistDataService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempWhitelistDataService.swift; sourceTree = ""; }; + 854EFAD5233394F400A6BDC3 /* TempUnprotectedSitesDataService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempUnprotectedSitesDataService.swift; sourceTree = ""; }; 854EFAD82333977A00A6BDC3 /* HTTPURLResponseExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPURLResponseExtension.swift; sourceTree = ""; }; 854EFADB23339C4A00A6BDC3 /* DataCompletion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataCompletion.swift; sourceTree = ""; }; - 854EFADE2333A03400A6BDC3 /* TempWhitelistDataServiceUserDefaultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempWhitelistDataServiceUserDefaultsTests.swift; sourceTree = ""; }; + 854EFADE2333A03400A6BDC3 /* TempUnprotectedSitesDataServiceUserDefaultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempUnprotectedSitesDataServiceUserDefaultsTests.swift; sourceTree = ""; }; 854EFAE02333B4AF00A6BDC3 /* TrustedSitesManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedSitesManagerTests.swift; sourceTree = ""; }; 854EFAE22333BB4D00A6BDC3 /* BlockerListManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockerListManagerTests.swift; sourceTree = ""; }; 855150262375AA7900DBC528 /* SyncSupport.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SyncSupport.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -921,7 +921,7 @@ 859F13CC227926D800EDE40A /* PageData.swift */, 859914E0227B0C1C0023C1F2 /* PrivacyPractice.swift */, 859914DE227B08EC0023C1F2 /* PrivacyPracticesManager.swift */, - 854EFAD5233394F400A6BDC3 /* TempWhitelistDataService.swift */, + 854EFAD5233394F400A6BDC3 /* TempUnprotectedSitesDataService.swift */, 850AFAFC232A4FF8004C859B /* TermsOfService.swift */, 850AFAFE232A505B004C859B /* tosdr.json */, 8587A6852278901300F622AF /* TrackerBlocking.h */, @@ -999,7 +999,7 @@ 859F13D5227A468600EDE40A /* PageDataTests.swift */, 850AFB00232A50DF004C859B /* PrivacyPracticesTests.swift */, 85C55C2C230C5CEA0030B52A /* sample-tracker-data.json */, - 854EFADE2333A03400A6BDC3 /* TempWhitelistDataServiceUserDefaultsTests.swift */, + 854EFADE2333A03400A6BDC3 /* TempUnprotectedSitesDataServiceUserDefaultsTests.swift */, 8576BB7023100FF5005DAB06 /* tracker-cases.json */, 8541840E2283A54300DD2900 /* TrackerDataManagerTests.swift */, 834E585C232F2EBF00B43C37 /* TrackerDataServiceUserDefaultsTests.swift */, @@ -1646,7 +1646,7 @@ buildActionMask = 2147483647; files = ( 85A527C9227F634600233FDF /* ContentBlockerRule.swift in Sources */, - 854EFAD72333974D00A6BDC3 /* TempWhitelistDataService.swift in Sources */, + 854EFAD72333974D00A6BDC3 /* TempUnprotectedSitesDataService.swift in Sources */, 859F13DB227A4BE100EDE40A /* PageData.swift in Sources */, 859E7CF7230EFB96007353C0 /* ContentBlockerRulesBuilder.swift in Sources */, 859914E1227B0C1C0023C1F2 /* PrivacyPractice.swift in Sources */, @@ -1682,7 +1682,7 @@ 859F13D2227A3B2C00EDE40A /* GradeTests.swift in Sources */, 855150372375AABC00DBC528 /* SyncUserDefaultsTests.swift in Sources */, 855205C42333C9DE003E5640 /* DeepDetectionTests.swift in Sources */, - 854EFADF2333A03400A6BDC3 /* TempWhitelistDataServiceUserDefaultsTests.swift in Sources */, + 854EFADF2333A03400A6BDC3 /* TempUnprotectedSitesDataServiceUserDefaultsTests.swift in Sources */, 8587A6932278901400F622AF /* TrackerDetectionTests.swift in Sources */, 8347D38E23325E13006AB02A /* FireOncePixelTests.swift in Sources */, 850AFB01232A50DF004C859B /* PrivacyPracticesTests.swift in Sources */, diff --git a/SafariAppExtension/Dashboard.storyboard b/SafariAppExtension/Dashboard.storyboard index 3839a69..1387cc9 100644 --- a/SafariAppExtension/Dashboard.storyboard +++ b/SafariAppExtension/Dashboard.storyboard @@ -1,7 +1,7 @@ - + - + @@ -25,17 +25,17 @@ - + - + - + - + @@ -46,7 +46,7 @@ - + @@ -64,9 +64,9 @@ - + - + @@ -88,10 +88,10 @@ - + - + @@ -102,7 +102,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -127,9 +127,9 @@ - + - + @@ -158,10 +158,10 @@ - + - + @@ -172,7 +172,7 @@ - + @@ -190,9 +190,9 @@ - + - + @@ -214,23 +214,23 @@ - + - + - + - + - + - - + + @@ -245,11 +245,11 @@ - + - - + + @@ -284,7 +284,7 @@ - + @@ -300,9 +300,9 @@ - + - + @@ -329,33 +329,33 @@ - + - + - + - + - + - + - + - + @@ -375,10 +375,10 @@ - + - + @@ -405,9 +405,9 @@ - + - + @@ -440,27 +440,27 @@ - + - + - + - +