Skip to content
Snippets Groups Projects
Commit eab857f8 authored by freij89's avatar freij89
Browse files

resolve MR comments

parent 4724a94b
Branches
Tags
4 merge requests!58Onboarding screens swift ui merge dev,!55WIP: Resolve "UI for gamifcation & stats",!47Provisional fix for OpenSSL 1.1+, needs testing,!34Resolve "Extract Authentication from current Onboarding"
......@@ -23,6 +23,7 @@ struct AuthenticationScreen: View {
var encryptionOptions = ["Plaintext", "StartTLS", "TLS/SSL"]
var body: some View {
ScrollView{
ZStack {
Color.white.edgesIgnoringSafeArea(.all)
......@@ -42,13 +43,13 @@ struct AuthenticationScreen: View {
self.viewModel.validate(self.login, self.password, self.username, self.imapServer, self.imapPort, self.imapEncryption, self.smtpServer, self.smtpPort, self.smtpEncryption) :
self.viewModel.validate(self.login, self.password)
}) {
Text("Button")
Text("Login")
}
}
if self.viewModel.isDetailedAuthentication {
Text("Username")
TextField("Please enter your nickname", text: $username).textFieldStyle(RoundedBorderTextFieldStyle())
TextField("Please enter your username", text: $username).textFieldStyle(RoundedBorderTextFieldStyle())
HStack {
Text("Imap server")
......@@ -80,7 +81,7 @@ struct AuthenticationScreen: View {
}
Button(action: { self.viewModel.oauth() }) {
Text("Google button")
Text("Google login")
}
}.padding()
......@@ -97,4 +98,5 @@ struct AuthenticationScreen: View {
}
}
}
}
......@@ -18,11 +18,11 @@ class AuthenticationViewModel : ObservableObject {
var login:String = ""
@Published var imapServer: String = "imap.web.de"
@Published var imapServer: String = "imap.example.com"
@Published var imapPort: String = String(DEFAULT_IMAP_PORT)
@Published var imapTransportEncryption = 2
@Published var smtpServer: String = "smtp.web.de"
@Published var smtpServer: String = "smtp.example.com"
@Published var smtpPort: String = String(DEFAULT_SMTP_PORT)
@Published var smtpTransportEncryption = 1
......@@ -30,7 +30,7 @@ class AuthenticationViewModel : ObservableObject {
var imapConfigurationSuccessful = false
var smtpConfigurationSuccessful = false
var startTimeIMAPCheck: Date? //TODO What about SMTP?
var startTimeIMAPCheck: Date?
var startTimeView = Date()
var transportRows: [Int: String] = [MCOConnectionType.clear.rawValue: NSLocalizedString("Plaintext", comment: ""), MCOConnectionType.startTLS.rawValue: "StartTLS", MCOConnectionType.TLS.rawValue: "TLS/SSL"]
......@@ -52,7 +52,7 @@ class AuthenticationViewModel : ObservableObject {
self.smtpServer = smtpServer
self.smtpPort = smtpPort
self.smtpTransportEncryption = smtpEncryption
checkDetailConfig(imap: true, login, password, username: "rtes",imapServer, Int(imapPort)!, imapEncryption, smtpServer, Int(smtpPort)!, smtpEncryption)
checkDetailConfig(imap: true, login, password, username: username, imapServer, Int(imapPort)!, imapEncryption, smtpServer, Int(smtpPort)!, smtpEncryption)
}
func checkIMAPConfig(_ login: String, _ password: String) {
......@@ -111,7 +111,6 @@ class AuthenticationViewModel : ObservableObject {
print("No view controller!")
return
}
// TODO guard: Internet connection?
Logger.log(onboardingState: .GoogleLogIn, duration: 0)
EmailHelper.singleton().doEmailLoginIfRequired(onVC: vc, completionBlock: {
......@@ -172,11 +171,6 @@ class AuthenticationViewModel : ObservableObject {
let imapSession = setupIMAPSession(login, password)
let smtpSession = setupSMTPSession(login, password)
var name = login
if let n = username {
name = n
}
let imapConnValue = 1 << imapEncryption
let smtpConnValue = 1 << smtpEncryption
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment