From 11d0b1f737be1651d397cb7f41735e7ad8bca5bf Mon Sep 17 00:00:00 2001 From: nriedman <108841122+nriedman@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:00:12 -0700 Subject: [PATCH] Remove dead source code and dependencies Removed the following dependencies: SpeziContact SpeziScheduler SpeziMockWebService Removed filler tabs on landing page, leaving only Home. --- ENGAGEHF.xcodeproj/project.pbxproj | 147 ------------------ .../xcshareddata/swiftpm/Package.resolved | 29 +--- ENGAGEHF/Contacts/Contacts.swift | 78 ---------- ENGAGEHF/Education/EducationView.swift | 20 --- ENGAGEHF/HeartHealth/HeartHealthView.swift | 20 --- ENGAGEHF/Home.swift | 28 +--- ENGAGEHF/Medications/MedicationsView.swift | 20 --- ENGAGEHF/MockUpload/MockUpload.swift | 41 ----- ENGAGEHF/Schedule/Bundle+Questionnaire.swift | 26 ---- ENGAGEHF/Schedule/ENGAGEHFScheduler.swift | 49 ------ ENGAGEHF/Schedule/ENGAGEHFTaskContext.swift | 40 ----- ENGAGEHF/Schedule/EventContext.swift | 25 --- ENGAGEHF/Schedule/EventContextView.swift | 81 ---------- ENGAGEHF/Schedule/ModalView.swift | 47 ------ ENGAGEHF/Schedule/ScheduleView.swift | 119 -------------- 15 files changed, 2 insertions(+), 768 deletions(-) delete mode 100644 ENGAGEHF/Contacts/Contacts.swift delete mode 100644 ENGAGEHF/Education/EducationView.swift delete mode 100644 ENGAGEHF/HeartHealth/HeartHealthView.swift delete mode 100644 ENGAGEHF/Medications/MedicationsView.swift delete mode 100644 ENGAGEHF/MockUpload/MockUpload.swift delete mode 100644 ENGAGEHF/Schedule/Bundle+Questionnaire.swift delete mode 100644 ENGAGEHF/Schedule/ENGAGEHFScheduler.swift delete mode 100644 ENGAGEHF/Schedule/ENGAGEHFTaskContext.swift delete mode 100644 ENGAGEHF/Schedule/EventContext.swift delete mode 100644 ENGAGEHF/Schedule/EventContextView.swift delete mode 100644 ENGAGEHF/Schedule/ModalView.swift delete mode 100644 ENGAGEHF/Schedule/ScheduleView.swift diff --git a/ENGAGEHF.xcodeproj/project.pbxproj b/ENGAGEHF.xcodeproj/project.pbxproj index 0c2f251d..50fd5f9c 100644 --- a/ENGAGEHF.xcodeproj/project.pbxproj +++ b/ENGAGEHF.xcodeproj/project.pbxproj @@ -7,12 +7,9 @@ objects = { /* Begin PBXBuildFile section */ - 27FA29902A388E9B009CAC45 /* ModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FA298F2A388E9B009CAC45 /* ModalView.swift */; }; - 2F3D4ABC2A4E7C290068FB2F /* SpeziScheduler in Frameworks */ = {isa = PBXBuildFile; productRef = 2F3D4ABB2A4E7C290068FB2F /* SpeziScheduler */; }; 2F49B7762980407C00BCB272 /* Spezi in Frameworks */ = {isa = PBXBuildFile; productRef = 2F49B7752980407B00BCB272 /* Spezi */; }; 2F4E237E2989A2FE0013F3D9 /* LaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E237D2989A2FE0013F3D9 /* LaunchTests.swift */; }; 2F4E23832989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23822989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift */; }; - 2F4FC8D729EE69D300BFFE26 /* MockUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4FC8D629EE69D300BFFE26 /* MockUpload.swift */; }; 2F5E32BD297E05EA003432F8 /* ENGAGEHFDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E32BC297E05EA003432F8 /* ENGAGEHFDelegate.swift */; }; 2F6025CB29BBE70F0045459E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2F6025CA29BBE70F0045459E /* GoogleService-Info.plist */; }; 2F65B44E2A3B8B0600A36932 /* NotificationPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F65B44D2A3B8B0600A36932 /* NotificationPermissions.swift */; }; @@ -26,7 +23,6 @@ 2FC3439129EE6349002D773C /* AppIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */; }; 2FC3439229EE634B002D773C /* ConsentDocument.md in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */; }; 2FC975A82978F11A00BA99FE /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC975A72978F11A00BA99FE /* Home.swift */; }; - 2FE5DC2629EDD38A004B9AB4 /* Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2529EDD38A004B9AB4 /* Contacts.swift */; }; 2FE5DC3529EDD7CA004B9AB4 /* Consent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2F29EDD7CA004B9AB4 /* Consent.swift */; }; 2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */; }; 2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */; }; @@ -37,14 +33,7 @@ 2FE5DC4529EDD7F2004B9AB4 /* Binding+Negate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4229EDD7F2004B9AB4 /* Binding+Negate.swift */; }; 2FE5DC4629EDD7F2004B9AB4 /* Bundle+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4329EDD7F2004B9AB4 /* Bundle+Image.swift */; }; 2FE5DC4729EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4429EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift */; }; - 2FE5DC4E29EDD7FA004B9AB4 /* ScheduleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4829EDD7FA004B9AB4 /* ScheduleView.swift */; }; - 2FE5DC4F29EDD7FA004B9AB4 /* EventContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4929EDD7FA004B9AB4 /* EventContext.swift */; }; - 2FE5DC5029EDD7FA004B9AB4 /* EventContextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4A29EDD7FA004B9AB4 /* EventContextView.swift */; }; - 2FE5DC5129EDD7FA004B9AB4 /* ENGAGEHFTaskContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4B29EDD7FA004B9AB4 /* ENGAGEHFTaskContext.swift */; }; - 2FE5DC5229EDD7FA004B9AB4 /* ENGAGEHFScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4C29EDD7FA004B9AB4 /* ENGAGEHFScheduler.swift */; }; - 2FE5DC5329EDD7FA004B9AB4 /* Bundle+Questionnaire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC4D29EDD7FA004B9AB4 /* Bundle+Questionnaire.swift */; }; 2FE5DC6429EDD883004B9AB4 /* SpeziAccount in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC6329EDD883004B9AB4 /* SpeziAccount */; }; - 2FE5DC6729EDD894004B9AB4 /* SpeziContact in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC6629EDD894004B9AB4 /* SpeziContact */; }; 2FE5DC7229EDD8D3004B9AB4 /* SpeziHealthKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC7129EDD8D3004B9AB4 /* SpeziHealthKit */; }; 2FE5DC7529EDD8E6004B9AB4 /* SpeziFirebaseAccount in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC7429EDD8E6004B9AB4 /* SpeziFirebaseAccount */; }; 2FE5DC7729EDD8E6004B9AB4 /* SpeziFirebaseConfiguration in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC7629EDD8E6004B9AB4 /* SpeziFirebaseConfiguration */; }; @@ -56,12 +45,8 @@ 2FE5DC9929EDD9D9004B9AB4 /* XCTestExtensions in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC9829EDD9D9004B9AB4 /* XCTestExtensions */; }; 2FE5DC9C29EDD9EF004B9AB4 /* XCTHealthKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2FE5DC9B29EDD9EF004B9AB4 /* XCTHealthKit */; }; 2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; }; - 2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */ = {isa = PBXBuildFile; productRef = 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */; }; 2FF53D8D2A8729D600042B76 /* ENGAGEHFStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */; }; 4DB025B72BBDE903002D2545 /* DashboardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025B62BBDE903002D2545 /* DashboardView.swift */; }; - 4DB025BD2BBDE9F7002D2545 /* HeartHealthView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */; }; - 4DB025BF2BBDEA03002D2545 /* EducationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025BE2BBDEA03002D2545 /* EducationView.swift */; }; - 4DB025C12BBDEA0B002D2545 /* MedicationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */; }; 4DB025CA2BBE3A59002D2545 /* HomeViewUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025C92BBE3A59002D2545 /* HomeViewUITests.swift */; }; 4DB025CE2BBE8D2E002D2545 /* GreetingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DB025CD2BBE8D2E002D2545 /* GreetingView.swift */; }; 56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */ = {isa = PBXBuildFile; productRef = 56E708342BB06B7100B08F0A /* SpeziLicense */; }; @@ -97,10 +82,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 27FA298F2A388E9B009CAC45 /* ModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalView.swift; sourceTree = ""; }; 2F4E237D2989A2FE0013F3D9 /* LaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchTests.swift; sourceTree = ""; }; 2F4E23822989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ENGAGEHFTestingSetup.swift; sourceTree = ""; }; - 2F4FC8D629EE69D300BFFE26 /* MockUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockUpload.swift; sourceTree = ""; }; 2F5E32BC297E05EA003432F8 /* ENGAGEHFDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ENGAGEHFDelegate.swift; sourceTree = ""; }; 2F6025CA29BBE70F0045459E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 2F65B44D2A3B8B0600A36932 /* NotificationPermissions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationPermissions.swift; sourceTree = ""; }; @@ -108,7 +91,6 @@ 2FAEC07F297F583900C11C42 /* ENGAGEHF.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ENGAGEHF.entitlements; sourceTree = ""; }; 2FC94CD4298B0A1D009C8209 /* ENGAGEHF.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = ENGAGEHF.xctestplan; sourceTree = ""; }; 2FC975A72978F11A00BA99FE /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; - 2FE5DC2529EDD38A004B9AB4 /* Contacts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Contacts.swift; sourceTree = ""; }; 2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon.png; sourceTree = ""; }; 2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ConsentDocument.md; sourceTree = ""; }; 2FE5DC2F29EDD7CA004B9AB4 /* Consent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Consent.swift; sourceTree = ""; }; @@ -121,19 +103,10 @@ 2FE5DC4229EDD7F2004B9AB4 /* Binding+Negate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Binding+Negate.swift"; sourceTree = ""; }; 2FE5DC4329EDD7F2004B9AB4 /* Bundle+Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Image.swift"; sourceTree = ""; }; 2FE5DC4429EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CodableArray+RawRepresentable.swift"; sourceTree = ""; }; - 2FE5DC4829EDD7FA004B9AB4 /* ScheduleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScheduleView.swift; sourceTree = ""; }; - 2FE5DC4929EDD7FA004B9AB4 /* EventContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventContext.swift; sourceTree = ""; }; - 2FE5DC4A29EDD7FA004B9AB4 /* EventContextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventContextView.swift; sourceTree = ""; }; - 2FE5DC4B29EDD7FA004B9AB4 /* ENGAGEHFTaskContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ENGAGEHFTaskContext.swift; sourceTree = ""; }; - 2FE5DC4C29EDD7FA004B9AB4 /* ENGAGEHFScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ENGAGEHFScheduler.swift; sourceTree = ""; }; - 2FE5DC4D29EDD7FA004B9AB4 /* Bundle+Questionnaire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Questionnaire.swift"; sourceTree = ""; }; 2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SocialSupportQuestionnaire.json; sourceTree = ""; }; 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = ""; }; 2FF53D8C2A8729D600042B76 /* ENGAGEHFStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ENGAGEHFStandard.swift; sourceTree = ""; }; 4DB025B62BBDE903002D2545 /* DashboardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardView.swift; sourceTree = ""; }; - 4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartHealthView.swift; sourceTree = ""; }; - 4DB025BE2BBDEA03002D2545 /* EducationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EducationView.swift; sourceTree = ""; }; - 4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MedicationsView.swift; sourceTree = ""; }; 4DB025C92BBE3A59002D2545 /* HomeViewUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewUITests.swift; sourceTree = ""; }; 4DB025CD2BBE8D2E002D2545 /* GreetingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingView.swift; sourceTree = ""; }; 653A254D283387FE005D4D48 /* ENGAGEHF.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ENGAGEHF.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -157,7 +130,6 @@ 2FE5DC6429EDD883004B9AB4 /* SpeziAccount in Frameworks */, 2FB099AF2A875DF100B20952 /* FirebaseAuth in Frameworks */, 97D73D6A2AD860AD00B47FA0 /* SpeziFirebaseStorage in Frameworks */, - 2FE5DC6729EDD894004B9AB4 /* SpeziContact in Frameworks */, 2FE5DC8429EDD934004B9AB4 /* SpeziQuestionnaire in Frameworks */, 2FB099B32A875DF100B20952 /* FirebaseFirestoreSwift in Frameworks */, 2FB099B12A875DF100B20952 /* FirebaseFirestore in Frameworks */, @@ -170,11 +142,9 @@ 2FE5DC7529EDD8E6004B9AB4 /* SpeziFirebaseAccount in Frameworks */, A92E4DF02BAA001100AC8DE8 /* OrderedCollections in Frameworks */, 9739A0C62AD7B5730084BEA5 /* FirebaseStorage in Frameworks */, - 2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */, 2FE5DC7229EDD8D3004B9AB4 /* SpeziHealthKit in Frameworks */, 2F49B7762980407C00BCB272 /* Spezi in Frameworks */, 2FE5DC8F29EDD980004B9AB4 /* SpeziViews in Frameworks */, - 2F3D4ABC2A4E7C290068FB2F /* SpeziScheduler in Frameworks */, 2FBD738C2A3BD150004228E7 /* SpeziScheduler in Frameworks */, 2FE5DC7929EDD8E6004B9AB4 /* SpeziFirestore in Frameworks */, 2FE5DC7729EDD8E6004B9AB4 /* SpeziFirebaseConfiguration in Frameworks */, @@ -200,14 +170,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2F4FC8D529EE69BE00BFFE26 /* MockUpload */ = { - isa = PBXGroup; - children = ( - 2F4FC8D629EE69D300BFFE26 /* MockUpload.swift */, - ); - path = MockUpload; - sourceTree = ""; - }; 2FC9759D2978E30800BA99FE /* Supporting Files */ = { isa = PBXGroup; children = ( @@ -218,14 +180,6 @@ path = "Supporting Files"; sourceTree = ""; }; - 2FE5DC2729EDD38D004B9AB4 /* Contacts */ = { - isa = PBXGroup; - children = ( - 2FE5DC2529EDD38A004B9AB4 /* Contacts.swift */, - ); - path = Contacts; - sourceTree = ""; - }; 2FE5DC2829EDD398004B9AB4 /* Onboarding */ = { isa = PBXGroup; children = ( @@ -252,20 +206,6 @@ path = Resources; sourceTree = ""; }; - 2FE5DC3B29EDD7D0004B9AB4 /* Schedule */ = { - isa = PBXGroup; - children = ( - 2FE5DC4D29EDD7FA004B9AB4 /* Bundle+Questionnaire.swift */, - 2FE5DC4929EDD7FA004B9AB4 /* EventContext.swift */, - 2FE5DC4A29EDD7FA004B9AB4 /* EventContextView.swift */, - 2FE5DC4829EDD7FA004B9AB4 /* ScheduleView.swift */, - 2FE5DC4C29EDD7FA004B9AB4 /* ENGAGEHFScheduler.swift */, - 2FE5DC4B29EDD7FA004B9AB4 /* ENGAGEHFTaskContext.swift */, - 27FA298F2A388E9B009CAC45 /* ModalView.swift */, - ); - path = Schedule; - sourceTree = ""; - }; 2FE5DC3C29EDD7DA004B9AB4 /* SharedContext */ = { isa = PBXGroup; children = ( @@ -294,30 +234,6 @@ path = Dashboard; sourceTree = ""; }; - 4DB025B92BBDE9CB002D2545 /* HeartHealth */ = { - isa = PBXGroup; - children = ( - 4DB025BC2BBDE9F7002D2545 /* HeartHealthView.swift */, - ); - path = HeartHealth; - sourceTree = ""; - }; - 4DB025BA2BBDE9DA002D2545 /* Medications */ = { - isa = PBXGroup; - children = ( - 4DB025C02BBDEA0B002D2545 /* MedicationsView.swift */, - ); - path = Medications; - sourceTree = ""; - }; - 4DB025BB2BBDE9E2002D2545 /* Education */ = { - isa = PBXGroup; - children = ( - 4DB025BE2BBDEA03002D2545 /* EducationView.swift */, - ); - path = Education; - sourceTree = ""; - }; 653A2544283387FE005D4D48 = { isa = PBXGroup; children = ( @@ -349,14 +265,8 @@ 2F4E23822989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift */, 2FC975A72978F11A00BA99FE /* Home.swift */, 4DB025B52BBDE8EC002D2545 /* Dashboard */, - 4DB025B92BBDE9CB002D2545 /* HeartHealth */, - 4DB025BB2BBDE9E2002D2545 /* Education */, - 4DB025BA2BBDE9DA002D2545 /* Medications */, A9720E412ABB68B300872D23 /* Account */, 2FE5DC2829EDD398004B9AB4 /* Onboarding */, - 2FE5DC3B29EDD7D0004B9AB4 /* Schedule */, - 2FE5DC2729EDD38D004B9AB4 /* Contacts */, - 2F4FC8D529EE69BE00BFFE26 /* MockUpload */, 2FE5DC3C29EDD7DA004B9AB4 /* SharedContext */, 2FE5DC3D29EDD7E4004B9AB4 /* Helper */, 2FE5DC2D29EDD792004B9AB4 /* Resources */, @@ -420,7 +330,6 @@ packageProductDependencies = ( 2F49B7752980407B00BCB272 /* Spezi */, 2FE5DC6329EDD883004B9AB4 /* SpeziAccount */, - 2FE5DC6629EDD894004B9AB4 /* SpeziContact */, 2FE5DC7129EDD8D3004B9AB4 /* SpeziHealthKit */, 2FE5DC7429EDD8E6004B9AB4 /* SpeziFirebaseAccount */, 2FE5DC7629EDD8E6004B9AB4 /* SpeziFirebaseConfiguration */, @@ -430,9 +339,7 @@ 2FE5DC8B29EDD972004B9AB4 /* SpeziSecureStorage */, 2FE5DC8E29EDD980004B9AB4 /* SpeziViews */, 2FBD738B2A3BD150004228E7 /* SpeziScheduler */, - 2F3D4ABB2A4E7C290068FB2F /* SpeziScheduler */, 2FE5DC8029EDD91D004B9AB4 /* SpeziOnboarding */, - 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */, 2FB099AE2A875DF100B20952 /* FirebaseAuth */, 2FB099B02A875DF100B20952 /* FirebaseFirestore */, 2FB099B22A875DF100B20952 /* FirebaseFirestoreSwift */, @@ -523,7 +430,6 @@ packageReferences = ( 2F49B7742980407B00BCB272 /* XCRemoteSwiftPackageReference "Spezi" */, 2FE5DC6229EDD883004B9AB4 /* XCRemoteSwiftPackageReference "SpeziAccount" */, - 2FE5DC6529EDD894004B9AB4 /* XCRemoteSwiftPackageReference "SpeziContact" */, 2FE5DC7029EDD8D3004B9AB4 /* XCRemoteSwiftPackageReference "SpeziHealthKit" */, 2FE5DC7329EDD8E6004B9AB4 /* XCRemoteSwiftPackageReference "SpeziFirebase" */, 2FE5DC8229EDD934004B9AB4 /* XCRemoteSwiftPackageReference "SpeziQuestionnaire" */, @@ -532,9 +438,7 @@ 2FE5DC9029EDD9C3004B9AB4 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, 2FE5DC9729EDD9D9004B9AB4 /* XCRemoteSwiftPackageReference "XCTestExtensions" */, 2FE5DC9A29EDD9EF004B9AB4 /* XCRemoteSwiftPackageReference "XCTHealthKit" */, - 2F3D4ABA2A4E7C290068FB2F /* XCRemoteSwiftPackageReference "SpeziScheduler" */, 97F466E62A76BBEE005DC9B4 /* XCRemoteSwiftPackageReference "SpeziOnboarding" */, - 2FE750CA2A87240100723EAE /* XCRemoteSwiftPackageReference "SpeziMockWebService" */, 2FB099B42A875E2B00B20952 /* XCRemoteSwiftPackageReference "HealthKitOnFHIR" */, 5661551B2AB8384200209B80 /* XCRemoteSwiftPackageReference "swift-package-list" */, A92E4DEE2BAA001100AC8DE8 /* XCRemoteSwiftPackageReference "swift-collections" */, @@ -589,37 +493,25 @@ files = ( 2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */, 2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */, - 2F4FC8D729EE69D300BFFE26 /* MockUpload.swift in Sources */, - 4DB025C12BBDEA0B002D2545 /* MedicationsView.swift in Sources */, 2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */, 2FE5DC3829EDD7CA004B9AB4 /* InterestingModules.swift in Sources */, - 4DB025BF2BBDEA03002D2545 /* EducationView.swift in Sources */, 2FE5DC3529EDD7CA004B9AB4 /* Consent.swift in Sources */, 2FE5DC4529EDD7F2004B9AB4 /* Binding+Negate.swift in Sources */, 4DB025B72BBDE903002D2545 /* DashboardView.swift in Sources */, 2FC975A82978F11A00BA99FE /* Home.swift in Sources */, - 2FE5DC4E29EDD7FA004B9AB4 /* ScheduleView.swift in Sources */, A9DFE8A92ABE551400428242 /* AccountButton.swift in Sources */, 2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */, 2FF53D8D2A8729D600042B76 /* ENGAGEHFStandard.swift in Sources */, 2FE5DC4729EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift in Sources */, - 4DB025BD2BBDE9F7002D2545 /* HeartHealthView.swift in Sources */, A9720E432ABB68CC00872D23 /* AccountSetupHeader.swift in Sources */, 2FE5DC4029EDD7EE004B9AB4 /* FeatureFlags.swift in Sources */, 2FE5DC4629EDD7F2004B9AB4 /* Bundle+Image.swift in Sources */, - 2FE5DC4F29EDD7FA004B9AB4 /* EventContext.swift in Sources */, - 2FE5DC5029EDD7FA004B9AB4 /* EventContextView.swift in Sources */, 2F4E23832989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift in Sources */, - 2FE5DC5329EDD7FA004B9AB4 /* Bundle+Questionnaire.swift in Sources */, - 2FE5DC5129EDD7FA004B9AB4 /* ENGAGEHFTaskContext.swift in Sources */, 2F5E32BD297E05EA003432F8 /* ENGAGEHFDelegate.swift in Sources */, - 2FE5DC5229EDD7FA004B9AB4 /* ENGAGEHFScheduler.swift in Sources */, A9FE7AD02AA39BAB0077B045 /* AccountSheet.swift in Sources */, 653A2551283387FE005D4D48 /* ENGAGEHF.swift in Sources */, 2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */, 2F65B44E2A3B8B0600A36932 /* NotificationPermissions.swift in Sources */, - 27FA29902A388E9B009CAC45 /* ModalView.swift in Sources */, - 2FE5DC2629EDD38A004B9AB4 /* Contacts.swift in Sources */, 4DB025CE2BBE8D2E002D2545 /* GreetingView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1125,14 +1017,6 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 2F3D4ABA2A4E7C290068FB2F /* XCRemoteSwiftPackageReference "SpeziScheduler" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/StanfordSpezi/SpeziScheduler.git"; - requirement = { - kind = upToNextMinorVersion; - minimumVersion = 0.8.0; - }; - }; 2F49B7742980407B00BCB272 /* XCRemoteSwiftPackageReference "Spezi" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordSpezi/Spezi"; @@ -1165,14 +1049,6 @@ minimumVersion = 1.1.0; }; }; - 2FE5DC6529EDD894004B9AB4 /* XCRemoteSwiftPackageReference "SpeziContact" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/StanfordSpezi/SpeziContact.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 1.0.0; - }; - }; 2FE5DC7029EDD8D3004B9AB4 /* XCRemoteSwiftPackageReference "SpeziHealthKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/StanfordSpezi/SpeziHealthKit.git"; @@ -1237,14 +1113,6 @@ minimumVersion = 0.3.5; }; }; - 2FE750CA2A87240100723EAE /* XCRemoteSwiftPackageReference "SpeziMockWebService" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/StanfordSpezi/SpeziMockWebService.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 1.0.0; - }; - }; 5661551B2AB8384200209B80 /* XCRemoteSwiftPackageReference "swift-package-list" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/FelixHerrmann/swift-package-list"; @@ -1280,11 +1148,6 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 2F3D4ABB2A4E7C290068FB2F /* SpeziScheduler */ = { - isa = XCSwiftPackageProductDependency; - package = 2F3D4ABA2A4E7C290068FB2F /* XCRemoteSwiftPackageReference "SpeziScheduler" */; - productName = SpeziScheduler; - }; 2F49B7752980407B00BCB272 /* Spezi */ = { isa = XCSwiftPackageProductDependency; package = 2F49B7742980407B00BCB272 /* XCRemoteSwiftPackageReference "Spezi" */; @@ -1324,11 +1187,6 @@ package = 2FE5DC6229EDD883004B9AB4 /* XCRemoteSwiftPackageReference "SpeziAccount" */; productName = SpeziAccount; }; - 2FE5DC6629EDD894004B9AB4 /* SpeziContact */ = { - isa = XCSwiftPackageProductDependency; - package = 2FE5DC6529EDD894004B9AB4 /* XCRemoteSwiftPackageReference "SpeziContact" */; - productName = SpeziContact; - }; 2FE5DC7129EDD8D3004B9AB4 /* SpeziHealthKit */ = { isa = XCSwiftPackageProductDependency; package = 2FE5DC7029EDD8D3004B9AB4 /* XCRemoteSwiftPackageReference "SpeziHealthKit" */; @@ -1384,11 +1242,6 @@ package = 2FE5DC9A29EDD9EF004B9AB4 /* XCRemoteSwiftPackageReference "XCTHealthKit" */; productName = XCTHealthKit; }; - 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */ = { - isa = XCSwiftPackageProductDependency; - package = 2FE750CA2A87240100723EAE /* XCRemoteSwiftPackageReference "SpeziMockWebService" */; - productName = SpeziMockWebService; - }; 56E708342BB06B7100B08F0A /* SpeziLicense */ = { isa = XCSwiftPackageProductDependency; package = 56E708332BB06B7100B08F0A /* XCRemoteSwiftPackageReference "SpeziLicense" */; diff --git a/ENGAGEHF.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ENGAGEHF.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b4efd2f7..09739527 100644 --- a/ENGAGEHF.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ENGAGEHF.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "d2097b02aed2e09776146d22c31b71e71570248079de679a782c846c09d0ae6f", + "originHash" : "bee0ebef27ad6762a532584daf21fda010763ebcd3c397d471d2bfbad0b9aa6c", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -190,15 +190,6 @@ "version" : "1.2.1" } }, - { - "identity" : "spezicontact", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziContact.git", - "state" : { - "revision" : "494b776f8c98d771e4a609a1fb706097dba4c030", - "version" : "1.0.0" - } - }, { "identity" : "spezifirebase", "kind" : "remoteSourceControl", @@ -235,15 +226,6 @@ "revision" : "9b1713dd9ac14708c0381cf54ad84e13f3780083" } }, - { - "identity" : "spezimockwebservice", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziMockWebService.git", - "state" : { - "revision" : "b18067d3499e630bbd995ef05a296ef8fdd42528", - "version" : "1.0.0" - } - }, { "identity" : "spezionboarding", "kind" : "remoteSourceControl", @@ -262,15 +244,6 @@ "version" : "1.1.0" } }, - { - "identity" : "spezischeduler", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziScheduler.git", - "state" : { - "revision" : "eed3980f20b01a788720c869010e3fe2fbfcd1fd", - "version" : "0.8.2" - } - }, { "identity" : "spezistorage", "kind" : "remoteSourceControl", diff --git a/ENGAGEHF/Contacts/Contacts.swift b/ENGAGEHF/Contacts/Contacts.swift deleted file mode 100644 index 42fd079b..00000000 --- a/ENGAGEHF/Contacts/Contacts.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import SpeziContact -import SwiftUI - - -/// Displays the contacts for the ENGAGEHF. -struct Contacts: View { - let contacts = [ - Contact( - name: PersonNameComponents( - givenName: "Leland", - familyName: "Stanford" - ), - image: Image(systemName: "figure.wave.circle"), // swiftlint:disable:this accessibility_label_for_image - title: "University Founder", - description: String(localized: "LELAND_STANFORD_BIO"), - organization: "Stanford University", - address: { - let address = CNMutablePostalAddress() - address.country = "USA" - address.state = "CA" - address.postalCode = "94305" - address.city = "Stanford" - address.street = "450 Serra Mall" - return address - }(), - contactOptions: [ - .call("+1 (650) 723-2300"), - .text("+1 (650) 723-2300"), - .email(addresses: ["contact@stanford.edu"]), - ContactOption( - image: Image(systemName: "safari.fill"), // swiftlint:disable:this accessibility_label_for_image - title: "Website", - action: { - if let url = URL(string: "https://stanford.edu") { - UIApplication.shared.open(url) - } - } - ) - ] - ) - ] - - @Binding var presentingAccount: Bool - - - var body: some View { - NavigationStack { - ContactsList(contacts: contacts) - .navigationTitle(String(localized: "CONTACTS_NAVIGATION_TITLE")) - .toolbar { - if AccountButton.shouldDisplay { - AccountButton(isPresented: $presentingAccount) - } - } - } - } - - - init(presentingAccount: Binding) { - self._presentingAccount = presentingAccount - } -} - - -#if DEBUG -#Preview { - Contacts(presentingAccount: .constant(false)) -} -#endif diff --git a/ENGAGEHF/Education/EducationView.swift b/ENGAGEHF/Education/EducationView.swift deleted file mode 100644 index 80d3e460..00000000 --- a/ENGAGEHF/Education/EducationView.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SwiftUI - - -struct Education: View { - @Binding var presentingAccount: Bool - - - var body: some View { - Text("Education Test") - .accessibilityLabel(Text("EDU")) - } -} diff --git a/ENGAGEHF/HeartHealth/HeartHealthView.swift b/ENGAGEHF/HeartHealth/HeartHealthView.swift deleted file mode 100644 index 8d9a3e8e..00000000 --- a/ENGAGEHF/HeartHealth/HeartHealthView.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SwiftUI - - -struct HeartHealth: View { - @Binding var presentingAccount: Bool - - - var body: some View { - Text("Heart Health Test") - .accessibilityLabel(Text("HH")) - } -} diff --git a/ENGAGEHF/Home.swift b/ENGAGEHF/Home.swift index ef8aeb24..3aa96d49 100644 --- a/ENGAGEHF/Home.swift +++ b/ENGAGEHF/Home.swift @@ -14,10 +14,6 @@ import SwiftUI struct HomeView: View { enum Tabs: String { case home - case heart - case medications - case education - case mockUpload } static var accountEnabled: Bool { @@ -36,30 +32,8 @@ struct HomeView: View { .tabItem { Label("Home", systemImage: "house") } - HeartHealth(presentingAccount: $presentingAccount) - .tag(Tabs.heart) - .tabItem { - Label("Heart Health", systemImage: "heart.square") - } - Medications(presentingAccount: $presentingAccount) - .tag(Tabs.medications) - .tabItem { - Label("Medications", systemImage: "pill") - } - Education(presentingAccount: $presentingAccount) - .tag(Tabs.education) - .tabItem { - Label("Education", systemImage: "book.pages") - } - if FeatureFlags.disableFirebase { - MockUpload(presentingAccount: $presentingAccount) - .tag(Tabs.mockUpload) - .tabItem { - Label("MOCK_WEB_SERVICE_TAB_TITLE", systemImage: "server.rack") - } - } } - .accessibilityLabel(Text("Tab Bar")) + .sheet(isPresented: $presentingAccount) { AccountSheet() } diff --git a/ENGAGEHF/Medications/MedicationsView.swift b/ENGAGEHF/Medications/MedicationsView.swift deleted file mode 100644 index 055c704f..00000000 --- a/ENGAGEHF/Medications/MedicationsView.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SwiftUI - - -struct Medications: View { - @Binding var presentingAccount: Bool - - - var body: some View { - Text("Medications Test") - .accessibilityLabel(Text("MED")) - } -} diff --git a/ENGAGEHF/MockUpload/MockUpload.swift b/ENGAGEHF/MockUpload/MockUpload.swift deleted file mode 100644 index 38da83ed..00000000 --- a/ENGAGEHF/MockUpload/MockUpload.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SpeziMockWebService -import SwiftUI - - -struct MockUpload: View { - @Binding var presentingAccount: Bool - - var body: some View { - NavigationStack { - RequestList() - .toolbar { - if AccountButton.shouldDisplay { - AccountButton(isPresented: $presentingAccount) - } - } - } - } - - - init(presentingAccount: Binding) { - self._presentingAccount = presentingAccount - } -} - - -#if DEBUG -#Preview { - MockUpload(presentingAccount: .constant(false)) - .previewWith { - MockWebService() - } -} -#endif diff --git a/ENGAGEHF/Schedule/Bundle+Questionnaire.swift b/ENGAGEHF/Schedule/Bundle+Questionnaire.swift deleted file mode 100644 index 6a766924..00000000 --- a/ENGAGEHF/Schedule/Bundle+Questionnaire.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import SpeziQuestionnaire - - -extension Foundation.Bundle { - func questionnaire(withName name: String) -> Questionnaire { - guard let resourceURL = self.url(forResource: name, withExtension: "json") else { - fatalError("Could not find the questionnaire \"\(name).json\" in the bundle.") - } - - do { - let resourceData = try Data(contentsOf: resourceURL) - return try JSONDecoder().decode(Questionnaire.self, from: resourceData) - } catch { - fatalError("Could not decode the FHIR questionnaire named \"\(name).json\": \(error)") - } - } -} diff --git a/ENGAGEHF/Schedule/ENGAGEHFScheduler.swift b/ENGAGEHF/Schedule/ENGAGEHFScheduler.swift deleted file mode 100644 index 5f38b583..00000000 --- a/ENGAGEHF/Schedule/ENGAGEHFScheduler.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import SpeziScheduler - - -/// A `Scheduler` using the ``ENGAGEHFTaskContext`` to schedule and manage tasks and events in the -/// ENGAGEHF. -typealias ENGAGEHFScheduler = Scheduler - - -extension ENGAGEHFScheduler { - static var socialSupportTask: SpeziScheduler.Task { - let dateComponents: DateComponents - if FeatureFlags.testSchedule { - // Adds a task at the current time for UI testing if the `--testSchedule` feature flag is set - dateComponents = DateComponents( - hour: Calendar.current.component(.hour, from: .now), - minute: Calendar.current.component(.minute, from: .now) - ) - } else { - // For the normal app usage, we schedule the task for every day at 8:00 AM - dateComponents = DateComponents(hour: 8, minute: 0) - } - - return Task( - title: String(localized: "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_TITLE"), - description: String(localized: "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_DESCRIPTION"), - schedule: Schedule( - start: Calendar.current.startOfDay(for: Date()), - repetition: .matching(dateComponents), - end: .numberOfEvents(365) - ), - notifications: true, - context: ENGAGEHFTaskContext.questionnaire(Bundle.main.questionnaire(withName: "SocialSupportQuestionnaire")) - ) - } - - /// Creates a default instance of the ``ENGAGEHFScheduler`` by scheduling the tasks listed below. - convenience init() { - self.init(tasks: [Self.socialSupportTask]) - } -} diff --git a/ENGAGEHF/Schedule/ENGAGEHFTaskContext.swift b/ENGAGEHF/Schedule/ENGAGEHFTaskContext.swift deleted file mode 100644 index d0621b3e..00000000 --- a/ENGAGEHF/Schedule/ENGAGEHFTaskContext.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import ModelsR4 - - -/// The context attached to each task in the ENGAGEHF. -/// -/// We currently only support `Questionnaire`s, more cases can be added in the future. -enum ENGAGEHFTaskContext: Codable, Identifiable { - /// The task should display a `Questionnaire`. - case questionnaire(Questionnaire) - /// The task is used for UI testing. - case test(String) - - - var id: FHIRPrimitive? { - switch self { - case let .questionnaire(questionnaire): - return questionnaire.id - case .test: - return FHIRPrimitive(FHIRString(UUID().uuidString)) - } - } - - var actionType: LocalizedStringResource { - switch self { - case .questionnaire: - return LocalizedStringResource("TASK_CONTEXT_ACTION_QUESTIONNAIRE") - case .test: - return LocalizedStringResource("TASK_CONTEXT_ACTION_TEST") - } - } -} diff --git a/ENGAGEHF/Schedule/EventContext.swift b/ENGAGEHF/Schedule/EventContext.swift deleted file mode 100644 index be96cfed..00000000 --- a/ENGAGEHF/Schedule/EventContext.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SpeziScheduler - - -struct EventContext: Comparable, Identifiable { - let event: Event - let task: Task - - - var id: Event.ID { - event.id - } - - - static func < (lhs: EventContext, rhs: EventContext) -> Bool { - lhs.event.scheduledAt < rhs.event.scheduledAt - } -} diff --git a/ENGAGEHF/Schedule/EventContextView.swift b/ENGAGEHF/Schedule/EventContextView.swift deleted file mode 100644 index 3a5c2551..00000000 --- a/ENGAGEHF/Schedule/EventContextView.swift +++ /dev/null @@ -1,81 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SpeziScheduler -import SwiftUI - - -struct EventContextView: View { - let eventContext: EventContext - - - var body: some View { - HStack { - VStack(alignment: .leading) { - HStack { - if eventContext.event.complete { - Image(systemName: "checkmark.circle.fill") - .foregroundColor(.accentColor) - .font(.system(size: 30)) - .accessibilityHidden(true) - } - VStack(alignment: .leading, spacing: 8) { - Text(verbatim: eventContext.task.title) - .font(.headline) - .accessibilityLabel( - eventContext.event.complete - ? "COMPLETED_TASK_LABEL \(eventContext.task.title)" - : "TASK_LABEL \(eventContext.task.title)" - ) - Text(verbatim: format(eventDate: eventContext.event.scheduledAt)) - .font(.subheadline) - } - } - Divider() - Text(eventContext.task.description) - .font(.callout) - if !eventContext.event.complete { - Text(eventContext.task.context.actionType) - .frame(maxWidth: .infinity, minHeight: 50) - .foregroundColor(.white) - .background(Color.accentColor) - .clipShape(RoundedRectangle(cornerRadius: 8)) - .padding(.top, 8) - } - } - } - .disabled(eventContext.event.complete) - .contentShape(Rectangle()) - } - - - private func format(eventDate: Date) -> String { - let dateFormatter = DateFormatter() - dateFormatter.dateStyle = .none - dateFormatter.timeStyle = .short - return dateFormatter.string(from: eventDate) - } -} - - -#if DEBUG -#Preview(traits: .sizeThatFitsLayout) { - let task = ENGAGEHFScheduler.socialSupportTask - - return EventContextView( - eventContext: EventContext( - // We use a force unwrap in the preview as we can not recover from an error here - // and the code will never end up in a production environment. - // swiftlint:disable:next force_unwrapping - event: task.events(from: .now.addingTimeInterval(-60 * 60 * 24)).first!, - task: task - ) - ) - .padding() -} -#endif diff --git a/ENGAGEHF/Schedule/ModalView.swift b/ENGAGEHF/Schedule/ModalView.swift deleted file mode 100644 index 16b826ed..00000000 --- a/ENGAGEHF/Schedule/ModalView.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SpeziViews -import SwiftUI - - -struct ModalView: View { - @Environment(\.dismiss) private var dismiss - - let text: String - let buttonText: String - let onClose: () async -> Void - - - var body: some View { - VStack { - Spacer() - Text(text) - .padding() - Spacer() - AsyncButton { - self.dismiss() - await self.onClose() - } label: { - Text(buttonText) - .frame(maxWidth: .infinity, minHeight: 38) - } - .padding() - .buttonStyle(.borderedProminent) - } - } -} - - -#if DEBUG -#Preview { - ModalView(text: "Preview Modal", buttonText: "Close") { - print("Preview Modal closed.") - } -} -#endif diff --git a/ENGAGEHF/Schedule/ScheduleView.swift b/ENGAGEHF/Schedule/ScheduleView.swift deleted file mode 100644 index c2f5c343..00000000 --- a/ENGAGEHF/Schedule/ScheduleView.swift +++ /dev/null @@ -1,119 +0,0 @@ -// -// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import OrderedCollections -import SpeziAccount -import SpeziQuestionnaire -import SpeziScheduler -import SwiftUI - - -struct ScheduleView: View { - @Environment(ENGAGEHFStandard.self) private var standard - @Environment(ENGAGEHFScheduler.self) private var scheduler - - @State private var presentedContext: EventContext? - @Binding private var presentingAccount: Bool - - - private var eventContextsByDate: OrderedDictionary { - let eventContexts = scheduler.tasks.flatMap { task in - task - .events( - from: Calendar.current.startOfDay(for: .now), - to: .numberOfEventsOrEndDate(100, .now) - ) - .map { event in - EventContext(event: event, task: task) - } - } - .sorted() - - return OrderedDictionary(grouping: eventContexts) { eventContext in - Calendar.current.startOfDay(for: eventContext.event.scheduledAt) - } - } - - - var body: some View { - NavigationStack { - let eventContextsByDate = eventContextsByDate - List(eventContextsByDate.keys, id: \.timeIntervalSinceNow) { startOfDay in - Section(format(startOfDay: startOfDay)) { - ForEach(eventContextsByDate[startOfDay] ?? [], id: \.event) { eventContext in - EventContextView(eventContext: eventContext) - .onTapGesture { - if !eventContext.event.complete { - presentedContext = eventContext - } - } - } - } - } - .sheet(item: $presentedContext) { presentedContext in - destination(withContext: presentedContext) - } - .toolbar { - if AccountButton.shouldDisplay { - AccountButton(isPresented: $presentingAccount) - } - } - .navigationTitle("SCHEDULE_LIST_TITLE") - } - } - - - init(presentingAccount: Binding) { - self._presentingAccount = presentingAccount - } - - - private func destination(withContext eventContext: EventContext) -> some View { - @ViewBuilder var destination: some View { - switch eventContext.task.context { - case let .questionnaire(questionnaire): - QuestionnaireView(questionnaire: questionnaire) { result in - presentedContext = nil - - guard case let .completed(response) = result else { - return // user cancelled the task - } - - eventContext.event.complete(true) - await standard.add(response: response) - } - case let .test(string): - ModalView(text: string, buttonText: String(localized: "CLOSE")) { - await eventContext.event.complete(true) - } - } - } - return destination - } - - - private func format(startOfDay: Date) -> String { - let dateFormatter = DateFormatter() - dateFormatter.dateStyle = .long - dateFormatter.timeStyle = .none - return dateFormatter.string(from: startOfDay) - } -} - - -#if DEBUG -#Preview("ScheduleView") { - ScheduleView(presentingAccount: .constant(false)) - .previewWith(standard: ENGAGEHFStandard()) { - ENGAGEHFScheduler() - AccountConfiguration { - MockUserIdPasswordAccountService() - } - } -} -#endif