Skip to content

Commit

Permalink
Upgrade to Spezi 0.8.0 (#42)
Browse files Browse the repository at this point in the history
# Upgrade to Spezi 0.8.0

## ♻️ Current situation & Problem
This PR upgrades the app to Spezi 0.8.0.

Further, we migrate the app to use the new observation framework.


## ⚙️ Release Notes 
* Upgrade to Spezi 0.8.0
* Migrate to observation
* Consistently use `#Preview`

## 📚 Documentation
--

## ✅ Testing
Tests were addresses as required.

### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Supereg authored Nov 17, 2023
1 parent e84b2a5 commit f992823
Show file tree
Hide file tree
Showing 35 changed files with 281 additions and 291 deletions.
42 changes: 26 additions & 16 deletions NAMS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
A926D78B2AB7A552000C4C2F /* OnboardingFlow+PreviewSimulator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A916ADD82AB6217D006960DF /* OnboardingFlow+PreviewSimulator.swift */; };
A926D78C2AB7A552000C4C2F /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC975A72978F11A00BA99FE /* Home.swift */; };
A926D78E2AB7A552000C4C2F /* OnboardingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */; };
A926D7902AB7A552000C4C2F /* NAMSStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9610AB82AB4868D00E46ADE /* NAMSStandard.swift */; };
A926D7912AB7A552000C4C2F /* CodableArray+RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4429EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift */; };
A926D7922AB7A552000C4C2F /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3E29EDD7ED004B9AB4 /* FeatureFlags.swift */; };
A926D7932AB7A552000C4C2F /* Bundle+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4329EDD7F2004B9AB4 /* Bundle+Image.swift */; };
Expand Down Expand Up @@ -189,7 +188,8 @@
A94A42B72AE9EBE300A3F9E5 /* AccountSetupHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94A42AD2AE9EBE300A3F9E5 /* AccountSetupHeader.swift */; };
A94A42BA2AE9ED8300A3F9E5 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94A42B92AE9ED8200A3F9E5 /* AccountOnboarding.swift */; };
A94A42BB2AE9ED8300A3F9E5 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = A94A42B92AE9ED8200A3F9E5 /* AccountOnboarding.swift */; };
A9610AB92AB4868D00E46ADE /* NAMSStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9610AB82AB4868D00E46ADE /* NAMSStandard.swift */; };
A988FEBD2B05C7AE00022A61 /* SpeziPersonalInfo in Frameworks */ = {isa = PBXBuildFile; productRef = A988FEBC2B05C7AE00022A61 /* SpeziPersonalInfo */; };
A988FEBF2B05C7B800022A61 /* SpeziPersonalInfo in Frameworks */ = {isa = PBXBuildFile; productRef = A988FEBE2B05C7B800022A61 /* SpeziPersonalInfo */; };
A989112D2A36687B00E66E3A /* PatientListSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A989112C2A36687B00E66E3A /* PatientListSheet.swift */; };
A989112F2A36688A00E66E3A /* PatientRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A989112E2A36688A00E66E3A /* PatientRow.swift */; };
A98911322A36689D00E66E3A /* Patient.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98911312A36689D00E66E3A /* Patient.swift */; };
Expand Down Expand Up @@ -336,7 +336,6 @@
A94A42AB2AE9EBE200A3F9E5 /* AccountButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountButton.swift; sourceTree = "<group>"; };
A94A42AD2AE9EBE300A3F9E5 /* AccountSetupHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountSetupHeader.swift; sourceTree = "<group>"; };
A94A42B92AE9ED8200A3F9E5 /* AccountOnboarding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = "<group>"; };
A9610AB82AB4868D00E46ADE /* NAMSStandard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NAMSStandard.swift; sourceTree = "<group>"; };
A989112C2A36687B00E66E3A /* PatientListSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PatientListSheet.swift; sourceTree = "<group>"; };
A989112E2A36688A00E66E3A /* PatientRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PatientRow.swift; sourceTree = "<group>"; };
A98911312A36689D00E66E3A /* Patient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Patient.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -365,6 +364,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A988FEBD2B05C7AE00022A61 /* SpeziPersonalInfo in Frameworks */,
2FE5DC6429EDD883004B9AB4 /* SpeziAccount in Frameworks */,
2FE5DC6729EDD894004B9AB4 /* SpeziContact in Frameworks */,
2FE5DC8429EDD934004B9AB4 /* SpeziQuestionnaire in Frameworks */,
Expand Down Expand Up @@ -408,6 +408,7 @@
A926D7AD2AB7A552000C4C2F /* SpeziSecureStorage in Frameworks */,
A92E34F22ADB9B9000FE0B51 /* OrderedCollections in Frameworks */,
A926D7AE2AB7A552000C4C2F /* SpeziFirebaseAccount in Frameworks */,
A988FEBF2B05C7B800022A61 /* SpeziPersonalInfo in Frameworks */,
A926D7B02AB7A552000C4C2F /* Spezi in Frameworks */,
A926D7B12AB7A552000C4C2F /* SpeziViews in Frameworks */,
A926D7B32AB7A552000C4C2F /* SpeziFHIR in Frameworks */,
Expand Down Expand Up @@ -508,7 +509,6 @@
2FC975A72978F11A00BA99FE /* Home.swift */,
653A2550283387FE005D4D48 /* NAMSApp.swift */,
2F5E32BC297E05EA003432F8 /* NAMSAppDelegate.swift */,
A9610AB82AB4868D00E46ADE /* NAMSStandard.swift */,
2F4E23822989D51F0013F3D9 /* NAMSTestingSetup.swift */,
A94534082AEAE3490095AAD3 /* ScheduleView.swift */,
A94A42A82AE9EBC300A3F9E5 /* Account */,
Expand Down Expand Up @@ -774,6 +774,7 @@
2FE5DC8B29EDD972004B9AB4 /* SpeziSecureStorage */,
2FE5DC8E29EDD980004B9AB4 /* SpeziViews */,
A92E34EF2ADB9B7E00FE0B51 /* OrderedCollections */,
A988FEBC2B05C7AE00022A61 /* SpeziPersonalInfo */,
);
productName = NAMS;
productReference = 653A254D283387FE005D4D48 /* NAMS.app */;
Expand Down Expand Up @@ -846,6 +847,7 @@
A926D7792AB7A552000C4C2F /* SpeziSecureStorage */,
A926D77A2AB7A552000C4C2F /* SpeziViews */,
A92E34F12ADB9B9000FE0B51 /* OrderedCollections */,
A988FEBE2B05C7B800022A61 /* SpeziPersonalInfo */,
);
productName = NAMS;
productReference = A926D7C32AB7A552000C4C2F /* NAMS Muse.app */;
Expand Down Expand Up @@ -1032,7 +1034,6 @@
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */,
A94A42BA2AE9ED8300A3F9E5 /* AccountOnboarding.swift in Sources */,
A926D82C2AB7B430000C4C2F /* DeviceManager.swift in Sources */,
A9610AB92AB4868D00E46ADE /* NAMSStandard.swift in Sources */,
2FE5DC4729EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift in Sources */,
2FE5DC4029EDD7EE004B9AB4 /* FeatureFlags.swift in Sources */,
A9BCB5902AE8588B00DA8588 /* NoInformationText.swift in Sources */,
Expand Down Expand Up @@ -1149,7 +1150,6 @@
A9BCB5842AE830FB00DA8588 /* NewPatientModel.swift in Sources */,
A9DF79DE2AE8A80D00AB5983 /* Patient.swift in Sources */,
A926D82D2AB7B430000C4C2F /* DeviceManager.swift in Sources */,
A926D7902AB7A552000C4C2F /* NAMSStandard.swift in Sources */,
A926D7912AB7A552000C4C2F /* CodableArray+RawRepresentable.swift in Sources */,
A926D7922AB7A552000C4C2F /* FeatureFlags.swift in Sources */,
A9F2ECD12AEC5EF50057C7DD /* MeasurementTask.swift in Sources */,
Expand Down Expand Up @@ -1932,79 +1932,79 @@
repositoryURL = "https://github.com/StanfordSpezi/Spezi";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.7.3;
minimumVersion = 0.8.0;
};
};
2FE5DC6229EDD883004B9AB4 /* XCRemoteSwiftPackageReference "SpeziAccount" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziAccount.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.6.1;
minimumVersion = 0.7.3;
};
};
2FE5DC6529EDD894004B9AB4 /* XCRemoteSwiftPackageReference "SpeziContact" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziContact.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.1;
minimumVersion = 0.5.0;
};
};
2FE5DC6829EDD8A9004B9AB4 /* XCRemoteSwiftPackageReference "SpeziFHIR" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziFHIR.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.0;
minimumVersion = 0.4.1;
};
};
2FE5DC7329EDD8E6004B9AB4 /* XCRemoteSwiftPackageReference "SpeziFirebase" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziFirebase.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.7.1;
minimumVersion = 0.8.0;
};
};
2FE5DC7F29EDD91D004B9AB4 /* XCRemoteSwiftPackageReference "SpeziOnboarding" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziOnboarding.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.6.0;
minimumVersion = 0.7.0;
};
};
2FE5DC8229EDD934004B9AB4 /* XCRemoteSwiftPackageReference "SpeziQuestionnaire" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziQuestionnaire.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.3;
minimumVersion = 0.5.0;
};
};
2FE5DC8829EDD972004B9AB4 /* XCRemoteSwiftPackageReference "SpeziStorage" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziStorage.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.3;
minimumVersion = 0.5.0;
};
};
2FE5DC8D29EDD980004B9AB4 /* XCRemoteSwiftPackageReference "SpeziViews" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/StanfordSpezi/SpeziViews.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.5.1;
minimumVersion = 0.6.2;
};
};
2FE5DC9029EDD9C3004B9AB4 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 10.13.0;
minimumVersion = 10.17.0;
};
};
2FE5DC9729EDD9D9004B9AB4 /* XCRemoteSwiftPackageReference "XCTestExtensions" */ = {
Expand Down Expand Up @@ -2233,6 +2233,16 @@
package = A92E34EE2ADB9B7E00FE0B51 /* XCRemoteSwiftPackageReference "swift-collections" */;
productName = OrderedCollections;
};
A988FEBC2B05C7AE00022A61 /* SpeziPersonalInfo */ = {
isa = XCSwiftPackageProductDependency;
package = 2FE5DC8D29EDD980004B9AB4 /* XCRemoteSwiftPackageReference "SpeziViews" */;
productName = SpeziPersonalInfo;
};
A988FEBE2B05C7B800022A61 /* SpeziPersonalInfo */ = {
isa = XCSwiftPackageProductDependency;
package = 2FE5DC8D29EDD980004B9AB4 /* XCRemoteSwiftPackageReference "SpeziViews" */;
productName = SpeziPersonalInfo;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 653A2545283387FE005D4D48 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
"version" : "1.2022062300.0"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "5746b2d35c91c50581590ed97abe4c06b5037274",
"version" : "10.18.0"
}
},
{
"identity" : "fhirmodels",
"kind" : "remoteSourceControl",
Expand All @@ -23,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "837d4af6ead57cec1fc38007892500d3139c7556",
"version" : "10.16.0"
"revision" : "5de0369ee79ad096c164eb3afeb7921d92a43b58",
"version" : "10.18.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "56f681586ff006a7982b53dc94082eea31971acf",
"version" : "10.16.0"
"revision" : "6b332152355c372ace9966d8ee76ed191f97025e",
"version" : "10.17.0"
}
},
{
Expand All @@ -50,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "c38ce365d77b04a9a300c31061c5227589e5597b",
"version" : "7.11.5"
"revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3",
"version" : "7.12.1"
}
},
{
Expand Down Expand Up @@ -113,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/ResearchKit",
"state" : {
"revision" : "9530fadc9d09c0b783388c752b0dbe841974b6af",
"version" : "2.2.18"
"revision" : "cf79a15c7d8c436f98937fe93e72e880dd2f73e4",
"version" : "2.2.20"
}
},
{
Expand All @@ -131,80 +140,89 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/Spezi",
"state" : {
"revision" : "e75ea4d241b6eb611ca4c1c25926097cf324ce37",
"version" : "0.7.3"
"revision" : "092eabc50a3600d8a03b43ad0d2dcd02914b223f",
"version" : "0.8.1"
}
},
{
"identity" : "speziaccount",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziAccount.git",
"state" : {
"revision" : "81a215080070d419140cc55bd478f2177176623c",
"version" : "0.6.1"
"revision" : "d65ad46827f748af7f6c99bd783f74225b530747",
"version" : "0.7.3"
}
},
{
"identity" : "spezicontact",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziContact.git",
"state" : {
"revision" : "9dea670bcfea51c2db04ea73b80fda923c2ebaed",
"version" : "0.4.1"
"revision" : "bd38bd769a20ebe89cec75ebc80dcbccfbd25230",
"version" : "0.5.0"
}
},
{
"identity" : "spezifhir",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFHIR.git",
"state" : {
"revision" : "4c7a5f4855193ad5fd140ec35623344ee3d48b0c",
"version" : "0.4.0"
"revision" : "043243181f380dfd88ff3cccaab73d42c850c275",
"version" : "0.4.1"
}
},
{
"identity" : "spezifirebase",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFirebase.git",
"state" : {
"revision" : "187d1edded739097ee6162dcc2c38183b6f42d2e",
"version" : "0.7.1"
"revision" : "084d697f58dc1a3275677992f6a5884736e3e2f6",
"version" : "0.8.0"
}
},
{
"identity" : "spezifoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziFoundation.git",
"state" : {
"revision" : "683c66f922a4cfe0882c4a86a43854f613b48541",
"version" : "0.1.0"
}
},
{
"identity" : "spezionboarding",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziOnboarding.git",
"state" : {
"revision" : "0ea46a66c17615e1a933481a07434bfd41717c54",
"version" : "0.6.0"
"revision" : "70d1a740a0da8a5bc83d95bcff177ebd3e7402c0",
"version" : "0.7.0"
}
},
{
"identity" : "speziquestionnaire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziQuestionnaire.git",
"state" : {
"revision" : "849e207da973a089e7a209289217ff3efab68596",
"version" : "0.4.3"
"revision" : "4f3e1cd25c271244a4f8fe3653969f17063603a6",
"version" : "0.5.0"
}
},
{
"identity" : "spezistorage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziStorage.git",
"state" : {
"revision" : "58f79a21291da6d2d2193275486fa3c69b4f31fa",
"version" : "0.4.3"
"revision" : "e9be3c2743e462894bf56d41339b040f4060b567",
"version" : "0.5.0"
}
},
{
"identity" : "speziviews",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziViews.git",
"state" : {
"revision" : "4b7cc423fd823123d354ec1d541ca7d2e0a9d6e3",
"version" : "0.5.1"
"revision" : "eac443080926649d09a703483a6dd6f5a8bb7d51",
"version" : "0.6.2"
}
},
{
Expand Down
5 changes: 3 additions & 2 deletions NAMS/Account/AccountSetupHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import SwiftUI


struct AccountSetupHeader: View {
@EnvironmentObject private var account: Account
@Environment(Account.self)
private var account
@Environment(\._accountSetupState)
private var setupState

Expand Down Expand Up @@ -40,6 +41,6 @@ struct AccountSetupHeader: View {
#if DEBUG
#Preview {
AccountSetupHeader()
.environmentObject(Account())
.environment(Account())
}
#endif
7 changes: 4 additions & 3 deletions NAMS/Account/AccountSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ struct AccountSheet: View {
@Environment(\.dismiss)
var dismiss

@EnvironmentObject var account: Account
@Environment(Account.self)
private var account
@Environment(\.accountRequired)
var accountRequired

Expand Down Expand Up @@ -71,11 +72,11 @@ struct AccountSheet: View {
.set(\.name, value: PersonNameComponents(givenName: "Leland", familyName: "Stanford"))

return AccountSheet()
.environmentObject(Account(building: details, active: MockUserIdPasswordAccountService()))
.environment(Account(building: details, active: MockUserIdPasswordAccountService()))
}

#Preview {
AccountSheet()
.environmentObject(Account(MockUserIdPasswordAccountService()))
.environment(Account(MockUserIdPasswordAccountService()))
}
#endif
Loading

0 comments on commit f992823

Please sign in to comment.