Skip to content

Commit

Permalink
Debug option added to reset survey prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
amddg44 committed May 8, 2024
1 parent c1f5709 commit fb52753
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
4 changes: 4 additions & 0 deletions DuckDuckGo/AutofillDebugViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AutofillDebugViewController: UITableViewController {
case toggleAutofillDebugScript = 201
case resetEmailProtectionInContextSignUp = 202
case resetDaysSinceInstalledTo0 = 203
case toggleAutofillSurvey = 204
}

let defaults = AppUserDefaults()
Expand All @@ -45,6 +46,9 @@ class AutofillDebugViewController: UITableViewController {
defaults.autofillDebugScriptEnabled.toggle()
cell.accessoryType = defaults.autofillDebugScriptEnabled ? .checkmark : .none
NotificationCenter.default.post(Notification(name: AppUserDefaults.Notifications.autofillDebugScriptToggled))
} else if cell.tag == Row.toggleAutofillSurvey.rawValue {
defaults.autofillSurveyEnabled = true
ActionMessageView.present(message: "Passwords Survey enabled")
} else if cell.tag == Row.resetEmailProtectionInContextSignUp.rawValue {
EmailManager().resetEmailProtectionInContextPrompt()
tableView.deselectRow(at: indexPath, animated: true)
Expand Down
27 changes: 18 additions & 9 deletions DuckDuckGo/Debug.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,21 @@
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Autofill Debug Script" secondaryText=""/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="204" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="7kA-xL-gNM">
<rect key="frame" x="0.0" y="94.5" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7kA-xL-gNM" id="IQg-h7-bT2">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Reset Passwords Survey Prompt" secondaryText=""/>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Email Protection" id="iDX-JX-E1u">
<cells>
<tableViewCell clipsSubviews="YES" tag="202" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="tsg-0B-svT">
<rect key="frame" x="0.0" y="172.5" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="217" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="tsg-0B-svT" id="waU-fZ-uIn">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
Expand All @@ -387,7 +396,7 @@
<listContentConfiguration key="contentConfiguration" text="Reset Email Protection InContext Signup Prompt"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="203" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="zG5-R0-kxQ">
<rect key="frame" x="0.0" y="217" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="261.5" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="zG5-R0-kxQ" id="4zQ-oz-2TS">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
Expand Down Expand Up @@ -907,17 +916,17 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ConfigurationURLTableViewCell" id="i6Y-Di-PX3" customClass="ConfigurationURLTableViewCell" customModule="DuckDuckGo" customModuleProvider="target">
<rect key="frame" x="0.0" y="50" width="414" height="82"/>
<rect key="frame" x="0.0" y="50" width="414" height="82.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="i6Y-Di-PX3" id="qn4-gq-5fa">
<rect key="frame" x="0.0" y="0.0" width="414" height="82"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="82.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="pKD-Xm-Eu1">
<rect key="frame" x="20" y="11" width="374" height="60"/>
<rect key="frame" x="20" y="11" width="374" height="60.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="j3A-OZ-DWy">
<rect key="frame" x="0.0" y="0.0" width="44" height="60"/>
<rect key="frame" x="0.0" y="0.0" width="44" height="60.5"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gKw-J7-XIW">
<rect key="frame" x="0.0" y="0.0" width="44" height="20"/>
Expand All @@ -927,22 +936,22 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UrI-B0-rWf">
<rect key="frame" x="0.0" y="20" width="44" height="19.5"/>
<rect key="frame" x="0.0" y="20" width="44" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="accent"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6RK-ug-mZa">
<rect key="frame" x="0.0" y="40" width="44" height="20"/>
<rect key="frame" x="0.0" y="40.5" width="44" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nkj-yK-cgm">
<rect key="frame" x="350" y="0.0" width="24" height="60"/>
<rect key="frame" x="350" y="0.0" width="24" height="60.5"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="Reload-24"/>
</button>
Expand Down

0 comments on commit fb52753

Please sign in to comment.