generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure to only pass complete account details to the account setup …
…complete closure (#79) # Make sure to only pass complete account details to the account setup complete closure ## ♻️ Current situation & Problem The `AccountSetup` accepts a `setupComplete` closure that will get called once the setup is completed giving the parent view the opportunity to perform additional checks or navigation steps based on the outcome. While a `AccountService` always calls an `ExternalStorageProvider` before submitting account details to `Account`, they have been decoupled in v2.0.0 and an `ExternalStorageProvider` must always return immediacy from its `load` call. In scenarios where account details are not locally cached yet, an `ExternalStorageProvider` returns details that are marked as [incomplete](https://swiftpackageindex.com/stanfordspezi/speziaccount/documentation/speziaccount/accountdetails/isincomplete). `AccountSetup` didn't check for this flag and forwarded incomplete details to the `setupComplete` closure. This PR fixes this issue and updates the behavior to only forward account details that are also marked as complete. ## ⚙️ Release Notes * Fixed an issue where `AccountSetup` would forward incomplete account details and didn't wait for an `ExternalStorageProvider` to load externally stored account details. * Fixed an issue where `flags` wouldn't be copied between account details. ## 📚 Documentation We improved some of the documentation discoverability. ## ✅ Testing Added UI tests to verify that the incomplete details are not passed to the `setupComplete` closure. ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
18 changed files
with
110 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,18 @@ extension AccountDetails { | |
.day(.twoDigits) | ||
|
||
static var defaultDetails: AccountDetails { | ||
let date: Date | ||
do { | ||
date = try Date("09.03.1824", strategy: dateStyle) | ||
} catch { | ||
preconditionFailure("Failed to parse date: \(error)") | ||
} | ||
var details = AccountDetails() | ||
details.userId = "[email protected]" | ||
details.password = "StanfordRocks123!" | ||
details.name = PersonNameComponents(givenName: "Leland", familyName: "Stanford") | ||
details.genderIdentity = .male | ||
details.dateOfBirth = try? Date("09.03.1824", strategy: dateStyle) | ||
details.dateOfBirth = date | ||
return details | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters