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

Small cleanup throughout the app #40

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 0 additions & 4 deletions LLMonFHIR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */; };
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */; };
2FE5DC3829EDD7CA004B9AB4 /* Disclaimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */; };
2FE5DC3929EDD7CA004B9AB4 /* String+ModuleLocalized.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */; };
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */; };
2FE5DC4029EDD7EE004B9AB4 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3E29EDD7ED004B9AB4 /* FeatureFlags.swift */; };
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3F29EDD7EE004B9AB4 /* StorageKeys.swift */; };
Expand Down Expand Up @@ -124,7 +123,6 @@
2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitPermissions.swift; sourceTree = "<group>"; };
2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingFlow.swift; sourceTree = "<group>"; };
2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Disclaimer.swift; sourceTree = "<group>"; };
2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+ModuleLocalized.swift"; sourceTree = "<group>"; };
2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Welcome.swift; sourceTree = "<group>"; };
2FE5DC3E29EDD7ED004B9AB4 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
2FE5DC3F29EDD7EE004B9AB4 /* StorageKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKeys.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -258,7 +256,6 @@
2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */,
2F42429A2A8B14AC006E2B01 /* OpenAIAPIKey.swift */,
2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */,
2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */,
2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */,
);
path = Onboarding;
Expand Down Expand Up @@ -559,7 +556,6 @@
files = (
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */,
2F42429B2A8B14AC006E2B01 /* OpenAIAPIKey.swift in Sources */,
2FE5DC3929EDD7CA004B9AB4 /* String+ModuleLocalized.swift in Sources */,
2F036EC12B0EEE07009B2745 /* ResourceSelection.swift in Sources */,
2F036EA32B0EC9BC009B2745 /* FHIRStore+Extensions.swift in Sources */,
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--disableFirebase"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--showOnboarding"
isEnabled = "NO">
Expand All @@ -90,7 +86,7 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--useFirebaseEmulator"
argument = "--testMode"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extension FHIRResource {
return dateFormatter
}()


var functionCallIdentifier: String {
resourceType.filter { !$0.isWhitespace }
+ displayName.filter { !$0.isWhitespace }
Expand Down
2 changes: 1 addition & 1 deletion LLMonFHIR/FHIR Interpretation/LLMFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

static func getResources(allResourcesFunctionCallIdentifier: [String]) -> ChatFunctionDeclaration {
ChatFunctionDeclaration(
name: LLMFunction.getResourcesName,
name: Self.getResourcesName,

Check warning on line 17 in LLMonFHIR/FHIR Interpretation/LLMFunction.swift

View check run for this annotation

Codecov / codecov/patch

LLMonFHIR/FHIR Interpretation/LLMFunction.swift#L17

Added line #L17 was not covered by tests
description: String(localized: "FUNCTION_DESCRIPTION"),
parameters: JSONSchema(
type: .object,
Expand Down
26 changes: 13 additions & 13 deletions LLMonFHIR/Onboarding/Disclaimer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ struct Disclaimer: View {

var body: some View {
SequentialOnboardingView(
title: "DISCLAIMER_TITLE".moduleLocalized,
subtitle: "DISCLAIMER_SUBTITLE".moduleLocalized,
title: "DISCLAIMER_TITLE",
subtitle: "DISCLAIMER_SUBTITLE",
content: [
.init(
title: "DISCLAIMER_AREA1_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA1_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA1_TITLE",
description: "DISCLAIMER_AREA1_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA2_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA2_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA2_TITLE",
description: "DISCLAIMER_AREA2_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA3_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA3_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA3_TITLE",
description: "DISCLAIMER_AREA3_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA4_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA4_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA4_TITLE",
description: "DISCLAIMER_AREA4_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA5_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA5_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA5_TITLE",
description: "DISCLAIMER_AREA5_DESCRIPTION"
)
],
actionText: "DISCLAIMER_BUTTON".moduleLocalized,
actionText: "DISCLAIMER_BUTTON",
action: {
onboardingNavigationPath.nextStep()
}
Expand Down
8 changes: 4 additions & 4 deletions LLMonFHIR/Onboarding/HealthKitPermissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct HealthKitPermissions: View {
contentView: {
VStack {
OnboardingTitleView(
title: "HEALTHKIT_PERMISSIONS_TITLE".moduleLocalized,
subtitle: "HEALTHKIT_PERMISSIONS_SUBTITLE".moduleLocalized
title: "HEALTHKIT_PERMISSIONS_TITLE",
subtitle: "HEALTHKIT_PERMISSIONS_SUBTITLE"
)
Spacer()
Image(systemName: "heart.text.square.fill")
Expand All @@ -37,10 +37,10 @@ struct HealthKitPermissions: View {
}
}, actionView: {
OnboardingActionsView(
verbatim: "HEALTHKIT_PERMISSIONS_BUTTON".moduleLocalized,
"HEALTHKIT_PERMISSIONS_BUTTON",
action: {
healthKitProcessing = true
do {
healthKitProcessing = true
// HealthKit is not available in the preview simulator.
if ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" {
try await _Concurrency.Task.sleep(for: .seconds(5))
Expand Down
13 changes: 0 additions & 13 deletions LLMonFHIR/Onboarding/String+ModuleLocalized.swift

This file was deleted.

39 changes: 24 additions & 15 deletions LLMonFHIR/Onboarding/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,35 @@ struct Welcome: View {

var body: some View {
OnboardingView(
title: "WELCOME_TITLE".moduleLocalized,
subtitle: "WELCOME_SUBTITLE".moduleLocalized,
title: "WELCOME_TITLE",
subtitle: "WELCOME_SUBTITLE",
areas: [
.init(
icon: Image(systemName: "apps.iphone"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA1_TITLE".moduleLocalized,
description: "WELCOME_AREA1_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "apps.iphone")
.accessibilityHidden(true)
},
title: "WELCOME_AREA1_TITLE",
description: "WELCOME_AREA1_DESCRIPTION"
),
.init(
icon: Image(systemName: "shippingbox.fill"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA2_TITLE".moduleLocalized,
description: "WELCOME_AREA2_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "shippingbox.fill")
.accessibilityHidden(true)
},
title: "WELCOME_AREA2_TITLE",
description: "WELCOME_AREA2_DESCRIPTION"
),
.init(
icon: Image(systemName: "list.bullet.clipboard.fill"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA3_TITLE".moduleLocalized,
description: "WELCOME_AREA3_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "list.bullet.clipboard.fill")
.accessibilityHidden(true)
},
title: "WELCOME_AREA3_TITLE",
description: "WELCOME_AREA3_DESCRIPTION"
)
],
actionText: "WELCOME_BUTTON".moduleLocalized,
actionText: "WELCOME_BUTTON",
action: {
onboardingNavigationPath.nextStep()
}
Expand Down
4 changes: 1 addition & 3 deletions LLMonFHIR/SharedContext/StorageKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: MIT
//

/// Constants shared across the Spezi Teamplate Application to access storage information including the `AppStorage` and `SceneStorage`
/// Constants shared across the Spezi Template Application to access storage information including the `AppStorage` and `SceneStorage`
enum StorageKeys {
enum Defaults {
static let enableTextToSpeech = false
Expand All @@ -17,8 +17,6 @@ enum StorageKeys {
// MARK: - Onboarding
/// A `Bool` flag indicating of the onboarding was completed.
static let onboardingFlowComplete = "onboardingFlow.complete"
/// A `Step` flag indicating the current step in the onboarding process.
static let onboardingFlowStep = "onboardingFlow.step"


// MARK: - Home
Expand Down