feat: Working on ignoring flagged measurements that are zero for optional values.
This commit is contained in:
@@ -390,6 +390,7 @@ public struct EquipmentMeasurementFormView: View {
|
||||
prompt: Text(title)
|
||||
)
|
||||
.numberPad()
|
||||
.onSubmit { send(.submitField) }
|
||||
} else {
|
||||
TextField(
|
||||
title,
|
||||
@@ -398,6 +399,7 @@ public struct EquipmentMeasurementFormView: View {
|
||||
prompt: Text(title)
|
||||
)
|
||||
.decimalPad()
|
||||
.onSubmit { send(.submitField) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,13 @@ public struct FlaggedMeasurementsList {
|
||||
self._sharedSettings = sharedSettings
|
||||
self.estimatedMeasurements = estimatedMeasurements
|
||||
}
|
||||
|
||||
|
||||
var ignoreIfZeroFields: [EquipmentMeasurement.FlaggedMeasurement.FieldKey] {
|
||||
guard let measurement = sharedSettings.equipmentMeasurement else { return [] }
|
||||
guard measurement.equipmentType == .airHandler else { return [] }
|
||||
return [.coilDrop, .filterDrop]
|
||||
}
|
||||
|
||||
#warning("Move to shared settings.")
|
||||
public struct FlaggedMeasurementContainer: Equatable, Identifiable {
|
||||
public let id: UUID
|
||||
@@ -222,7 +228,10 @@ public struct FlaggedMeasurementListView: View {
|
||||
List {
|
||||
if let existingMeasurement = store.sharedSettings.flaggedEquipmentMeasurement {
|
||||
Section {
|
||||
FlaggedEquipmentMeasurementView(existingMeasurement)
|
||||
FlaggedEquipmentMeasurementView(
|
||||
existingMeasurement,
|
||||
ignoreIfZero: store.ignoreIfZeroFields
|
||||
)
|
||||
} header: {
|
||||
HStack {
|
||||
Text("Existing Measurements")
|
||||
@@ -232,7 +241,8 @@ public struct FlaggedMeasurementListView: View {
|
||||
ForEach(store.estimatedMeasurements) { measurement in
|
||||
Section {
|
||||
FlaggedEquipmentMeasurementView(
|
||||
measurement.flaggedMeasurement
|
||||
measurement.flaggedMeasurement,
|
||||
ignoreIfZero: store.ignoreIfZeroFields
|
||||
)
|
||||
} header: {
|
||||
HStack {
|
||||
|
||||
Reference in New Issue
Block a user