From e0ace7c2f20b24f77483b693e723101eaecb8c3b Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 14:19:24 -0800 Subject: [PATCH 1/9] added password and email to acc configuration --- Behavior/Account/AccountSetupHeader.swift | 18 ++++++++++++------ Behavior/Account/AccountSheet.swift | 2 +- Behavior/BehaviorDelegate.swift | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index 124a033..c2a2211 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.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 // @@ -17,11 +17,16 @@ struct AccountSetupHeader: View { 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") + Text("ACCOUNT_TITLE") + .font(.largeTitle) + .bold() + .padding(.bottom) + .padding(.top, 30) + } + Text("ACCOUNT_SUBTITLE") .padding(.bottom, 8) if account.signedIn, case .generic = setupState { @@ -41,3 +46,4 @@ struct AccountSetupHeader: View { .environment(Account()) } #endif + 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 3009e2f..a51640a 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -25,6 +25,8 @@ class BehaviorDelegate: SpeziAppDelegate { AccountConfiguration(configuration: [ .requires(\.userId), .requires(\.name), + .requires(\.password), + .requires(\.email), // additional values stored using the `FirestoreAccountStorage` within our Standard implementation .collects(\.genderIdentity), From f23c896ef1cc0422c5fb2b3bfa351b52336fe546 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 14:26:45 -0800 Subject: [PATCH 2/9] Made date of birth required --- Behavior/BehaviorDelegate.swift | 5 +++-- Behavior/Resources/Localizable.xcstrings | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index a51640a..c50b73a 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -27,10 +27,11 @@ class BehaviorDelegate: SpeziAppDelegate { .requires(\.name), .requires(\.password), .requires(\.email), + .requires(\.dateOfBirth), // additional values stored using the `FirestoreAccountStorage` within our Standard implementation - .collects(\.genderIdentity), - .collects(\.dateOfBirth) + .collects(\.genderIdentity) + ]) if FeatureFlags.useFirebaseEmulator { diff --git a/Behavior/Resources/Localizable.xcstrings b/Behavior/Resources/Localizable.xcstrings index 58cd655..172bc1f 100644 --- a/Behavior/Resources/Localizable.xcstrings +++ b/Behavior/Resources/Localizable.xcstrings @@ -11,12 +11,23 @@ } } }, + "ACCOUNT_REQUIRED_ITEMS" : { + "extractionState" : "manual", + "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!" } } } From 097713201cddd2ca3ccacd63c7520cde4cdc90b2 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 14:27:15 -0800 Subject: [PATCH 3/9] Modified account onboarding text descriptions --- Behavior/Account/AccountButton.swift | 1 + Behavior/Account/AccountSetupHeader.swift | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Behavior/Account/AccountButton.swift b/Behavior/Account/AccountButton.swift index dc1bf32..59aa115 100644 --- a/Behavior/Account/AccountButton.swift +++ b/Behavior/Account/AccountButton.swift @@ -36,3 +36,4 @@ struct AccountButton: View { AccountButton(isPresented: .constant(false)) } #endif + diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index c2a2211..60da660 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.swift @@ -29,10 +29,17 @@ struct AccountSetupHeader: View { 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) From 00ed7f67d4a2a58a7a4a9cd856e6cd2db91af27d Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 14:31:20 -0800 Subject: [PATCH 4/9] Updated formatting to pass tests --- Behavior/Account/AccountButton.swift | 1 - Behavior/BehaviorDelegate.swift | 1 - 2 files changed, 2 deletions(-) diff --git a/Behavior/Account/AccountButton.swift b/Behavior/Account/AccountButton.swift index 59aa115..dc1bf32 100644 --- a/Behavior/Account/AccountButton.swift +++ b/Behavior/Account/AccountButton.swift @@ -36,4 +36,3 @@ struct AccountButton: View { AccountButton(isPresented: .constant(false)) } #endif - diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index c50b73a..fa0a582 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -31,7 +31,6 @@ class BehaviorDelegate: SpeziAppDelegate { // additional values stored using the `FirestoreAccountStorage` within our Standard implementation .collects(\.genderIdentity) - ]) if FeatureFlags.useFirebaseEmulator { From 6479d49c3411985dcc894f008ba9b48aaff12211 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 14:42:01 -0800 Subject: [PATCH 5/9] Update AccountSetupHeader.swift --- Behavior/Account/AccountSetupHeader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index 60da660..6cac977 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.swift @@ -19,7 +19,7 @@ struct AccountSetupHeader: View { VStack { HStack { // Plan to replace image with logo of Behavioral App - Image(systemName: "star.circle.fill") + // Image(systemName: "star.circle.fill") Text("ACCOUNT_TITLE") .font(.largeTitle) .bold() From 753615150abcc9d4be38eeb13dac7c3d8f154c37 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Tue, 16 Jan 2024 15:30:19 -0800 Subject: [PATCH 6/9] Modifications for SwiftLint 1. Removed Vertical Whitespace before Closing Braces 2. Solved for Trailing Newline Violation --- Behavior/Account/AccountSetupHeader.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index 6cac977..dfd8160 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.swift @@ -39,7 +39,6 @@ struct AccountSetupHeader: View { Text("ACCOUNT_REQUIRED_ITEMS") } .padding() - } } .multilineTextAlignment(.center) @@ -53,4 +52,3 @@ struct AccountSetupHeader: View { .environment(Account()) } #endif - From 33421726af98f4392edce7a74934e729f17327a6 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Thu, 18 Jan 2024 17:35:38 -0800 Subject: [PATCH 7/9] Account details update: for Andrea's feedback --- Behavior/Account/AccountSetupHeader.swift | 8 ++------ Behavior/BehaviorDelegate.swift | 5 ++--- Behavior/Resources/Localizable.xcstrings | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Behavior/Account/AccountSetupHeader.swift b/Behavior/Account/AccountSetupHeader.swift index dfd8160..38648ca 100644 --- a/Behavior/Account/AccountSetupHeader.swift +++ b/Behavior/Account/AccountSetupHeader.swift @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Spezi Template Application open-source project +// This source file is part of the Behavior based on the Stanford Spezi Template Application project // // SPDX-FileCopyrightText: 2023 Stanford University // @@ -17,15 +17,11 @@ struct AccountSetupHeader: View { var body: some View { VStack { - HStack { - // Plan to replace image with logo of Behavioral App - // Image(systemName: "star.circle.fill") - Text("ACCOUNT_TITLE") + Text("ACCOUNT_TITLE") .font(.largeTitle) .bold() .padding(.bottom) .padding(.top, 30) - } Text("ACCOUNT_SUBTITLE") .padding(.bottom, 8) diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index fa0a582..0f4e99a 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -25,12 +25,11 @@ class BehaviorDelegate: SpeziAppDelegate { AccountConfiguration(configuration: [ .requires(\.userId), .requires(\.name), - .requires(\.password), - .requires(\.email), .requires(\.dateOfBirth), // additional values stored using the `FirestoreAccountStorage` within our Standard implementation - .collects(\.genderIdentity) + .collects(\.genderIdentity), + .collects(\.email) ]) if FeatureFlags.useFirebaseEmulator { diff --git a/Behavior/Resources/Localizable.xcstrings b/Behavior/Resources/Localizable.xcstrings index 172bc1f..a7433a9 100644 --- a/Behavior/Resources/Localizable.xcstrings +++ b/Behavior/Resources/Localizable.xcstrings @@ -12,7 +12,7 @@ } }, "ACCOUNT_REQUIRED_ITEMS" : { - "extractionState" : "manual", + "extractionState" : "automatic", "localizations" : { "en" : { "stringUnit" : { @@ -553,4 +553,4 @@ } }, "version" : "1.0" -} \ No newline at end of file +} From bcbcc97c72f5787c022ed8eb2ea346c68c9d5359 Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Mon, 22 Jan 2024 13:53:41 -0800 Subject: [PATCH 8/9] Update BehaviorDelegate.swift --- Behavior/BehaviorDelegate.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index 0f4e99a..c06a40a 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -29,7 +29,6 @@ class BehaviorDelegate: SpeziAppDelegate { // additional values stored using the `FirestoreAccountStorage` within our Standard implementation .collects(\.genderIdentity), - .collects(\.email) ]) if FeatureFlags.useFirebaseEmulator { From 748efeca1decad1df25fcebd9ccb7a48d67659de Mon Sep 17 00:00:00 2001 From: EvelynBunnyDev Date: Mon, 22 Jan 2024 14:43:39 -0800 Subject: [PATCH 9/9] Update BehaviorDelegate.swift --- Behavior/BehaviorDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Behavior/BehaviorDelegate.swift b/Behavior/BehaviorDelegate.swift index c06a40a..a113f81 100644 --- a/Behavior/BehaviorDelegate.swift +++ b/Behavior/BehaviorDelegate.swift @@ -28,7 +28,7 @@ class BehaviorDelegate: SpeziAppDelegate { .requires(\.dateOfBirth), // additional values stored using the `FirestoreAccountStorage` within our Standard implementation - .collects(\.genderIdentity), + .collects(\.genderIdentity) ]) if FeatureFlags.useFirebaseEmulator {