Skip to content

Commit a2ec244

Browse files
committed
TF-1164 Empty Tokens screen changes
1 parent 237dda3 commit a2ec244

File tree

17 files changed

+39
-42
lines changed

17 files changed

+39
-42
lines changed

TwoFAS/TwoFAS/DataControllers/Analytics/AppEventController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ enum AppEvent {
2727
case widgetEnabled
2828
case widgetDisabled
2929
case onboardingStart
30-
case onboardingGA
3130
case onboardingBackupFile
3231
case missingIcon(String)
3332
case missingIssuer(String)
@@ -87,7 +86,6 @@ private extension AppEvent {
8786
case .widgetEnabled: return "widget_add_service"
8887
case .widgetDisabled: return "widget_remove_service"
8988
case .onboardingStart: return "onboarding_start"
90-
case .onboardingGA: return "onboarding_GA"
9189
case .onboardingBackupFile: return "onboarding_backup_file"
9290
case .missingIcon: return "missing_icon"
9391
case .missingIssuer: return "no_image_for_issuer_on_ios"

TwoFAS/TwoFAS/Other/Assets.xcassets/GAImport/gaImport1.imageset/Contents.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
22
"images" : [
33
{
4-
"filename" : "gaImport1.pdf",
4+
"filename" : "ImportArrowLigth.pdf",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "dark"
12+
}
13+
],
14+
"filename" : "ImportArrowDark.pdf",
515
"idiom" : "universal"
616
}
717
],
Binary file not shown.

TwoFAS/TwoFAS/Other/Assets.xcassets/Introduction/IntroductionEmptyHeader.imageset/Contents.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"images" : [
33
{
4-
"filename" : "Frame.pdf",
4+
"filename" : "IntroductionEmptyHeaderLight.pdf",
55
"idiom" : "universal"
66
},
77
{
@@ -11,7 +11,7 @@
1111
"value" : "dark"
1212
}
1313
],
14-
"filename" : "Frame-1.pdf",
14+
"filename" : "IntroductionEmptyHeaderDark.pdf",
1515
"idiom" : "universal"
1616
}
1717
],

TwoFAS/TwoFAS/Root/Modules/Main/Flow/MainFlowController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,8 @@ extension MainFlowController: MainSplitFlowControllerParent {
187187
func navigationSwitchedToSettings() {
188188
viewController.presenter.handleSwitchedToSettings()
189189
}
190+
191+
func navigationSwitchedToSettingsExternalImport() {
192+
viewController.presenter.handleSwitchToExternalImport()
193+
}
190194
}

TwoFAS/TwoFAS/Root/Modules/Main/Presenter/MainPresenter.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ final class MainPresenter {
6868
view?.navigateToViewPath(.settings(option: .browserExtension))
6969
}
7070

71+
func handleSwitchToExternalImport() {
72+
view?.navigateToViewPath(.settings(option: .externalImport))
73+
}
74+
7175
func handleSwitchedToSettings() {
7276
view?.settingsTabActive()
7377
}

TwoFAS/TwoFAS/Root/Modules/MainSplit/Flow/MainSplitFlowController.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import UIKit
2222
protocol MainSplitFlowControllerParent: AnyObject {
2323
func navigationSwitchedToTokens()
2424
func navigationSwitchedToSettings()
25+
func navigationSwitchedToSettingsExternalImport()
2526
}
2627

2728
protocol MainSplitFlowControlling: AnyObject {
@@ -162,6 +163,10 @@ extension MainSplitFlowController: TokensPlainFlowControllerParent {
162163
func tokensSwitchToTokensTab() {
163164
parent?.navigationSwitchedToTokens()
164165
}
166+
167+
func tokensSwitchToSettingsExternalImport() {
168+
parent?.navigationSwitchedToSettingsExternalImport()
169+
}
165170
}
166171

167172
extension MainSplitFlowController: SettingsFlowControllerParent {

TwoFAS/TwoFAS/Root/Modules/Tokens/Flow/TokensPlainFlowController.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Common
2222

2323
protocol TokensPlainFlowControllerParent: AnyObject {
2424
func tokensSwitchToTokensTab()
25+
func tokensSwitchToSettingsExternalImport()
2526
}
2627

2728
protocol TokensPlainFlowControlling: AnyObject {
@@ -38,7 +39,6 @@ protocol TokensPlainFlowControlling: AnyObject {
3839
func toCameraNotAvailable()
3940
// MARK: Initial screen
4041
func toFileImport()
41-
func toImportGA()
4242
func toShowGallery()
4343
func toHelp()
4444
// MARK: Link actions
@@ -209,13 +209,7 @@ extension TokensPlainFlowController: TokensPlainFlowControlling {
209209
// MARK: - Initial screen
210210

211211
func toFileImport() {
212-
guard let mainSplitViewController, mainSplitViewController.presentedViewController == nil else { return }
213-
ImporterOpenFileFlowController.present(on: mainSplitViewController, parent: self, url: nil)
214-
}
215-
216-
func toImportGA() {
217-
guard let mainSplitViewController, mainSplitViewController.presentedViewController == nil else { return }
218-
GridViewGAImportNavigationFlowController.present(on: mainSplitViewController, parent: self)
212+
parent?.tokensSwitchToSettingsExternalImport()
219213
}
220214

221215
func toShowGallery() {

TwoFAS/TwoFAS/Root/Modules/Tokens/Presenter/TokensPresenter.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,11 @@ extension TokensPresenter {
173173
}
174174
}
175175

176-
func handleImport2FAS() {
177-
Log("TokensPresenter - handleImport2FAS")
176+
func handleImportExternalFile() {
177+
Log("TokensPresenter - handleImportExternalFile")
178178
flowController.toFileImport()
179179
}
180180

181-
func handleImportGA() {
182-
Log("TokensPresenter - handleImportGA")
183-
flowController.toImportGA()
184-
}
185-
186181
func handleShowHelp() {
187182
Log("TokensPresenter - handleShowHelp")
188183
flowController.toHelp()

TwoFAS/TwoFAS/Root/Modules/Tokens/View/Subviews/GridViewEmptyListScreen.swift

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import UIKit
2121

2222
final class GridViewEmptyListScreen: UIView {
2323
var pairNewService: Callback?
24-
var import2FAS: Callback?
25-
var importGA: Callback?
24+
var importFromExternalService: Callback?
2625
var help: Callback?
2726

2827
private let iconImage: UIImageView = {
@@ -50,17 +49,10 @@ final class GridViewEmptyListScreen: UIView {
5049
return button
5150
}()
5251

53-
private let import2FASButton: LoadingContentButton = {
52+
private let importButton: LoadingContentButton = {
5453
let button = LoadingContentButton()
55-
button.apply(MainContainerButtonStyling.borderOnly.value)
56-
button.update(title: T.Introduction.import2fasTitle)
57-
return button
58-
}()
59-
60-
private let importGAButton: LoadingContentButton = {
61-
let button = LoadingContentButton()
62-
button.apply(MainContainerButtonStyling.borderOnly.value)
63-
button.update(title: T.Introduction.importGoogleAuthenticator)
54+
button.apply(MainContainerButtonStyling.textOnly.value)
55+
button.update(title: T.Introduction.importExternalApp)
6456
return button
6557
}()
6658

@@ -124,7 +116,7 @@ final class GridViewEmptyListScreen: UIView {
124116

125117
mainStackView.addArrangedSubviews([headerStackView, buttonsStackView])
126118
headerStackView.addArrangedSubviews([iconImage, headerLabel])
127-
buttonsStackView.addArrangedSubviews([pairNewServiceButton, import2FASButton, importGAButton])
119+
buttonsStackView.addArrangedSubviews([pairNewServiceButton, importButton])
128120

129121
addSubview(helpButton, with: [
130122
helpButton.topAnchor.constraint(
@@ -140,8 +132,7 @@ final class GridViewEmptyListScreen: UIView {
140132
])
141133

142134
pairNewServiceButton.action = { [weak self] in self?.pairNewService?() }
143-
import2FASButton.action = { [weak self] in self?.import2FAS?() }
144-
importGAButton.action = { [weak self] in self?.importGA?() }
135+
importButton.action = { [weak self] in self?.importFromExternalService?() }
145136
helpButton.action = { [weak self] in self?.help?() }
146137
}
147138
}

TwoFAS/TwoFAS/Root/Modules/Tokens/View/TokensViewController.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,10 @@ private extension TokensViewController {
239239
}
240240

241241
func setupEmptyScreensEvents() {
242-
emptyListScreenView.pairNewService = { [weak self] in self?.presenter.handleShowCamera() }
243-
emptyListScreenView.import2FAS = { [weak self] in
242+
emptyListScreenView.pairNewService = { [weak self] in self?.presenter.handleAddService() }
243+
emptyListScreenView.importFromExternalService = { [weak self] in
244244
AppEventLog(.onboardingBackupFile)
245-
self?.presenter.handleImport2FAS()
246-
}
247-
emptyListScreenView.importGA = { [weak self] in
248-
AppEventLog(.onboardingGA)
249-
self?.presenter.handleImportGA()
245+
self?.presenter.handleImportExternalFile()
250246
}
251247
emptyListScreenView.help = { [weak self] in self?.presenter.handleShowHelp() }
252248
}

0 commit comments

Comments
 (0)