Skip to content
Merged
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
12 changes: 0 additions & 12 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
1D4A3E2D2478628500FD601B /* StoredAlert+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D4A3E2B2478628500FD601B /* StoredAlert+CoreDataClass.swift */; };
1D4A3E2E2478628500FD601B /* StoredAlert+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D4A3E2C2478628500FD601B /* StoredAlert+CoreDataProperties.swift */; };
1D63DEA526E950D400F46FA5 /* SupportManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D63DEA426E950D400F46FA5 /* SupportManager.swift */; };
C1A55E012E9F000000A10002 /* IssueReportSubmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A55E012E9F000000A10001 /* IssueReportSubmitter.swift */; };
1D6B1B6726866D89009AC446 /* AlertPermissionsChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D6B1B6626866D89009AC446 /* AlertPermissionsChecker.swift */; };
1D70C40126EC0F9D00C62570 /* SupportManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D70C40026EC0F9D00C62570 /* SupportManagerTests.swift */; };
1D80313D24746274002810DF /* AlertStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D80313C24746274002810DF /* AlertStoreTests.swift */; };
Expand Down Expand Up @@ -123,7 +122,6 @@
4328E0351CFC0AE100E199AA /* WatchDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4328E0341CFC0AE100E199AA /* WatchDataManager.swift */; };
432CF87520D8AC950066B889 /* NSUserDefaults+WatchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4328E0231CFBE2C500E199AA /* NSUserDefaults+WatchApp.swift */; };
432E73CB1D24B3D6009AD15D /* RemoteDataServicesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 432E73CA1D24B3D6009AD15D /* RemoteDataServicesManager.swift */; };
433EA4C41D9F71C800CD78FB /* CommandResponseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 433EA4C31D9F71C800CD78FB /* CommandResponseViewController.swift */; };
4344628220A7A37F00C4BE6F /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4344628120A7A37E00C4BE6F /* CoreBluetooth.framework */; };
4344629220A7C19800C4BE6F /* ButtonGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4344629120A7C19800C4BE6F /* ButtonGroup.swift */; };
4344629820A8B2D700C4BE6F /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4374B5EE209D84BE00D17AA8 /* OSLog.swift */; };
Expand Down Expand Up @@ -358,7 +356,6 @@
A987CD4924A58A0100439ADC /* ZipArchive.swift in Sources */ = {isa = PBXBuildFile; fileRef = A987CD4824A58A0100439ADC /* ZipArchive.swift */; };
A999D40624663D18004C89D4 /* PumpManagerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = A999D40524663D18004C89D4 /* PumpManagerError.swift */; };
A9A056B324B93C62007CF06D /* CriticalEventLogExportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A056B224B93C62007CF06D /* CriticalEventLogExportView.swift */; };
C1A55E012E9F000000A10004 /* SendIssueReportView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A55E012E9F000000A10003 /* SendIssueReportView.swift */; };
A9A056B524B94123007CF06D /* CriticalEventLogExportViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A056B424B94123007CF06D /* CriticalEventLogExportViewModel.swift */; };
A9A63F8E246B271600588D5B /* NSTimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 439897341CD2F7DE00223065 /* NSTimeInterval.swift */; };
A9B607B0247F000F00792BE4 /* UserNotifications+Loop.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B607AF247F000F00792BE4 /* UserNotifications+Loop.swift */; };
Expand Down Expand Up @@ -838,7 +835,6 @@
1D4A3E2B2478628500FD601B /* StoredAlert+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StoredAlert+CoreDataClass.swift"; sourceTree = "<group>"; };
1D4A3E2C2478628500FD601B /* StoredAlert+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StoredAlert+CoreDataProperties.swift"; sourceTree = "<group>"; };
1D63DEA426E950D400F46FA5 /* SupportManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportManager.swift; sourceTree = "<group>"; };
C1A55E012E9F000000A10001 /* IssueReportSubmitter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueReportSubmitter.swift; sourceTree = "<group>"; };
1D6B1B6626866D89009AC446 /* AlertPermissionsChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPermissionsChecker.swift; sourceTree = "<group>"; };
1D70C40026EC0F9D00C62570 /* SupportManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportManagerTests.swift; sourceTree = "<group>"; };
1D80313C24746274002810DF /* AlertStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertStoreTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -891,7 +887,6 @@
4328E0341CFC0AE100E199AA /* WatchDataManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = WatchDataManager.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
432E73CA1D24B3D6009AD15D /* RemoteDataServicesManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteDataServicesManager.swift; sourceTree = "<group>"; };
4337615E1D52F487004A3647 /* GlucoseHUDView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlucoseHUDView.swift; sourceTree = "<group>"; };
433EA4C31D9F71C800CD78FB /* CommandResponseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandResponseViewController.swift; sourceTree = "<group>"; };
4344628120A7A37E00C4BE6F /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreBluetooth.framework; sourceTree = DEVELOPER_DIR; };
4344628320A7A3BE00C4BE6F /* LoopKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LoopKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4344628420A7A3BE00C4BE6F /* CGMBLEKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CGMBLEKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -1173,7 +1168,6 @@
A987CD4824A58A0100439ADC /* ZipArchive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZipArchive.swift; sourceTree = "<group>"; };
A999D40524663D18004C89D4 /* PumpManagerError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpManagerError.swift; sourceTree = "<group>"; };
A9A056B224B93C62007CF06D /* CriticalEventLogExportView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CriticalEventLogExportView.swift; sourceTree = "<group>"; };
C1A55E012E9F000000A10003 /* SendIssueReportView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendIssueReportView.swift; sourceTree = "<group>"; };
A9A056B424B94123007CF06D /* CriticalEventLogExportViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CriticalEventLogExportViewModel.swift; sourceTree = "<group>"; };
A9B607AF247F000F00792BE4 /* UserNotifications+Loop.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserNotifications+Loop.swift"; sourceTree = "<group>"; };
A9B996EF27235191002DC09C /* LoopWarning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoopWarning.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2007,7 +2001,6 @@
children = (
43A51E1E1EB6D62A000736CC /* CarbAbsorptionViewController.swift */,
43A51E201EB6DBDD000736CC /* LoopChartsTableViewController.swift */,
433EA4C31D9F71C800CD78FB /* CommandResponseViewController.swift */,
C178249F1E19CF9800D9D25C /* GlucoseThresholdTableViewController.swift */,
4302F4E21D4EA54200F0FCAF /* InsulinDeliveryTableViewController.swift */,
437D9BA21D7BC977007245E8 /* PredictionTableViewController.swift */,
Expand All @@ -2034,7 +2027,6 @@
14C970662C59918100E8A01B /* Charts */,
431A8C3F1EC6E8AB00823B9C /* CircleMaskView.swift */,
A9A056B224B93C62007CF06D /* CriticalEventLogExportView.swift */,
C1A55E012E9F000000A10003 /* SendIssueReportView.swift */,
C191D2A025B3ACAA00C26C0B /* DosingStrategySelectionView.swift */,
14BBB3AE2C61274400ECB800 /* Favorite Foods */,
43D381611EBD9759007F8C8F /* HeaderValuesTableViewCell.swift */,
Expand Down Expand Up @@ -2111,7 +2103,6 @@
43FCEEA8221A615B0013DD30 /* StatusChartsManager.swift */,
E95D37FF24EADE68005E2F50 /* Store Protocols */,
1D63DEA426E950D400F46FA5 /* SupportManager.swift */,
C1A55E012E9F000000A10001 /* IssueReportSubmitter.swift */,
C18859AB2AF29BE50010F21F /* TemporaryPresetsManager.swift */,
89ADE13A226BFA0F0067222B /* TestingScenariosManager.swift */,
1D82E69F25377C6B009131FB /* TrustedTimeChecker.swift */,
Expand Down Expand Up @@ -3413,7 +3404,6 @@
897A5A9624C2175B00C4E71D /* BolusEntryView.swift in Sources */,
4F70C2131DE90339006380B7 /* StatusExtensionContext.swift in Sources */,
A9A056B324B93C62007CF06D /* CriticalEventLogExportView.swift in Sources */,
C1A55E012E9F000000A10004 /* SendIssueReportView.swift in Sources */,
43C05CC521EC29E3006FB252 /* TextFieldTableViewCell.swift in Sources */,
C1D289B522F90A52003FFBD9 /* BasalDeliveryState.swift in Sources */,
4F2C15821E074FC600E160D4 /* NSTimeInterval.swift in Sources */,
Expand Down Expand Up @@ -3575,7 +3565,6 @@
A96DAC2C2838F31200D94E38 /* SharedLogging.swift in Sources */,
4302F4E31D4EA54200F0FCAF /* InsulinDeliveryTableViewController.swift in Sources */,
1D63DEA526E950D400F46FA5 /* SupportManager.swift in Sources */,
C1A55E012E9F000000A10002 /* IssueReportSubmitter.swift in Sources */,
84D1F1A72D09053A00CB271F /* StatusTableView.swift in Sources */,
4FC8C8011DEB93E400A1452E /* NSUserDefaults+StatusExtension.swift in Sources */,
14C9707E2C5A9EB600E8A01B /* GlucoseCarbChartView.swift in Sources */,
Expand Down Expand Up @@ -3611,7 +3600,6 @@
A987CD4924A58A0100439ADC /* ZipArchive.swift in Sources */,
43F41C371D3BF32400C11ED6 /* UIAlertController.swift in Sources */,
A9CBE45C248ACC03008E7BA2 /* SettingsStore+SimulatedCoreData.swift in Sources */,
433EA4C41D9F71C800CD78FB /* CommandResponseViewController.swift in Sources */,
E9B3552229358C440076AB04 /* MealDetectionManager.swift in Sources */,
C16DA84222E8E112008624C2 /* PluginManager.swift in Sources */,
C151634E2FA2C9C800FEECE8 /* RequiredVersionUpdateView.swift in Sources */,
Expand Down
139 changes: 0 additions & 139 deletions Loop/Managers/IssueReportSubmitter.swift

