From a340ac17af761149bc48ff178fd5cff9b333b248 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev <153574461+EvelynBunnyDev@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:47:10 -0800 Subject: [PATCH] Account details update: made email & DoB mandatory and updated onboarding texts (#5) # *Name of the PR* ## :recycle: Current situation & Problem *Modifying account detail configurations.* *Responding to reviewer comment.* ## :gear: Release Notes *Modified localizable strings (onboarding texts) and made the strings 'automatic'* *Removed commented code that I'm not implementing.* ## :books: Documentation *In-line documentation provided.* ## :white_check_mark: Testing *N/A. All elements should be testable* ## :pencil: Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md): - [ ] I agree to follow the [Code of Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md). --- Behavior/Account/AccountSetupHeader.swift | 17 ++++++++++++----- Behavior/Account/AccountSheet.swift | 2 +- Behavior/BehaviorDelegate.swift | 6 ++++-- Behavior/Resources/Localizable.xcstrings | 17 ++++++++++++++--- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index 124a033..38648ca 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.swift @@ -18,16 +18,23 @@ struct AccountSetupHeader: View { var body: some View { VStack { Text("ACCOUNT_TITLE") - .font(.largeTitle) - .bold() - .padding(.bottom) - .padding(.top, 30) + .font(.largeTitle) + .bold() + .padding(.bottom) + .padding(.top, 30) + Text("ACCOUNT_SUBTITLE") .padding(.bottom, 8) + Divider() if account.signedIn, case .generic = setupState { Text("ACCOUNT_SIGNED_IN_DESCRIPTION") + .padding() } else { - Text("ACCOUNT_SETUP_DESCRIPTION") + VStack { + Text("ACCOUNT_SETUP_DESCRIPTION") + Text("ACCOUNT_REQUIRED_ITEMS") + } + .padding() } } .multilineTextAlignment(.center) diff --git a/Behavior/Account/AccountSheet.swift b/Behavior/Account/AccountSheet.swift index 8f93ff6..f5bfaf1 100644 --- a/Behavior/Account/AccountSheet.swift +++ b/Behavior/Account/AccountSheet.swift @@ -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 // // SPDX-FileCopyrightText: 2023 Stanford University // diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index 3e6b657..370b05f 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -25,8 +25,10 @@ class BehaviorDelegate: SpeziAppDelegate { AccountConfiguration(configuration: [ .requires(\.userId), .requires(\.name), - .collects(\.genderIdentity), - .collects(\.dateOfBirth) + .requires(\.dateOfBirth), + + // additional values stored using the `FirestoreAccountStorage` within our Standard implementation + .collects(\.genderIdentity) ]) if FeatureFlags.useFirebaseEmulator { diff --git a/Behavior/Resources/Localizable.xcstrings b/Behavior/Resources/Localizable.xcstrings index 4ea9d96..5b32854 100644 --- a/Behavior/Resources/Localizable.xcstrings +++ b/Behavior/Resources/Localizable.xcstrings @@ -11,12 +11,23 @@ } } }, + "ACCOUNT_REQUIRED_ITEMS" : { + "extractionState" : "automatic", + "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! " } } } @@ -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!" } } } @@ -521,4 +532,4 @@ } }, "version" : "1.0" -} \ No newline at end of file +}