Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account details update: made email & DoB mandatory and updated onboarding texts #5

Merged
merged 10 commits into from
Jan 24, 2024
25 changes: 18 additions & 7 deletions Behavior/Account/AccountSetupHeader.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// This source file is part of the Behavior based on the Stanford Spezi Template Application project
// This source file is part of the Stanford Spezi Template Application open-source project
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
Expand All @@ -17,17 +17,28 @@

var body: some View {
VStack {
Text("ACCOUNT_TITLE")
.font(.largeTitle)
.bold()
.padding(.bottom)
.padding(.top, 30)
HStack {
// Plan to replace image with logo of Behavioral App
// Image(systemName: "star.circle.fill")
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
Text("ACCOUNT_TITLE")
.font(.largeTitle)
.bold()
.padding(.bottom)
.padding(.top, 30)
}

Check warning on line 29 in Behavior/Account/AccountSetupHeader.swift

View check run for this annotation

Codecov / codecov/patch

Behavior/Account/AccountSetupHeader.swift#L20-L29

Added lines #L20 - L29 were not covered by tests
Text("ACCOUNT_SUBTITLE")
.padding(.bottom, 8)
Divider()

Check warning on line 32 in Behavior/Account/AccountSetupHeader.swift

View check run for this annotation

Codecov / codecov/patch

Behavior/Account/AccountSetupHeader.swift#L32

Added line #L32 was not covered by tests
if account.signedIn, case .generic = setupState {
Text("ACCOUNT_SIGNED_IN_DESCRIPTION")
.padding()

Check warning on line 35 in Behavior/Account/AccountSetupHeader.swift

View check run for this annotation

Codecov / codecov/patch

Behavior/Account/AccountSetupHeader.swift#L35

Added line #L35 was not covered by tests
} else {
Text("ACCOUNT_SETUP_DESCRIPTION")
VStack {
Text("ACCOUNT_SETUP_DESCRIPTION")
Text("ACCOUNT_REQUIRED_ITEMS")
}
.padding()

Check warning on line 41 in Behavior/Account/AccountSetupHeader.swift

View check run for this annotation

Codecov / codecov/patch

Behavior/Account/AccountSetupHeader.swift#L37-L41

Added lines #L37 - L41 were not covered by tests
}
}
.multilineTextAlignment(.center)
Expand Down
2 changes: 1 addition & 1 deletion Behavior/Account/AccountSheet.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// This source file is part of the Behavior based on the Stanford Spezi Template Application project
// This source file is part of the Stanford Spezi Template Application open-source project
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
Expand Down
6 changes: 4 additions & 2 deletions Behavior/BehaviorDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class BehaviorDelegate: SpeziAppDelegate {
AccountConfiguration(configuration: [
.requires(\.userId),
.requires(\.name),
.requires(\.password),
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
.requires(\.email),
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
.requires(\.dateOfBirth),

// additional values stored using the `FirestoreAccountStorage` within our Standard implementation
.collects(\.genderIdentity),
.collects(\.dateOfBirth)
.collects(\.genderIdentity)
])

if FeatureFlags.useFirebaseEmulator {
Expand Down
15 changes: 13 additions & 2 deletions Behavior/Resources/Localizable.xcstrings
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@
}
}
},
"ACCOUNT_REQUIRED_ITEMS" : {
"extractionState" : "manual",
EvelynBunnyDev marked this conversation as resolved.
Show resolved Hide resolved
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Email, Name, and Date of Birth are required."
}
}
}
},
"ACCOUNT_SETUP_DESCRIPTION" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "You may login to your existing account. Or create a new one if you don't have one already."
"value" : "Login to your existing account, or create one if you are new! "
}
}
}
Expand All @@ -26,7 +37,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "You are already logged in with the account shown below. Continue or change your account by logging out."
"value" : "You are logged in!"
}
}
}
Expand Down