Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
eab857f8
Commit
eab857f8
authored
5 years ago
by
freij89
Browse files
Options
Downloads
Patches
Plain Diff
resolve MR comments
parent
4724a94b
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!58
Onboarding screens swift ui merge dev
,
!55
WIP: Resolve "UI for gamifcation & stats"
,
!47
Provisional fix for OpenSSL 1.1+, needs testing
,
!34
Resolve "Extract Authentication from current Onboarding"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
enzevalos_iphone/AuthenticationScreen.swift
+64
-62
64 additions, 62 deletions
enzevalos_iphone/AuthenticationScreen.swift
enzevalos_iphone/AuthenticationViewModel.swift
+5
-11
5 additions, 11 deletions
enzevalos_iphone/AuthenticationViewModel.swift
with
69 additions
and
73 deletions
enzevalos_iphone/AuthenticationScreen.swift
+
64
−
62
View file @
eab857f8
...
...
@@ -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
(
"
Butto
n"
)
Text
(
"
Logi
n"
)
}
}
if
self
.
viewModel
.
isDetailedAuthentication
{
Text
(
"Username"
)
TextField
(
"Please enter your
nick
name"
,
text
:
$username
)
.
textFieldStyle
(
RoundedBorderTextFieldStyle
())
TextField
(
"Please enter your
user
name"
,
text
:
$username
)
.
textFieldStyle
(
RoundedBorderTextFieldStyle
())
HStack
{
Text
(
"Imap server"
)
...
...
@@ -80,7 +81,7 @@ struct AuthenticationScreen: View {
}
Button
(
action
:
{
self
.
viewModel
.
oauth
()
})
{
Text
(
"Google
butto
n"
)
Text
(
"Google
logi
n"
)
}
}
.
padding
()
...
...
@@ -97,4 +98,5 @@ struct AuthenticationScreen: View {
}
}
}
}
This diff is collapsed.
Click to expand it.
enzevalos_iphone/AuthenticationViewModel.swift
+
5
−
11
View file @
eab857f8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment