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

Ecosystem Upgrades and Reusability Improvements #61

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 95 additions & 114 deletions NAMS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"originHash" : "5086b61a408696c4f726af4d46ae5275d0699ee624e8d619b38c592bbebc03f2",
"originHash" : "e6e70e3fae6c5eab21bd16df95736241cb8649c371f6d9d965145f910f530a14",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "748c7837511d0e6a507737353af268484e1745e2",
"version" : "1.2024011601.1"
"revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version" : "1.2024011602.0"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "c218c2054299b15ae577e818bbba16084d3eabe6",
"version" : "10.18.2"
"revision" : "21fe1af9be463a359aaf8d96789ef73fc3760d09",
"version" : "11.0.1"
}
},
{
Expand Down Expand Up @@ -51,53 +51,53 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "888f0b6026e2441a69e3ee2ad5293c7a92031e62",
"version" : "10.23.1"
"revision" : "1fc52ab0e172e7c5a961f975a76c2611f4f22852",
"version" : "11.2.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "c7a5917ebe48d69f421aadf154ef3969c8b7f12d",
"version" : "10.23.1"
"revision" : "07a2f57d147d2bf368a0d2dcb5579ff082d9e44f",
"version" : "11.1.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
"version" : "9.4.0"
"revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
"version" : "10.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55",
"version" : "7.13.1"
"revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb",
"version" : "8.0.2"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version" : "1.62.2"
"revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083",
"version" : "1.65.1"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "9534039303015a84837090d20fa21cae6e5eadb6",
"version" : "3.3.2"
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
Expand Down Expand Up @@ -159,35 +159,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git",
"state" : {
"revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56",
"version" : "0.34.1"
"revision" : "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7",
"version" : "0.35.0"
}
},
{
"identity" : "spezi",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/Spezi",
"state" : {
"revision" : "c43e4fa3d3938a847de2b677091a34ddaea5bc76",
"version" : "1.2.3"
"revision" : "d5c8eec55255fd753367422c49db1ec16610c48b",
"version" : "1.7.4"
}
},
{
"identity" : "speziaccount",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziAccount.git",
"state" : {
"revision" : "cb9441e5fe9ca31a17be2507d03817a080e63e9d",
"version" : "1.2.2"
"revision" : "7e78ee9e7e4df2071a18ac0fc722671ac1dcfac4",
"version" : "2.0.0-beta.7"
}
},
{
"identity" : "spezibluetooth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziBluetooth",
"state" : {
"revision" : "3178bc1184dc6636e8112694e09fdfca7cbcf7d7",
"version" : "1.0.2"
"branch" : "feature/service-configure",
"revision" : "a3b817455827213bb1cb98852582d08a63181910"
}
},
{
Expand All @@ -199,31 +199,49 @@
"version" : "1.0.0"
}
},
{
"identity" : "spezidevices",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziDevices.git",
"state" : {
"revision" : "dc8dcd53773b9bb4041870b0f65cec32f7ed5108",
"version" : "1.3.0"
}
},
{
"identity" : "spezifileformats",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFileFormats",
"state" : {
"revision" : "017ea997f4f6128b15e8b8d4aac979cb7a822e74",
"version" : "1.2.0"
"revision" : "3a7b6fc8843af63f7f4e8f8e0a4bf6ad5da9c446",
"version" : "2.1.2"
}
},
{
"identity" : "spezifirebase",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFirebase.git",
"state" : {
"revision" : "16c1c751c14b08ae593eacf9bc2752c2e070fe2f",
"version" : "1.1.0"
"revision" : "d0cb58fc43c99e632446b43c5cb56943f8339bf2",
"version" : "2.0.0-beta.3"
}
},
{
"identity" : "spezifoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFoundation.git",
"state" : {
"revision" : "01af5b91a54f30ddd121258e81aff2ddc2a99ff9",
"version" : "1.0.4"
"revision" : "17bd0e03e69e0cc722d4cd28148d04443f4e2aba",
"version" : "2.0.0-beta.2"
}
},
{
"identity" : "spezinetworking",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziNetworking",
"state" : {
"revision" : "26f1ed49e1916ae4fdc1bd033127a873a9e6dd0a",
"version" : "2.1.3"
}
},
{
Expand All @@ -249,17 +267,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziStorage.git",
"state" : {
"revision" : "b958df9b31f24800388a7bfc28f457ce7b82556c",
"version" : "1.0.2"
"revision" : "60962375bbce7cc0599bc3da4ebda08231922371",
"version" : "1.2.0"
}
},
{
"identity" : "speziviews",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziViews.git",
"state" : {
"revision" : "4d2a724d97c8f19ac7de7aa2c046b1cb3ef7b279",
"version" : "1.3.1"
"branch" : "feature/additional-infrastructure",
"revision" : "dd28a4696f43ce0de8ef4acbf523f14c8c0c49c6"
}
},
{
Expand All @@ -285,8 +303,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
}
},
{
Expand All @@ -312,8 +330,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82",
"version" : "510.0.3"
}
},
{
Expand All @@ -330,8 +348,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint",
"state" : {
"revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee",
"version" : "0.54.0"
"revision" : "b515723b16eba33f15c4677ee65f3fef2ce8c255",
"version" : "0.55.1"
}
},
{
Expand Down Expand Up @@ -366,8 +384,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/XCTRuntimeAssertions",
"state" : {
"revision" : "51da3403f128b120705571ce61e0fe190f8889e6",
"version" : "1.0.1"
"revision" : "f560ec8410af032dd485ca9386e8c2b5d3e1a1f8",
"version" : "1.1.3"
}
},
{
Expand All @@ -381,4 +399,4 @@
}
],
"version" : 3
}
}
5 changes: 4 additions & 1 deletion NAMS/Account/AccountSetupHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// SPDX-License-Identifier: MIT
//

