From 3e61bc47274cfc4b6fc4d71ae9f0d35aa57f9e55 Mon Sep 17 00:00:00 2001 From: Anton Kharchevskyi Date: Mon, 16 Mar 2020 19:53:26 +0100 Subject: [PATCH 1/3] Temporary disable search contacts --- .../Compose/ComposeViewController.swift | 21 +++++++++++-------- .../Setup/SetupViewController.swift | 2 +- .../Services/Google/GoogleService.swift | 7 ++++++- FlowCryptUITests/SignInTest.swift | 1 + 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/FlowCrypt/Controllers/Compose/ComposeViewController.swift b/FlowCrypt/Controllers/Compose/ComposeViewController.swift index bc6818c06..0d7691d0a 100644 --- a/FlowCrypt/Controllers/Compose/ComposeViewController.swift +++ b/FlowCrypt/Controllers/Compose/ComposeViewController.swift @@ -114,7 +114,9 @@ final class ComposeViewController: ASViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - showScopeAlertIfNeeded() + + // temporary disable search contacts - https://github.com/FlowCrypt/flowcrypt-ios/issues/217 + // showScopeAlertIfNeeded() } deinit { @@ -589,14 +591,15 @@ extension ComposeViewController { } private func handleEditingChanged(with text: String?) { - guard let text = text, text.isNotEmpty else { - updateState(with: .main) - return - } - - searchThrottler.throttle { [weak self] in - self?.searchEmail(with: text) - } +// temporary disable search contacts - https://github.com/FlowCrypt/flowcrypt-ios/issues/217 +// guard let text = text, text.isNotEmpty else { +// updateState(with: .main) +// return +// } +// +// searchThrottler.throttle { [weak self] in +// self?.searchEmail(with: text) +// } } private func handleDidBeginEditing() { diff --git a/FlowCrypt/Controllers/Setup/SetupViewController.swift b/FlowCrypt/Controllers/Setup/SetupViewController.swift index 7da971425..1cdebf6f0 100644 --- a/FlowCrypt/Controllers/Setup/SetupViewController.swift +++ b/FlowCrypt/Controllers/Setup/SetupViewController.swift @@ -157,7 +157,7 @@ extension SetupViewController { private func renderNoBackupsFoundOptions(_ msg: String, error: Error? = nil) { let errStr = error != nil ? "\n\n\(error!)" : "" let alert = UIAlertController(title: "Notice", message: msg + errStr, preferredStyle: .alert) - if error == nil { // no backous found, not an error: show option to create a key or import key + if error == nil { // no backups found, not an error: show option to create a key or import key alert.addAction(UIAlertAction(title: "Import existing Private Key", style: .default) { [weak self] _ in self?.handleImportKey() }) diff --git a/FlowCrypt/Functionality/Services/Google/GoogleService.swift b/FlowCrypt/Functionality/Services/Google/GoogleService.swift index 3882bf5e6..eeccd5a5b 100644 --- a/FlowCrypt/Functionality/Services/Google/GoogleService.swift +++ b/FlowCrypt/Functionality/Services/Google/GoogleService.swift @@ -60,7 +60,12 @@ extension GoogleService: GoogleServiceType { func setUpAuthentication() throws { guard let googleSignIn = instance else { throw AppErr.general("Unexpected nil GIDSignIn") } googleSignIn.clientID = "679326713487-8f07eqt1hvjvopgcjeie4dbtni4ig0rc.apps.googleusercontent.com" - googleSignIn.scopes = Scope.allCases.compactMap { $0.value } + + // temporary disable search contacts - https://github.com/FlowCrypt/flowcrypt-ios/issues/217 + // let scopes = Scope.allCases.compactMap { $0.value } + + let scopes = [Scope.mail, Scope.userInfo].compactMap { $0.value } + googleSignIn.scopes = scopes googleSignIn.delegate = UserService.shared } diff --git a/FlowCryptUITests/SignInTest.swift b/FlowCryptUITests/SignInTest.swift index 2dca4d309..e847ea6ef 100644 --- a/FlowCryptUITests/SignInTest.swift +++ b/FlowCryptUITests/SignInTest.swift @@ -147,6 +147,7 @@ class SignInTest: XCTestCase { app.buttons["+"].tap() wait(0.2) app.typeText(user.email) + app.tables/*@START_MENU_TOKEN@*/.textFields["Subject"]/*[[".cells.textFields[\"Subject\"]",".textFields[\"Subject\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() app.tables/*@START_MENU_TOKEN@*/.textFields["Subject"]/*[[".cells.textFields[\"Subject\"]",".textFields[\"Subject\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() app.typeText("Some Subject") From aeb27e715958a108f03f8be15b6443c19ebfe7ad Mon Sep 17 00:00:00 2001 From: Anton Kharchevskyi Date: Mon, 16 Mar 2020 19:55:03 +0100 Subject: [PATCH 2/3] Update makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c54e781fe..3fe19be04 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ all: ui_tests dependencies: bundle config set path 'vendor/bundle' + bundle install ui_tests: dependencies - bundle exec fastlane test_ui --verbose \ No newline at end of file + bundle exec fastlane test_ui --verbose From 4278dd97251aa341f0a5f3d904b5704506c1f84c Mon Sep 17 00:00:00 2001 From: Anton Kharchevskyi Date: Mon, 16 Mar 2020 19:59:44 +0100 Subject: [PATCH 3/3] small cleanup --- FlowCryptUITests/SignInTest.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FlowCryptUITests/SignInTest.swift b/FlowCryptUITests/SignInTest.swift index e847ea6ef..eccee9895 100644 --- a/FlowCryptUITests/SignInTest.swift +++ b/FlowCryptUITests/SignInTest.swift @@ -147,9 +147,9 @@ class SignInTest: XCTestCase { app.buttons["+"].tap() wait(0.2) app.typeText(user.email) - app.tables/*@START_MENU_TOKEN@*/.textFields["Subject"]/*[[".cells.textFields[\"Subject\"]",".textFields[\"Subject\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() + app.tables.textFields["Subject"].tap() - app.tables/*@START_MENU_TOKEN@*/.textFields["Subject"]/*[[".cells.textFields[\"Subject\"]",".textFields[\"Subject\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() + app.tables.textFields["Subject"].tap() app.typeText("Some Subject") let nextCompose = goKeyboardButton() nextCompose.tap()