Просмотр исходного кода

Remove `.disabled` attribute that was not doing anything on treatment list.

Rename `SMB` enum case EventType to `smb` to match other cases.

Update navigation title of external insulin sheet to match manual glucose sheet.
Brian Wieder 2 лет назад
Родитель
Сommit
67ddedb393

+ 1 - 1
FreeAPS/Sources/Models/NightscoutTreatment.swift

@@ -4,7 +4,7 @@ func determineBolusEventType(for event: PumpHistoryEvent) -> EventType {
     if event.isExternalInsulin ?? false {
         return .nsExternalInsulin
     } else if event.isSMB ?? false {
-        return .SMB
+        return .smb
     }
     return event.type
 }

+ 1 - 1
FreeAPS/Sources/Models/PumpHistoryEvent.swift

@@ -46,7 +46,7 @@ struct PumpHistoryEvent: JSON, Equatable {
 
 enum EventType: String, JSON {
     case bolus = "Bolus"
-    case SMB
+    case smb = "SMB"
     case mealBolus = "Meal Bolus"
     case correctionBolus = "Correction Bolus"
     case snackBolus = "Snack Bolus"

+ 3 - 7
FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -223,10 +223,6 @@ extension DataTable {
                     ).tint(.red)
                 }
             }
-            .disabled(
-                item.type == .tempBasal || item.type == .tempTarget || item.type == .resume || item
-                    .type == .suspend
-            )
             .alert(
                 Text(NSLocalizedString(alertTitle, comment: "")),
                 isPresented: $isRemoveHistoryItemAlertPresented
@@ -283,7 +279,7 @@ extension DataTable {
                                     showExternalInsulin = false
                                 }
                                 label: {
-                                    Text("Log external insulin")
+                                    Text("Save")
                                 }
                                 .foregroundColor(amountWarningCondition ? Color.white : Color.accentColor)
                                 .frame(maxWidth: .infinity, alignment: .center)
@@ -306,8 +302,8 @@ extension DataTable {
                     }
                 }
                 .onAppear(perform: configureView)
-                .navigationTitle("External Insulin")
-                .navigationBarTitleDisplayMode(.inline)
+                .navigationTitle("Log External Insulin")
+                .navigationBarTitleDisplayMode(.automatic)
                 .navigationBarItems(leading: Button("Close", action: { showExternalInsulin = false
                     state.externalInsulinAmount = 0 }))
             }