@_spi(TestingSupport)
import SpeziAccount
import SwiftUI

Expand Down Expand Up @@ -41,6 +42,8 @@ struct AccountSetupHeader: View {
#if DEBUG
#Preview {
AccountSetupHeader()
.environment(Account())
.previewWith {
AccountConfiguration(service: InMemoryAccountService())
}
}
#endif
52 changes: 19 additions & 33 deletions NAMS/Account/AccountSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// SPDX-License-Identifier: MIT
//

@_spi(TestingSupport)
import SpeziAccount
import SwiftUI

Expand All @@ -23,50 +24,37 @@ struct AccountSheet: View {


@State var isInSetup = false
@State var overviewIsEditing = false


var body: some View {
@Bindable var deviceCoordinator = deviceCoordinator
NavigationStack {
if account.signedIn && !isInSetup {
AccountOverview(isEditing: $overviewIsEditing) {
AccountOverview(close: .showCloseButton) {
Section("Developer") {
Toggle(isOn: $deviceCoordinator.enableMockDevice) {
Text("Show Mock Devices")
}
}
}
.onDisappear {
overviewIsEditing = false
}
.toolbar {
if !overviewIsEditing {
closeButton
}
}
} else {
AccountSetup { _ in
dismiss() // we just signed in, dismiss the account setup sheet
} header: {
AccountSetupHeader()
}
.onAppear {
isInSetup = true
}
.toolbar {
if !accountRequired {
closeButton
.onAppear {
isInSetup = true
}
.toolbar {
if !accountRequired {
ToolbarItem(placement: .cancellationAction) {
Button("Close") {
dismiss()
}
}
}
}
}
}
}
}

@ToolbarContentBuilder var closeButton: some ToolbarContent {
ToolbarItem(placement: .cancellationAction) {
Button("Close") {
dismiss()
}
}
}
Expand All @@ -75,24 +63,22 @@ struct AccountSheet: View {

#if DEBUG
#Preview {
let details = AccountDetails.Builder()
.set(\.accountId, value: UUID().uuidString)
.set(\.userId, value: "lelandstanford@stanford.edu")
.set(\.name, value: PersonNameComponents(givenName: "Leland", familyName: "Stanford"))
var details = AccountDetails()
details.accountId = UUID().uuidString
details.userId = "lelandstanford@stanford.edu"
details.name = PersonNameComponents(givenName: "Leland", familyName: "Stanford")

return AccountSheet()
.previewWith {
AccountConfiguration(building: details, active: MockUserIdPasswordAccountService())
AccountConfiguration(service: InMemoryAccountService(), activeDetails: details)
DeviceCoordinator()
}
}

#Preview {
AccountSheet()
.previewWith {
AccountConfiguration {
MockUserIdPasswordAccountService()
}
AccountConfiguration(service: InMemoryAccountService())
DeviceCoordinator()
}
}
Expand Down
Loading
Loading