This file was deleted.

5 changes: 3 additions & 2 deletions Loop/Managers/LoopAppManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ class LoopAppManager: NSObject {
supportManager = SupportManager(pluginManager: pluginManager,
deviceSupportDelegate: deviceDataManager,
servicesManager: servicesManager,
alertIssuer: alertManager)
alertIssuer: alertManager,
criticalEventLogExporterFactory: criticalEventLogExportManager,
diagnosticReportGenerator: self)
servicesManager.supportManager = supportManager

supportManager.onRequiredUpdate = { [weak self] in
Expand Down Expand Up @@ -587,7 +589,6 @@ class LoopAppManager: NSObject {
pumpManagerSettingsViewModel: pumpViewModel,
cgmManagerSettingsViewModel: cgmViewModel,
servicesViewModel: servicesViewModel,
criticalEventLogExportViewModel: CriticalEventLogExportViewModel(exporterFactory: criticalEventLogExportManager),
therapySettings: { [weak self] in self?.settingsManager.therapySettings ?? TherapySettings() },
initialDosingEnabled: self.settingsManager.settings.dosingEnabled,
automaticDosingStrategy: self.settingsManager.settings.automaticDosingStrategy,
Expand Down
24 changes: 20 additions & 4 deletions Loop/Managers/SupportManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,23 @@ public final class SupportManager {
private let alertIssuer: AlertIssuer
private let deviceSupportDelegate: DeviceSupportDelegate
private let pluginManager: PluginManager
private let criticalEventLogExporterFactory: CriticalEventLogExporterFactory?
private weak var diagnosticReportGenerator: DiagnosticReportGenerator?

lazy private var cancellables = Set<AnyCancellable>()

init(pluginManager: PluginManager,
deviceSupportDelegate: DeviceSupportDelegate,
servicesManager: ServicesManager? = nil,
alertIssuer: AlertIssuer) {

alertIssuer: AlertIssuer,
criticalEventLogExporterFactory: CriticalEventLogExporterFactory? = nil,
diagnosticReportGenerator: DiagnosticReportGenerator? = nil) {

self.alertIssuer = alertIssuer
self.deviceSupportDelegate = deviceSupportDelegate
self.pluginManager = pluginManager
self.criticalEventLogExporterFactory = criticalEventLogExporterFactory
self.diagnosticReportGenerator = diagnosticReportGenerator

restoreState()

Expand Down Expand Up @@ -216,7 +222,14 @@ extension SupportManager: SupportUIDelegate {
public func openURL(url: URL) {
UIApplication.shared.open(url)
}


public func criticalEventLogExportView() -> AnyView {
guard let criticalEventLogExporterFactory else {
return AnyView(EmptyView())
}
return AnyView(CriticalEventLogExportView(viewModel: CriticalEventLogExportViewModel(exporterFactory: criticalEventLogExporterFactory)))
}

public var pumpStatus: LoopKit.PumpManagerStatus? {
deviceSupportDelegate.pumpManagerStatus
}
Expand All @@ -242,7 +255,10 @@ extension SupportManager: SupportUIDelegate {
}

public func generateIssueReport() async -> String {
await deviceSupportDelegate.generateDiagnosticReport()
if let diagnosticReportGenerator {
return await diagnosticReportGenerator.generateDiagnosticReport()
}
return await deviceSupportDelegate.generateDiagnosticReport()
}

public func issueAlert(_ alert: LoopKit.Alert) async {
Expand Down
Loading